/* Dashboard app shell */

.dash-glow {
  background:
    radial-gradient(ellipse 70% 50% at 80% -5%, rgba(145, 91, 61, 0.14), transparent 55%),
    radial-gradient(ellipse 55% 45% at 10% 0%, rgba(45, 106, 79, 0.1), transparent 50%),
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(218, 145, 115, 0.18), transparent);
}

.dash-nav {
  background: rgba(252, 250, 247, 0.72);
  border-bottom-color: rgba(49, 26, 23, 0.06);
}

.dash-nav-links {
  gap: 1.35rem;
}

.dash-nav-links a:not(.btn) {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.35rem 0;
  position: relative;
}

.dash-nav-links a:not(.btn):hover {
  color: var(--text);
}

.dash-nav-links a.active {
  color: var(--text);
  font-weight: 600;
}

.dash-nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-warm), var(--accent));
}

.btn-nav-cta {
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  box-shadow: 0 2px 12px rgba(145, 91, 61, 0.2);
}

.dash-main {
  padding: 5rem 0 2rem;
  max-width: 960px;
  width: 100%;
}

.dash-main-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 2rem 0 3rem;
  max-width: 420px;
}

.hidden {
  display: none !important;
}

/* Flat auth shell */

body.dash-auth-view {
  background: var(--bg);
}

body.dash-auth-view .bg-glow {
  display: none;
}

.auth-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.auth-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  width: min(420px, calc(100% - 2rem));
  margin-inline: auto;
}

.logo-flat {
  font-size: 1rem;
  font-weight: 600;
}

.logo-mark-flat {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent);
  font-size: 0.95rem;
  box-shadow: none;
}

.auth-back {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.auth-back:hover {
  color: var(--text);
}

.dash-auth {
  width: 100%;
}

.dash-auth-card {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.dash-auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.dash-auth-subtitle {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.dash-auth-foot {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

.btn-flat {
  border-radius: 8px;
  box-shadow: none;
  padding: 0.8rem 1rem;
}

.btn-flat:hover {
  transform: none;
  box-shadow: none;
}

.dash-error {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  background: rgba(180, 60, 60, 0.08);
  border: 1px solid rgba(180, 60, 60, 0.2);
  color: #8b2e2e;
  font-size: 0.9rem;
}

.dash-lead {
  position: relative;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.dash-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-soft);
}

.dash-form input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.dash-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: none;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.dash-msg {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  color: var(--success);
  min-height: 1.25rem;
}

.dash-hint {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: left;
}

.dash-link {
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: inherit;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.dash-link:hover {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* App hero header */

.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1.35rem 1.5rem;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(242, 235, 225, 0.9) 100%);
  border: 1px solid rgba(145, 91, 61, 0.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 16px 40px rgba(49, 26, 23, 0.06);
}

.dash-hero-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.dash-avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fcfaf7;
  background: linear-gradient(145deg, var(--accent-warm) 0%, var(--accent) 55%, var(--accent-2) 100%);
  box-shadow: 0 8px 20px rgba(145, 91, 61, 0.35);
}

.dash-hero-copy {
  min-width: 0;
}

.dash-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--success);
  background: rgba(45, 106, 79, 0.1);
  border: 1px solid rgba(45, 106, 79, 0.18);
}

.dash-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(45, 106, 79, 0.8);
  animation: dash-pulse 2s ease-in-out infinite;
}

@keyframes dash-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.85);
  }
}

.dash-hero h1 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.dash-hero-email {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.dash-sign-out {
  color: var(--muted);
}

.dash-sign-out:hover {
  color: #8b2e2e;
  border-color: rgba(180, 60, 60, 0.25);
  background: rgba(180, 60, 60, 0.06);
}

/* Metrics */

.quota-card {
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(45, 106, 79, 0.12) 0%, rgba(252, 250, 247, 0.95) 55%);
  border: 1px solid rgba(45, 106, 79, 0.18);
  box-shadow: 0 8px 24px rgba(45, 106, 79, 0.06);
}

.quota-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
}

.quota-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
}

.quota-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(49, 26, 23, 0.06);
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #40916c, var(--success), #52b788);
  box-shadow: 0 0 12px rgba(45, 106, 79, 0.35);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.quota-label {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

/* Account credit / Stripe top-up */

.credit-card {
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(145, 91, 61, 0.1) 0%, rgba(252, 250, 247, 0.98) 60%);
  border: 1px solid rgba(145, 91, 61, 0.16);
  box-shadow: 0 8px 24px rgba(145, 91, 61, 0.07);
}

.credit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.credit-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.credit-balance {
  margin: 0.25rem 0 0;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.credit-badge {
  flex-shrink: 0;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(49, 26, 23, 0.05);
  border: 1px solid rgba(49, 26, 23, 0.08);
}

.credit-desc {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.topup-msg {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
}

.topup-msg-success {
  color: var(--success);
  background: rgba(45, 106, 79, 0.1);
  border: 1px solid rgba(45, 106, 79, 0.18);
}

.topup-msg-error {
  color: #8b2e2e;
  background: rgba(180, 60, 60, 0.08);
  border: 1px solid rgba(180, 60, 60, 0.18);
}

.topup-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.topup-btn {
  padding: 0.7rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(145, 91, 61, 0.22);
  background: rgba(255, 255, 255, 0.65);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.topup-btn:hover:not(:disabled) {
  background: rgba(145, 91, 61, 0.1);
  border-color: rgba(145, 91, 61, 0.35);
  transform: translateY(-1px);
}

.topup-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.topup-custom label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-soft);
}

.topup-custom-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topup-currency {
  font-weight: 600;
  color: var(--muted);
}

.topup-custom-row input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
}

.topup-custom-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.dash-kpis .benchmark-kpi {
  border-radius: 16px;
  padding: 1.1rem 1.15rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(49, 26, 23, 0.08);
  box-shadow: 0 4px 16px rgba(49, 26, 23, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dash-kpis .benchmark-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(49, 26, 23, 0.08);
}

.dash-kpis .benchmark-kpi strong {
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.dash-kpis .benchmark-kpi.accent {
  background: linear-gradient(145deg, rgba(145, 91, 61, 0.08) 0%, rgba(252, 250, 247, 0.95) 100%);
  border-color: rgba(145, 91, 61, 0.15);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.dash-panel {
  padding: 1.25rem 1.35rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(49, 26, 23, 0.08);
  box-shadow: 0 4px 20px rgba(49, 26, 23, 0.04);
}

.dash-panel-wide {
  margin-bottom: 0;
}

.dash-panel h2 {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dash-panel-desc {
  margin: -0.5rem 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  height: 148px;
  padding-top: 0.5rem;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.chart-bar {
  width: 100%;
  max-width: 2.25rem;
  margin-top: auto;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--accent-warm) 0%, var(--accent) 100%);
  box-shadow: 0 4px 12px rgba(145, 91, 61, 0.25);
  min-height: 4px;
  transition: height 0.4s ease;
}

.chart-day {
  margin-top: 0.45rem;
  font-size: 0.65rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dash-key {
  display: block;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  background: rgba(49, 26, 23, 0.04);
  border: 1px dashed rgba(145, 91, 61, 0.25);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  word-break: break-all;
  color: var(--text);
}

.dash-install {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 12px;
}

.dash-actions {
  margin-bottom: 1rem;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-list li {
  display: grid;
  grid-template-columns: 1fr minmax(0, 8rem) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0;
  border-top: 1px solid rgba(49, 26, 23, 0.06);
  font-size: 0.82rem;
  transition: background 0.15s;
}

.recent-list li:hover {
  background: rgba(145, 91, 61, 0.03);
  margin-inline: -0.5rem;
  padding-inline: 0.5rem;
  border-radius: 8px;
}

.recent-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.recent-time {
  color: var(--muted);
  font-size: 0.78rem;
}

.recent-route {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-saved {
  font-weight: 700;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.recent-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 0.88rem;
}

.copy-btn {
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.copy-btn.is-copied {
  background: rgba(45, 106, 79, 0.14) !important;
  border-color: rgba(45, 106, 79, 0.35) !important;
  color: var(--success) !important;
  transform: scale(1.03);
}

.copy-btn.is-copied::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(45, 106, 79, 0.25), transparent 70%);
  animation: copy-pulse 0.55s ease-out;
  pointer-events: none;
}

@keyframes copy-pulse {
  from {
    opacity: 1;
    transform: scale(0.85);
  }
  to {
    opacity: 0;
    transform: scale(1.35);
  }
}

@media (max-width: 768px) {
  .dash-main {
    padding: 4.75rem 0 1.5rem;
  }

  .dash-main-auth {
    min-height: calc(100vh - 64px);
    padding: 1.5rem 0 2rem;
  }

  .auth-header-inner {
    width: min(420px, calc(100% - 1.25rem));
  }

  .dash-nav-links {
    gap: 1rem;
  }

  .dash-hero {
    padding: 1.15rem 1.2rem;
  }

  .dash-hero-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .dash-kpis {
    grid-template-columns: 1fr;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .topup-amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topup-custom-row {
    flex-wrap: wrap;
  }

  .recent-list li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}
