/* ==================================================================
   Farko Track — console theme
   Loaded after the compiled app.css, so it restates the design tokens
   and overrides the places where colour was doing a job that white
   should do. Hand-written: this project has no Node on the server or
   the workstation, so there is no Vite build to run.

   The rules of this world:
     1. The surface is ink with warmth in it — the colour of laterite
        dust in shade, never blue-grey and never a flat black.
     2. White is the action colour. Buttons, selection, focus.
     3. Colour means a vehicle state — moving, due, offline, alarm —
        and is never spent on decoration.
     4. The background is Tamale itself. The street network in
        public/img/tamale-*.svg is the real one, 11 km across, drawn
        from OpenStreetMap and centred on the Central roundabout. It
        is texture, not telemetry: it never shows where a vehicle is.
     5. Copper belongs to the city underneath. It appears in the field
        and on the brand mark and nowhere else — never on a control.

   Changing the background:
     set --field to one of the three files. board = streets read as
     traces on a circuit board. aerial = Tamale as it looks from above.
     survey = a cool survey plate. One line, no rebuild.
   ================================================================== */

:root{
  /* ---- the field ---- */
  --field:url('/img/tamale-board.svg');
  --field-strength:1;          /* 0 hides the map entirely */

  /* ---- surface: ink with warmth, no blue ---- */
  --bg:#0A0908;
  --panel:#141210;
  --panel-alt:#1A1714;
  --panel-raised:#221E1A;
  --border:#332E29;
  --border-soft:#241F1C;

  --text:#F5F2EE;
  --text-dim:#B6AFA7;
  --text-mute:#837B73;

  /* ---- status: the only colour that carries meaning ---- */
  --signal:#3FD37C;      /* moving / healthy */
  --signal-dim:#0E2E1C;
  --amber:#FFB224;       /* due / attention */
  --amber-dim:#352709;
  --red:#FF453A;         /* alarm */
  --red-dim:#38150F;
  --offline:#6F6862;

  /* ---- identity: the ground under the console ---- */
  --copper:#E0894B;
  --copper-deep:#A75F32;

  /* ---- action ---- */
  --accent:#FFFFFF;
  --accent-ink:#0A0908;

  --radius:12px;

  /* ---- type ---- */
  --face-ui:'Inter', system-ui, -apple-system, sans-serif;
  --face-display:'Archivo', 'Inter', system-ui, sans-serif;
  --face-mono:'IBM Plex Mono', ui-monospace, monospace;

  /* The compiled app.css declares --font-display itself and points it at
     Space Grotesk. Repointing it here, rather than chasing every selector
     that uses it, moves the rest of the product onto the same face as the
     headings this file sets directly. This block is unlayered, so it wins
     over the @layer the build puts its own :root in. */
  --font-display:'Archivo', 'Inter', system-ui, sans-serif;
}

/* ---------- the field ----------
   Four layers, bottom to top: ink, a pool of dark at the foot of the
   screen so long tables fade out instead of stopping, the city, and a
   thin wash of light at the top so the first screenful lifts. The map
   is fixed, so scrolling a table does not drag the city with it. */
.ft-app{
  background:
    linear-gradient(180deg, rgba(255,241,228,0.030), transparent 440px),
    radial-gradient(ellipse 100% 60% at 50% 122%, rgba(0,0,0,0.46), transparent 74%),
    var(--field) center center / cover no-repeat fixed,
    var(--bg);
  color:var(--text);
}
.ft-app ::selection{background:rgba(255,255,255,0.20); color:#fff;}
.ft-app ::-webkit-scrollbar-thumb{background:#36302B;}
.ft-app ::-webkit-scrollbar-thumb:hover{background:#443D37;}

/* ---------- type ----------
   Archivo carries headings and figures: a grotesque with drafting-table
   bones, set a touch wide so a number reads as an instrument reading
   rather than body copy. Inter stays for everything you actually read,
   Plex Mono for anything you would copy out — plate, IMEI, amount. */
.ft-app .topbar h1,
.ft-app .section-head h2,
.ft-app .kpi .value,
.ft-app .modal-head h3,
.ft-app .drawer-head h3,
.ft-app .login-head h2{
  font-family:var(--face-display);
  font-variation-settings:'wdth' 108;
}
.ft-app .topbar h1{font-size:21px; letter-spacing:-0.022em; font-weight:600;}
.ft-app .section-head h2{letter-spacing:-0.018em; font-size:17px; font-weight:600;}
.ft-app .kpi .value{letter-spacing:-0.020em; font-size:27px; font-weight:600;}
.ft-app .modal-head h3,
.ft-app .drawer-head h3{letter-spacing:-0.018em; font-weight:600;}
.ft-app td.mono, .ft-app .mono{font-family:var(--face-mono);}
.ft-app td.mono, .ft-app .mono,
.ft-app .kpi .value{font-variant-numeric:tabular-nums;}

/* ---------- sidebar ---------- */
.ft-app .sidebar{
  background:rgba(14,12,11,0.84);
  backdrop-filter:blur(14px);
  border-right:1px solid var(--border-soft);
}
.ft-app .brand{border-bottom-color:var(--border-soft);}
.ft-app .brand-text .tag{letter-spacing:0.14em; color:var(--copper); opacity:.85;}

/* ---------- the mark ----------
   The logo is the owner's own, supplied as artwork with a transparent
   background and cropped to the pin: img/farko-logo.png, 167x256.

   What was wrong before was never the logo. The app was serving a small,
   lossy copy of it (images/brand-icon.jpeg, 288px square) and the compiled
   app.css put it on a solid white tile - background-color:#fff on
   .brand-mark. That tile is what made it look stuck onto the screen. The
   tile goes, the artwork is served at a size it can actually fill, and the
   pin floats on the dark surface the way it was drawn to.

   The swap is done here, in CSS, instead of by editing the two Blade views
   that print the <img>. One file to change and one file to revert, and the
   app's own markup is left alone.

   The <img> is hidden rather than replaced. Nothing is lost to a screen
   reader: its alt text said "Farko Track", and the name is already printed
   beside it in .brand-text .name.

   img/farko-mark.svg is a flat copper alternative, kept but not used. */
.ft-app .brand-mark{
  background:none;
  border:0;
  border-radius:0;
  overflow:visible;
}
.ft-app .brand-mark img{display:none;}
.ft-app .brand-mark::after{
  content:"";
  width:100%; height:100%;
  background:url('/img/farko-logo.png') center center / contain no-repeat;
}

/* active nav is white on a lift, not a coloured highlight */
.ft-app .nav-item{border-radius:9px;}
.ft-app .nav-item:hover{background:rgba(255,255,255,0.05); color:var(--text);}
.ft-app .nav-item.active{
  background:rgba(255,255,255,0.075);
  color:var(--text);
  border-color:var(--border);
}
.ft-app .nav-item.active .ico{opacity:1;}
.ft-app .nav-item .count{
  background:rgba(255,255,255,0.06); border-color:transparent; color:var(--text-dim);
}
.ft-app .nav-item.alert .count{color:var(--amber); background:var(--amber-dim); border-color:transparent;}

.ft-app .sidebar-foot{border-top-color:var(--border-soft);}
.ft-app .role-pill{background:rgba(255,255,255,0.04); border-color:var(--border-soft);}
.ft-app .avatar{
  background:rgba(255,255,255,0.10);
  color:var(--text);
  border:1px solid var(--border);
}
.ft-app .drawer-close{
  background:rgba(255,255,255,0.045); border-color:var(--border-soft); border-radius:8px;
}
.ft-app .drawer-close:hover{background:rgba(255,255,255,0.09); color:var(--text);}

/* ---------- top bar ---------- */
.ft-app .topbar{
  background:rgba(10,9,8,0.74);
  backdrop-filter:blur(16px);
  border-bottom-color:var(--border-soft);
}
.ft-app .search{
  background:rgba(255,255,255,0.045);
  border-color:var(--border-soft);
  border-radius:9px;
}
.ft-app .search:focus-within{border-color:rgba(255,255,255,0.28);}
.ft-app .menu-toggle{background:rgba(255,255,255,0.05); border-color:var(--border-soft);}

/* ---------- surfaces ----------
   Panels sit just light enough to lift off the map and just transparent
   enough that the city still shows through at the edges. */
.ft-app .panel{
  background:rgba(20,18,16,0.80);
  border:1px solid var(--border-soft);
  border-radius:14px;
  box-shadow:0 1px 0 rgba(255,241,228,0.040) inset, 0 18px 40px -24px rgba(0,0,0,0.9);
}
.ft-app .panel-head{border-bottom-color:var(--border-soft); padding:15px 18px;}
.ft-app .panel-head .meta{letter-spacing:0.06em;}

.ft-app .kpi{
  background:rgba(20,18,16,0.80);
  border:1px solid var(--border-soft);
  border-radius:14px;
  box-shadow:0 1px 0 rgba(255,241,228,0.040) inset;
  transition:border-color .18s ease, background .18s ease;
  position:relative;
  overflow:hidden;
}
/* a copper hairline along the top edge: the one place the ground under
   the console shows up inside a panel */
.ft-app .kpi::before{
  content:"";
  position:absolute; inset:0 0 auto 0; height:1px;
  background:linear-gradient(90deg, transparent, rgba(224,137,75,0.38) 22%, rgba(224,137,75,0.10) 72%, transparent);
}
.ft-app .kpi:hover{border-color:var(--border); background:rgba(26,23,20,0.9);}
/* Labels wrap to two lines ("Renewals due — 30d") while others take one, so
   the values are bottom-aligned instead of floating at different heights.
   The figure never wraps: "GH₵ 250.00" broke across lines at 27px. */
.ft-app .kpi{display:flex; flex-direction:column; min-height:116px;}
.ft-app .kpi .label{letter-spacing:0.08em; font-size:10px; line-height:1.45;}
.ft-app .kpi .value{
  margin-top:auto; padding-top:10px;
  font-size:clamp(19px, 1.9vw, 26px);
  white-space:nowrap;
}
.ft-app .kpi .delta{margin-top:5px;}

.ft-app .theft-card,
.ft-app .role-card,
.ft-app .txn-type,
.ft-app .gateway{
  background:rgba(20,18,16,0.80);
  border:1px solid var(--border-soft);
  border-radius:14px;
}
.ft-app .note{background:rgba(255,255,255,0.035); border-color:var(--border-soft);}
.ft-app .dropzone{border-color:var(--border); background:rgba(255,255,255,0.02); border-radius:14px;}
.ft-app .dropzone .icn{background:rgba(255,255,255,0.06); color:var(--text);}

/* ---------- actions: white is the verb ---------- */
.ft-app .btn{
  border-radius:9px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.05);
  color:var(--text);
  transition:background .15s ease, border-color .15s ease, color .15s ease;
}
.ft-app .btn:hover{filter:none; background:rgba(255,255,255,0.1); border-color:#453E38;}
.ft-app .btn.ghost{background:transparent;}
.ft-app .btn.ghost:hover{background:rgba(255,255,255,0.06);}
.ft-app .btn.primary{
  background:var(--accent); color:var(--accent-ink); border-color:var(--accent);
  box-shadow:0 10px 26px -14px rgba(255,255,255,0.55);
}
.ft-app .btn.primary:hover{filter:none; background:#E9E5E0; border-color:#E9E5E0;}

.ft-app .chip{
  background:rgba(255,255,255,0.045); border-color:var(--border-soft); border-radius:8px;
  letter-spacing:0.02em;
}
.ft-app .chip.active{
  background:rgba(255,255,255,0.12); border-color:rgba(255,255,255,0.4); color:var(--text);
}
.ft-app .view-toggle{background:rgba(255,255,255,0.045); border-color:var(--border-soft);}
.ft-app .view-toggle button.active{background:rgba(255,255,255,0.13); color:var(--text);}

/* ---------- fields ---------- */
.ft-app .field label{letter-spacing:0.08em; font-size:11.5px; color:var(--text-mute);}
.ft-app .field select,
.ft-app .field textarea,
.ft-app .field input{
  background:rgba(255,255,255,0.04);
  border:1px solid var(--border-soft);
  border-radius:9px;
  caret-color:var(--accent);
  color:var(--text);
}
.ft-app .field select:focus,
.ft-app .field textarea:focus,
.ft-app .field input:focus{
  border-color:rgba(255,255,255,0.45);
  background:rgba(255,255,255,0.06);
}
.ft-app .field input.invalid{border-color:var(--red); background:var(--red-dim);}

/* old wizard (still used by the manage-client modal) */
.ft-app .wizard-dot.active b{background:var(--accent); border-color:var(--accent); color:var(--accent-ink);}
.ft-app .wizard-dot.done b{background:rgba(255,255,255,0.1); border-color:var(--border); color:var(--text-dim);}

/* ---------- status keeps its colour ---------- */
.ft-app .badge{border-radius:7px; font-size:10.5px; letter-spacing:0.03em;}
.ft-app .badge.green{background:var(--signal-dim); color:var(--signal); border-color:rgba(63,211,124,0.28);}
.ft-app .badge.amber{background:var(--amber-dim); color:var(--amber); border-color:rgba(255,178,36,0.28);}
.ft-app .badge.red{background:var(--red-dim); color:var(--red); border-color:rgba(255,69,58,0.28);}
.ft-app .badge.grey{background:rgba(255,255,255,0.06); color:var(--text-mute); border-color:transparent;}

/* ---------- tables ---------- */
.ft-app thead th{
  background:rgba(17,15,13,0.96); border-bottom-color:var(--border-soft);
  letter-spacing:0.09em;
}
.ft-app tbody td{border-bottom-color:rgba(255,241,228,0.050);}
.ft-app tbody tr.clickable:hover td{background:rgba(255,255,255,0.035);}
.ft-app tbody tr.highlight td{background:rgba(255,255,255,0.09);}

/* ---------- overlays ---------- */
.ft-app .overlay{background:rgba(6,5,4,0.74); backdrop-filter:blur(4px);}
.ft-app .modal{
  background:rgba(23,20,18,0.97);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 40px 90px -30px rgba(0,0,0,0.95);
}
.ft-app .drawer{
  background:rgba(18,16,14,0.97);
  backdrop-filter:blur(18px);
  border-left:1px solid var(--border);
}
.ft-app .modal-head, .ft-app .drawer-head{border-bottom-color:var(--border-soft);}
.ft-app .modal-foot{border-top-color:var(--border-soft);}
.ft-app .drawer-sec .st a{color:var(--text); text-decoration:underline; text-underline-offset:3px;}
.ft-app .link-row{border-bottom-color:rgba(255,241,228,0.050);}

.ft-app .toast{
  background:rgba(29,26,23,0.98);
  border:1px solid var(--border);
  color:var(--text);
  border-radius:11px;
  box-shadow:0 18px 40px -18px rgba(0,0,0,0.9);
}
.ft-app .toast.error{border-color:rgba(255,69,58,0.4); color:var(--red);}

.ft-app .gateway.selected{border-color:rgba(255,255,255,0.45); background:rgba(255,255,255,0.07);}
.ft-app .role-card.current{
  border-color:rgba(255,255,255,0.35);
  background:linear-gradient(180deg, rgba(255,255,255,0.05), transparent 45%);
}
.ft-app .perm.yes .chk{background:var(--signal-dim); color:var(--signal);}
.ft-app .perm.no .chk{background:rgba(255,255,255,0.055); color:var(--text-mute);}

/* ---------- sign in ----------
   The only screen with nothing to do on it, so it is the only screen
   that moves: one arterial road out of Tamale lights up and runs,
   once, behind the card. Everywhere else the city holds still. */
.ft-app #loginScreen::before{
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255,241,228,0.055), transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 110%, rgba(0,0,0,0.78), transparent 70%);
}
.ft-app .login-card{
  background:rgba(23,20,18,0.80);
  backdrop-filter:blur(22px);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 50px 110px -40px rgba(0,0,0,0.95), 0 1px 0 rgba(255,241,228,0.055) inset;
}
.ft-app .login-head h2{letter-spacing:-0.02em; font-size:22px; font-weight:600;}
.ft-app .login-row a{color:var(--text-dim); text-decoration:underline; text-underline-offset:3px;}
.ft-app .login-row a:hover{color:var(--text);}
.ft-app .remember input{accent-color:var(--accent);}
.ft-app .pw-toggle:hover{color:var(--text);}
.ft-app .demo-acct{background:rgba(255,255,255,0.04); border-color:var(--border-soft); border-radius:10px;}
.ft-app .demo-acct:hover{border-color:var(--border); background:rgba(255,255,255,0.07);}
.ft-app .demo-acct .di{background:rgba(255,255,255,0.07);}

/* ---------- keyboard focus, everywhere ---------- */
.ft-app :focus-visible{outline:2px solid rgba(255,255,255,0.75); outline-offset:2px; border-radius:6px;}

@media (prefers-reduced-motion: reduce){
  .ft-app *{animation-duration:.01ms !important; transition-duration:.01ms !important;}
}
