/* ============================================================
   Investech Softwares — Dashboard
   Design System (Dark premium / Blue primary / Purple accent)
   ============================================================ */

:root {
  /* Core surfaces */
  --bg: #0a0e17;
  --bg-elev: #0f1626;
  --surface: #131c2e;
  --surface-2: #18233a;
  --surface-hover: #1d2a44;
  --border: #20304d;
  --border-soft: #1a2740;

  /* Text */
  --text: #e8edf6;
  --text-muted: #9aa9c4;
  --text-faint: #64748b;

  /* Brand */
  --primary: #2f6bff;
  --primary-hover: #4a80ff;
  --primary-soft: rgba(47, 107, 255, 0.12);
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.14);

  /* Feedback */
  --success: #2dd4a7;
  --warning: #f5b544;
  --danger: #ff5c72;

  /* Layout */
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --header-h: 64px;
  --footer-h: 56px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  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; }
ul { list-style: none; }
::selection { background: var(--primary-soft); color: #fff; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--surface-hover); }

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.25s ease;
}
.app.sidebar-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ============================================================
   Sidebar (fixed)
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-elev);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: width 0.25s ease, transform 0.25s ease;
}
.app.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.sidebar__brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.brand__logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(47, 107, 255, 0.4);
}
.brand__logo svg { width: 22px; height: 22px; color: #fff; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; overflow: hidden; white-space: nowrap; }
.brand__text strong { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand__text span { font-size: 11px; color: var(--text-faint); letter-spacing: 0.04em; text-transform: uppercase; }
.app.sidebar-collapsed .brand__text { display: none; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav__group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 16px 12px 8px;
  font-weight: 600;
}
.app.sidebar-collapsed .nav__group-label { text-align: center; font-size: 0; padding: 12px 0 6px; }
.app.sidebar-collapsed .nav__group-label::before { content: "•"; font-size: 12px; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  background: none;
  text-align: left;
  position: relative;
}
.nav__item svg,
.nav__item .ic { width: 22px; height: 22px; flex-shrink: 0; }
.nav__item:hover { background: var(--surface); color: var(--text); }
.nav__item.active {
  background: var(--primary-soft);
  color: #fff;
  border-color: rgba(47, 107, 255, 0.25);
}
.nav__item.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.nav__label { white-space: nowrap; overflow: hidden; }
.app.sidebar-collapsed .nav__label { display: none; }
.app.sidebar-collapsed .nav__item { justify-content: center; }
.nav__badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
}
.app.sidebar-collapsed .nav__badge { display: none; }

.sidebar__cta { padding: 16px; flex-shrink: 0; }
.cta-card {
  background: linear-gradient(150deg, rgba(47, 107, 255, 0.16), rgba(124, 92, 255, 0.14));
  border: 1px solid rgba(124, 92, 255, 0.25);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.cta-card h4 { font-size: 13.5px; margin-bottom: 4px; }
.cta-card p { font-size: 11.5px; color: var(--text-muted); margin-bottom: 12px; }
.app.sidebar-collapsed .sidebar__cta { display: none; }

/* ============================================================
   Main column
   ============================================================ */
.main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 50;
}
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.header__search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  height: 38px;
  max-width: 420px;
  flex: 1;
}
.header__search svg { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }
.header__search input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13.5px; width: 100%;
}
.header__search input::placeholder { color: var(--text-faint); }
.header__search kbd {
  font-size: 10.5px; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; background: var(--bg);
}

.header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header__order-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px; border: none;
  background: var(--primary);
  color: #fff; font-weight: 600; font-size: 13.5px;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(47, 107, 255, 0.32);
}
.header__order-btn:hover { background: var(--primary-hover); }
.header__order-btn:active { transform: translateY(1px); }
.header__order-btn svg { width: 16px; height: 16px; }

.notif-btn { position: relative; }
.notif-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
}

/* User avatar button */
.avatar-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.1s;
}
.avatar-btn:hover { border-color: var(--primary); }
.avatar-btn:active { transform: scale(0.96); }
.avatar-btn svg { width: 20px; height: 20px; }

/* ---------- Content ---------- */
.content { flex: 1; padding: 28px 24px 40px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page { display: none; animation: fadeUp 0.35s ease; }
.page.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.breadcrumb { font-size: 12.5px; color: var(--text-faint); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.breadcrumb svg { width: 13px; height: 13px; }

/* ============================================================
   Cards / Grid
   ============================================================ */
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
}
.card--pad-lg { padding: 24px; }

.stat__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat__icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.stat__icon svg { width: 20px; height: 20px; }
.stat__icon.purple { background: var(--accent-soft); color: var(--accent); }
.stat__icon.green { background: rgba(45, 212, 167, 0.12); color: var(--success); }
.stat__icon.amber { background: rgba(245, 181, 68, 0.12); color: var(--warning); }
.stat__trend { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 3px; }
.stat__trend.up { color: var(--success); }
.stat__trend.down { color: var(--danger); }
.stat__trend svg { width: 13px; height: 13px; }
.stat__value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat__label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title h2 { font-size: 17px; font-weight: 650; }
.link-btn { font-size: 13px; color: var(--primary); font-weight: 600; background: none; border: none; }
.link-btn:hover { color: var(--primary-hover); }

/* Bars chart (pure css) */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar {
  width: 70%;
  background: linear-gradient(180deg, var(--primary), rgba(47, 107, 255, 0.35));
  border-radius: 6px 6px 0 0;
  transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar.alt { background: linear-gradient(180deg, var(--accent), rgba(124, 92, 255, 0.35)); }
.bar-col span { font-size: 11px; color: var(--text-faint); }

/* Progress / credits */
.credit-ring { display: flex; align-items: center; gap: 20px; }
.ring {
  --val: 68;
  width: 120px; height: 120px; border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--val) * 1%), var(--surface-2) 0);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ring::before {
  content: ""; position: absolute; width: 92px; height: 92px;
  border-radius: 50%; background: var(--surface);
}
.ring__inner { position: relative; text-align: center; }
.ring__inner strong { font-size: 22px; font-weight: 700; }
.ring__inner span { font-size: 11px; color: var(--text-muted); display: block; }

/* Lists / table */
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border-soft);
}
.list-row:last-child { border-bottom: none; }
.list-row__icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0;
}
.list-row__icon svg { width: 18px; height: 18px; color: var(--text-muted); }
.list-row__main { flex: 1; min-width: 0; }
.list-row__main strong { font-size: 14px; font-weight: 600; display: block; }
.list-row__main span { font-size: 12.5px; color: var(--text-muted); }
.list-row__meta { text-align: right; font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
}
.badge.success { background: rgba(45, 212, 167, 0.12); color: var(--success); }
.badge.warning { background: rgba(245, 181, 68, 0.12); color: var(--warning); }
.badge.info { background: var(--primary-soft); color: var(--primary); }
.badge.muted { background: var(--surface-2); color: var(--text-muted); }
.badge.purple { background: var(--accent-soft); color: var(--accent); }
.badge .dot-i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-faint); font-weight: 600;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
td { padding: 14px; font-size: 13.5px; border-bottom: 1px solid var(--border-soft); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--primary); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(47, 107, 255, 0.3); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.btn--lg { height: 48px; font-size: 15px; padding: 0 26px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============================================================
   Footer (dynamic, scroll-aware)
   ============================================================ */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-elev);
  padding: 16px 24px;
  display: flex; align-items: center; gap: 16px;
  font-size: 12.5px; color: var(--text-muted);
  flex-wrap: wrap;
}
.footer__links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer__links a:hover { color: var(--text); }
.footer__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.footer__status { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-weight: 600; }
.footer__status .dot-i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(45, 212, 167, 0.18); }

/* ============================================================
   User popup menu
   ============================================================ */
.user-menu {
  position: fixed;
  top: calc(var(--header-h) + 6px);
  right: 24px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  transform-origin: top right;
  animation: popIn 0.16s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.user-menu[hidden] { display: none; }
.user-menu__head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border-soft); }
.user-menu__avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; color: #fff; font-weight: 700; flex-shrink: 0;
}
.user-menu__info strong { font-size: 14px; display: block; }
.user-menu__info span { font-size: 12px; color: var(--text-muted); }
.user-menu__list { padding: 8px; }
.user-menu__item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--text-muted);
  font-size: 13.5px; font-weight: 500; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.user-menu__item svg { width: 18px; height: 18px; flex-shrink: 0; }
.user-menu__item:hover { background: var(--surface-2); color: var(--text); }
.user-menu__item .chev { margin-left: auto; width: 15px; height: 15px; color: var(--text-faint); }
.user-menu__sep { height: 1px; background: var(--border-soft); margin: 6px 8px; }

/* Indique e Ganhe — glowing text */
.refer-item .refer-text {
  font-weight: 700;
  background: linear-gradient(90deg, #4a80ff, #a78bff, #ffffff, #7c5cff, #4a80ff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shineText 4s linear infinite, glowPulse 2.4s ease-in-out infinite;
}
.refer-item svg { color: var(--accent); filter: drop-shadow(0 0 5px rgba(124, 92, 255, 0.7)); }
@keyframes shineText { to { background-position: 300% 0; } }
@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(124, 92, 255, 0.3)); }
  50% { filter: drop-shadow(0 0 9px rgba(124, 92, 255, 0.65)); }
}

/* ============================================================
   Order flow (multi-step)
   ============================================================ */
.order-shell { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }

.steps-aside { position: sticky; top: calc(var(--header-h) + 28px); }
.steps-aside .card { padding: 18px; }
.step-line { display: flex; gap: 14px; padding: 12px 6px; position: relative; }
.step-line:not(:last-child)::after {
  content: ""; position: absolute; left: 19px; top: 38px; bottom: -6px;
  width: 2px; background: var(--border);
}
.step-line.done:not(:last-child)::after { background: var(--primary); }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--border);
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 12px; font-weight: 700; color: var(--text-faint); z-index: 1;
}
.step-line.active .step-dot { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.step-line.done .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-line.done .step-dot svg { width: 15px; height: 15px; }
.step-meta strong { font-size: 13.5px; display: block; }
.step-meta span { font-size: 11.5px; color: var(--text-faint); }
.step-line.active .step-meta strong { color: var(--text); }

.order-progress { height: 6px; background: var(--surface-2); border-radius: 20px; overflow: hidden; margin-bottom: 24px; }
.order-progress__bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 20px; transition: width 0.4s ease; width: 14%; }

.step-panel { display: none; animation: fadeUp 0.3s ease; }
.step-panel.active { display: block; }
.step-panel h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.step-panel > p.sub { color: var(--text-muted); font-size: 14px; margin-bottom: 22px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.field label .req { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* option cards */
.opt-grid { display: grid; gap: 12px; }
.opt-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.opt-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.opt {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.opt:hover { border-color: var(--surface-hover); background: var(--surface); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border); flex-shrink: 0; margin-top: 1px;
  display: grid; place-items: center; transition: all 0.15s;
}
.opt__check svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.opt.radio .opt__check { border-radius: 50%; }
.opt input:checked ~ .opt__check { background: var(--primary); border-color: var(--primary); }
.opt input:checked ~ .opt__check svg { opacity: 1; }
.opt input:checked ~ .opt__body { color: var(--text); }
.opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.opt__body strong { font-size: 13.5px; display: block; }
.opt__body span { font-size: 12px; color: var(--text-muted); }
.opt__ic { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; margin-top: 1px; }

/* map */
#orderMap { height: 300px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 8px; z-index: 1; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.map-selected {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--primary-soft);
  border: 1px solid rgba(47, 107, 255, 0.3); border-radius: 10px;
  font-size: 13.5px; margin-top: 8px;
}
.map-selected svg { width: 17px; height: 17px; color: var(--primary); }

/* terms acceptance */
.terms-box {
  max-height: 240px; overflow-y: auto;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 18px;
  font-size: 13px; color: var(--text-muted);
}
.terms-box h4 { color: var(--text); font-size: 13.5px; margin: 14px 0 6px; }
.terms-box h4:first-child { margin-top: 0; }
.terms-box p { margin-bottom: 8px; }

.accept-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }

/* Checkbox / termos (corrigido) */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.check-row.is-checked { border-color: var(--primary); background: var(--primary-soft); }
.check-row__input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.check-row__label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.45;
  flex: 1;
  color: var(--text-muted);
}
.check-row__mark {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.check-row.is-checked .check-row__mark {
  background: var(--primary);
  border-color: var(--primary);
}
.check-row.is-checked .check-row__mark::after {
  content: "";
  position: absolute;
  left: 5px; top: 2px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.inline-link {
  background: none; border: none; padding: 0;
  color: var(--primary); font-weight: 600;
  font-size: inherit; font-family: inherit;
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.inline-link:hover { color: var(--primary-hover); }

.expand-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
}
.expand-panel.is-open { border-color: rgba(47, 107, 255, 0.35); }

/* Campo senha com mostrar/ocultar */
.input-password { position: relative; }
.input-password .input { padding-right: 46px; }
.input-password__toggle {
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border: none; border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  display: grid; place-items: center;
  cursor: pointer;
}
.input-password__toggle:hover { background: var(--surface-hover); color: var(--text); }
.input-password__toggle svg { width: 18px; height: 18px; }
.input-password__toggle .icon-eye-off { display: none; }
.input-password__toggle.is-visible .icon-eye { display: none; }
.input-password__toggle.is-visible .icon-eye-off { display: block; }

.step-actions { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border-soft); }
.step-actions .spacer { flex: 1; }

/* review */
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.review-item { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.review-item dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); margin-bottom: 4px; }
.review-item dd { font-size: 14px; font-weight: 500; }

/* success */
.order-success { text-align: center; padding: 40px 20px; }
.success-ic {
  width: 76px; height: 76px; border-radius: 50%;
  background: rgba(45, 212, 167, 0.14); color: var(--success);
  display: grid; place-items: center; margin: 0 auto 20px;
  animation: popIn 0.4s ease;
}
.success-ic svg { width: 38px; height: 38px; }
.order-success h2 { font-size: 24px; margin-bottom: 8px; }
.order-success p { color: var(--text-muted); max-width: 440px; margin: 0 auto 8px; }
.order-success .order-id {
  display: inline-block; margin: 16px 0 24px;
  font-family: ui-monospace, monospace; font-size: 15px; font-weight: 700;
  padding: 8px 18px; background: var(--surface-2); border-radius: 10px; color: var(--primary);
}

/* ============================================================
   Toast
   ============================================================ */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; min-width: 260px; animation: slideIn 0.25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.toast.success svg { color: var(--success); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================================
   Overlay / backdrop
   ============================================================ */
.backdrop {
  position: fixed; inset: 0; background: rgba(5, 8, 14, 0.6);
  backdrop-filter: blur(2px); z-index: 150;
}
.backdrop[hidden] { display: none; }

/* mobile toggle visibility */
.menu-toggle { display: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .order-shell { grid-template-columns: 1fr; }
  .steps-aside { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w); }
  .app.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { grid-column: 1; }
  .menu-toggle { display: grid; }
  .header__search { display: none; }
  .header__order-btn span { display: none; }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .review-grid, .field-row, .opt-grid.cols-2, .opt-grid.cols-3 { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 32px; }
}
@media (max-width: 520px) {
  .grid.cols-4 { grid-template-columns: 1fr; }
  .header { padding: 0 14px; gap: 10px; }
  .user-menu { right: 12px; left: 12px; width: auto; }
}

/* ============================================================
   Auth gate
   ============================================================ */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-gate[hidden] { display: none; }
.auth-gate__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(47, 107, 255, 0.22), transparent),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(124, 92, 255, 0.18), transparent),
    var(--bg);
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 22px;
  box-shadow: var(--shadow-lg);
}
.auth-card__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.auth-card__brand strong { display: block; font-size: 16px; }
.auth-card__brand span { font-size: 12.5px; color: var(--text-muted); }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg-elev);
  border-radius: 10px;
}
.auth-tab {
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}
.auth-tab.active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-form .field { margin-bottom: 14px; }
.auth-error {
  background: rgba(255, 92, 114, 0.12);
  border: 1px solid rgba(255, 92, 114, 0.35);
  color: #ffb4be;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}
.auth-bonus {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 12px;
}
.auth-footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 18px;
  line-height: 1.5;
}
.auth-footer a { color: var(--primary); font-weight: 600; }

.app.public-mode .sidebar,
.app.public-mode .header__actions,
.app.public-mode .footer,
.app.public-mode .sidebar__cta { display: none; }
.app.public-mode { grid-template-columns: 1fr; }
.app.public-mode .main::before {
  content: "Visualizando Termos — faça login para acessar o painel";
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px;
  background: var(--primary-soft);
  border-bottom: 1px solid var(--border-soft);
}

/* ============================================================
   Material Symbols
   ============================================================ */
.material-symbols-rounded.ic {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  display: inline-flex;
  vertical-align: middle;
}
.nav__item .ic { font-size: 22px; flex-shrink: 0; }
.brand__logo .ic { font-size: 22px; color: #fff; }
.stat__icon .ic { font-size: 22px; }
.list-row__icon .ic { font-size: 20px; color: var(--text-muted); }
.btn .ic { margin-right: 4px; }

/* ============================================================
   Terms overlay (card)
   ============================================================ */
.terms-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  place-items: center;
  padding: 20px;
}
.terms-overlay[hidden] { display: none; }
.terms-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.72);
  backdrop-filter: blur(4px);
}
.terms-card {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: min(88vh, 900px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.terms-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.terms-card__head h2 { font-size: 20px; margin: 0; }
.terms-card__sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.terms-card__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}
.terms-section { margin-bottom: 24px; scroll-margin-top: 12px; }
.terms-section h3 { font-size: 16px; margin-bottom: 8px; }
.terms-section p { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.terms-card__foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-elev);
}
body.terms-open { overflow: hidden; }

.draft-banner {
  border-color: rgba(124, 92, 255, 0.35);
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.08), rgba(124, 92, 255, 0.1));
}
.row-pending { background: rgba(124, 92, 255, 0.04); }
.btn--sm {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   Toggle switch (settings)
   ============================================================ */
.switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 44px;
  height: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s, background 0.2s;
}
.switch input:checked + .switch__track {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.switch input:checked + .switch__track::after {
  transform: translateX(20px);
  background: var(--primary);
}

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 36px 20px;
}
.empty-state__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 17px; margin-bottom: 8px; }
.empty-state p {
  color: var(--text-muted);
  font-size: 13.5px;
  max-width: 360px;
  margin: 0 auto;
}

.grid.credit-packs {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
