/* Cui Bono — clean professional, white with deep blue accents. Light/dark via [data-theme]. */
:root {
  --blue-900: #0b2a6b;
  --blue-700: #164fa3;
  --blue-500: #2c6fd6;
  --blue-100: #e8f0fe;
  --gold: #f2b441;
  --bg: #ffffff;
  --surface: #f6f8fc;
  --text: #0f1b33;
  --muted: #5b6b8c;
  --border: #dbe3f0;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(11, 42, 107, 0.08);
  --ok: #1a8f5e;
  --warn: #b8790a;
  --bad: #c23a3a;
}
[data-theme='dark'] {
  --bg: #0b1220;
  --surface: #111a2e;
  --text: #eef2fb;
  --muted: #9aa8c9;
  --border: #253254;
  --blue-100: #16264a;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-700); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { color: var(--text); line-height: 1.15; margin: 0 0 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mt { margin-top: 1.5rem; }

/* Price / money — ONE unbreakable token */
.price, .money { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Customer header ─────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; padding: 0.75rem 1.25rem; }
.brand { display: flex; align-items: center; }
.nav-links { display: flex; gap: 1.25rem; margin-left: auto; }
.nav-link { color: var(--text); text-decoration: none; font-weight: 500; padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.nav-link:hover, .nav-link.active { color: var(--blue-700); border-bottom-color: var(--blue-700); }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-burger { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text); }
.nav-links-mobile { display: none; flex-direction: column; padding: 0 1.25rem 1rem; }
.nav-links-mobile.open { display: flex; }

@media (max-width: 860px) {
  .header-inner .nav-links { display: none; }
  .nav-burger { display: block; margin-left: auto; }
  .header-actions { margin-left: 0.5rem; }
}

.theme-toggle { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; width: 40px; height: 40px; cursor: pointer; font-size: 1.1rem; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.65rem 1.1rem; border-radius: 10px; border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 44px; font-size: 0.95rem; }
.btn-primary { background: var(--blue-700); color: #fff; }
.btn-primary:hover { background: var(--blue-900); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface); }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,0.7); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,0.15); }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; min-height: 36px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { background-size: cover; background-position: center; color: #fff; padding: 6rem 1.25rem 5rem; }
.hero-inner { max-width: 820px; margin: 0 auto; text-align: left; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--gold); font-weight: 700; margin-bottom: 0.75rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.08; margin-bottom: 1rem; color: #fff; }
.hero-sub { font-size: 1.15rem; color: rgba(255,255,255,0.92); max-width: 640px; margin-bottom: 1.75rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.hero-trust { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: rgba(255,255,255,0.85); }

/* ── Sections ─────────────────────────────────────────────────────── */
.section { max-width: 1180px; margin: 0 auto; padding: 4rem 1.25rem; }
.section.narrow { max-width: 900px; }
.section.narrow-sm { max-width: 480px; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.1rem); text-align: center; }
.section-sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 2.5rem; }
.section-split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.section-split.reverse { direction: rtl; }
.section-split.reverse > * { direction: ltr; }
.split-img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; height: 320px; object-fit: cover; }
.tick-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.tick-list li::before { content: '✔'; color: var(--blue-700); margin-right: 0.5rem; }
@media (max-width: 760px) { .section-split { grid-template-columns: 1fr; } }

.cta-banner { background-size: cover; background-position: center; border-radius: var(--radius); color: #fff; text-align: center; padding: 4rem 2rem; }
.cta-banner h2 { color: #fff; }
.cta-banner p { color: rgba(255,255,255,0.9); margin-bottom: 1.5rem; }

/* ── Cards / grids ────────────────────────────────────────────────── */
.cards-grid { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .cards-3, .cards-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards-3, .cards-4 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.5rem; height: 100%; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-700); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }

.pricing-grid .pricing-card { justify-content: flex-start; }
.pricing-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.pricing-head h3 { margin: 0; }
.pricing-card .price { font-size: 1.6rem; color: var(--blue-700); white-space: nowrap; }
.pricing-card.featured { border-color: var(--blue-700); border-width: 2px; }

.stat-card { text-align: left; gap: 0.25rem; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.chip-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.5rem 0; }
.chip { background: var(--blue-100); color: var(--blue-900); padding: 0.4rem 0.8rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.chip-btn { border: 1px solid var(--border); cursor: pointer; min-height: 44px; }
.chip-btn.selected { background: var(--blue-700); color: #fff; }

.badge-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.badge { background: var(--gold); color: #3a2802; padding: 0.25rem 0.65rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }

.pill { background: var(--blue-100); color: var(--blue-900); padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.pill-user { background: var(--surface); }
.pill-ok { background: #e2f6ec; color: var(--ok); }
.pill-warn { background: #fdf1dc; color: var(--warn); }
.pill-bad { background: #fbe4e4; color: var(--bad); }
.pill-muted { background: var(--surface); color: var(--muted); }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-card { max-width: 640px; }
.form-card label, form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.9rem; }
input, select, textarea { font: inherit; padding: 0.65rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); min-height: 44px; }
textarea { min-height: 100px; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > label { flex: 1; min-width: 180px; }
.role-choice { border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.radio, .checkbox { flex-direction: row !important; align-items: center; gap: 0.5rem !important; font-weight: 500; }
.error { color: var(--bad); min-height: 1.2rem; font-size: 0.9rem; }
.notice-success { background: #e2f6ec; color: var(--ok); border-radius: 10px; padding: 1rem; font-weight: 600; }
.notice-warn { background: #fdf1dc; color: var(--warn); border-radius: 10px; padding: 1rem; font-weight: 600; }
.notice-bad { background: #fbe4e4; color: var(--bad); border-radius: 10px; padding: 1rem; font-weight: 600; }

.tab-row { display: flex; gap: 0.5rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; }
.tab-btn { background: none; border: 1px solid var(--border); border-radius: 999px; padding: 0.5rem 1rem; cursor: pointer; min-height: 40px; color: var(--text); }
.tab-btn.active { background: var(--blue-700); color: #fff; border-color: var(--blue-700); }

.stepper { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.step-pill { font-size: 0.8rem; padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.step-pill.active { background: var(--blue-700); color: #fff; border-color: var(--blue-700); }
.wizard-nav { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.channel-row { display: flex; gap: 1rem; align-items: center; margin-bottom: 0.6rem; flex-wrap: wrap; }
.channel-handle { flex: 1; min-width: 160px; }
.rounded-img { border-radius: var(--radius); height: 160px; object-fit: cover; width: 100%; }
.image-note { display: flex; flex-direction: column; gap: 0.5rem; max-width: 320px; }

/* ── Vendor cards / profile ───────────────────────────────────────── */
.vendor-card-head { display: flex; align-items: center; gap: 0.85rem; }
.vendor-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--blue-100); }
.vendor-avatar.lg { width: 88px; height: 88px; }
.vendor-stats-row { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); }
.card-actions { display: flex; gap: 0.75rem; margin-top: auto; }
.vendor-hero { flex-direction: row; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.vendor-hero > a { margin-left: auto; }
.rating-row { border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.75rem; }

/* ── Tables ───────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td:nth-child(2), .table td:last-child { white-space: normal; }
.mini-select { min-height: 36px; padding: 0.2rem 0.4rem; }

.link-card { text-decoration: none; }
.link-card h4 { color: var(--blue-700); }

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: auto; padding: 3rem 1.25rem 1.5rem; }
.footer-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 2rem; }
.footer-grid a { display: block; color: var(--text); text-decoration: none; margin-bottom: 0.4rem; }
.footer-grid h4 { margin-top: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.credits { max-width: 1180px; margin: 2rem auto 0; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--muted); }
.footer-bottom { max-width: 1180px; margin: 1rem auto 0; font-size: 0.8rem; }

/* ── Admin console (distinct app shell) ──────────────────────────── */
.admin-shell { flex-direction: row; min-height: 100vh; }
.admin-sidebar { width: 250px; flex-shrink: 0; background: var(--blue-900); color: #fff; display: flex; flex-direction: column; padding: 1.25rem; gap: 0.5rem; position: sticky; top: 0; height: 100vh; }
.brand-admin { filter: brightness(0) invert(1); }
.admin-tag { color: rgba(255,255,255,0.6); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem; }
.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.admin-nav-link { color: rgba(255,255,255,0.85); text-decoration: none; padding: 0.65rem 0.75rem; border-radius: 8px; font-weight: 500; }
.admin-nav-link:hover { background: rgba(255,255,255,0.08); }
.admin-nav-link.active { background: rgba(255,255,255,0.16); color: #fff; }
.admin-sidebar-foot { margin-top: auto; }
.admin-sidebar-foot .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.3); }
.admin-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.admin-content { max-width: 1180px; width: 100%; margin: 0 auto; padding: 2rem 1.5rem; }
@media (max-width: 760px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-foot { margin-top: 0; }
}

.module-grid { display: grid; gap: 0.5rem; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) { .module-grid { grid-template-columns: 1fr; } }
.module-row { display: flex; align-items: center; gap: 0.5rem; }
.conn-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.conn-ok { background: var(--ok); }
.conn-down { background: var(--bad); }

.page-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.25rem; }

/* ── Admin sign-in gate (anonymous visit to /admin/*) ─────────────── */
.admin-login-wrap { min-height: calc(100vh - 70px); display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.admin-login-card { max-width: 460px; width: 100%; }

/* ── Assistant chat widget (customer app only) ───────────────────── */
.assistant-widget { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50; }
.assistant-fab { width: 56px; height: 56px; border-radius: 50%; background: var(--blue-700); color: #fff; border: none; font-size: 1.4rem; cursor: pointer; box-shadow: var(--shadow); }
.assistant-panel { position: absolute; right: 0; bottom: 68px; width: min(340px, 90vw); max-height: 60vh; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.assistant-head { background: var(--blue-900); color: #fff; padding: 0.75rem 1rem; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.assistant-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 1rem; }
.assistant-log { flex: 1; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.assistant-msg { padding: 0.5rem 0.75rem; border-radius: 10px; font-size: 0.88rem; max-width: 90%; }
.assistant-msg-user { background: var(--blue-100); align-self: flex-end; }
.assistant-msg-bot { background: var(--surface); align-self: flex-start; border: 1px solid var(--border); }
.assistant-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border); }
.assistant-form input { flex: 1; min-height: 40px; }
@media (max-width: 480px) { .assistant-panel { right: -0.5rem; } }
