:root {
  --bg: #ffffff;
  --bg-2: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #fbfbfc;
  --line: #e7e9ee;
  --line-2: #d9dce3;
  --ink: #15161a;
  --muted: #5f6572;
  --dim: #8a90a0;
  --accent: #5b4dff;
  --accent-2: #4a3df0;
  --accent-soft: #eceaff;
  --accent-glow: rgba(91, 77, 255, .12);
  --green: #2ea043;
  --green-dim: rgba(46, 160, 67, .16);
  --red: #d1242f;
  --amber: #9a6700;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --shadow-sm: 0 1px 2px rgba(16, 20, 30, .05);
  --shadow-md: 0 4px 16px rgba(16, 20, 30, .08);
  --shadow-lg: 0 24px 60px rgba(16, 20, 30, .12);
  --radius: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
b { color: var(--ink); }

/* Background */
.bg { position: fixed; inset: 0; z-index: -1; background: var(--bg); }

/* Buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--ink); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: transform .08s ease, border-color .15s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border: none; color: #fff; box-shadow: 0 6px 20px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 8px 26px var(--accent-glow); border: none; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn svg { width: 15px; height: 15px; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .select, .search-box input {
  background: var(--panel); border: 1px solid var(--line-2); color: var(--ink);
  padding: 11px 14px; border-radius: 10px; font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .select:focus, .search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.select { cursor: pointer; }

.btn-github {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--ink); color: #fff; border: none; border-radius: 10px;
  padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .08s ease, box-shadow .15s;
}
.btn-github:hover { box-shadow: 0 8px 24px rgba(21,22,26,.18); }
.btn-github:active { transform: translateY(1px); }
.auth-oauth-hint { margin-top: 10px; font-size: 12.5px; color: var(--dim); text-align: center; }
.auth-oauth-loading { text-align: center; color: var(--dim); font-size: 13px; padding: 10px 0; }
.privy-root { margin-bottom: 4px; }

/* Auth */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px;
  box-shadow: var(--shadow-lg);
}
.logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.logo-img { display: block; width: 150px; height: 150px; border-radius: 50%; box-shadow: 0 8px 30px rgba(46,160,67,.25); }
.logo-img.side { width: 40px; height: 40px; box-shadow: 0 3px 14px rgba(46,160,67,.25); }
.logo-wrap { display: flex; justify-content: center; margin-bottom: 22px; }
.logo-text { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.auth-title { font-size: 30px; line-height: 1.12; letter-spacing: -.02em; margin-bottom: 10px; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; color: var(--dim); font-size: 12.5px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.divider span { white-space: nowrap; }
.auth-actions { display: flex; gap: 10px; }
.auth-actions .btn-primary { flex: 1; }
.auth-hint { margin-top: 16px; font-size: 12px; color: var(--dim); text-align: center; }
.form-msg { min-height: 18px; font-size: 13px; margin-bottom: 8px; }
.form-msg.err { color: var(--red); }
.form-msg.ok { color: var(--green); }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0; border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 26px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.nav-link:hover { color: var(--ink); background: var(--bg-2); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }
.nav-link .ic { width: 18px; color: var(--dim); }
.nav-link.active .ic { color: var(--accent); }
.pill { margin-left: auto; background: var(--green-dim); color: var(--green); font-size: 11px; padding: 2px 8px; border-radius: 999px; font-family: var(--mono); }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 700; color: #fff; }
.who { display: flex; flex-direction: column; min-width: 0; }
.who strong { font-size: 14px; overflow-wrap: anywhere; word-break: break-word; }
.who span { font-size: 12px; color: var(--dim); }

/* Mobile top bar + off-canvas sidebar */
.mobile-bar {
  display: none; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 40;
}
.mobile-bar .logo-row { margin-bottom: 0; }
.hamburger {
  display: flex; flex-direction: column; gap: 5px; background: none; border: 1px solid var(--line-2);
  width: 42px; height: 42px; border-radius: 10px; align-items: center; justify-content: center; cursor: pointer;
}
.hamburger span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.sidebar-scrim {
  display: none; position: fixed; inset: 0; background: rgba(21,22,26,.45); z-index: 25;
  opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px);
}
.sidebar-scrim.show { display: block; opacity: 1; }

.main { flex: 1; min-width: 0; padding: 34px 40px 60px; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.view-head h2 { font-size: 28px; letter-spacing: -.02em; }
.head-actions { display: flex; gap: 10px; align-items: center; }

/* Panels & stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--accent); opacity: .85; }
.stat-label { display: block; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.stat-num { font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-family: var(--mono); }
.stat-unit { font-size: 13px; color: var(--muted); font-family: var(--font); margin-left: 6px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h3, .panel-title { font-size: 16px; letter-spacing: -.01em; }

/* Heatmap (GitHub light scale) */
.heatmap { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 8px; }
.hm-col { display: flex; flex-direction: column; gap: 3px; }
.hm-cell { width: 12px; height: 12px; border-radius: 2px; background: #ebedf0; }
.hm-cell.l0 { background: #ebedf0; }
.hm-cell.l1 { background: #9be9a8; }
.hm-cell.l2 { background: #40c463; }
.hm-cell.l3 { background: #30a14e; }
.hm-cell.l4 { background: #216e39; }

/* Upcoming */
.upcoming { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.up-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg-2); text-align: center; }
.up-item .d { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.up-item .n { font-size: 20px; font-weight: 800; font-family: var(--mono); margin: 2px 0; }
.up-item.off { opacity: .5; }
.up-item.done { border-color: rgba(46,160,67,.4); }
.dot-now { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); margin-left: 4px; }

/* Accounts */
.accounts-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.account-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm); }
.account-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.account-top > div { min-width: 0; }
.account-avatar { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); flex-shrink: 0; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-top h4 { font-size: 16px; overflow-wrap: anywhere; word-break: break-word; }
.account-top a { font-size: 13px; overflow-wrap: anywhere; word-break: break-all; }
.account-meta { font-size: 12px; color: var(--dim); font-family: var(--mono); }
.account-actions { display: flex; gap: 8px; margin-top: auto; }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 700; letter-spacing: .03em; }
.badge.on { background: var(--green-dim); color: var(--green); }
.badge.off { background: rgba(209,36,47,.1); color: var(--red); }
.empty { text-align: center; color: var(--dim); padding: 50px 0; }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* Projects */
.search-box input { width: 260px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.project-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .1s, box-shadow .15s;
}
.project-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.proj-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.proj-cat { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; }
.proj-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.proj-blurb { color: var(--muted); font-size: 13px; flex: 1; }
.proj-stack { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.status-badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.status-badge.pushed { background: var(--green-dim); color: var(--green); }
.status-badge.ready { background: rgba(154,103,0,.12); color: var(--amber); }

/* Plans */
.plans-list { display: flex; flex-direction: column; gap: 12px; }
.plan-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.plan-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.plan-head h4 { font-size: 15px; }
.plan-date { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.session-list { display: flex; gap: 10px; flex-wrap: wrap; }
.session-chip { font-family: var(--mono); font-size: 12px; background: var(--bg-2); border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.session-chip .c { color: var(--accent); }
.plan-empty { color: var(--dim); font-size: 13px; }

/* Logs */
.logs { display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); font-size: 12.5px; }
.log-line {
  display: flex; gap: 14px; align-items: baseline; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.log-time { color: var(--dim); flex-shrink: 0; }
.log-kind { flex-shrink: 0; font-weight: 600; }
.log-kind.create { color: var(--accent); }
.log-kind.evolve { color: var(--accent); }
.log-kind.account { color: var(--amber); }
.log-kind.auth { color: var(--green); }
.log-kind.error { color: var(--red); }
.log-msg { color: var(--muted); overflow-wrap: anywhere; }

/* Settings */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row h4 { font-size: 14px; margin-bottom: 2px; }
.setting-row p { font-size: 13px; }
.range-wrap { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.range-wrap input[type=range] { flex: 1; accent-color: var(--accent); }
.range-wrap output { font-family: var(--mono); min-width: 38px; text-align: right; color: var(--accent); }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(20px); }
.oauth-note { background: var(--accent-soft); border: 1px solid rgba(91,77,255,.2); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--muted); margin: 10px 0 16px; }
.oauth-fields { max-width: 420px; }

/* Modal & toast */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(21,22,26,.4); backdrop-filter: blur(3px); padding: 20px; }
.modal-card { width: 100%; max-width: 480px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-lg); animation: fade .2s ease; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { font-size: 18px; }
.modal-close { background: none; border: none; color: var(--dim); font-size: 26px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--ink); }
.steps { margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.step span { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 50%; color: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.step code { overflow-wrap: anywhere; }
.toast {
  position: fixed; bottom: 26px; right: 26px; z-index: 60; background: var(--ink);
  border: none; border-radius: 12px; padding: 13px 18px; font-size: 14px; color: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,.25); max-width: 340px;
}
.toast.err { background: var(--red); }

/* ---------- Countdown chip ---------- */
.countdown-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 8px 14px; font-size: 13px;
}
.countdown-chip.none { opacity: .45; }
.cd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.countdown-chip.none .cd-dot { background: var(--dim); box-shadow: none; animation: none; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.cd-label { color: var(--muted); font-weight: 600; }
.cd-time { font-family: var(--mono); font-weight: 600; color: var(--ink); min-width: 86px; text-align: right; }

/* ---------- Token guide modal ---------- */
.modal-wide { max-width: 600px; }
.guide { margin: 16px 0 20px; display: flex; flex-direction: column; gap: 14px; }
.guide-step { display: flex; gap: 14px; }
.guide-num {
  width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--accent); color: #fff; border-radius: 50%; font-family: var(--mono);
  font-size: 13px; font-weight: 700;
}
.guide-step h4 { font-size: 14px; margin-bottom: 2px; }
.guide-step p { font-size: 13px; }
.guide-link { margin-top: 8px; display: inline-flex; }
.guide-tip {
  display: inline-block; margin: 6px 0; padding: 5px 12px; border-radius: 8px;
  background: var(--green-dim); color: var(--green); font-weight: 700; font-size: 12.5px;
}
.scope-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.scope-row {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; cursor: default;
}
.scope-row input { margin-top: 4px; accent-color: var(--accent); }
.scope-row code { font-size: 12.5px; }
.scope-row .badge { vertical-align: middle; }
.scope-row p { margin-top: 3px; }

/* ---------- Admin panel ---------- */
.admin-app { display: flex; min-height: 100vh; }
.admin-side {
  width: 240px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh;
}
.admin-logo-row { margin-bottom: 0; }
.admin-badge {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  background: var(--amber); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  vertical-align: middle;
}
.admin-nav { margin-top: 18px; }
.admin-main { flex: 1; min-width: 0; padding: 34px 40px 60px; }
.admin-view { display: none; animation: fade .25s ease; }
.admin-view.active { display: block; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--dim); border-bottom: 1px solid var(--line-2);
}
.admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg-2); }
.admin-table .empty { padding: 40px 0; }

.admin-user-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.admin-user-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm);
}
.admin-user-meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--dim); font-family: var(--mono); }

.admin-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line-2); padding-bottom: 10px; flex-wrap: wrap; }
.admin-tab {
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel);
  font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted);
}
.admin-tab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.admin-tab-pane { display: none; }
.admin-tab-pane.active { display: block; animation: fade .2s ease; }

.admin-queue-bar { height: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 12px 0 18px; }
.admin-queue-fill { height: 100%; background: var(--green); border-radius: 999px; transition: width .4s; }
.queue-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.queue-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  font-family: var(--mono); font-size: 12.5px;
}
.queue-row.done { opacity: .5; }
.queue-state { font-weight: 700; }
.queue-row:not(.done) .queue-state { color: var(--accent); }
.queue-row.done .queue-state { color: var(--green); }

/* ================= Responsive ================= */

/* Tablet & mobile: off-canvas sidebar behind a hamburger */
@media (max-width: 900px) {
  .app, .admin-app { flex-direction: column; }
  .mobile-bar { display: flex; width: 100%; }
  .sidebar, .admin-side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; height: 100vh;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg); z-index: 35;
  }
  .sidebar.open, .admin-side.open { transform: translateX(0); }
  .admin-logo-row { margin-bottom: 0; }
  .main, .admin-main { padding: 20px 16px 70px; }
  .auth-card { padding: 24px; }
  .view-head { align-items: stretch; flex-direction: column; gap: 12px; }
  .head-actions { flex-wrap: wrap; width: 100%; }
  .head-actions .select { flex: 1 1 auto; min-width: 0; }
  .head-actions .btn { flex: 1 1 auto; min-width: 0; }
  .countdown-chip { flex: 1 1 100%; justify-content: center; }
  .search-box input { width: 100%; }
  .search-box { flex: 1; }
  .stat-num { font-size: 26px; }
  .hm-cell { width: 10px; height: 10px; }
  .account-actions { flex-wrap: wrap; }
  .account-actions .btn { flex: 1 1 auto; min-width: 0; }
  .plan-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .setting-row { flex-wrap: wrap; }
  .setting-row > div:first-child { flex: 1; min-width: 200px; }
  .modal-card { max-height: 92vh; }
  .toast { left: 16px; right: 16px; max-width: none; text-align: center; }
}

/* Phones */
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .view-head h2 { font-size: 23px; }
  .auth-title { font-size: 25px; }
  .head-actions { gap: 8px; }
  .projects-grid, .accounts-list, .admin-user-cards { grid-template-columns: 1fr; }
  .upcoming { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .log-line { flex-wrap: wrap; gap: 6px 10px; }
  .admin-table th:nth-child(2), .admin-table td:nth-child(2),
  .admin-table th:nth-child(4), .admin-table td:nth-child(4) { display: none; }
}
