/* ============================================================
   TWENDE — design system
   Dark fintech aesthetic · M-Pesa green + savanna amber
   ============================================================ */
:root {
  --bg:        #0A0E0D;
  --bg-2:      #0E1413;
  --surface:   #121A18;
  --surface-2: #18211E;
  --surface-3: #1F2A26;
  --border:    rgba(255,255,255,.07);
  --border-2:  rgba(255,255,255,.12);

  --primary:   #00D26A;
  --primary-2: #00A855;
  --amber:     #FFB627;
  --orange:    #FF6B35;
  --sky:       #3DA9FC;
  --violet:    #C77DFF;

  --text:      #F1F5F3;
  --text-2:    #9AA8A1;
  --text-3:    #5E6B65;

  --ok:        #00D26A;
  --warn:      #FFB627;
  --danger:    #FF5470;

  --radius:    20px;
  --radius-sm: 13px;
  --radius-lg: 28px;

  --shadow:    0 18px 50px -18px rgba(0,0,0,.7);
  --glow:      0 0 0 1px rgba(0,210,106,.25), 0 8px 40px -8px rgba(0,210,106,.35);

  --font-display: "Bricolage Grotesque", serif;
  --font-body:    "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", monospace;

  --maxw: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  /* atmospheric background: layered radial glows + faint grain */
  background-image:
    radial-gradient(900px 600px at 12% -5%, rgba(0,210,106,.10), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(255,182,39,.07), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(61,169,252,.06), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.02; }
h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }

/* ---- layout shell ---- */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.content { flex: 1; min-width: 0; padding: 30px clamp(18px, 4vw, 48px) 80px; max-width: var(--maxw); margin: 0 auto; width: 100%; }
.page-head { margin-bottom: 26px; }
.page-head .eyebrow { color: var(--primary); font-weight: 700; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.page-head p { color: var(--text-2); margin: 8px 0 0; max-width: 60ch; }

/* ---- sidebar ---- */
.sidebar {
  width: 256px; flex-shrink: 0; background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--border); padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 22px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #042; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem;
  box-shadow: 0 6px 20px -6px rgba(0,210,106,.6);
}
.brand .name { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; }
.brand .name span { color: var(--primary); }
.nav-group-label { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); padding: 16px 12px 6px; font-weight: 700; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px;
  color: var(--text-2); font-weight: 600; font-size: .92rem; transition: .16s; cursor: pointer; border: 1px solid transparent;
}
.nav-link .ico { width: 20px; text-align: center; font-size: 1.05rem; }
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.nav-link.active .ico { filter: drop-shadow(0 0 8px rgba(0,210,106,.7)); }
.sidebar .spacer { flex: 1; }
.role-badge {
  margin: 10px; padding: 13px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); display: flex; align-items: center; gap: 11px;
}
.role-badge .av { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg,var(--amber),var(--orange)); display: grid; place-items: center; font-weight: 800; color: #2a1500; }

/* ---- cards ---- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); position: relative;
}
.card.glow { box-shadow: var(--glow); border-color: rgba(0,210,106,.25); }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px){ .cols-2,.cols-3,.cols-4 { grid-template-columns: 1fr; } }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-body); font-weight: 700; font-size: .95rem; cursor: pointer;
  padding: 13px 22px; border-radius: 13px; border: 1px solid var(--border-2);
  background: var(--surface-3); color: var(--text); transition: .16s; width: 100%;
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-2); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #042; border: none; box-shadow: 0 10px 26px -10px rgba(0,210,106,.7); }
.btn.primary:hover { box-shadow: 0 14px 32px -10px rgba(0,210,106,.85); }
.btn.amber { background: linear-gradient(135deg, var(--amber), var(--orange)); color: #2a1500; border: none; }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(255,84,112,.12); color: var(--danger); border-color: rgba(255,84,112,.3); }
.btn.sm { padding: 8px 14px; font-size: .85rem; width: auto; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.auto { width: auto; }

/* ---- chips / pills / tags ---- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); font-size: .8rem; font-weight: 600; color: var(--text-2); }
.tag { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 7px; }
.tag.ok    { background: rgba(0,210,106,.14); color: var(--ok); }
.tag.warn  { background: rgba(255,182,39,.16); color: var(--amber); }
.tag.surge { background: rgba(255,107,53,.16); color: var(--orange); }

/* ---- forms ---- */
.field { display: block; margin-bottom: 14px; }
.field label { display: block; font-size: .78rem; font-weight: 700; color: var(--text-2); margin-bottom: 7px; letter-spacing: .03em; }
.input, select.input {
  width: 100%; padding: 13px 15px; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--border-2); color: var(--text); font-family: var(--font-body); font-size: .95rem; transition: .15s;
}
.input:focus, select.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,210,106,.15); }

/* ---- stat cards ---- */
.stat { padding: 20px; border-radius: var(--radius); background: linear-gradient(180deg,var(--surface),var(--surface-2)); border: 1px solid var(--border); }
.stat .k { font-size: .78rem; color: var(--text-2); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.stat .v { font-family: var(--font-display); font-size: 2rem; font-weight: 800; margin-top: 6px; letter-spacing: -.03em; }
.stat .v small { font-size: .9rem; color: var(--text-2); font-weight: 600; }
.stat .delta { font-size: .82rem; font-weight: 700; margin-top: 4px; }
.stat .delta.up { color: var(--ok); } .stat .delta.down { color: var(--danger); }

/* ---- list rows ---- */
.row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: none; }
.avatar { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; color: #042; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.avatar.amber { background: linear-gradient(135deg,var(--amber),var(--orange)); color: #2a1500; }
.avatar.sky { background: linear-gradient(135deg,var(--sky),#1e6fd0); color: #fff; }
.avatar.violet { background: linear-gradient(135deg,var(--violet),#8a4fd0); color: #fff; }

.stars { color: var(--amber); font-size: .9rem; letter-spacing: 1px; }

/* ---- divider, misc ---- */
hr.sep { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.kvs { display:flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.kvs:last-child { border-bottom: none; }
.kvs b { font-weight: 700; }
.flex { display:flex; } .between { justify-content: space-between; } .center { align-items:center; }
.gap-8{gap:8px} .gap-12{gap:12px} .gap-16{gap:16px} .wrap{flex-wrap:wrap}
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mb-0{margin-bottom:0}
.right{margin-left:auto}.tcenter{text-align:center}

/* ---- animations ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px);} to {opacity:1;transform:none;} }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0%{transform:scale(1);opacity:.7} 100%{transform:scale(2.6);opacity:0} }
.fade { animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) both; }
.fade-1{animation-delay:.05s}.fade-2{animation-delay:.12s}.fade-3{animation-delay:.2s}.fade-4{animation-delay:.28s}
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.2); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }

/* ---- error ui ---- */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--danger); color: #fff; padding: 12px 18px; z-index: 1000; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* mobile: collapse sidebar to top bar */
@media (max-width: 760px){
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 50; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; overflow-x: auto; }
  .sidebar .spacer, .nav-group-label { display: none; }
  .brand { padding: 4px 8px; }
  .nav-link { padding: 8px 11px; }
  .nav-link span.label { display: none; }
  .role-badge { margin: 0 0 0 auto; }
}

/* ============================================================
   Ride-share specific components
   ============================================================ */

/* segmented control (seats, pay method, role filters) */
.seg { display: flex; gap: 8px; }
.seg .opt { flex: 1; text-align: center; padding: 11px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--border-2); color: var(--text-2); cursor: pointer; font-weight: 600; font-size: .88rem; transition: .14s; }
.seg .opt:hover { color: var(--text); }
.seg .opt.on { border-color: var(--primary); color: var(--text); background: rgba(0,210,106,.08); }

/* circular match score */
.score { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; position: relative; }
.score::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface-2); }
.score .num { position: relative; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; line-height: 1; }
.score .pct { position: relative; font-size: .6rem; color: var(--text-2); font-weight: 700; }

/* seat availability dots */
.seats { display: inline-flex; gap: 4px; align-items: center; }
.seats .seat { width: 11px; height: 11px; border-radius: 3px; background: var(--surface-3); border: 1px solid var(--border-2); }
.seats .seat.taken { background: var(--text-3); border-color: var(--text-3); }
.seats .seat.free { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 8px rgba(0,210,106,.5); }

/* match card */
.match { display: flex; gap: 16px; align-items: center; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(180deg,var(--surface),var(--surface-2)); cursor: pointer; transition: .16s; margin-bottom: 12px; }
.match:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow); }

/* route stepper (vertical list of stops) */
.stepper { position: relative; padding-left: 26px; }
.stepper::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: repeating-linear-gradient(var(--border-2) 0 5px, transparent 5px 10px); }
.stepper .stop { position: relative; padding: 7px 0; }
.stepper .stop::before { content: ""; position: absolute; left: -22px; top: 12px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text-3); }
.stepper .stop.end::before { border-color: var(--amber); background: var(--amber); }
.stepper .stop.start::before { border-color: var(--primary); background: var(--primary); }
.stepper .stop.via::before { width: 8px; height: 8px; left: -20.5px; top: 13px; }

/* impact tiles */
.impact { display: flex; align-items: baseline; gap: 8px; }
.impact .big { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; letter-spacing: -.04em; }

/* pref pill list */
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { font-size: .78rem; font-weight: 600; padding: 5px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-2); }

/* shared label used on Find / Offer pages */
.womenonly { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: .9rem; color: var(--text-2); cursor: pointer; margin-top: 14px; }
.womenonly input { width: 18px; height: 18px; accent-color: var(--primary); }
.prefchk { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.prefchk input { accent-color: var(--primary); }
.plate { font-family: var(--font-mono); font-weight: 700; background: #1a2420; border: 1px solid var(--border-2); padding: 3px 9px; border-radius: 6px; letter-spacing: .04em; }
