/* ===================================================================
   Speed Courier — Parcel Claim + Staff UI (dark-default, themed)
   =================================================================== */
:root {
  color-scheme: dark;
  --brand: #fc2e00;
  --brand-2: #ff7a3a;
  --brand-grad: linear-gradient(100deg, #fc2e00, #ff7a2a);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --radius: 14px;
  --dark: #0b0d12;               /* app chrome (top bars) — dark in both themes */

  /* ---- DARK (default) ---- */
  --bg: #08090d;
  --bg-2: #0e1017;
  --surface: #14161e;
  --surface-2: #1a1d27;
  --card: #12141b;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #f1f3f9;
  --muted: #8a93a6;
  --field-bg: rgba(255, 255, 255, 0.05);
  --logo-filter: none;
  --shadow: 0 30px 60px -34px rgba(0, 0, 0, 0.65);
}
html.light {
  color-scheme: light;
  --bg: #eef1f7;
  --bg-2: #e4e8f1;
  --surface: #ffffff;
  --surface-2: #eaeef5;
  --card: #ffffff;
  --line: #dde2ec;
  --line-2: #c5cdda;
  --ink: #0e1118;
  --muted: #5c6675;
  --field-bg: #ffffff;
  --logo-filter: brightness(0);
  --shadow: 0 18px 42px -24px rgba(16, 20, 45, 0.20);
}
/* light-theme depth for claim + admin cards */
html.light .claim-card,
html.light .login-card,
html.light .stat-card,
html.light .inq-card,
html.light .msg-card,
html.light .cd-card,
html.light .table-wrap,
html.light .inq-empty { box-shadow: 0 6px 20px -12px rgba(16, 20, 45, 0.16); }
html.light .btn-ghost { border-color: var(--line-2); }
html.light .status.st-submitted { background: rgba(90,105,130,.14); color: #475063; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: clip; }
body { font-family: "Inter", system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; overflow-x: clip; -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
@media (max-width: 600px) { .claim-nav { padding-left: 16px; padding-right: 16px; } .claim-back .cb-tx { display: none; } }
h1, h2, h3 { font-family: "Sora", sans-serif; letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); }
a { color: inherit; text-decoration: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.muted { color: var(--muted); }

/* theme toggle (sits on the dark top bars) */
.theme-toggle { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; font-size: 1rem; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.theme-toggle:hover { border-color: var(--brand); background: rgba(255,255,255,.12); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 24px; border-radius: 11px; font-weight: 600; font-size: .95rem; cursor: pointer; border: 1px solid transparent; transition: transform .2s var(--ease), box-shadow .2s, background .2s, border-color .2s; }
.btn-brand { background: var(--brand-grad); color: #fff; box-shadow: 0 14px 32px -14px rgba(252,46,0,.7); }
.btn-brand:hover { transform: translateY(-2px); box-shadow: 0 20px 42px -14px rgba(252,46,0,.85); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-sm { display: inline-block; padding: 7px 14px; border-radius: 8px; font-size: .82rem; font-weight: 600; color: var(--brand); border: 1px solid var(--line); background: var(--surface); transition: .2s; }
.btn-sm:hover { border-color: var(--brand); }

/* ===== Language toggle — English (default) ⇄ Chichewa ===== */
.l-ny { display: none; }
html.ny .l-en { display: none; }
html.ny .l-ny { display: inline; }

/* Floating language toggle — top-right, glassy pill with a sliding highlight */
.lang-fab { position: fixed; top: 74px; right: 18px; z-index: 60;
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 6px 5px 11px; border-radius: 999px;
  background: rgba(18,20,26,.66); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255,255,255,.16); box-shadow: 0 14px 36px -14px rgba(0,0,0,.6);
  animation: lfIn .5s var(--ease) both; }
@keyframes lfIn { from { opacity: 0; transform: translateY(-10px) scale(.94); } to { opacity: 1; transform: none; } }
.lf-globe { width: 15px; height: 15px; fill: none; stroke: rgba(255,255,255,.72); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.lf-track { position: relative; display: inline-flex; }
.lf-thumb { position: absolute; inset: 0 auto 0 0; width: 50%; border-radius: 999px; background: var(--brand-grad); box-shadow: 0 6px 16px -6px rgba(252,46,0,.85); transition: transform .4s var(--ease); }
html.ny .lf-thumb { transform: translateX(100%); }
.lang-fab .ls-opt { position: relative; z-index: 1; flex: 1; min-width: 44px; text-align: center; border: 0; background: transparent;
  color: rgba(255,255,255,.68); font-family: inherit; font-weight: 700; font-size: .8rem; letter-spacing: .01em; padding: 7px 14px; cursor: pointer; transition: color .3s; }
.lang-fab .ls-opt.on { color: #fff; }
.lang-fab .ls-opt:not(.on):hover { color: rgba(255,255,255,.95); }
html.light .lang-fab { background: rgba(255,255,255,.8); border-color: rgba(16,20,45,.1); box-shadow: 0 14px 32px -14px rgba(16,20,45,.28); }
html.light .lf-globe { stroke: var(--muted); }
html.light .lang-fab .ls-opt { color: var(--muted); }
html.light .lang-fab .ls-opt.on { color: #fff; }
@media (max-width: 600px) {
  .lang-fab { top: 64px; right: 12px; padding: 4px 5px 4px 9px; gap: 5px; }
  .lang-fab .ls-opt { padding: 6px 12px; font-size: .76rem; min-width: 40px; }
  .lf-globe { width: 14px; height: 14px; }
}

/* fields */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--field-bg); font-size: .95rem; font-family: inherit; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(252,46,0,.15); }
.field textarea { resize: vertical; }
.field .hint { display: block; margin-top: 6px; font-size: .78rem; color: var(--muted); }
.field select option { color: #14161c; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

/* alerts */
.alert { padding: 13px 16px; border-radius: 11px; font-size: .9rem; margin-bottom: 18px; }
.alert-error { background: rgba(224,19,36,.12); border: 1px solid rgba(224,19,36,.35); color: #ff8a7a; }
.alert-error ul { margin: 0; padding-left: 18px; }
.alert-success { background: rgba(18,133,75,.14); border: 1px solid rgba(18,133,75,.4); color: #4ade80; }
.alert-info { background: rgba(60,110,255,.12); border: 1px solid rgba(60,110,255,.35); color: #9db8ff; }

/* status badges */
.status { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.st-submitted { background: rgba(120,135,160,.18); color: #b8c2d4; }
.st-review    { background: rgba(161,92,0,.2); color: #f0b45c; }
.st-info      { background: rgba(109,59,214,.2); color: #b79bf2; }
.st-escalated { background: rgba(201,55,17,.2); color: #ff8a6a; }
.st-resolved  { background: rgba(18,133,75,.2); color: #4ade80; }
.st-rejected  { background: rgba(204,34,34,.2); color: #ff7a7a; }

/* ===== Client claim page ===== */
.claim-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px clamp(20px, 5vw, 48px); background: var(--dark); }
.claim-brand img { height: 30px; display: block; }
.claim-nav-right { display: flex; align-items: center; gap: 14px; }
.claim-back { color: rgba(255,255,255,.8); font-size: .9rem; }
.claim-back:hover { color: #fff; }
.claim-main { max-width: 820px; margin: 0 auto; padding: clamp(30px, 6vw, 60px) clamp(20px, 5vw, 40px) 60px; }
.claim-head { text-align: center; margin-bottom: 34px; }
.claim-kicker { display: inline-flex; align-items: center; gap: 9px; text-transform: uppercase; letter-spacing: .2em; font-size: .72rem; font-weight: 700; color: var(--brand); margin-bottom: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.claim-head h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 800; }
.claim-sub { color: var(--muted); max-width: 560px; margin: 12px auto 0; }
.claim-sub strong { color: var(--ink); }

.claim-tabs { display: flex; gap: 8px; background: var(--surface-2); padding: 6px; border-radius: 12px; width: fit-content; margin: 0 auto 24px; }
.tab-btn { border: 0; background: transparent; padding: 10px 22px; border-radius: 8px; font-weight: 600; font-size: .92rem; color: var(--muted); cursor: pointer; font-family: inherit; transition: .2s; }
.tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 4px 14px -6px rgba(0,0,0,.4); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .5s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.claim-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: clamp(24px, 4vw, 38px); box-shadow: var(--shadow); }

.claim-success { text-align: center; }
.success-ico { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; background: rgba(18,133,75,.16); color: #4ade80; font-size: 2rem; display: grid; place-items: center; }
.success-ico.reject { background: rgba(201,55,17,.18); color: #ff8a6a; }
.claim-success h2 { font-size: 1.6rem; margin-bottom: 8px; }
.ref-box { margin: 22px auto; max-width: 360px; padding: 18px; border: 1px dashed var(--brand); border-radius: 12px; background: rgba(252,46,0,.08); }
.ref-box span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); margin-bottom: 6px; }
.ref-box strong { font-family: ui-monospace, monospace; font-size: 1.4rem; color: var(--brand); }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.track-result { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 24px; }
.tr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tr-ref { font-family: ui-monospace, monospace; font-weight: 700; font-size: 1.1rem; margin-right: 10px; color: var(--ink); }
.tr-type { color: var(--muted); font-size: .9rem; }
.tr-meta { color: var(--muted); font-size: .85rem; margin: 6px 0 20px; }
.timeline-c { position: relative; padding-left: 26px; }
.timeline-c::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tc-item { position: relative; padding-bottom: 20px; }
.tc-dot { position: absolute; left: -26px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line-2); }
.tc-body strong { display: block; font-size: .98rem; }
.tc-date { font-size: .78rem; color: var(--muted); }
.tc-body p { margin-top: 6px; color: var(--ink); font-size: .92rem; }

.claim-foot { text-align: center; padding: 30px 20px 40px; color: var(--muted); font-size: .88rem; }
.claim-foot a { color: var(--brand); }
.claim-foot .muted a { color: var(--muted); text-decoration: underline; }

/* ===== Staff login ===== */
.login-body { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(1000px 600px at 70% 0%, rgba(252,46,0,.14), transparent 60%), var(--bg); padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 40px; box-shadow: var(--shadow); text-align: center; }
.login-logo { height: 40px; margin-bottom: 18px; filter: var(--logo-filter); }
.login-card h1 { font-size: 1.5rem; }
.login-sub { color: var(--muted); font-size: .9rem; margin: 6px 0 22px; }
.login-card form { text-align: left; }
.login-back { margin-top: 18px; font-size: .85rem; }
.login-back a { color: var(--muted); }
.demo-note { margin-top: 22px; padding: 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: .8rem; color: var(--muted); text-align: left; line-height: 1.7; }
.demo-note code { background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.login-top { position: fixed; top: 16px; right: 16px; z-index: 5; }
.login-top .theme-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.login-top .theme-toggle:hover { border-color: var(--brand); }

@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===== Animated theme switch (shared) ===== */
.theme-switch { position: relative; width: 54px; height: 30px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; padding: 0; flex-shrink: 0; }
.theme-switch:hover { border-color: var(--brand); }
.claim-nav .theme-switch, .admin-top .theme-switch { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); }
.ts-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-grad); display: grid; place-items: center; transition: transform .4s var(--ease); box-shadow: 0 3px 10px rgba(252,46,0,.5); }
html.light .ts-knob { transform: translateX(24px); }
.ts-knob svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.k-sun { display: none; } .k-moon { display: block; }
html.light .k-sun { display: block; } html.light .k-moon { display: none; }
