/* ============================================================
   Sabah Tourism Board — Research Portal
   style.css : modern, minimalist, animated, responsive
   Brand: "Feel Sabah, North Borneo"
   ============================================================ */

:root {
  /* Official Sabah Tourism Board logo palette */
  --teal:        #00a79c;   /* logo teal (primary) */
  --teal-deep:   #00897f;
  --blue:        #28a0da;   /* logo blue */
  --ink:         #123c39;   /* deep brand surface */
  --ink-soft:    #1c4f4b;
  --coral:       #f48220;   /* logo orange (accent) */
  --red:         #ec2227;   /* logo red */
  --gold:        #ffce5c;   /* logo gold */
  --green:       #27b14b;   /* logo green */
  --sky:         #6fd0c9;

  --bg:          #f4f8f7;
  --surface:     #ffffff;
  --surface-2:   #eef6f5;
  --line:        #e2eceb;
  --text:        #15302d;
  --text-soft:   #5c736f;
  --text-mute:   #94a8a4;

  --grad-brand:  linear-gradient(135deg, #00a79c 0%, #18a39a 45%, #27b14b 100%);
  --grad-hero:   linear-gradient(140deg, #123c39 0%, #0a6f66 48%, #00a79c 100%);
  --grad-coral:  linear-gradient(135deg, #f48220 0%, #ec2227 100%);

  --radius:      18px;
  --radius-sm:   12px;
  --shadow:      0 10px 30px -12px rgba(18,60,57,.22);
  --shadow-lg:   0 24px 60px -20px rgba(18,60,57,.35);
  --ring:        0 0 0 4px rgba(0,167,156,.16);

  --ease:        cubic-bezier(.22,.61,.36,1);
  --font:        'Arima Madurai', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
img { max-width: 100%; display: block; }

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  0% { opacity: 0; transform: scale(.92); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-14px); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal { opacity: 0; animation: fadeUp .7s var(--ease) forwards; }
.reveal.d1 { animation-delay: .08s; }
.reveal.d2 { animation-delay: .16s; }
.reveal.d3 { animation-delay: .24s; }
.reveal.d4 { animation-delay: .32s; }
.reveal.d5 { animation-delay: .40s; }

/* ============================================================
   AUTH / LANDING
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
.auth-hero {
  position: relative;
  background: var(--grad-hero);
  color: #fff;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-hero::before,
.auth-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .5;
}
.auth-hero::before {
  width: 460px; height: 460px;
  background: radial-gradient(circle at 30% 30%, rgba(39,177,75,.5), transparent 70%);
  top: -160px; right: -120px;
  animation: float 9s ease-in-out infinite;
}
.auth-hero::after {
  width: 380px; height: 380px;
  background: radial-gradient(circle at 30% 30%, rgba(244,130,32,.45), transparent 70%);
  bottom: -140px; left: -100px;
  animation: float 11s ease-in-out infinite reverse;
}
.auth-hero > * { position: relative; z-index: 1; }

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand .logo-mark {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 8px 24px -8px rgba(0,167,156,.5);
  flex-shrink: 0;
}
.brand .logo-mark svg { width: 30px; height: 30px; }
.brand .logo-mark img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

/* Explore Sabah wordmark in hero */
.hero-wordmark {
  width: 230px;
  max-width: 60%;
  margin-bottom: 22px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.25));
  animation: fadeUp .7s var(--ease) both;
  animation-delay: .1s;
}
.brand .brand-text small {
  display: block;
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--sky);
  font-weight: 600;
}
.brand .brand-text strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .2px;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1px;
  margin-bottom: 18px;
}
.hero-copy h1 .accent {
  background: linear-gradient(120deg, #F2A03D, #FF6B4A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy p {
  color: rgba(255,255,255,.78);
  font-size: 1.05rem;
  max-width: 440px;
}
.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 26px;
}
.hero-tagline .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(43,168,74,.3);
}
.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 8px;
}
.hero-stats .stat strong {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
}
.hero-stats .stat span {
  font-size: .8rem;
  color: rgba(255,255,255,.65);
  text-transform: uppercase;
  letter-spacing: .12em;
}

/* Auth panel (right) */
.auth-panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.auth-card {
  width: 100%;
  max-width: 410px;
  animation: fadeUp .7s var(--ease) both;
}
.auth-card h2 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.5px;
}
.auth-card .sub {
  color: var(--text-soft);
  margin: 6px 0 26px;
  font-size: .95rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  padding: 5px;
  border-radius: 100px;
  margin-bottom: 26px;
}
.tabs button {
  flex: 1;
  padding: 10px 14px;
  border-radius: 100px;
  background: transparent;
  color: var(--text-soft);
  font-weight: 600;
  font-size: .9rem;
  transition: all .3s var(--ease);
}
.tabs button.active {
  background: var(--surface);
  color: var(--teal);
  box-shadow: var(--shadow);
}

/* Forms */
.field { margin-bottom: 16px; animation: slideDown .4s var(--ease) both; }
.field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 7px;
}
.field .input-wrap { position: relative; }
.field .input-wrap svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-mute);
  pointer-events: none;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 15px 13px 42px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .25s, box-shadow .25s;
}
.field input.no-icon { padding-left: 15px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--ring);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .95rem;
  transition: transform .2s var(--ease), box-shadow .25s, background .25s, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  width: 100%;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 12px 26px -10px rgba(14,131,136,.7);
}
.btn-primary:hover { box-shadow: 0 16px 34px -10px rgba(14,131,136,.85); transform: translateY(-2px); }
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
}
.btn-ghost:hover { background: var(--line); }
.btn-coral { background: var(--grad-coral); color: #fff; box-shadow: 0 12px 26px -10px rgba(255,107,74,.6); }
.btn-coral:hover { transform: translateY(-2px); }
.btn-sm { padding: 9px 15px; font-size: .85rem; border-radius: 10px; }
.btn-danger { background: #fde9e4; color: #d2391a; }
.btn-danger:hover { background: #fbd9d0; }

.auth-foot {
  margin-top: 22px;
  text-align: center;
  font-size: .9rem;
  color: var(--text-soft);
}
.auth-foot a { color: var(--teal); font-weight: 700; }
.admin-link {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--line);
  color: var(--text-soft);
  font-size: .88rem;
  font-weight: 600;
  transition: all .25s;
}
.admin-link:hover { border-color: var(--teal); color: var(--teal); background: var(--surface-2); }

/* Alerts */
.alert {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
  animation: slideDown .35s var(--ease);
}
.alert.show { display: block; }
.alert-error { background: #fdece7; color: #c33012; }
.alert-success { background: #e4f6ec; color: #1c7a43; }

/* ============================================================
   DASHBOARD SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--ink);
  color: #cfe0e2;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { margin-bottom: 34px; padding: 0 8px; }
.sidebar .brand .brand-text small { color: var(--sky); }
.sidebar .brand .brand-text strong { color: #fff; }

.nav-group-label {
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #5e7a7e;
  padding: 0 12px;
  margin: 18px 0 8px;
  font-weight: 700;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  color: #aac3c6;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  transition: all .25s var(--ease);
  margin-bottom: 3px;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(14,131,136,.8);
}
.nav-spacer { flex: 1; }
.nav-user {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.nav-user .avatar {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad-coral);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: .9rem;
  flex-shrink: 0;
}
.nav-user .meta { overflow: hidden; }
.nav-user .meta strong { display: block; font-size: .85rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user .meta span { font-size: .74rem; color: #7c989c; }
.nav-user button {
  margin-left: auto;
  background: rgba(255,255,255,.07);
  color: #cfe0e2;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  transition: all .25s;
  flex-shrink: 0;
}
.nav-user button:hover { background: var(--coral); color: #fff; }

/* Main */
.main { padding: 30px 38px 60px; overflow-x: hidden; }
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.topbar .page-title h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.6px;
}
.topbar .page-title p { color: var(--text-soft); font-size: .92rem; }
.topbar .spacer { flex: 1; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box svg {
  position: absolute; left: 14px;
  width: 18px; height: 18px; color: var(--text-mute);
}
.search-box input {
  padding: 11px 16px 11px 42px;
  border: 1.5px solid var(--line);
  border-radius: 100px;
  background: var(--surface);
  font-size: .9rem;
  width: 240px;
  transition: all .25s;
  font-family: inherit;
}
.search-box input:focus { outline: none; border-color: var(--teal); box-shadow: var(--ring); width: 280px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.chip-finding { background: #e2f5ee; color: #1c7a4f; }
.chip-report { background: #fdeee2; color: #c5701b; }
.chip-soft { background: var(--surface-2); color: var(--text-soft); }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.kpi-card .ico {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.kpi-card .ico svg { width: 22px; height: 22px; color: #fff; }
.kpi-card .ico.teal { background: var(--grad-brand); }
.kpi-card .ico.coral { background: var(--grad-coral); }
.kpi-card .ico.gold { background: linear-gradient(135deg,#28a0da,#56bdec); }
.kpi-card .ico.green { background: linear-gradient(135deg,#27b14b,#4ec96e); }
.kpi-card .val { font-size: 1.9rem; font-weight: 800; letter-spacing: -1px; }
.kpi-card .lbl { color: var(--text-soft); font-size: .86rem; font-weight: 600; }
.kpi-card .delta {
  margin-top: 8px; font-size: .78rem; font-weight: 700;
  color: var(--green);
}

/* Content cards / item grid */
.section-head {
  display: flex; align-items: center; gap: 14px;
  margin: 8px 0 18px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.4px; }
.section-head .count { color: var(--text-mute); font-weight: 600; font-size: .9rem; }
.section-head .spacer { flex: 1; }

.filter-pills { display: flex; gap: 8px; }
.filter-pills button {
  padding: 8px 16px;
  border-radius: 100px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--text-soft);
  font-weight: 600;
  font-size: .85rem;
  transition: all .25s;
}
.filter-pills button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
}
.item-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s var(--ease), box-shadow .3s;
  border: 1px solid transparent;
}
.item-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(14,131,136,.18); }
.item-card .card-top {
  padding: 20px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.item-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.3px;
  margin: 14px 20px 6px;
  line-height: 1.3;
}
.item-card .desc {
  color: var(--text-soft);
  font-size: .88rem;
  margin: 0 20px 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-card .mini-chart {
  height: 120px;
  margin: 0 14px 14px;
  position: relative;
}
.item-card .card-meta {
  margin: auto 20px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .78rem;
  color: var(--text-mute);
  font-weight: 600;
}
.item-card .card-actions {
  padding: 0 16px 16px;
  display: flex;
  gap: 8px;
}
.item-card .card-actions .btn { flex: 1; }

.format-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 800; letter-spacing: .04em;
  padding: 4px 9px; border-radius: 7px;
}
.format-pdf { background: #fdeae6; color: #d2391a; }
.format-csv { background: #e4f3ec; color: #1f8049; }

/* ============================================================
   MODAL  (detail view + admin forms)
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,45,52,.55);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fadeIn .25s var(--ease);
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 22px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn .35s var(--ease);
}
.modal.narrow { max-width: 540px; }
.modal-head {
  position: sticky; top: 0;
  background: var(--surface);
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  z-index: 2;
}
.modal-head .htext h3 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; }
.modal-head .htext p { color: var(--text-soft); font-size: .9rem; margin-top: 4px; }
.modal-head .close {
  margin-left: auto;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--text-soft);
  transition: all .25s;
  flex-shrink: 0;
}
.modal-head .close:hover { background: var(--coral); color: #fff; transform: rotate(90deg); }
.modal-body { padding: 26px 28px; }

.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.chart-toolbar .lbl { font-size: .82rem; font-weight: 700; color: var(--text-soft); }
.chart-type-btns { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.chart-type-btns button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-weight: 600;
  font-size: .82rem;
  transition: all .25s;
}
.chart-type-btns button svg { width: 15px; height: 15px; }
.chart-type-btns button.active { background: var(--surface); color: var(--teal); box-shadow: var(--shadow); }

.chart-stage {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 20px;
  height: 360px;
  position: relative;
  margin-bottom: 22px;
}

.data-table-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data-table th {
  background: var(--surface-2);
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-soft);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
table.data-table td { padding: 12px 16px; border-top: 1px solid var(--line); }
table.data-table tr:hover td { background: var(--surface-2); }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* Admin table */
.admin-table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th {
  text-align: left; padding: 15px 20px;
  font-size: .76rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-mute);
  font-weight: 700; background: var(--surface-2);
}
table.admin-table td { padding: 15px 20px; border-top: 1px solid var(--line); font-size: .9rem; }
table.admin-table tr { transition: background .2s; }
table.admin-table tbody tr:hover { background: var(--surface-2); }
table.admin-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-soft);
  transition: all .25s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.edit:hover { background: var(--teal); color: #fff; }
.icon-btn.del:hover { background: var(--coral); color: #fff; }

/* dynamic rows editor */
.rows-editor { display: flex; flex-direction: column; gap: 8px; }
.rows-editor .erow { display: flex; gap: 8px; align-items: center; }
.rows-editor .erow input { padding: 10px 12px; }
.rows-editor .erow .del-row {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: #fde9e4; color: #d2391a; display: grid; place-items: center;
  transition: all .2s;
}
.rows-editor .erow .del-row:hover { background: #d2391a; color: #fff; }

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-mute);
}
.empty-state svg { width: 56px; height: 56px; margin-bottom: 14px; opacity: .5; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-soft); margin-bottom: 6px; }

/* Toast */
.toast-zone {
  position: fixed; bottom: 26px; right: 26px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 14px 20px;
  border-radius: 14px;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: slideDown .35s var(--ease);
  min-width: 240px;
}
.toast.ok { border-left: 4px solid var(--green); }
.toast.err { border-left: 4px solid var(--coral); }
.toast svg { width: 18px; height: 18px; }

/* spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* mobile nav toggle */
.menu-toggle {
  display: none;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow);
  place-items: center; color: var(--ink);
}
.menu-toggle svg { width: 22px; height: 22px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 40px 32px; min-height: 320px; }
  .hero-stats { gap: 24px; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 264px;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform .35s var(--ease);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .main { padding: 20px; }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(10,45,52,.5);
    z-index: 80; display: none;
  }
  .sidebar-backdrop.show { display: block; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .auth-panel { padding: 32px 22px; }
  .search-box input, .search-box input:focus { width: 100%; }
  .search-box { width: 100%; }
  .topbar { gap: 12px; }
  .modal-body { padding: 18px; }
  .chart-stage { height: 280px; }
}
