:root {
  --side: #070b16;
  --side-2: #0e1528;
  --side-line: #1b2640;
  --side-text: #aeb9cc;
  --bg: #f3f5f9;
  --panel: #ffffff;
  --line: #e2e7ef;
  --line-2: #cfd7e3;
  --text: #121a2b;
  --muted: #637089;
  --blue: #1476e6;
  --blue-soft: #e7f1fd;
  --gold: #e8940c;
  --gold-soft: #fdf2df;
  --green: #148a4b;
  --green-soft: #e3f5eb;
  --red: #c9302c;
  --red-soft: #fbe7e6;
  --amber: #a86400;
  --amber-soft: #fff3d6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; line-height: 1.45;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-screen {
  --px: 0px; --py: 0px;
  position: relative; overflow: hidden; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, 440px);
  align-items: center; gap: 48px; padding: 32px max(24px, 6vw); color: #e8edf6; background: #050914;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
.lg-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lg-grid {
  position: absolute; inset: -40px; background-image: linear-gradient(rgba(148,170,210,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(148,170,210,.07) 1px, transparent 1px);
  background-size: 48px 48px; transform: translate(calc(var(--px) * -.3), calc(var(--py) * -.3));
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 40% 45%, #000 25%, transparent 80%); mask-image: radial-gradient(ellipse 80% 70% at 40% 45%, #000 25%, transparent 80%);
  animation: lg-grid 40s linear infinite;
}
@keyframes lg-grid { to { background-position: 48px 48px, 48px 48px; } }
.lg-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.lg-blob.b1 { width: 560px; height: 560px; left: -120px; top: -160px; background: radial-gradient(circle, #1f7bff, transparent 65%); transform: translate(var(--px), var(--py)); animation: lg-drift1 18s ease-in-out infinite alternate; }
.lg-blob.b2 { width: 480px; height: 480px; right: -140px; bottom: -160px; background: radial-gradient(circle, #f5a524, transparent 65%); opacity: .35; transform: translate(calc(var(--px) * -1), calc(var(--py) * -1)); animation: lg-drift2 22s ease-in-out infinite alternate; }
.lg-blob.b3 { width: 380px; height: 380px; left: 40%; top: 55%; background: radial-gradient(circle, #16c1d6, transparent 65%); opacity: .25; animation: lg-drift1 26s ease-in-out infinite alternate-reverse; }
@keyframes lg-drift1 { to { translate: 80px 60px; scale: 1.12; } }
@keyframes lg-drift2 { to { translate: -70px -50px; scale: 1.08; } }
.lg-float { position: absolute; bottom: -60px; font-size: 26px; opacity: 0; filter: saturate(.8); animation: lg-rise 16s linear infinite; }
.lg-float.f1 { left: 6%; animation-delay: 0s; } .lg-float.f2 { left: 18%; animation-delay: -4s; font-size: 20px; } .lg-float.f3 { left: 31%; animation-delay: -9s; }
.lg-float.f4 { left: 44%; animation-delay: -2s; font-size: 22px; } .lg-float.f5 { left: 57%; animation-delay: -12s; } .lg-float.f6 { left: 70%; animation-delay: -6s; font-size: 20px; }
.lg-float.f7 { left: 82%; animation-delay: -14s; } .lg-float.f8 { left: 93%; animation-delay: -8s; font-size: 22px; }
@keyframes lg-rise { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: .35; } 85% { opacity: .25; } 100% { transform: translateY(-110vh) rotate(25deg); opacity: 0; } }

.lg-hero { position: relative; z-index: 1; max-width: 560px; }
.lg-brand { display: flex; align-items: center; gap: 36px; margin-bottom: 30px; padding-left: 14px; }
.lg-logo { position: relative; width: 132px; height: 132px; flex: none; display: grid; place-items: center; }
.lg-logo img { width: 104px; height: 104px; object-fit: cover; border-radius: 26px; box-shadow: 0 20px 50px rgba(0,0,0,.6), 0 0 0 1px rgba(148,170,210,.25), 0 0 60px rgba(31,123,255,.35); animation: lg-bob 6s ease-in-out infinite; }
.lg-logo .ring { position: absolute; inset: 0; border-radius: 50%; }
.lg-logo .r1 { border: 1px dashed rgba(98,179,255,.45); animation: lg-spin 24s linear infinite; }
.lg-logo .r2 { inset: -14px; border: 2px solid transparent; border-top-color: #f5a524; border-right-color: rgba(245,165,36,.25); animation: lg-spin 6s linear infinite; }
@keyframes lg-spin { to { transform: rotate(360deg); } }
@keyframes lg-bob { 50% { translate: 0 -8px; } }
.lg-clock { font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; background: linear-gradient(90deg, #fff, #9cc9ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-date { color: #9aa7bd; font-size: 14px; margin-top: 6px; }
.lg-hero h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.12; margin: 0 0 12px; letter-spacing: -.02em; }
.lg-hero h2 span { background: linear-gradient(90deg, #62b3ff, #2388ff 55%, #ffc95c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-lead { color: #aeb9cc; font-size: 17px; margin: 0 0 26px; }
.lg-slides { position: relative; min-height: 96px; }
.lg-slide { position: absolute; inset: 0; display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid rgba(148,170,210,.18);
  backdrop-filter: blur(6px); opacity: 0; transform: translateY(12px); transition: opacity .5s, transform .5s cubic-bezier(.2,.7,.2,1); }
.lg-slide.on { opacity: 1; transform: none; }
.lg-slide .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(145deg, rgba(35,136,255,.3), rgba(245,165,36,.15)); flex: none; }
.lg-slide b { font-size: 16px; }
.lg-slide p { margin: 4px 0 0; color: #9aa7bd; font-size: 14px; }
.lg-dots { display: flex; gap: 8px; margin-top: 16px; }
.lg-dots button { width: 8px; height: 8px; border-radius: 999px; border: 0; padding: 0; background: rgba(255,255,255,.25); cursor: pointer; transition: width .3s, background .3s; }
.lg-dots button.on { width: 26px; background: #f5a524; }

.login-card {
  position: relative; z-index: 1; width: 100%; padding: 30px 28px 24px; border-radius: 24px; color: #e8edf6;
  background: linear-gradient(160deg, rgba(19,31,58,.82), rgba(8,13,26,.9)); border: 1px solid rgba(148,170,210,.2);
  box-shadow: 0 40px 100px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: lg-in .7s cubic-bezier(.2,.7,.2,1) both;
}
.login-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(98,179,255,.7), transparent 35%, transparent 65%, rgba(245,165,36,.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@keyframes lg-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.lc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.lc-top img { width: 48px; height: 48px; border-radius: 14px; background: #000; box-shadow: 0 0 0 1px rgba(148,170,210,.25); }
.login-card h1 { font-size: 22px; margin: 0; }
.lc-top p { margin: 2px 0 0; color: #9aa7bd; font-size: 13px; text-align: left; }
.lc-field { position: relative; margin-bottom: 14px; }
.lc-field input {
  width: 100%; height: 56px; padding: 20px 46px 6px 46px; border-radius: 14px; font-size: 15px; color: #fff;
  background: rgba(4,8,18,.7); border: 1px solid rgba(148,170,210,.25); outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.lc-field input:focus { border-color: #62b3ff; box-shadow: 0 0 0 4px rgba(35,136,255,.18); background: rgba(4,8,18,.9); }
.lc-field label { position: absolute; left: 46px; top: 18px; margin: 0; color: #8b98af; font-size: 15px; font-weight: 500; pointer-events: none; transition: all .18s ease; }
.lc-field input:focus + label, .lc-field input:not(:placeholder-shown) + label { top: 8px; font-size: 11px; color: #62b3ff; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }
.lc-ico { position: absolute; left: 15px; top: 17px; font-size: 16px; opacity: .8; }
.lc-eye { position: absolute; right: 8px; top: 9px; width: 38px; height: 38px; border-radius: 10px; border: 0; background: none; cursor: pointer; font-size: 16px; }
.lc-eye:hover { background: rgba(255,255,255,.08); }
.lc-field.bad input { border-color: #f87171; box-shadow: 0 0 0 4px rgba(248,113,113,.15); }
.lc-caps { margin: -6px 0 10px; font-size: 12px; font-weight: 600; color: #fbbf24; }
.lc-row { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 14px; }
.lc-check { display: flex; align-items: center; gap: 8px; margin: 0; color: #aeb9cc; font-size: 13px; font-weight: 500; cursor: pointer; }
.lc-check input { width: 16px; height: 16px; min-height: 0; accent-color: #f5a524; }
.lc-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: rgba(185,28,28,.18); border: 1px solid rgba(248,113,113,.35); color: #fecaca; }
.lc-forgot { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: #8ec5ff; text-decoration: underline; text-underline-offset: 3px; }
.lc-forgot:hover { color: #cfe6ff; }
.lc-inline-link { display: inline-block; margin-top: 6px; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: #fecaca; text-decoration: underline; text-underline-offset: 3px; }
.lc-inline-link:hover { color: #fff; }

/* The screen behind a password-reset link — one centred card, no marketing panel. */
.reset-screen { grid-template-columns: 1fr; place-content: center; justify-items: center; }
.reset-screen .login-card { width: min(440px, 100%); }
.reset-screen #rsWho { margin: 2px 0 0; color: #9aa7bd; font-size: 13px; }
.reset-screen .field label { color: #aeb9cc; font-size: 12px; }
.reset-screen .field input { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; color: #fff; background: rgba(4,8,18,.7); border: 1px solid rgba(148,170,210,.25); }
.reset-screen .field input:focus { border-color: #62b3ff; box-shadow: 0 0 0 4px rgba(35,136,255,.18); outline: none; }
.reset-screen .hint, .reset-screen .empty { color: #8b98af; }
.reset-screen .alert { color: #fecaca; }
.lc-submit {
  position: relative; overflow: hidden; width: 100%; height: 52px; border: 0; border-radius: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: #1b1100; background: linear-gradient(135deg, #ffc95c, #f5a524); box-shadow: 0 12px 30px rgba(245,165,36,.3); transition: transform .2s, box-shadow .2s;
}
.lc-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(245,165,36,.45); }
.lc-submit::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s; }
.lc-submit:hover::after { transform: translateX(120%); }
.lc-submit .arrow { transition: transform .2s; }
.lc-submit:hover .arrow { transform: translateX(4px); }
.lc-submit .spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(27,17,0,.25); border-top-color: #1b1100; animation: lg-spin .7s linear infinite; }
.login-card.busy .lc-submit .spin { display: block; }
.login-card.busy .lc-submit .arrow { display: none; }
.login-card.ok .lc-submit { background: linear-gradient(135deg, #34d399, #059669); color: #fff; }
.login-card.ok .lc-submit .arrow { display: none; }
.login-card.shake { animation: lg-shake .45s; }
@keyframes lg-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.lc-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 18px; font-size: 13px; color: #8b98af; }
.lc-foot a { color: #aeb9cc; }
@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; gap: 24px; padding: 24px 16px; align-content: center; justify-items: center; }
  .lg-hero { text-align: center; }
  .lg-brand { justify-content: center; margin-bottom: 12px; }
  .lg-logo { width: 96px; height: 96px; } .lg-logo img { width: 76px; height: 76px; border-radius: 20px; }
  .lg-clock { font-size: 32px; }
  .lg-lead, .lg-slides, .lg-dots { display: none; }
  .lg-hero h2 { font-size: 26px; margin: 0; }
  .login-card { max-width: 440px; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-blob, .lg-grid, .lg-float, .lg-logo img, .lg-logo .ring, .login-card { animation: none !important; }
  .lg-float { display: none; }
}

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
.sidebar { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--side-line); color: #fff; font-weight: 800; letter-spacing: .04em; }
.sidebar .brand img { width: 38px; height: 38px; border-radius: 8px; }
.sidebar .brand b { color: #3a9bff; }
.sidebar .brand small { display: block; font-size: 9px; letter-spacing: .28em; color: #f6a31a; margin-top: -3px; }
.nav-group { padding: 6px 10px 2px; }
.nav-group h6 { margin: 0 8px 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #5d6a84; font-weight: 700; }

/* Each department is a dropdown: the heading is the button, the links slide out beneath it. */
.nav-group > .nav-head {
  display: flex; align-items: center; gap: 9px; width: 100%; margin: 0 0 2px;
  padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  color: #8ea0bd; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; text-align: left;
  transition: background .15s, color .15s;
}
.nav-group > .nav-head:hover { background: var(--side-2); color: #fff; }
.nav-group > .nav-head:focus-visible { outline: 2px solid #3a9bff; outline-offset: -2px; }
.nav-group > .nav-head .g-ico { width: 20px; text-align: center; font-size: 14px; filter: saturate(.75); }
.nav-group > .nav-head .g-label { flex: 1; min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }
.nav-group > .nav-head .g-count {
  font-size: 10px; font-weight: 700; letter-spacing: 0; color: #64748b;
  background: rgba(255,255,255,.07); border-radius: 20px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.nav-group > .nav-head .g-dot { width: 7px; height: 7px; border-radius: 50%; background: #e8940c; box-shadow: 0 0 0 3px rgba(232,148,12,.18); }
.nav-group > .nav-head .g-chev { font-size: 10px; color: #64748b; transition: transform .2s ease; transform: rotate(-90deg); }
.nav-group.open > .nav-head { color: #dbe6f6; }
.nav-group.open > .nav-head .g-chev { transform: none; }
.nav-group.has-active > .nav-head { color: #fff; background: rgba(20,118,230,.14); }
.nav-group.has-active > .nav-head .g-ico { filter: none; }

.nav-group > .nav-items {
  display: grid; grid-template-rows: 0fr; overflow: hidden;
  transition: grid-template-rows .22s ease, opacity .18s ease; opacity: .4;
}
.nav-group > .nav-items > div { min-height: 0; overflow: hidden; }
.nav-group.open > .nav-items { grid-template-rows: 1fr; opacity: 1; }
.nav-group > .nav-items .nav-link { margin-left: 9px; padding-left: 12px; border-left: 1px solid var(--side-line); border-radius: 0 8px 8px 0; }
.nav-group > .nav-items .nav-link.active { border-left-color: transparent; }
.nav-toggle-all { display: block; width: calc(100% - 20px); margin: 8px 10px 0; padding: 6px; border: 0; border-radius: 8px; background: transparent; color: #5d6a84; font: inherit; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.nav-toggle-all:hover { background: var(--side-2); color: #dbe6f6; }

@media (prefers-reduced-motion: reduce) {
  .nav-group > .nav-items, .nav-group > .nav-head .g-chev { transition: none; }
}
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; }
.nav-link:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav-link.active { background: linear-gradient(90deg, rgba(20,118,230,.35), rgba(20,118,230,.1)); color: #fff; box-shadow: inset 3px 0 0 #3a9bff; }
.nav-link .ico { width: 20px; text-align: center; }
.nav-link .badge { margin-left: auto; }
.sidebar .foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--side-line); font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 20px; min-height: 58px; }
.topbar .title { font-size: 17px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.topbar select { width: auto; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 18px; cursor: pointer; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 8px; border: 1px solid transparent; background: none; }
.user-chip:hover { border-color: var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #1476e6, #0b3d8a); color: #fff; font-weight: 700; font-size: 12px; }
.user-chip .who { text-align: left; line-height: 1.15; }
.user-chip .who small { color: var(--muted); display: block; font-size: 11px; }
.dropdown { position: absolute; right: 16px; top: 54px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 200px; padding: 6px; z-index: 30; }
.dropdown button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.dropdown button:hover { background: var(--bg); }

.content { padding: 20px; max-width: 1400px; width: 100%; }

/* ---------- Components ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 15px; }
.card-b { padding: 16px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.grid > .card, .board .card { margin-top: 0; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

.kpi { padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent { border-top: 3px solid var(--blue); }
.kpi.gold { border-top: 3px solid var(--gold); }
.kpi.green { border-top: 3px solid var(--green); }
.kpi.red { border-top: 3px solid var(--red); }
a.kpi { color: inherit; display: block; }
a.kpi:hover { text-decoration: none; border-color: var(--line-2); }

.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #0f63c4; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1d1200; }
.btn-gold:hover { background: #d0830a; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #0f7540; }
.btn-red { background: var(--panel); border-color: #eab0ae; color: var(--red); }
.btn-red:hover { background: var(--red-soft); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }

label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 4px; color: #33405a; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; min-height: 36px; }
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(20,118,230,.35); border-color: var(--blue); }
input.big { font-size: 22px; font-weight: 700; padding: 10px 12px; font-variant-numeric: tabular-nums; }
.field { margin-bottom: 12px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; min-height: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f8fafc; font-weight: 700; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #f7faff; }
tfoot td { font-weight: 700; background: #f8fafc; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge.green { background: var(--green-soft); color: var(--green); border-color: #bfe5cf; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: #f1c3c1; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: #f3dca3; }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: #c4dcf8; }
.badge.gold { background: var(--gold-soft); color: #955c00; border-color: #f4d7a4; }
.sidebar .badge { background: #e8940c; color: #1d1200; border: 0; }

.alert { padding: 10px 14px; border-radius: 8px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert + .alert { margin-top: 8px; }
.alert.error { background: var(--red-soft); border-color: #f1c3c1; color: #8f1f1c; }
.alert.warning { background: var(--amber-soft); border-color: #f3dca3; color: #7a4a00; }
.alert.success { background: var(--green-soft); border-color: #bfe5cf; color: #0d6036; }
.alert.info { background: var(--blue-soft); border-color: #c4dcf8; color: #0b4d99; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 9px 14px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* POS */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.type-tile { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; font-weight: 600; min-height: 56px; }
.type-tile small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; margin-top: 2px; }
.type-tile:hover { border-color: var(--blue); }
.type-tile.active { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.preview { background: #f8fafc; border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 12px; }
.preview .line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.product { text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.product:hover { border-color: var(--blue); }
.product:disabled { opacity: .5; }
.product b { display: block; }
.cart-line { display: grid; grid-template-columns: 1fr 70px 90px 28px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }

/* Reconciliation */
.recon-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 10px; font-weight: 700; }
.recon-status.approved { background: var(--green-soft); color: var(--green); border: 1px solid #bfe5cf; }
.recon-status.submitted { background: var(--blue-soft); color: var(--blue); border: 1px solid #c4dcf8; }
.recon-status.rejected { background: var(--red-soft); color: var(--red); border: 1px solid #f1c3c1; }
.recon-status.open { background: var(--amber-soft); color: var(--amber); border: 1px solid #f3dca3; }
.recon-status .big { font-size: 18px; }
.formula { width: 100%; }
.formula td { border: 0; padding: 3px 0; }
.formula tr.total td { border-top: 2px solid var(--text); font-weight: 700; padding-top: 6px; }
.formula .op { width: 18px; color: var(--muted); font-weight: 700; }
.disc { margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-weight: 700; }
.disc.ok { background: var(--green-soft); color: var(--green); }
.disc.short { background: var(--red-soft); color: var(--red); }
.disc.excess { background: var(--amber-soft); color: var(--amber); }

.wb-table td:first-child { padding-left: 24px; }
.wb-table tr.head td { padding-left: 12px; font-weight: 700; background: #f8fafc; }
.wb-table tr.sum td { font-weight: 700; border-top: 2px solid var(--line-2); }
.wb-table tr.grand td { font-weight: 800; font-size: 16px; background: var(--blue-soft); color: #0b4d99; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 16, 30, .5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal.wide { max-width: 900px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 16px; }
.modal-h .x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-b { padding: 18px; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: 10px; background: #111a2e; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: pop .2s ease; }
.toast.error { background: #8f1f1c; }
.toast.success { background: #0d6036; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.map pre { background: #0b1020; color: #cfe3ff; padding: 16px; border-radius: 10px; overflow-x: auto; font-size: 12px; line-height: 1.35; }
.print-only { display: none; }


/* ---------- Human resources ---------- */
.tiny { font-size: 11px; }
.pre { white-space: pre-wrap; margin: 0; }
.spacer { flex: 1; }
.hr-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px;
  background: linear-gradient(120deg, #0b1530, #10244a 60%, #1b2a4a); color: #fff; border: 0; }
.hr-hero h2 { font-size: 20px; }
.hr-hero p { margin: 4px 0 0; color: #b6c3da; }
.hr-hero .btn:not(.btn-primary):not(.btn-gold) { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
.hr-flow { display: flex; gap: 6px; margin: 14px 0 4px; overflow-x: auto; padding-bottom: 4px; }
.hr-flow-step { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 12px; white-space: nowrap; }
.hr-flow-step span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 11px; flex: none; }

.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board-col { background: #eef2f8; border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.board-col.focus { box-shadow: inset 0 0 0 2px var(--blue); }
.board-h { display: flex; justify-content: space-between; align-items: center; padding: 2px 2px 4px; }
.app-card { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.app-card:hover { border-color: var(--blue); transform: translateY(-1px); }
.stars { color: var(--gold); letter-spacing: 1px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

.kv th { width: 110px; background: none; text-transform: none; letter-spacing: 0; font-size: 12px; padding: 6px 8px 6px 0; }
.kv td { padding: 6px 0; }
.interview { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.interview.completed { border-left: 3px solid var(--green); }
.interview.scheduled { border-left: 3px solid var(--blue); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 10px 8px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--blue); }

.emp-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 4px; margin: 0 0 14px; }
.emp-form legend, fieldset legend { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 6px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0; min-width: 0; }
.fields.f3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields.f4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fields .span2 { grid-column: span 2; }
.emp-head h2 { font-size: 20px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.progress { width: 90px; height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress.wide { width: 160px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: inherit; }
.checklist { display: flex; flex-direction: column; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.check-item .tick { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2); display: grid; place-items: center; font-weight: 800; flex: none; }
.check-item.done .tick { background: var(--green); border-color: var(--green); color: #fff; }
.check-item.waived .tick { background: var(--bg); color: var(--muted); }
.bands input { min-height: 30px; padding: 4px 6px; }
.bands th, .bands td { padding: 4px; }
.register td, .register th { white-space: nowrap; }


/* Credentials */
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cred-grid .card { margin-top: 0; }
.cred { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border-top: 3px solid var(--line-2); }
.cred.on-file { border-top-color: var(--green); }
.cred.missing { border-top-color: var(--red); }
.cred-top { display: flex; align-items: flex-start; gap: 10px; }
.cred-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--blue-soft); flex: none; }
.cred-file { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: #f8fafc; border: 1px solid var(--line); word-break: break-all; }
.cred-file.empty-file { border-style: dashed; background: none; }
.cred-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.contract-box { margin-top: 2px; padding: 10px; border-radius: 8px; background: var(--gold-soft); border: 1px solid #f4d7a4; display: flex; flex-direction: column; gap: 8px; }
.cred-table th.c, .cred-table td.c { text-align: center; font-size: 11px; }
.cred-dot { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 800; border: 0; font-size: 13px; text-decoration: none !important; }
.cred-dot.ok { background: var(--green-soft); color: var(--green); }
.cred-dot.waived { background: var(--bg); color: var(--muted); }
.cred-dot.missing { background: var(--red-soft); color: var(--red); cursor: pointer; }
button.cred-dot.missing:hover { background: var(--red); color: #fff; }
a.tab { text-decoration: none !important; display: inline-block; }
.doc.contract .c-head { text-align: center; font-size: 12px; border-bottom: 3px double #1476e6; padding-bottom: 8px; margin-bottom: 10px; font-family: "Segoe UI", system-ui, sans-serif; }
.doc.contract .c-head b { font-size: 17px; letter-spacing: .06em; }
.doc.contract h1 { text-align: center; font-size: 18px; text-decoration: underline; margin: 12px 0 2px; }
.doc.contract .ref { text-align: center; font-size: 12px; margin: 0 0 10px; }
.doc.contract h2 { font-size: 14px; margin: 14px 0 4px; }
.doc.contract table.sign { width: 100%; margin-top: 26px; border-collapse: collapse; }
.doc.contract table.sign td { width: 50%; vertical-align: top; border: 0; padding: 0 16px 0 0; }

/* Printable company documents (offer letter, onboarding pack, payslip) */
.doc { font-family: Georgia, "Times New Roman", serif; font-size: 14px; line-height: 1.55; color: #111; }
.doc h3 { font-size: 15px; margin: 18px 0 6px; }
.doc h4 { font-size: 14px; margin: 12px 0 4px; }
.doc p { margin: 6px 0; }
.doc ul { margin: 4px 0; }
.doc-head { display: flex; align-items: center; gap: 14px; border-bottom: 3px double #1476e6; padding-bottom: 10px; margin-bottom: 12px; font-family: "Segoe UI", system-ui, sans-serif; font-size: 12px; }
.doc-head img { width: 96px; border-radius: 8px; }
.doc-head b { font-size: 16px; letter-spacing: .04em; }
.doc-title { text-align: center; font-size: 17px; letter-spacing: .06em; margin: 12px 0; text-decoration: underline; }
.doc .blank { display: inline-block; border-bottom: 1px solid #333; height: 1em; vertical-align: baseline; }
.doc .fill { border-bottom: 1px dotted #555; padding: 0 4px; font-weight: 600; font-family: "Segoe UI", system-ui, sans-serif; }
.doc-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.doc-table th, .doc-table td { border: 1px solid #bbb; padding: 6px 8px; background: none; color: #111; font-size: 13px; text-transform: none; letter-spacing: 0; }
.doc-table th { background: #f3f5f9; font-weight: 700; }
.doc-table tfoot td { font-weight: 700; background: #f3f5f9; }
.sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; }
.sign-row { margin: 10px 0 4px; }
.photo-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.photo-box { width: 120px; height: 150px; border: 1px dashed #888; display: grid; place-items: center; font-size: 11px; color: #666; flex: none; text-align: center; font-family: "Segoe UI", system-ui, sans-serif; }
.doc-page + .doc-page { border-top: 1px dashed var(--line-2); margin-top: 20px; padding-top: 10px; }
.net-pay { display: flex; justify-content: space-between; align-items: center; margin: 12px 0; padding: 12px 16px; border-radius: 8px; background: #0b1530; color: #fff; font-family: "Segoe UI", system-ui, sans-serif; font-weight: 800; letter-spacing: .06em; }
.net-pay span { font-size: 20px; color: #ffc95c; }


/* ---------- Company modules ---------- */
.spacer { flex: 1; }
.attention { margin-bottom: 16px; border-left: 4px solid var(--gold); }
.reminders { display: flex; flex-direction: column; }
.reminder { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: inherit; }
.reminder:hover { background: #f7faff; text-decoration: none; }
.reminder .r-ico { font-size: 18px; }
.reminder .r-main { flex: 1; display: flex; flex-direction: column; }
.reminder .r-go { color: var(--muted); font-size: 20px; }
.reminder.error { box-shadow: inset 3px 0 0 var(--red); }
.reminder.warning { box-shadow: inset 3px 0 0 var(--gold); }
.reminder.info { box-shadow: inset 3px 0 0 var(--blue); }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 210px; padding: 10px 4px 0; overflow-x: auto; }
.bar-col { flex: 1; min-width: 60px; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.bar-stack { width: 42px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; background: var(--line); min-height: 2px; }
.seg { display: block; min-height: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.seg-rent { background: #1476e6; } .seg-electricity { background: #e8940c; } .seg-water { background: #0ea5e9; } .seg-internet { background: #8b5cf6; }
.seg-security { background: #148a4b; } .seg-garbage { background: #64748b; } .seg-service_charge { background: #0b3d8a; } .seg-other { background: #c9302c; }
.process { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 16px; }
.proc-step { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.proc-step .num, .stage-pill span, .stepper .st span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.stage-strip { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.stage-pill { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); white-space: nowrap; font-size: 12px; font-weight: 600; }
.stage-pill b { background: var(--bg); border-radius: 999px; padding: 0 8px; }
.stepper { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.stepper .st { flex: 1; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; }
.stepper .st span { background: var(--line-2); color: var(--muted); }
.stepper .st.done span { background: var(--green); color: #fff; }
.stepper .st.current { color: var(--blue); }
.stepper .st.current span { background: var(--gold); color: #1d1200; box-shadow: 0 0 0 4px var(--gold-soft); }
.step-form { margin: 14px 0; padding: 14px; border: 1px solid #c4dcf8; border-radius: 10px; background: var(--blue-soft); }
.step-form h4 { margin: 0 0 10px; font-size: 14px; }
tr.sel td { background: var(--green-soft); }
.enquiry { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.enquiry.new { box-shadow: inset 3px 0 0 var(--blue); }
.transcript { margin-top: 6px; padding: 8px; background: #f8fafc; border-radius: 8px; font-size: 13px; max-height: 240px; overflow-y: auto; }
.transcript .user { color: #0b4d99; }
.report-form { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; }
.report-form .field { margin: 0; }
@media (max-width: 1100px) { .report-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .report-form { grid-template-columns: 1fr; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g4, .fields.f4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.5); }
  .menu-btn { display: block; }
  .g3 { grid-template-columns: 1fr; }
  .user-chip .who { display: none; }
  .content { padding: 16px; }
}
@media (max-width: 560px) {
  .g2, .g4, .fields, .fields.f3, .fields.f4 { grid-template-columns: 1fr; }
  .fields .span2 { grid-column: auto; }
  .sign-grid { grid-template-columns: 1fr; }
  .topbar { padding: 8px 16px; flex-wrap: wrap; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .no-print, .toasts, .btn { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .print-only { display: block; }
  .modal-bg { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; max-width: none; }
  body.printing-modal .shell { display: none; }
  .doc-page + .doc-page { border: 0; margin: 0; padding: 0; break-before: page; }
  .modal-h { display: none; }
  .modal-b { padding: 0; }
  .net-pay { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Property agency */
.seg-due { background: #c4dcf8; } .seg-collected { background: #148a4b; }
table tr.total td { border-top: 2px solid var(--line-2, #cbd5e1); background: #f5f7fb; }
select[size] { padding: 4px; }
select[size] option { padding: 4px 6px; border-radius: 4px; }

/* Procurement department */
.q-lines input { width: 100%; min-width: 0; }
.q-lines td { padding: 4px; vertical-align: middle; }
.letter-paper { background: #fffdf8; }
.stepper a.st { text-decoration: none; }


/* Email & outbox, and the locked-account row on Staff & roles. */
.kpis-inline { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted); }
.kpis-inline b { font-size: 17px; color: var(--text); margin-right: 4px; }
.kpis-inline .danger b { color: var(--red); }
tr.row-locked { background: rgba(220, 38, 38, .05); }
tr.row-locked td:first-child { box-shadow: inset 3px 0 0 var(--red); }

/* ===========================================================================
   Security, authorisations, backups, eTIMS, casual workers and purchasing.
   =========================================================================== */

/* Colour aliases, so a screen can say .alert.red rather than remembering
   whether this stylesheet calls it "error" or "danger". */
.alert.red { background: var(--red-soft); border-color: #f1c3c1; color: #8f1f1c; }
.alert.amber { background: var(--amber-soft); border-color: #f3dca3; color: #7a4a00; }
.alert.green { background: var(--green-soft); border-color: #bfe5cf; color: #0d6036; }
.alert.blue { background: var(--blue-soft); border-color: #c4dcf8; color: #0b4d99; }
.alert { display: block; margin: 12px 0; line-height: 1.6; }
.alert ul, .alert ol { margin: 6px 0 0; padding-left: 20px; }

/* Headline figures above a screen. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 16px 0; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--shadow);
}
.stat .s-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat .s-value { display: block; font-size: 21px; font-weight: 700; margin: 4px 0 2px; }
.stat .s-sub { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }
.stat.warn { border-color: #f3dca3; background: var(--amber-soft); }
.stat.warn .s-value { color: var(--amber); }
.stat.bad { border-color: #f1c3c1; background: var(--red-soft); }
.stat.bad .s-value { color: var(--red); }

/* A process shown as the steps it actually goes through. */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.pipeline > div {
  position: relative; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg);
}
.pipeline > div b { display: block; font-size: 14px; }
.pipeline > div span { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.pipeline.big > div b { font-size: 19px; }
.pipeline.big > div.on { border-color: var(--blue); background: var(--blue-soft); }

/* The backup chain: green where it holds, red where it does not. */
.bk-chain { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.bk-chain > div { padding: 11px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.bk-chain > div b { display: block; font-size: 13px; }
.bk-chain > div span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.bk-chain > div.ok { border-color: #bfe5cf; background: var(--green-soft); }
.bk-chain > div.warn { border-color: #f3dca3; background: var(--amber-soft); }
.bk-chain > div.bad { border-color: #f1c3c1; background: var(--red-soft); }

/* Numbered instructions people actually follow. */
ol.steps { counter-reset: st; list-style: none; padding-left: 0; margin: 10px 0; }
ol.steps li { counter-increment: st; position: relative; padding-left: 34px; margin-bottom: 11px; line-height: 1.6; }
ol.steps li::before {
  content: counter(st); position: absolute; left: 0; top: 0;
  width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: 12px;
}

/* Two-factor enrolment. */
.mfa-setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 14px 0; }
.mfa-key label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 5px; }
.mfa-key code {
  display: block; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 8px; font-size: 14px; word-break: break-all;
}
.mfa-key code.mfa-secret { font-size: 17px; letter-spacing: .08em; font-weight: 600; }
.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; margin: 14px 0; }
.codes code {
  padding: 9px 11px; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 7px; text-align: center; font-size: 15px; letter-spacing: .04em;
}

/* The barcode box at the counter. */
.scanbar {
  display: flex; align-items: center; gap: 9px; margin-bottom: 8px; padding: 7px 10px;
  border: 2px solid var(--blue); border-radius: 9px; background: var(--blue-soft);
}
.scanbar:focus-within { box-shadow: 0 0 0 3px rgba(20, 118, 230, .18); }
.scanbar .scan-ico { font-size: 15px; color: var(--blue); letter-spacing: -2px; }
.scanbar input {
  flex: 1; border: 0; background: transparent; font-size: 15px; padding: 3px 0; outline: none; color: var(--text);
}
.scan-msg { min-height: 19px; font-size: 13px; margin-bottom: 8px; }
.scan-msg .pos { color: var(--green); font-weight: 600; }
.scan-msg .neg { color: var(--red); font-weight: 600; }

/* A row for something switched off or ended: present, but not shouting. */
tr.muted-row { opacity: .55; }
tr.hl { background: var(--blue-soft); }
tr.warn { background: var(--amber-soft); }

.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h2 { margin: 0; flex: 1; font-size: 20px; }

.progress { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; background: var(--green); border-radius: 99px; transition: width .3s ease; }

.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .mfa-setup, .pipeline, .bk-chain { grid-template-columns: 1fr; }
}

/* Split payments at the counter: one row per method. */
.pay-block { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.pay-row { display: flex; gap: 6px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.pay-row select, .pay-row input { flex: 1 1 110px; min-width: 0; }
.pay-row input[type="number"] { flex: 0 1 100px; text-align: right; }
.pay-sum { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.pay-sum .pos { color: var(--green); }
.pay-sum .neg { color: var(--red); }
