/* =====================================================================
   Qzain — Design system (professional, blue-led, responsive)
   ===================================================================== */
:root {
  --blue: #2563eb;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --indigo: #4f46e5;
  --ink: #0f172a;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e6ebf2;
  --green: #16a34a;
  --green-bg: #ecfdf3;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 30px rgba(15,23,42,.06);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidebar-w: 250px;
  --sidebar-mini-w: 76px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 {
  color: var(--slate-900); line-height: 1.25; margin: 0 0 .5em;
  font-weight: 700; letter-spacing: -.02em;
}
h1 { font-size: clamp(24px, 3vw, 32px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
.muted { color: var(--slate-500); }
.muted-inline { color: var(--slate-400); font-weight: 500; }
.text-center { text-align: center; }
.small { font-size: 13px; }

/* ---------- Icons ---------- */
.icon {
  width: 20px; height: 20px; display: inline-block; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none;
}
.icon-sm { width: 16px; height: 16px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page { flex: 1; padding: 26px 0 56px; }
.section { padding: 40px 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.center { text-align: center; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; cursor: pointer; background: var(--blue-600); color: #fff;
  transition: background .15s, box-shadow .15s, transform .1s; text-decoration: none; line-height: 1; font-family: inherit;
}
.btn:hover { background: var(--blue-700); text-decoration: none; box-shadow: 0 6px 16px rgba(37,99,235,.22); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--blue-600); }
.btn-outline { background: #fff; color: var(--blue-700); border-color: var(--blue-100); }
.btn-outline:hover { background: var(--blue-50); box-shadow: none; }
.btn-ghost { background: var(--slate-100); color: var(--slate-700); }
.btn-ghost:hover { background: var(--slate-200); box-shadow: none; }
.btn-success { background: var(--green); }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 13px 24px; font-size: 15.5px; }
.btn-block { width: 100%; }

/* ---------- Cards / grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-sm { padding: 14px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Stat tiles */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px; }
.stat .ic-box { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat .ic-box.blue { background: var(--blue-50); color: var(--blue-700); }
.stat .ic-box.green { background: var(--green-bg); color: var(--green); }
.stat .ic-box.amber { background: var(--amber-bg); color: var(--amber); }
.stat .label { color: var(--slate-500); font-size: 12.5px; font-weight: 600; }
.stat .value { font-size: 22px; font-weight: 800; margin-top: 2px; letter-spacing: -.02em; }
.value.blue, .text-blue { color: var(--blue-700); }
.value.green, .text-green { color: var(--green); }
.value.amber, .text-amber { color: var(--amber); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill .icon { width: 14px; height: 14px; }
.pill-blue { background: var(--blue-50); color: var(--blue-700); }
.pill-green { background: var(--green-bg); color: #15803d; }
.pill-red { background: var(--red-bg); color: #b91c1c; }
.pill-amber { background: var(--amber-bg); color: var(--amber); }
.pill-gray { background: var(--slate-100); color: var(--slate-500); }
.coin { color: var(--amber); font-weight: 800; }
.coin-pill { display: inline-block; margin: 6px 0 0; background: var(--amber-bg); color: var(--amber); font-weight: 700; padding: 6px 14px; border-radius: 999px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table th, .table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--slate-100); font-size: 14px; vertical-align: middle; }
.table th { background: var(--slate-50); color: var(--slate-500); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 13.5px; color: var(--slate-700); }
.form-control { width: 100%; padding: 12px 14px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); font-size: 15px; background: #fff; color: var(--ink); font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.form-control:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.input-wrap { position: relative; }
.input-wrap .form-control { padding-right: 46px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); cursor: pointer; border: 0; background: none; color: var(--slate-400); padding: 7px; border-radius: 8px; display: inline-flex; }
.eye:hover { color: var(--slate-700); background: var(--slate-100); }
.eye .icon { width: 20px; height: 20px; }
.help-text { font-size: 12.5px; color: var(--slate-500); margin-top: 5px; }
.req::after { content: " *"; color: var(--red); }
.auth-card { max-width: 440px; margin: 18px auto; }

/* Alerts */
.messages { list-style: none; margin: 0 0 18px; padding: 0; }
.messages li { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 10px; font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.messages li.success { background: var(--green-bg); color: #15803d; border-color: #bbf7d0; }
.messages li.error { background: var(--red-bg); color: #b91c1c; border-color: #fecaca; }
.messages li.warning { background: var(--amber-bg); color: #b45309; border-color: #fde68a; }
.messages li.info { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }

/* ---------- Public top nav ---------- */
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 85; }
.nav-backdrop.open { display: block; }
.topnav { background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; color: var(--slate-900); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-name { color: var(--slate-900); }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; flex: none; box-shadow: 0 2px 6px rgba(37,99,235,.3); }
.nav-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
/* Public nav is a slide-in drawer on ALL viewports; the hamburger (top-right)
   is always visible and opens the menu from the LEFT. */
.nav-menu { position: fixed; top: 0; left: 0; height: 100vh; width: 300px; max-width: 86vw;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0;
  padding: 76px 16px 20px; background: #fff; border-right: 1px solid var(--line);
  box-shadow: var(--shadow); transform: translateX(-100%); transition: transform .25s ease; z-index: 90; }
.nav-menu.open { transform: none; }
.nav-menu a.btn { width: 100%; justify-content: flex-start; }
.nav-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 6px 0 0; width: 100%; }
.nav-actions .btn { width: 100%; justify-content: center; }
.nav-toggle { display: inline-flex; background: none; border: 0; cursor: pointer; color: var(--slate-700); padding: 8px; border-radius: 10px; margin-left: auto; }
.nav-toggle:hover { background: var(--slate-100); }
.nav-toggle .icon { width: 26px; height: 26px; }
.nav-close { position: absolute; top: 14px; right: 14px; z-index: 2; color: var(--slate-700); }
.nav-close:hover { background: var(--slate-100); }

/* ---------- Landing / hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 56px 48px; color: #fff;
  background: radial-gradient(900px 360px at 85% -20%, rgba(79,70,229,.45), transparent), linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero h1 { color: #fff; font-size: clamp(28px, 4.6vw, 44px); letter-spacing: -.03em; max-width: 18ch; }
.hero p { font-size: 17px; opacity: .94; max-width: 620px; }
.hero .btn-outline { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn-outline:hover { background: rgba(255,255,255,.24); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature .ic-box { width: 46px; height: 46px; border-radius: 12px; background: var(--blue-50); color: var(--blue-700); display: grid; place-items: center; margin-bottom: 14px; }
.feature .ic-box .icon { width: 24px; height: 24px; }
.feature h3 { margin: 0 0 6px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .num { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--blue-600); color: #fff; display: grid; place-items: center; font-weight: 800; }
.cta-card { background: linear-gradient(135deg, #eef4ff, #fff); border: 1px solid var(--line); }

/* ---------- App shell (dashboard area) ---------- */
.app-shell { display: flex; align-items: stretch; min-height: calc(100vh - var(--topbar-h)); }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.app-topbar-inner { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 14px; }
.brand-sm .brand-name { font-size: 17px; }
.app-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.balance-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--amber-bg); color: var(--amber); font-weight: 700; padding: 7px 13px; border-radius: 999px; font-size: 14px; }
.balance-chip .icon { width: 17px; height: 17px; }
.user-chip { display: inline-flex; align-items: center; gap: 9px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.user-chip:hover { text-decoration: none; background: var(--slate-50); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-600); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-name { font-weight: 600; color: var(--slate-700); font-size: 14px; }

/* Sidebar */
.app-sidebar { width: var(--sidebar-w); flex: none; background: #0f172a; color: #cbd5e1; display: flex; flex-direction: column; padding: 14px 12px; position: sticky; top: 0; height: 100vh; }
.app-sidebar-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 14px; }
.app-sidebar-head .brand { color: #fff; font-size: 18px; }
.app-sidebar-head .brand-name { color: #fff; }
.sidebar-mini-btn { margin-left: auto; color: #94a3b8; }
.sidebar-mini-btn:hover { background: #1e293b; color: #fff; }
.app-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.app-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; color: #cbd5e1; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; }
.app-nav a:hover, .app-nav a.active { background: #1e293b; color: #fff; text-decoration: none; }
.app-nav a .icon { width: 19px; height: 19px; flex: none; }
.app-nav a.active { box-shadow: inset 3px 0 0 var(--blue-600); }
.app-sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid #1e293b; }
.logout-link { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; color: #fca5a5; font-weight: 600; font-size: 14px; }
.logout-link:hover { background: #1e293b; color: #fff; text-decoration: none; }
.logout-link .icon { width: 19px; height: 19px; flex: none; }

/* Mini (collapsed) state — desktop */
.app-shell.mini .app-sidebar { width: var(--sidebar-mini-w); }
.app-shell.mini .app-sidebar-head .brand-name,
.app-shell.mini .app-nav a span,
.app-shell.mini .logout-link span { display: none; }
.app-shell.mini .app-nav a,
.app-shell.mini .logout-link { justify-content: center; padding-left: 0; padding-right: 0; }
.app-shell.mini .sidebar-mini-btn { transform: rotate(180deg); }

.sidebar-backdrop { display: none; }

/* ---------- Stepper / quiz-survey engine ---------- */
.stepper { max-width: 760px; margin: 0 auto; }
.progress { height: 8px; background: var(--blue-100); border-radius: 999px; overflow: hidden; margin: 14px 0 22px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-600), var(--indigo)); width: 0; transition: width .25s; }
.q-block { display: none; }
.q-block.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.option { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border: 1.5px solid var(--slate-200); border-radius: 12px; margin-bottom: 10px; cursor: pointer; transition: .12s; background: #fff; }
.option:hover { border-color: var(--blue-600); background: var(--blue-50); }
.option.selected { border-color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 3px var(--blue-100); }
.option input { accent-color: var(--blue-600); width: 19px; height: 19px; }
.q-text { font-size: 16.5px; font-weight: 600; margin: 0 0 14px; line-height: 1.4; }

/* Timer */
.timer { font-weight: 700; font-size: 18px; background: #fff; border: 1px solid var(--line); padding: 9px 16px; border-radius: 999px; display: inline-flex; gap: 8px; align-items: center; box-shadow: var(--shadow-sm); color: var(--slate-900); }
.timer .icon { width: 18px; height: 18px; color: var(--blue-600); }
.timer.warn { color: var(--red); border-color: #fecaca; background: var(--red-bg); animation: blink 1s steps(2, start) infinite; }
.timer.warn .icon { color: var(--red); }
@keyframes blink { 50% { opacity: .4; } }

/* Result */
.result-box { text-align: center; padding: 30px 20px; }
.result-icon { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; }
.result-box.tone-ok .result-icon { background: var(--green-bg); color: var(--green); }
.result-box.tone-bad .result-icon { background: var(--red-bg); color: var(--red); }
.result-box.tone-warn .result-icon { background: var(--amber-bg); color: var(--amber); }
.result-icon .icon { width: 38px; height: 38px; }
.result-box .ok { color: var(--green); display: inline-flex; }
.result-box .no { color: var(--red); display: inline-flex; }
.result-box .ok .icon, .result-box .no .icon { width: 18px; height: 18px; }

/* Task */
.task-detail { max-width: 720px; margin: 0 auto; }
.link-btn { font-size: 16px; }

/* Copy */
.copy-box { display: flex; gap: 8px; }
.copy-box input { flex: 1; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 11px 16px; font-weight: 700; color: var(--slate-500); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--blue-700); border-color: var(--blue-600); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); max-width: 420px; width: 100%; padding: 26px; box-shadow: var(--shadow); }
.modal h3 { margin-top: 0; }

/* Content cards (surveys/quizzes/tasks lists) */
.content-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.content-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.content-card h3 { margin: 0 0 6px; font-size: 17px; }
.content-card .card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.content-card .card-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--blue-50); color: var(--blue-700); display: grid; place-items: center; flex: none; }
.content-card .card-ic .icon { width: 21px; height: 21px; }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.content-card .btn { margin-top: auto; }
.meta-line { display: flex; gap: 14px; color: var(--slate-500); font-size: 13px; flex-wrap: wrap; }
.meta-line span { display: inline-flex; align-items: center; gap: 5px; }
.meta-line .icon { width: 15px; height: 15px; }

/* Profile header (dashboard) */
.profile-head { display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.profile-head .avatar-lg { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.profile-head h1 { color: #fff; margin: 0; font-size: 22px; }
.profile-head p { margin: 2px 0 0; opacity: .85; font-size: 13.5px; }

/* Misc */
.empty { text-align: center; padding: 54px 20px; color: var(--slate-500); }
.empty .big { font-size: 46px; margin-bottom: 8px; color: var(--slate-300); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; color: var(--slate-700); padding: 8px; border-radius: 10px; }
.icon-btn:hover { background: var(--slate-100); }
.kbd { background: var(--slate-100); border-radius: 6px; padding: 1px 7px; font-size: 12px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--blue-100); border-top-color: var(--blue-600); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.site-footer { background: #0f172a; color: #cbd5e1; margin-top: 40px; padding: 34px 0 18px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.brand-footer .brand-name { color: #fff; }
.footer-tag { color: #94a3b8; margin: 8px 0 0; font-size: 14px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: #cbd5e1; font-weight: 600; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-base { margin-top: 18px; font-size: 13px; color: #64748b; border-top: 1px solid #1c3a6b; padding-top: 14px; }

/* Admin */
.admin-shell { display: flex; min-height: 100vh; font-family: var(--font); }
.sidebar { width: 248px; flex: none; background: #0f172a; color: #cbd5e1; padding: 18px 14px; display: flex; flex-direction: column; }
.sidebar .sidebar-head { display: flex; align-items: center; margin-bottom: 16px; padding: 0 8px; }
.sidebar .brand { color: #fff; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 10px; color: #cbd5e1; font-weight: 600; margin-bottom: 3px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.sidebar a:hover, .sidebar a.active { background: #1e293b; color: #fff; text-decoration: none; }
.sidebar a .icon { width: 18px; height: 18px; flex: none; }
.sidebar .group { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #64748b; margin: 16px 10px 6px; font-weight: 700; }
.admin-main { flex: 1; min-width: 0; background: var(--bg); padding: 24px; overflow-x: auto; }
.admin-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--slate-700); padding: 8px; border-radius: 10px; margin-right: 8px; }
.admin-toggle:hover { background: var(--slate-100); }
.sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  .admin-shell { display: block; }
  .admin-toggle { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 90; transform: translateX(-100%); transition: transform .25s ease; }
  .admin-shell.sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.45); }
  .admin-shell.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 80; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }

  /* App sidebar -> off-canvas */
  .app-sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 90; transform: translateX(-100%); transition: transform .25s ease; }
  .app-shell.sidebar-open .app-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .app-shell.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 80; }
  .app-shell.mini .app-sidebar { width: var(--sidebar-w); } /* never mini on mobile */
  .user-name { display: none; }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 14px; }
  .hero { padding: 30px 20px; border-radius: 16px; }
  .page { padding: 16px 0 32px; }
  .card { padding: 16px; }
  .content-card { padding: 16px; }
  .profile-head { align-items: flex-start; padding: 18px; gap: 14px; }
  .balance-chip .muted-inline { display: none; }
  .section { padding: 28px 0; }
  .grid { gap: 12px; }
  .app-topbar-inner { padding: 0 14px; }
}
