/* ============================================================
   EV AFRIQ — WORKSHOP APP STYLING
   All the styling for the whole app is in this one file.
   It is in the same order as the page: colours first, then
   sign in, the top bar, the page, tables, forms, messages.
   ============================================================ */


/* ---------- 1. COLOURS AND FONTS -------------------------- */
:root{
  --bg:#0A0E0D;          /* page background        */
  --surface:#121817;     /* cards and panels       */
  --surface2:#1A2322;    /* inputs, table headings */
  --surface3:#222D2B;
  --line:#26302E;
  --line2:#334240;

  --text:#EDF3F1;
  --muted:#8B9A96;
  --muted2:#6B7B77;

  --accent:#B6F23C;      /* EV Afriq lime          */
  --accent-ink:#0A0E0D;
  --accent-dim:rgba(182,242,60,.13);

  --amber:#FFB84D;
  --red:#FF6B5A;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,sans-serif;
  font-size:14px;
  line-height:1.5;
}


/* ---------- 1b. PROBLEM MESSAGE --------------------------- */
/* Shown instead of a blank screen when something stops the app. */
.problem{
  max-width:560px;
  margin:12vh auto;
  background:var(--surface);
  border:1px solid var(--line2);
  border-left:4px solid var(--red);
  border-radius:16px;
  padding:26px 28px;
}
.problem h2{
  font-family:'Space Grotesk';font-size:19px;font-weight:700;
  margin:0 0 10px;color:var(--red);
}
.problem p{margin:0 0 10px;font-size:14px;line-height:1.6;color:var(--text)}
.problem .small,.problem span.small{font-size:12px;color:var(--muted)}


/* ---------- 2. SIGN IN ------------------------------------ */
.signin{
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  padding:24px;
}
.signinbox{
  width:100%; max-width:380px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:20px;
  padding:32px;
  text-align:center;
}
.signinbox h1{font-family:'Space Grotesk';font-size:24px;margin:16px 0 4px}
.signinbox p{color:var(--muted);margin:0 0 24px}
.signinbox .field{text-align:left}

.logo{
  width:46px;height:46px;margin:0 auto;
  border-radius:13px;background:var(--accent);
  display:grid;place-items:center;
}
.logo svg{width:24px;height:24px;fill:var(--accent-ink)}
.logo.small{width:34px;height:34px;border-radius:10px;margin:0}
.logo.small svg{width:18px;height:18px}


/* ---------- 3. TOP BAR ------------------------------------ */
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; gap:28px;
  padding:14px 28px;
  background:rgba(10,14,13,.95);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.brand{display:flex;align-items:center;gap:11px}
.brand .name{font-family:'Space Grotesk';font-weight:700;font-size:16px;line-height:1.2}
.brand .where{font-size:11.5px;color:var(--muted)}

.nav{display:flex;gap:4px;margin-left:12px}
.navbtn{
  background:none;border:none;color:var(--muted);
  font-family:Inter;font-size:13.5px;font-weight:600;
  padding:9px 15px;border-radius:10px;cursor:pointer;
}
.navbtn:hover{color:var(--text);background:var(--surface)}
.navbtn.on{background:var(--accent-dim);color:var(--accent)}

.account{margin-left:auto;display:flex;align-items:center;gap:12px;font-size:12.5px}

@media(max-width:820px){
  .topbar{flex-wrap:wrap;gap:12px;padding:12px 16px}
  .nav{margin-left:0;width:100%;order:3}
  .navbtn{flex:1}
  .account{margin-left:auto}
}


/* ---------- 4. THE PAGE ----------------------------------- */
.page{max-width:1180px;margin:0 auto;padding:28px 28px 80px}
@media(max-width:820px){.page{padding:20px 16px 60px}}

h1{font-family:'Space Grotesk';font-size:26px;font-weight:700;margin:0 0 4px;letter-spacing:-.01em}
.sub{color:var(--muted);margin:0}

.pagehead{
  display:flex;align-items:flex-start;justify-content:space-between;
  gap:20px;margin-bottom:26px;flex-wrap:wrap;
}

.sectitle{
  font-family:'Space Grotesk';
  font-size:12px;font-weight:600;letter-spacing:.12em;
  text-transform:uppercase;color:var(--muted2);
  margin:32px 0 12px;
}

.back{
  background:none;border:none;color:var(--muted);
  font-family:Inter;font-size:13px;font-weight:600;
  padding:0;margin-bottom:16px;cursor:pointer;
}
.back:hover{color:var(--accent)}

.reg{
  font-size:14px;background:var(--surface2);border:1px solid var(--line);
  padding:4px 9px;border-radius:7px;color:var(--muted);vertical-align:middle;
}

.empty{color:var(--muted2);padding:22px 0;text-align:center}
.empty.error{color:var(--red)}
.dim{color:var(--muted2)}
.mono{font-family:'Space Grotesk';letter-spacing:.02em}
.hint{font-size:12.5px;color:var(--muted);line-height:1.6;margin:4px 0 18px}


/* ---------- 5. TILES AND PANELS --------------------------- */
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:8px}
@media(max-width:640px){.tiles{grid-template-columns:1fr}}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:18px}
.tile .n{font-family:'Space Grotesk';font-size:27px;font-weight:700;color:var(--accent);line-height:1.1}
.tile .l{font-size:11.5px;color:var(--muted);margin-top:6px}

.twocol{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:8px}
@media(max-width:820px){.twocol{grid-template-columns:1fr}}

.panel{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:20px}
.panel .sectitle{margin-top:0}

.kv{
  display:flex;justify-content:space-between;gap:18px;
  padding:10px 0;border-bottom:1px solid var(--line);font-size:13px;
}
.kv:last-child{border-bottom:none}
.kv span:first-child{color:var(--muted)}
.kv span:last-child{font-weight:600;text-align:right}


/* ---------- 6. TABLES ------------------------------------- */
/* The heading row stays put while the rows scroll underneath. */
.tablewrap{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  overflow:auto;
  max-height:min(560px, 70vh);
}
table{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}

thead th{
  position:sticky; top:0; z-index:2;
  background:var(--surface2);
  text-align:left;font-weight:600;font-size:11px;
  letter-spacing:.09em;text-transform:uppercase;color:var(--muted2);
  padding:13px 16px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}
tbody td{padding:13px 16px;border-bottom:1px solid var(--line);vertical-align:top}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:rgba(255,255,255,.02)}

.pill{
  display:inline-block;font-size:11px;font-weight:700;
  padding:4px 9px;border-radius:7px;white-space:nowrap;
  background:var(--surface3);color:var(--muted);
}
.pill.amber{background:rgba(255,184,77,.14);color:var(--amber)}
.pill.red{background:rgba(255,107,90,.14);color:var(--red)}


/* ---------- 7. FORMS -------------------------------------- */
.field{margin-bottom:14px}
.field label{
  display:block;font-size:11px;letter-spacing:.07em;text-transform:uppercase;
  color:var(--muted2);margin-bottom:6px;font-weight:600;
}
.field input,.field textarea,.field select{
  width:100%;
  background:var(--surface2);
  border:1px solid var(--line);
  color:var(--text);
  border-radius:11px;
  padding:12px 13px;
  font-family:Inter;font-size:14px;
}
.field input:focus,.field textarea:focus{
  outline:none;border-color:var(--accent);
}
.field textarea{min-height:92px;resize:vertical;line-height:1.55}
.row{display:grid;grid-template-columns:1fr 1fr;gap:12px}

.search{
  width:100%;
  background:var(--surface2);
  border:1px solid var(--line);
  color:var(--text);
  border-radius:12px;
  padding:13px 15px;
  font-family:Inter;font-size:14px;
  margin-bottom:16px;
}
.search:focus{outline:none;border-color:var(--accent)}

.statuspick{
  background:var(--surface2);border:1px solid var(--line);color:var(--muted);
  border-radius:9px;padding:7px 9px;font-family:Inter;font-size:12px;
}


/* ---------- 8. BUTTONS ------------------------------------ */
.btn{
  background:var(--accent);color:var(--accent-ink);
  border:none;border-radius:12px;
  padding:12px 20px;
  font-family:Inter;font-size:13.5px;font-weight:700;
  cursor:pointer;white-space:nowrap;
}
.btn:hover{filter:brightness(1.06)}
.btn:active{transform:translateY(1px)}
.btn.small{padding:7px 13px;font-size:12px;border-radius:9px}
.btn.wide{width:100%;padding:15px;margin-top:8px}
.btn.ghost{background:transparent;border:1px solid var(--line2);color:var(--text)}


/* ---------- 9. THE LITTLE MESSAGE AT THE BOTTOM ----------- */
.toast{
  position:fixed;left:50%;bottom:28px;
  transform:translate(-50%, 90px);
  background:var(--accent);color:var(--accent-ink);
  font-weight:600;font-size:13.5px;
  padding:13px 20px;border-radius:12px;
  box-shadow:0 14px 40px rgba(0,0,0,.5);
  opacity:0;pointer-events:none;
  transition:transform .26s cubic-bezier(.3,.9,.3,1), opacity .26s;
  max-width:88vw;
}
.toast.show{transform:translate(-50%,0);opacity:1}
.toast.error{background:var(--red);color:#fff}
