/* ============================================================
   Hango Pro — Design system
   Premium SaaS × nightlife × Swiss tech.
   Foundations: Deep Navy + white. Primary: Hango Mint. Accent: Pro Yellow.
   Mobile-first throughout.
   ============================================================ */

:root {
  --mint: #57CFAD;
  --mint-dark: #3DB794;
  --mint-soft: rgba(87, 207, 173, 0.12);
  --navy: #10212E;
  --navy-800: #16293A;
  --navy-700: #1D3447;
  --navy-600: #27455C;
  --teal: #439589;
  --gold: #CCAF23;
  --yellow: #FEE026;
  --ink: #14232E;
  --ink-soft: #4A5B66;
  --ink-faint: #74848F;
  --line: #E3EAED;
  --bg: #F6F9FA;
  --card: #FFFFFF;
  --danger: #C64633;
  --danger-soft: #FDECEA;
  --ok: #1D8A66;
  --ok-soft: #E3F6EE;
  --warn: #A97B12;
  --warn-soft: #FFF6D6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 8px rgba(16, 33, 46, 0.06), 0 12px 32px rgba(16, 33, 46, 0.07);
  --shadow-sm: 0 1px 3px rgba(16, 33, 46, 0.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--mint-dark); }
button { font-family: inherit; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--navy); font-weight: 800; letter-spacing: -0.015em; }
:focus-visible { outline: 3px solid rgba(87, 207, 173, 0.55); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--mint); color: var(--navy); font-weight: 700; font-size: 15.5px;
  border: none; border-radius: 12px; padding: 13px 22px; cursor: pointer;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  min-height: 48px;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(87,207,173,.35); color: var(--navy); }
.btn:active { transform: translateY(0); }
.btn.btn-lg { padding: 16px 30px; font-size: 17px; border-radius: 14px; }
.btn.btn-sm { padding: 8px 14px; font-size: 13.5px; min-height: 36px; border-radius: 9px; }
.btn.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--line); box-shadow: none; }
.btn.btn-outline:hover { border-color: var(--mint); color: var(--mint-dark); box-shadow: none; }
.btn.btn-ghost { background: transparent; color: var(--ink-soft); box-shadow: none; }
.btn.btn-ghost:hover { color: var(--navy); background: var(--mint-soft); box-shadow: none; }
.btn.btn-navy { background: var(--navy); color: #fff; }
.btn.btn-navy:hover { box-shadow: 0 6px 18px rgba(16,33,46,.3); color: #fff; }
.btn.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn.btn-white { background: #fff; color: var(--navy); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: 22px; }
.card-lg { padding: 30px; box-shadow: var(--shadow); }
.card h3 { font-size: 17px; margin-bottom: 12px; }
.card + .card { margin-top: 16px; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  border-radius: 99px; padding: 4px 11px; white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: #EEF3F5; color: var(--ink-soft); }
.badge-navy { background: var(--navy); color: #fff; }
.badge-mint { background: var(--mint-soft); color: var(--mint-dark); }
.badge-gold { background: #FBF3D2; color: var(--gold); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-danger { background: var(--danger); } .dot-neutral { background: #B9C6CD; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--navy); margin: 14px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"],
input[type="date"], input[type="number"], input[type="search"], input[type="datetime-local"], select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-size: 16px; font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s; min-height: 48px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px rgba(87,207,173,.18); }
.field-error { color: var(--danger); font-size: 13px; margin-top: 5px; }
.hint { color: var(--ink-faint); font-size: 13px; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row-3 { grid-template-columns: 1fr 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; font-size: 14.5px; }
.check input { width: 20px; height: 20px; min-height: 20px; margin-top: 2px; accent-color: var(--mint-dark); flex: none; }
.check label, .check span { margin: 0; font-weight: 500; color: var(--ink-soft); }

/* ---------- Alerts / flash ---------- */
.flash { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14.5px; font-weight: 500; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.note { background: var(--warn-soft); border-left: 3px solid var(--yellow); padding: 12px 14px; border-radius: 8px; font-size: 14px; color: #6B5D1B; }
.note-info { background: var(--mint-soft); border-left-color: var(--mint); color: var(--navy-700); }

/* ---------- Tables → cards on mobile ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; font-size: 14.5px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #FBFDFD; }
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #FAFCFC; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  table.data.cards { border-radius: 0; background: transparent; }
  table.data.cards thead { display: none; }
  table.data.cards tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 6px 2px; box-shadow: var(--shadow-sm); }
  table.data.cards td { display: flex; justify-content: space-between; gap: 12px; border: none; padding: 8px 14px; text-align: right; }
  table.data.cards td::before { content: attr(data-label); font-weight: 600; color: var(--ink-faint); font-size: 12.5px; text-align: left; }
  table.data.cards td.num { text-align: right; }
}

/* ============================================================
   PUBLIC SITE
   ============================================================ */
.site-header { position: sticky; top: 0; z-index: 60; background: rgba(16,33,46,.92); backdrop-filter: blur(12px); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 12px; }
.site-logo img { height: 40px; display: block; }
.site-nav { display: none; gap: 26px; align-items: center; }
.site-nav a { color: #C9D8DC; font-weight: 600; font-size: 14.5px; }
.site-nav a:hover, .site-nav a.active { color: var(--mint); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { color: #8FA5AE; font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.lang-switch a { color: #8FA5AE; padding: 3px 5px; } .lang-switch a.active, .lang-switch a:hover { color: var(--mint); }
.burger { background: none; border: none; color: #fff; display: inline-flex; padding: 10px; cursor: pointer; }
.burger svg { width: 26px; height: 26px; }
@media (min-width: 960px) { .site-nav { display: flex; } .burger { display: none; } }
.mobile-menu { display: none; background: var(--navy-800); padding: 12px 20px 24px; }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 13px 6px; color: #DAE6E9; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.06); }
.mobile-menu a:hover { color: var(--mint); }

.announce-bar { background: linear-gradient(90deg, var(--yellow), #FFD34D); color: var(--navy); font-weight: 600; font-size: 14px; padding: 9px 16px; text-align: center; }
.announce-bar a { color: var(--navy); text-decoration: underline; }

/* Hero */
.hero { background: radial-gradient(1200px 640px at 75% -10%, #1E3B50 0%, var(--navy) 55%); color: #fff; padding: 72px 0 84px; overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; inset: auto -10% -55% -10%; height: 60%; background: radial-gradient(closest-side, rgba(87,207,173,.16), transparent 70%); pointer-events: none; }
.hero h1 { color: #fff; font-size: clamp(34px, 6vw, 58px); max-width: 760px; margin-bottom: 18px; }
.hero h1 .accent { color: var(--mint); }
.hero p.lead { color: #B7C8CE; font-size: clamp(16px, 2.4vw, 19px); max-width: 620px; margin-bottom: 32px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; position: relative; z-index: 2; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(87,207,173,.14); border: 1px solid rgba(87,207,173,.4); color: var(--mint); font-size: 13px; font-weight: 700; border-radius: 99px; padding: 6px 14px; margin-bottom: 22px; }

/* Sections */
.section { padding: 68px 0; }
.section-dark { background: var(--navy); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-tint { background: #EFF6F4; }
.section h2 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 12px; }
.section .section-sub { color: var(--ink-soft); font-size: 17px; max-width: 640px; margin-bottom: 36px; }
.section-dark .section-sub { color: #A9BCC3; }
.center { text-align: center; }
.center .section-sub { margin-left: auto; margin-right: auto; }

/* Network visualization */
.network-viz { position: relative; margin: 40px auto 0; max-width: 860px; }
.network-grid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: center; }
@media (min-width: 820px) { .network-grid { grid-template-columns: 1fr auto 1fr; gap: 26px; } }
.network-hub { text-align: center; background: linear-gradient(160deg, var(--navy-700), var(--navy-800)); border: 1px solid rgba(87,207,173,.35); border-radius: 20px; padding: 28px 22px; box-shadow: 0 0 60px rgba(87,207,173,.15); }
.network-hub img { height: 54px; margin-bottom: 8px; }
.network-hub .hub-label { color: var(--mint); font-weight: 800; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; }
.network-col { display: flex; flex-direction: column; gap: 12px; }
.network-node { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 14px 16px; color: #DDE8EA; font-weight: 600; font-size: 14.5px; }
.network-node .dot { flex: none; }
.network-node small { display: block; color: #8FA5AE; font-weight: 500; font-size: 12px; }

/* Pricing */
.plans-grid { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 34px; }
@media (min-width: 700px) { .plans-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .plans-grid { grid-template-columns: repeat(4, 1fr); } }
.plan-card { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 26px 22px; display: flex; flex-direction: column; position: relative; transition: transform .18s ease, box-shadow .18s ease; }
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.plan-card.popular { border-color: var(--mint); box-shadow: 0 8px 30px rgba(87,207,173,.18); }
.plan-card.premium { background: linear-gradient(165deg, var(--navy) 0%, var(--navy-700) 100%); border-color: var(--gold); color: #E5EDEF; }
.plan-card.premium h3, .plan-card.premium .plan-price { color: #fff; }
.plan-flag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--mint); color: var(--navy); font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; border-radius: 99px; padding: 4px 14px; }
.plan-flag.gold-flag { background: var(--yellow); }
.plan-card h3 { font-size: 21px; }
.plan-sub { font-size: 13.5px; color: var(--ink-faint); margin: 4px 0 14px; min-height: 20px; }
.plan-card.premium .plan-sub { color: #9DB4BC; }
.plan-price { font-size: 34px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.plan-price small { font-size: 14px; font-weight: 600; color: var(--ink-faint); }
.plan-vat { font-size: 12px; color: var(--ink-faint); margin-bottom: 16px; }
.plan-card.premium .plan-vat { color: #9DB4BC; }
.plan-features { list-style: none; margin: 14px 0 22px; flex: 1; }
.plan-features li { padding: 6.5px 0 6.5px 26px; position: relative; font-size: 14px; color: var(--ink-soft); }
.plan-card.premium .plan-features li { color: #C3D2D8; }
.plan-features li::before { content: "✓"; position: absolute; left: 2px; color: var(--mint-dark); font-weight: 800; }
.plan-features li.hl { font-weight: 700; color: var(--navy); }
.plan-card.premium .plan-features li.hl { color: var(--yellow); }
.plan-features li.hl::before { color: var(--gold); }
.billing-toggle { display: inline-flex; background: #E9F0F2; border-radius: 99px; padding: 4px; gap: 2px; }
.billing-toggle button { border: none; background: transparent; padding: 9px 20px; border-radius: 99px; font-weight: 700; font-size: 14px; color: var(--ink-soft); cursor: pointer; min-height: 40px; }
.billing-toggle button.active { background: var(--navy); color: #fff; }
.toggle-note { font-size: 13px; color: var(--mint-dark); font-weight: 700; margin-left: 10px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 34px; }
@media (min-width: 900px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 24px 18px; text-align: center; }
.stat-value { font-size: clamp(28px, 4vw, 40px); font-weight: 800; color: var(--mint); letter-spacing: -0.02em; }
.stat-label { color: #A9BCC3; font-size: 13.5px; margin-top: 4px; }

/* Partner logos */
.logo-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 30px; }
@media (min-width: 720px) { .logo-row { grid-template-columns: repeat(4, 1fr); } }
.logo-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; min-height: 86px; display: flex; align-items: center; justify-content: center; padding: 16px; filter: grayscale(.2); transition: filter .2s, transform .2s; }
.logo-card:hover { filter: none; transform: translateY(-2px); }
.logo-card img { max-height: 46px; max-width: 100%; object-fit: contain; }
.logo-card .logo-name { font-weight: 700; color: var(--ink-faint); font-size: 14px; text-align: center; }

/* FAQ */
.faq-list { max-width: 760px; margin: 30px auto 0; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.faq-item summary { padding: 17px 20px; font-weight: 700; color: var(--navy); cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 14px; align-items: center; font-size: 15.5px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 22px; color: var(--mint-dark); font-weight: 400; transition: transform .2s; flex: none; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 20px 18px; color: var(--ink-soft); font-size: 14.5px; }

/* Footer */
.site-footer { background: var(--navy); color: #8FA5AE; padding: 54px 0 34px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 30px; margin-bottom: 34px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer img.f-logo { height: 44px; margin-bottom: 14px; }
.site-footer h4 { color: #fff; font-size: 13.5px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 14px; }
.site-footer a { color: #8FA5AE; display: block; padding: 4px 0; }
.site-footer a:hover { color: var(--mint); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: 13px; }

/* Cookie consent */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: var(--navy-800); color: #D5E1E5; padding: 18px 20px; box-shadow: 0 -8px 30px rgba(0,0,0,.3); display: none; }
.cookie-banner.visible { display: block; }
.cookie-inner { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 800px) { .cookie-inner { flex-direction: row; align-items: center; justify-content: space-between; } }
.cookie-inner p { font-size: 13.5px; max-width: 640px; }
.cookie-inner a { color: var(--mint); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   AUTH
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--navy); }
@media (min-width: 980px) { .auth-wrap { grid-template-columns: 1.1fr 1fr; } }
.auth-side { display: none; position: relative; background: radial-gradient(900px 500px at 20% 10%, #1E3B50, var(--navy)); color: #fff; padding: 60px; flex-direction: column; justify-content: space-between; }
@media (min-width: 980px) { .auth-side { display: flex; } }
.auth-side img.a-logo { height: 46px; align-self: flex-start; }
.auth-side h2 { color: #fff; font-size: 34px; max-width: 420px; }
.auth-side .a-points { color: #A9BCC3; font-size: 15px; display: grid; gap: 12px; }
.auth-side .a-points span { display: flex; gap: 10px; align-items: center; }
.auth-panel { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 34px 20px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card { padding: 30px 26px; }
.auth-logo-mobile { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-logo-mobile img { height: 44px; }
@media (min-width: 980px) { .auth-logo-mobile { display: none; } }
.auth-title { font-size: 24px; margin-bottom: 6px; }
.auth-sub { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 18px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-faint); font-size: 12.5px; margin: 18px 0; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============================================================
   PORTAL (customer)
   ============================================================ */
.portal-shell { min-height: 100vh; display: flex; flex-direction: column; }
.portal-topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.portal-topbar .inner { max-width: 1160px; margin: 0 auto; padding: 0 18px; height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-topbar img.p-logo { height: 34px; display: block; }
.portal-top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: #C9D8DC; background: transparent; border: none; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.icon-btn svg { width: 22px; height: 22px; }
.notif-dot { position: absolute; top: 8px; right: 8px; min-width: 17px; height: 17px; background: var(--yellow); color: var(--navy); border-radius: 99px; font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.portal-main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 22px 18px 96px; }
@media (min-width: 960px) {
  .portal-body { display: grid; grid-template-columns: 232px 1fr; gap: 28px; max-width: 1160px; margin: 0 auto; width: 100%; padding: 0 18px; flex: 1; }
  .portal-main { padding: 26px 0 60px; margin: 0; max-width: none; }
}
.portal-sidenav { display: none; }
@media (min-width: 960px) {
  .portal-sidenav { display: block; padding: 26px 0; }
  .portal-sidenav a { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 11px; color: var(--ink-soft); font-weight: 600; font-size: 14.5px; margin-bottom: 2px; }
  .portal-sidenav a svg { width: 20px; height: 20px; opacity: .75; }
  .portal-sidenav a:hover { background: #fff; color: var(--navy); }
  .portal-sidenav a.active { background: var(--navy); color: #fff; }
  .portal-sidenav a.active svg { opacity: 1; }
  .portal-sidenav .side-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 18px 14px 8px; }
}
/* Mobile bottom nav — thumb-friendly */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 55; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 20px rgba(16,33,46,.07); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 7px; font-size: 10.5px; font-weight: 700; color: var(--ink-faint); min-height: 56px; }
.bottom-nav a svg { width: 23px; height: 23px; }
.bottom-nav a.active { color: var(--mint-dark); }
@media (min-width: 960px) { .bottom-nav { display: none; } }

.page-title { font-size: clamp(22px, 4vw, 30px); margin-bottom: 4px; }
.page-sub { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 880px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 680px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1020px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--ink-faint); font-weight: 500; }
.kv .v { font-weight: 700; color: var(--navy); text-align: right; }

/* Distribution channel chips */
.channel-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .channel-grid { grid-template-columns: 1fr 1fr; } }
.channel-chip { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; background: #fff; }
.channel-chip .ch-name { font-weight: 700; font-size: 14.5px; color: var(--navy); flex: 1; }
.channel-chip .ch-name small { display: block; font-weight: 500; color: var(--ink-faint); font-size: 12px; }

/* Checklist */
.checklist { list-style: none; }
.checklist li { display: flex; gap: 11px; align-items: center; padding: 8px 0; font-size: 14.5px; color: var(--ink-soft); }
.checklist .ck { width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.checklist .ck.done { background: var(--ok-soft); color: var(--ok); }
.checklist .ck.todo { background: #EEF3F5; color: var(--ink-faint); }
.checklist li.done-item { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.2); }

/* Signature pad */
.sig-pad { border: 2px dashed var(--line); border-radius: var(--radius-sm); background: #fff; touch-action: none; width: 100%; height: 180px; display: block; }
.sig-pad.signed { border-color: var(--mint); }

/* Contract body rendering */
.doc-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; max-height: 480px; overflow-y: auto; font-size: 14.5px; color: var(--ink); }
.doc-body h1 { font-size: 20px; margin: 18px 0 10px; } .doc-body h1:first-child { margin-top: 0; }
.doc-body h2 { font-size: 16.5px; margin: 18px 0 8px; }
.doc-body p { margin-bottom: 10px; }
.doc-body ul { margin: 0 0 12px 20px; }
.doc-body li { margin-bottom: 4px; }

/* Assistant */
.chat-box { display: flex; flex-direction: column; gap: 12px; min-height: 300px; }
.chat-msg { max-width: 85%; padding: 12px 15px; border-radius: 15px; font-size: 14.5px; line-height: 1.5; }
.chat-user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.chat-bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-bot .src { display: block; margin-top: 8px; font-size: 12px; color: var(--ink-faint); }
.chat-input { display: flex; gap: 10px; margin-top: 14px; position: sticky; bottom: 84px; }
.chat-input input { flex: 1; }

/* Impersonation banner */
.impersonation-banner { background: var(--yellow); color: var(--navy); font-weight: 700; font-size: 14px; padding: 10px 16px; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.impersonation-banner form { display: inline; }
.impersonation-banner button { background: var(--navy); color: #fff; border: none; border-radius: 8px; padding: 6px 14px; font-weight: 700; cursor: pointer; }

/* Sticky mobile CTA */
.sticky-cta { position: sticky; bottom: 76px; z-index: 30; display: flex; justify-content: center; padding: 0 10px; }
@media (min-width: 960px) { .sticky-cta { display: none; } }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-shell { min-height: 100vh; }
.admin-topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.admin-topbar .inner { padding: 0 18px; height: 58px; display: flex; align-items: center; gap: 16px; }
.admin-topbar img { height: 30px; }
.admin-topbar .a-title { font-weight: 800; font-size: 14px; letter-spacing: .04em; color: var(--mint); text-transform: uppercase; }
.admin-topbar .spacer { flex: 1; }
.admin-layout { display: flex; min-height: calc(100vh - 58px); }
.admin-nav { display: none; }
@media (min-width: 1020px) {
  .admin-nav { display: block; width: 224px; flex: none; background: var(--navy-800); padding: 18px 10px 40px; color: #fff; }
  .admin-nav a { display: block; padding: 9px 13px; border-radius: 9px; color: #AEC2C9; font-weight: 600; font-size: 13.5px; margin-bottom: 1px; }
  .admin-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
  .admin-nav a.active { background: var(--mint); color: var(--navy); }
  .admin-nav .nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #5C7280; margin: 16px 13px 6px; }
}
.admin-nav-mobile { display: block; background: var(--navy-800); padding: 10px 16px; position: sticky; top: 58px; z-index: 45; }
.admin-nav-mobile select { background: var(--navy-700); border-color: var(--navy-600); color: #fff; min-height: 42px; }
@media (min-width: 1020px) { .admin-nav-mobile { display: none; } }
.admin-content { flex: 1; padding: 24px 18px 70px; max-width: 1280px; width: 100%; margin: 0 auto; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
@media (min-width: 800px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.kpi .kpi-value { font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.kpi .kpi-label { font-size: 12px; color: var(--ink-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi.kpi-danger .kpi-value { color: var(--danger); }
.kpi.kpi-mint .kpi-value { color: var(--mint-dark); }

.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 10px; }
.chart-bars .bar { flex: 1; background: linear-gradient(180deg, var(--mint), var(--teal)); border-radius: 4px 4px 0 0; min-height: 3px; position: relative; }
.chart-bars .bar span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: var(--ink-faint); white-space: nowrap; }
.chart-bars .bar:hover::after { content: attr(data-v); position: absolute; top: -26px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar form { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.toolbar input[type="search"], .toolbar input[type="text"] { min-height: 42px; }
.toolbar .btn { min-height: 42px; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chips a { background: #fff; border: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 99px; }
.filter-chips a.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 2px solid var(--line); margin-bottom: 20px; -webkit-overflow-scrolling: touch; }
.tabs a { padding: 11px 16px; font-weight: 700; font-size: 14px; color: var(--ink-faint); white-space: nowrap; border-bottom: 2.5px solid transparent; margin-bottom: -2px; }
.tabs a.active, .tabs a:hover { color: var(--navy); border-bottom-color: var(--mint); }

.timeline { list-style: none; position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 7px 0; font-size: 13.5px; color: var(--ink-soft); }
.timeline li::before { content: ""; position: absolute; left: -19.5px; top: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); border: 2px solid #fff; }
.timeline .tl-meta { color: var(--ink-faint); font-size: 12px; }

details.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
details.panel summary { padding: 14px 18px; font-weight: 700; color: var(--navy); cursor: pointer; font-size: 14.5px; }
details.panel .panel-body { padding: 0 18px 18px; }

.health-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.health-row .h-name { font-weight: 700; color: var(--navy); flex: 1; font-size: 14.5px; }
.health-row .h-detail { color: var(--ink-faint); font-size: 13px; }

.pill-state { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.pill-ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.pill-warn { background: var(--gold); box-shadow: 0 0 0 4px var(--warn-soft); }
.pill-error { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }

/* print */
@media print {
  .site-header, .site-footer, .bottom-nav, .portal-topbar, .portal-sidenav, .admin-nav, .admin-topbar, .cookie-banner, .sticky-cta { display: none !important; }
  body { background: #fff; }
}
