:root {
  /* Going Highway brand (matches goinghighway.com) */
  --bg: #0a0a0a; --panel: #141414; --panel-2: #1a1a1a; --line: #222222; --line-2: #333;
  --text: #e5e7eb; --muted: #9ca3af; --dim: #6b7280;
  --accent: #A6CF43; --accent-ink: #0a0a0a; --accent-glow: rgba(166, 207, 67, .15);
  --good: #3ecf8e; --good-bg: rgba(62,207,142,.12);
  --warn: #f5a524; --warn-bg: rgba(245,165,36,.12);
  --bad: #ff5c5c; --bad-bg: rgba(255,92,92,.12);
  --info: #6cb6ff; --info-bg: rgba(108,182,255,.12);
  --radius: 10px; --side: 248px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Saira SemiCondensed", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--text); }
a:hover { color: var(--accent); }
h1 { font-size: 26px; margin: 0; letter-spacing: .01em; font-weight: 700; color: #fff; }
h2 { color: #fff; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.right { text-align: right; } .nowrap { white-space: nowrap; }

/* Shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: #050505; border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 18px; text-decoration: none; }
.brand img { width: 150px; height: auto; max-height: 56px; object-fit: contain; object-position: left center; }
.brand b { font-size: 15px; letter-spacing: .14em; }
.brand span { font-size: 11px; color: var(--accent); letter-spacing: .18em; text-transform: uppercase; font-weight: 600; margin-top: 6px; }
.nav-group { margin: 10px 0 4px; padding: 0 10px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: #cfcfcf; text-decoration: none; font-size: 13.5px; }
.nav a:hover { background: var(--panel-2); color: #fff; }
.nav a.on { background: var(--accent-glow); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.nav .badge { margin-left: auto; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(10,10,10,.92); backdrop-filter: blur(6px); z-index: 5; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 6px 10px; }
.content { padding: 24px 28px 60px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards and grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.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)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat.bad .v { color: var(--bad); } .stat.good .v { color: var(--good); } .stat.warn .v { color: var(--warn); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.row-bad td { background: var(--bad-bg); }
tr.row-warn td { background: var(--warn-bg); }
tfoot td { font-weight: 650; background: var(--panel-2); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-2); white-space: nowrap; }
.b-good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.b-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.b-bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.b-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.b-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* Forms */
form.stack > * + * { margin-top: 12px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.fields .wide { grid-column: 1 / -1; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
input, select, textarea { width: 100%; background: #0d0d0d; color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; margin: 0; }
.hint { font-size: 12px; color: var(--dim); margin-top: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #555; color: #fff; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; box-shadow: 0 0 18px var(--accent-glow); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn.danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.btn.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.lg { padding: 14px 20px; font-size: 16px; }
.inline-form { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters > div { min-width: 150px; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--good-bg); color: var(--good); }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: #fff; border-color: var(--accent); }

/* Definition lists */
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: 11px; color: var(--dim); text-align: center; padding: 4px; text-transform: uppercase; }
.cal .day { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-height: 104px; padding: 6px; font-size: 12px; overflow: hidden; }
.cal .day.out { opacity: .35; }
.cal .day.today { border-color: var(--accent); }
.cal .day.sun { background: #101010; }
.cal .dnum { font-weight: 650; color: var(--muted); margin-bottom: 4px; }
.ev { display: block; border-radius: 5px; padding: 1px 6px; margin-bottom: 2px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.ev.holiday { background: var(--bad-bg); color: var(--bad); }
.ev.project { background: var(--info-bg); color: var(--info); }
.ev.mine { background: var(--accent); color: var(--accent-ink); }
.ev.bday { background: var(--good-bg); color: var(--good); }
.ev.leave { background: var(--warn-bg); color: var(--warn); }
.avail td.cell { text-align: center; font-size: 11px; padding: 6px 4px; min-width: 44px; }
.avail .free { color: var(--good); } .avail .busy { background: var(--info-bg); color: var(--info); } .avail .leave { background: var(--warn-bg); color: var(--warn); } .avail .conflict { background: var(--bad-bg); color: var(--bad); font-weight: 700; } .avail .off { color: var(--dim); }

/* Attendance capture */
.capture { max-width: 520px; }
.camera { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4; border: 1px solid var(--line); }
.camera video, .camera img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera img { transform: none; }
.gps { font-size: 12px; color: var(--muted); }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-pick label { margin: 0; }
.mode-pick input { display: none; }
.mode-pick span { display: block; text-align: center; padding: 14px; border: 1px solid var(--line-2); border-radius: 10px; font-weight: 600; color: var(--text); font-size: 14px; cursor: pointer; }
.mode-pick input:checked + span { border-color: var(--accent); background: rgba(166,207,67,.1); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 85% 110%, rgba(132, 204, 22, .14) 0%, transparent 60%), radial-gradient(700px 400px at 10% -10%, rgba(166, 207, 67, .06) 0%, transparent 60%), var(--bg); }
.login { width: 100%; max-width: 380px; }
.login .brand { padding: 0 0 22px; align-items: flex-start; }
.login .brand b { font-size: 20px; }
.login .brand img { width: 220px; max-height: none; }

.notif { padding: 12px 0; border-bottom: 1px solid var(--line); }
.notif.unread b { color: var(--accent); }
.selfie-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-2); }

@media (max-width: 980px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 20; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px #000; }
  .menu-btn { display: inline-block; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 60px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .cal .day { min-height: 64px; font-size: 10px; }
  .cal .ev { font-size: 9.5px; padding: 0 3px; }
}

/* Print (invoices, payslips, reports) */
.doc { background: #fff; color: #111; max-width: 860px; margin: 0 auto; padding: 36px; border-radius: 6px; font-size: 13px; }
.doc table { color: #111; }
.doc th { background: #f1f1f1; color: #333; }
.doc th, .doc td { border-bottom: 1px solid #ddd; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 14px; margin-bottom: 16px; }
.doc .doc-head img { max-height: 54px; max-width: 200px; }
.doc h1 { font-size: 20px; color: #111; }
.doc .muted { color: #555; }
.doc .totals td { border: 0; padding: 4px 12px; }
@media print {
  .side, .topbar, .no-print { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; }
  html, body { background: #fff; }
  .doc { padding: 0; max-width: none; }
}
