/* ─────────────────────────────────────────────────────────────
   style.css — Frontness Dashboard (dark theme)
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:          #0e0e14;
  --surface:     #16161e;
  --card:        #1c1c27;
  --border:      #27273a;
  --text:        #dde0f0;
  --textMuted:   #7a7d9a;
  --primary:     #6161ff;
  --primaryDim:  rgba(97,97,255,0.15);
  --accent:      #7affb2;
  --success:     #7affb2;
  --warning:     #ffe47a;
  --error:       #ff6b6b;
  --radius:      12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1,h2,h3,h4,h5 { font-weight: 500; margin: 0; }
h4 { font-size: 0.875rem; }
a { color: var(--primary); text-decoration: none; cursor: pointer; }
img { max-width: 100%; display: block; }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

app { display: block; min-height: 100dvh; }

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s ease;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-info    { background: var(--primary); color: #fff; }
.toast-success { background: var(--success); color: #111; }
.toast-error   { background: var(--error);   color: #fff; }
.toast-warning { background: var(--warning); color: #111; }

/* ─── Loading screen ─── */
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  width: 100%;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Login ─── */
.login-wrap {
  display: flex;
  min-height: 100dvh;
  align-items: stretch;
}
.login-panel {
  width: 100%;
  max-width: 480px;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.login-bg {
  flex: 1;
  background: var(--bg);
  background-image: radial-gradient(ellipse 60% 60% at 60% 40%, rgba(97,97,255,0.12) 0%, transparent 70%);
  position: relative;
  overflow: hidden;
}
.login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
}
.login-logo {
  margin-bottom: 3rem;
}
.login-logo svg { height: 22px; width: auto; }
.login-logo path { fill: var(--text); }
.login-body { margin-top: auto; margin-bottom: auto; }
.login-body h1 { font-size: 1.75rem; font-weight: 600; margin-bottom: 0.5rem; }
.login-body p  { color: var(--textMuted); margin-bottom: 2rem; font-size: 0.9rem; }
.login-footer  { margin-top: 2rem; }
.login-footer a { font-size: 0.8rem; color: var(--textMuted); }
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; font-size: 0.75rem; color: var(--textMuted); margin-bottom: 0.35rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.input-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.input-group input:focus { border-color: var(--primary); }
.input-group input::placeholder { color: var(--textMuted); }

/* ─── Buttons ─── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.12s;
  text-decoration: none;
  white-space: nowrap;
}
button:hover { background: var(--surface); }
button[disabled] { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 12px rgba(97,97,255,0.3);
}
.btn-primary:hover { background: #5050ee; border-color: #5050ee; }

.btn-full { width: 100%; height: 2.75rem; font-size: 1rem; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--textMuted);
}
.btn-ghost:hover { background: var(--card); color: var(--text); }

/* Loading spinner inside button */
.btn-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-loader-dark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─── Subscription Gate ─── */
.gate-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
  background-image: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(97,97,255,0.1) 0%, transparent 70%);
}
.gate-header {
  margin-bottom: 2.5rem;
  text-align: center;
}
.gate-header svg { height: 22px; width: auto; }
.gate-header path { fill: var(--text); }
.gate-header p { margin-top: 0.75rem; color: var(--textMuted); font-size: 0.9rem; }
.gate-logout {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

/* Price Card */
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  position: relative;
}
.price-card.price-featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 24px 60px rgba(97,97,255,0.18);
}
.price-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.price-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.price-amount {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.price-amount span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--textMuted);
}
.price-desc {
  color: var(--textMuted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.price-features {
  list-style: none;
  margin-bottom: 1.75rem;
}
.price-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.price-features li:last-child { border-bottom: none; }
.price-features li::before {
  content: '';
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  background: var(--accent);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.price-card .btn {
  width: 100%;
  height: 3rem;
  font-size: 1rem;
  border-radius: 999px;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 16px rgba(97,97,255,0.35);
  transition: background 0.2s, transform 0.12s, box-shadow 0.2s;
}
.price-card .btn:hover { background: #5050ee; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(97,97,255,0.45); }

/* ─── Main App Layout ─── */
.app-layout {
  display: flex;
  min-height: 100dvh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo svg { height: 18px; width: auto; }
.sidebar-logo path { fill: var(--text); }

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
}
.sidebar-nav button, .sidebar-nav a {
  width: 100%;
  display: flex;
  height: auto;
  padding: 0.65rem 0.875rem;
  gap: 0.75rem;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--textMuted);
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-align: left;
  text-decoration: none;
  margin-bottom: 2px;
  box-shadow: none;
}
.sidebar-nav button svg, .sidebar-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.12s;
}
.sidebar-nav button:hover, .sidebar-nav a:hover {
  background: var(--card);
  color: var(--text);
}
.sidebar-nav button:hover svg { opacity: 1; }
.sidebar-nav button.active {
  background: var(--primaryDim);
  color: var(--primary);
  font-weight: 500;
}
.sidebar-nav button.active svg { opacity: 1; }

.sidebar-footer {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.625rem;
  border-radius: 10px;
  margin-bottom: 0.25rem;
  cursor: default;
}
.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primaryDim);
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { font-size: 0.8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 0.7rem; color: var(--textMuted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--textMuted);
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-align: left;
  margin-top: 2px;
}
.sidebar-logout-btn svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.sidebar-logout-btn:hover { background: var(--card); color: var(--error); }
.sidebar-logout-btn:hover svg { opacity: 1; }

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

/* ─── Section ─── */
.section {
  display: none;
  padding: 2.5rem;
  min-height: 100dvh;
}
.section.active { display: block; }

.section-header {
  margin-bottom: 2rem;
}
.section-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0;
}
.section-header--domain h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: lowercase;
  letter-spacing: 0.01em;
}
.section-header p {
  color: var(--textMuted);
  font-size: 0.875rem;
}

/* ─── Dashboard section ─── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.dash-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--textMuted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.dash-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.dash-card-sub {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--textMuted);
}

.sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.sub-badge-active   { background: rgba(122,255,178,0.12); color: var(--success); border: 1px solid rgba(122,255,178,0.25); }
.sub-badge-trialing { background: rgba(255,228,122,0.1);  color: var(--warning); border: 1px solid rgba(255,228,122,0.25); }
.sub-badge-inactive { background: rgba(255,107,107,0.1);  color: var(--error);   border: 1px solid rgba(255,107,107,0.25); }

.dash-welcome {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.dash-welcome-text h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.3rem; }
.dash-welcome-text p  { color: var(--textMuted); font-size: 0.875rem; margin: 0; }
.dash-welcome-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.section-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.section-block-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--textMuted);
  margin-bottom: 1rem;
}

/* Quick links */
.quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
  width: 100%;
  box-shadow: none;
  height: auto;
}
.quick-link svg { width: 16px; height: 16px; color: var(--textMuted); flex-shrink: 0; }
.quick-link:hover { background: var(--card); }

/* ─── Analytics ─── */
.section-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-block-header .section-block-title { margin-bottom: 0; }
.analytics-chart-block .section-block-title { margin-bottom: 0; }

.analytics-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 98px;  /* 80px bars + 18px label row */
  padding-top: 0.5rem;
}
.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  height: 100%;
  cursor: default;
}
.chart-bar {
  width: 100%;
  flex-shrink: 0;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
  opacity: 0.7;
  transition: opacity 0.1s;
}
.chart-bar-label {
  height: 18px;
  line-height: 18px;
  font-size: 0.5rem;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
}
.chart-bar-col:hover .chart-bar { opacity: 1; }

.top-page-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.top-page-row:last-child { border-bottom: none; }
.top-page-path {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.top-page-bar-wrap {
  display: none;
}
.top-page-stats {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  text-align: right;
}
.top-page-stats span {
  font-weight: 400;
  color: var(--textMuted);
  margin-left: 0.4rem;
}
.analytics-empty {
  font-size: 0.85rem;
  color: var(--textMuted);
  padding: 0.5rem 0;
  margin: 0;
}
.analytics-loading {
  font-size: 0.85rem;
  color: var(--textMuted);
  padding: 0.5rem 0;
}

/* ─── Two-column row for referrers + devices ─── */
.dash-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .dash-row-2 { grid-template-columns: 1fr; }
}

/* ─── Generic stat row (pages, referrers, devices) ─── */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 80px 64px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-row-label {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.stat-row-bar {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.stat-row-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  opacity: 0.7;
}
.stat-row-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}
.stat-row-value span {
  font-weight: 400;
  color: var(--textMuted);
  margin-left: 0.3rem;
}

/* ─── Goals ─── */
.goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.goal-row:last-child { border-bottom: none; }
.goal-row-url {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.goal-row-stats {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}
.goal-clicks {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.goal-rate {
  font-size: 0.78rem;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  background: var(--border);
  color: var(--textMuted);
  font-weight: 500;
}
.goal-rate.goal-rate-active {
  background: rgba(99,102,241,0.15);
  color: var(--primary);
}

/* ─── Goals settings ─── */
.settings-group-desc {
  padding: 0 1.25rem 0.75rem;
  font-size: 0.8rem;
  color: var(--textMuted);
  line-height: 1.5;
}
#goals-list {
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.goal-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.goal-item .goal-input {
  flex: 1;
  height: 2.1rem;
  font-size: 0.82rem;
}
.goal-remove-btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--textMuted);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.goal-remove-btn:hover { background: rgba(255,107,107,0.1); color: var(--error); border-color: rgba(255,107,107,0.3); }

/* ─── Month navigation ─── */
.month-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.month-nav-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  min-width: 100px;
  text-align: center;
  padding: 0 0.25rem;
}
.month-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  width: 1.75rem;
  height: 1.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.month-nav-btn:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.month-nav-btn:disabled { opacity: 0.3; cursor: default; }

/* ─── Settings section ─── */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 560px;
}
.settings-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.settings-group-title {
  padding: 0.875rem 1.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--textMuted);
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-info label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.2rem; }
.settings-row-info span  { font-size: 0.8rem; color: var(--textMuted); }
.settings-row input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  min-width: 180px;
  max-width: 220px;
  outline: none;
  transition: border-color 0.15s;
}
.settings-row input:focus { border-color: var(--primary); }
.settings-row input:disabled { opacity: 0.5; }

.danger-zone { border-color: rgba(255,107,107,0.25); }
.danger-zone .settings-group-title { background: rgba(255,107,107,0.05); color: var(--error); }

/* ─── Mobile top bar ─── */
.mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.mobile-bar svg { height: 18px; width: auto; }
.mobile-bar path { fill: var(--text); }
.mobile-menu-btn {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.25rem;
  height: auto;
  box-shadow: none;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s;
}
.sidebar-overlay.active { opacity: 1; }

@media (max-width: 768px) {
  .login-bg { display: none; }
  .login-panel { max-width: 100%; border-right: none; }

  .mobile-bar { display: flex; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    height: 100dvh;
  }
  .sidebar.open     { transform: translateX(0); }
  .sidebar-overlay  { display: block; }

  .section { padding: 1.5rem 1rem; }
  .gate-logout { position: static; margin-bottom: 1rem; }
}

@media (max-width: 480px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
}
