/* Lancaster Technology and Development (LTDC) design language:
   maroon + gold, Big Shoulders Display headings, DM Sans text, pill buttons. */

@font-face { font-family: 'DM Sans'; src: url('../fonts/DMSans-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('../fonts/DMSans-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('../fonts/DMSans-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Big Shoulders Display'; src: url('../fonts/BigShouldersDisplay-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Big Shoulders Display'; src: url('../fonts/BigShouldersDisplay-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  --maroon: #5d0013;
  --maroon-dark: #3d000c;
  --maroon-soft: #f8eef0;
  --gold: #c28618;
  --gold-bright: #cc9934;
  --gold-light: #e1c26b;
  --gold-soft: #faf3e3;
  --bg: #f6f4f3;
  --card: #ffffff;
  --text: #333333;
  --muted: #6d6766;
  --border: #e6e1df;
  --success: #2f7a3e;
  --success-soft: #e5f3e8;
  --info: #1f4e8c;
  --info-soft: #e3ecf8;
  --danger: #b3261e;
  --radius: 12px;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--gold); }
h1 { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1.05; color: var(--maroon); margin: 4px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; letter-spacing: 0.01em; }
h1 .badge { font-family: 'DM Sans', sans-serif; letter-spacing: 0; }
h2 { font-family: var(--display); font-weight: 700; font-size: 19px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--maroon); margin: 0 0 16px; }
h3 { font-family: var(--display); font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--maroon); margin: 22px 0 10px; }
code { background: var(--maroon-soft); color: var(--maroon); padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px; color: #f3e6e8;
  background: linear-gradient(180deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  display: flex; flex-direction: column;
}
.brand { padding: 4px 8px 6px; }
.brand img { display: block; width: 100%; max-width: 190px; height: auto; }
.brand-sub { display: flex; align-items: center; gap: 8px; margin: 14px 8px 22px; padding-top: 14px; border-top: 1px solid rgba(225, 194, 107, 0.35); }
.brand-sub strong { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-light); }
.brand-sub small { display: block; font-size: 11px; color: rgba(255, 255, 255, 0.6); }
#nav a { display: block; padding: 10px 16px; border-radius: 999px; color: #f3e6e8; margin-bottom: 4px; font-weight: 500; }
#nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
#nav a.active { background: var(--gold-bright); color: var(--maroon-dark); font-weight: 700; }
main { flex: 1; min-width: 0; padding: 30px 36px 60px; max-width: 1400px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.back { font-size: 13px; font-weight: 500; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions.end { justify-content: flex-end; }
.actions.center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.cols.wide-left { grid-template-columns: 2fr 1fr; }
.clock-cols { grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card.empty, .empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h2 { color: var(--maroon); }
.scroll-x { overflow-x: auto; padding: 0; }

/* Buttons: pill shaped, maroon outline by default */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--maroon); background: #fff; color: var(--maroon);
  font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--maroon-soft); color: var(--maroon); }
.btn.primary { background: var(--maroon); color: #fff; }
.btn.primary:hover { background: var(--maroon-dark); border-color: var(--maroon-dark); color: #fff; }
.btn.gold { background: var(--gold-bright); border-color: var(--gold-bright); color: var(--maroon-dark); }
.btn.gold:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger.ghost { background: #fff; color: var(--danger); border-color: #e7b7b3; }
.btn.danger.ghost:hover { background: #fdf0ef; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.big { padding: 14px 28px; font-size: 16px; flex: 1; justify-content: center; }
.link { background: none; border: 0; color: var(--maroon); cursor: pointer; font: inherit; font-weight: 500; padding: 0 4px; }
.link:hover { color: var(--gold); }
.link.danger { color: var(--danger); }
.icon-btn { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }

/* Forms */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 500; font-size: 13px; }
.field em { color: var(--danger); font-style: normal; margin-left: 2px; }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea { font: inherit; padding: 9px 12px; border: 1px solid #d6cfcc; border-radius: 8px; background: #fff; color: var(--text); width: 100%; }
input[type='checkbox'] { width: auto; accent-color: var(--maroon); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(204, 153, 52, 0.25); border-color: var(--gold); }
.days, .checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks { flex-direction: column; gap: 8px; }
.days label, .checks label { display: flex; align-items: center; gap: 6px; }
.form-error { color: var(--danger); background: #fdf0ef; border: 1px solid #f0c6c2; padding: 10px 12px; border-radius: 8px; margin: 0; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input[type='search'] { max-width: 320px; }
.toolbar select, .toolbar input[type='date'] { width: auto; }
label.inline { display: flex; align-items: center; gap: 6px; color: var(--muted); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--maroon); font-weight: 700; padding: 10px; border-bottom: 2px solid var(--gold-light); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid #efebe9; vertical-align: middle; }
.table td small { display: block; color: var(--muted); font-size: 12px; }
.table td.num small { display: inline; }
.table.compact td { padding: 8px 10px; }
.table.clickable tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--gold-soft); }
.table tfoot td { border-top: 2px solid var(--maroon); border-bottom: 0; background: var(--maroon-soft); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.warn { color: var(--gold); font-weight: 700; }
.row-actions { white-space: nowrap; text-align: right; }
.notes { color: var(--muted); max-width: 200px; }
.register { font-size: 13px; }
.register th, .register td { padding: 10px 8px; }
.register td:first-child { white-space: nowrap; }
.scroll-x .table th { background: #fff; }

.person { display: flex; align-items: center; gap: 10px; }
.person strong { display: block; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--maroon); color: var(--gold-light); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.person.big .avatar { width: 60px; height: 60px; font-size: 21px; border: 3px solid var(--gold-light); }
.person.big p { margin: 2px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #efebe9; color: #4f4846; white-space: nowrap; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.amber { background: var(--gold-soft); color: #8a5d0c; border: 1px solid var(--gold-light); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.gray { background: #efebe9; color: #6d6766; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0; }
.info dt { font-size: 11px; color: var(--muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.05em; }
.info dd { margin: 0; font-weight: 500; word-break: break-word; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 9px 0; border-bottom: 1px solid #efebe9; }
.danger-zone { margin-top: 28px; display: flex; gap: 12px; align-items: center; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats .card { padding: 16px 20px; color: var(--text); border-top: 4px solid var(--gold-bright); }
.stats a.card:hover { border-color: var(--gold); color: var(--text); }
.stats small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.stats strong { font-family: var(--display); font-weight: 800; font-size: 32px; color: var(--maroon); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats .card.accent { background: linear-gradient(135deg, var(--maroon), var(--maroon-dark)); border-color: var(--maroon); border-top-color: var(--gold-bright); }
.stats .card.accent small { color: var(--gold-light); }
.stats .card.accent strong { color: #fff; }
.stats .card.wide-figure { grid-column: span 2; }
.stats strong { overflow-wrap: anywhere; }
.stats.small { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); background: var(--gold-soft); border: 1px solid #f0e2bf; border-radius: 10px; padding: 12px 18px; }
.stats.small strong { font-size: 22px; }

.notice { background: var(--gold-soft); border: 1px solid var(--gold-light); border-left: 5px solid var(--gold-bright); border-radius: 10px; padding: 4px 16px; margin-bottom: 16px; color: #5a3d07; }
.notice p { margin: 10px 0; }

.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 120px 1fr 28px; gap: 10px; align-items: center; padding: 7px 0; }
.bars span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { background: #efebe9; border-radius: 999px; height: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--maroon), var(--gold-bright)); border-radius: 999px; }
.bars b { text-align: right; color: var(--maroon); }
.latest-run { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.latest-run:hover { color: var(--text); }
.latest-run strong { font-family: var(--display); font-weight: 800; font-size: 34px; color: var(--maroon); }

.welcome { padding: 64px 20px; }
.welcome h2 { font-size: 40px; font-weight: 800; text-transform: none; letter-spacing: 0.01em; margin-bottom: 8px; }
.welcome h2 span { color: var(--gold); }
.welcome p { font-style: italic; font-size: 16px; }

/* Time clock */
.clock-card { text-align: center; display: flex; flex-direction: column; gap: 16px; border-top: 4px solid var(--gold-bright); }
.clock-time { font-family: var(--display); font-weight: 800; font-size: 72px; line-height: 1; color: var(--maroon); font-variant-numeric: tabular-nums; }
.clock-date { color: var(--muted); margin-top: -6px; font-style: italic; }
.clock-card .field { text-align: left; }
.clock-status { min-height: 20px; color: var(--muted); }
.clock-buttons { display: flex; gap: 12px; }

/* Modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(61, 0, 12, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 24px 60px rgba(61, 0, 12, 0.3); overflow: hidden; }
.modal.wide { max-width: 760px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 3px solid var(--gold-bright); }
.modal header h2 { margin: 0; }
.modal-body { padding: 22px; }
.modal .form-error { margin: 0 22px 12px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: #fbfaf9; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--maroon); color: #fff; padding: 12px 20px; border-radius: 999px; border: 1px solid var(--gold-light); opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 100; font-weight: 500; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); border-color: var(--danger); }

/* Payslip */
.payslips { display: flex; flex-direction: column; gap: 24px; }
.payslip { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; max-width: 840px; }
.payslip header { display: flex; justify-content: space-between; border-bottom: 3px solid var(--maroon); padding-bottom: 16px; margin-bottom: 18px; gap: 16px; }
.payslip header img { height: 44px; width: auto; display: block; margin-bottom: 8px; }
.payslip header h2 { margin: 0 0 4px; font-size: 18px; }
.payslip header h3 { margin: 0 0 4px; font-size: 28px; font-weight: 800; color: var(--gold); letter-spacing: 0.12em; }
.payslip header p { margin: 0; color: var(--muted); font-size: 13px; }
.payslip header .right { text-align: right; }
.draft-mark { color: var(--gold) !important; font-weight: 700; }
.slip-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; margin: 0 0 20px; }
.slip-info dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.slip-info dd { margin: 0; font-weight: 700; }
.slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.slip-cols table { width: 100%; border-collapse: collapse; }
.slip-cols th { text-align: left; font-family: var(--display); font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--maroon); border-bottom: 2px solid var(--gold-light); padding: 6px 0; }
.slip-cols td { padding: 7px 0; border-bottom: 1px dashed #ece7e5; }
.slip-cols tr.sub td { color: var(--muted); font-size: 13px; padding-left: 12px; }
.slip-cols tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--border); }
.net { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, var(--maroon), var(--maroon-dark)); border-radius: 10px; padding: 14px 22px; margin: 20px 0 10px; }
.net span { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0.1em; color: var(--gold-light); }
.net strong { font-family: var(--display); font-weight: 800; font-size: 32px; color: #fff; }
.slip-foot { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* App vs. sign-in screens */
body.booting .layout, body.booting #auth { visibility: hidden; }
body.auth-mode .layout { display: none; }
body:not(.auth-mode) #auth { display: none; }

/* Sidebar: section heading and signed-in user */
.nav-heading { margin: 18px 16px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-light); opacity: 0.85; }
.user-box { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(225, 194, 107, 0.35); }
.user-id { display: flex; align-items: center; gap: 10px; }
.user-id .avatar { background: var(--gold-bright); color: var(--maroon-dark); width: 34px; height: 34px; }
.user-id strong { display: block; color: #fff; font-size: 13px; line-height: 1.2; }
.user-id small { display: block; color: rgba(255, 255, 255, 0.6); font-size: 11px; }
.user-actions { display: flex; justify-content: space-between; margin-top: 10px; }
.user-actions .link { color: var(--gold-light); font-size: 12px; padding: 0; }
.user-actions .link:hover { color: #fff; }

/* Sign-in screen */
.auth-screen { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-hero {
  background: radial-gradient(circle at 20% 20%, rgba(204, 153, 52, 0.18), transparent 45%), linear-gradient(160deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-hero::after {
  content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(225, 194, 107, 0.25); box-shadow: 0 0 0 40px rgba(225, 194, 107, 0.05), 0 0 0 90px rgba(225, 194, 107, 0.04);
}
.auth-hero img { width: 230px; height: auto; }
.auth-kicker { font-family: ui-monospace, Consolas, monospace; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-light) !important; font-style: normal !important; margin: 0 0 14px !important; }
.auth-hero h1 { font-size: 64px; color: #fff; margin: 0 0 12px; display: block; }
.auth-hero h1 span { color: var(--gold-bright); }
.auth-hero p { font-style: italic; font-size: 18px; color: rgba(255, 255, 255, 0.85); margin: 0; max-width: 440px; }
.auth-hero small { color: var(--gold-light); font-style: italic; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--gold-bright); border-radius: 14px; padding: 32px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 18px 40px rgba(61, 0, 12, 0.08); }
.auth-card h2 { font-size: 30px; font-weight: 800; text-transform: none; letter-spacing: 0.01em; margin: 0; }
.auth-card > p { margin: -6px 0 4px; }
.auth-logo { display: none; width: 180px; height: auto; margin-bottom: 4px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--muted); margin: 0; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 60px; }
.pw-wrap .link { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; }
.btn.block { width: 100%; justify-content: center; padding: 11px 18px; font-size: 15px; }
#auth > .empty { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }

/* Users & Access */
.badge.maroon { background: var(--maroon); color: var(--gold-light); }
.matrix td, .matrix th { padding: 9px 12px; }
.matrix .center { text-align: center; }
.matrix .yes { color: var(--success); font-weight: 700; font-size: 16px; }
.matrix .no { color: #c9c2c0; }
.scroll-x.flat { border: 0; }
.stack.tight { gap: 12px; margin: 0; }
.role-hint { margin: -6px 0 0; }
.you { font-weight: 400; font-size: 12px; }
.card + .card, .card.scroll-x + .card { margin-top: 16px; }

/* Leave & requests, payroll setup */
.nav-badge { float: right; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--gold-bright); color: var(--maroon-dark); font-size: 12px; font-weight: 700; text-align: center; }
#nav a.active .nav-badge { background: var(--maroon); color: var(--gold-light); }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 10px 16px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a:hover { color: var(--maroon); }
.tabs a.active { color: var(--maroon); border-bottom-color: var(--gold-bright); }
.badge.maroon-soft { background: var(--maroon-soft); color: var(--maroon); }
.btn.small-btn { padding: 4px 12px; font-size: 13px; }
.stats .card.attention { border-top-color: var(--maroon); background: var(--gold-soft); }
.toolbar.pad, .muted.pad { padding: 16px 16px 0; }
.balances th small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.center { text-align: center !important; }
.cell-btn { background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; color: var(--text); min-width: 72px; }
.cell-btn:hover { border-color: var(--gold-light); background: var(--gold-soft); }
.cell-btn strong { font-family: var(--display); font-size: 20px; color: var(--maroon); }
.cell-btn span { color: var(--muted); margin-left: 2px; }
.cell-btn small { display: block; color: var(--muted); font-size: 11px; }
.cell-btn.override { border-color: var(--gold-bright); }
.cell-btn.low strong { color: var(--danger); }
.balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.balance { border: 1px solid var(--border); border-left: 4px solid var(--gold-bright); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.balance strong { font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--maroon); line-height: 1.1; }
.balance.low { border-left-color: var(--danger); }
.balance.low strong { color: var(--danger); }
.balance-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.balance-chips div { background: var(--gold-soft); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 92px; }
.balance-chips strong { font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--maroon); line-height: 1; }
.balance-chips span { font-size: 11px; color: var(--muted); }
.request-preview { margin: -4px 0 0; }
textarea { resize: vertical; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.input-suffix { display: flex; align-items: center; border: 1px solid #d6cfcc; border-radius: 8px; background: #fff; }
.input-suffix:focus-within { outline: 3px solid rgba(204, 153, 52, 0.25); border-color: var(--gold); }
.input-suffix input { border: 0; outline: none !important; min-width: 0; }
.input-suffix em { font-style: normal; color: var(--muted); padding: 0 10px; white-space: nowrap; font-size: 13px; }
.input-suffix em.pre { padding: 0 0 0 10px; }
.edit-table td { padding: 6px; }
.tax-cols { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tax-cols h3 { margin-top: 4px; }
.try { max-width: 560px; }

/* ===== ERP shell ===== */
.erp-mark { display: block; font-family: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; font-size: 10px; letter-spacing: 0.18em; color: rgba(255, 255, 255, 0.55); margin-bottom: 2px; }
.nav-switch { display: block; margin: -8px 4px 10px; padding: 8px 12px; border: 1px dashed rgba(225, 194, 107, 0.45); border-radius: 8px; color: var(--gold-light) !important; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.nav-switch:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; font-size: 0.92em; letter-spacing: 0.02em; }
.table .mono { white-space: nowrap; }
.tag-line { margin: 6px 0 0; color: var(--gold); font-weight: 700; letter-spacing: 0.08em; font-size: 13px; }

/* ===== Launcher (Lancaster website style) ===== */
body.launcher-mode .sidebar { display: none; }
body.launcher-mode main { padding: 0; max-width: none; }
body.launcher-mode { background: #fff; }
.lc { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.lc-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px max(32px, calc((100% - 1180px) / 2)); border-bottom: 1px solid var(--border); }
.lc-header img { height: 44px; width: auto; }
.lc-user { display: flex; align-items: center; gap: 16px; }
.lc-user strong { display: block; font-size: 14px; color: var(--text); }
.lc-user small { display: block; font-size: 12px; color: var(--muted); text-align: right; }
.lc-user > div { text-align: right; }
.lc-user .link { color: var(--text); font-weight: 500; }
.lc-user .link:hover { color: var(--gold); }

.lc-hero, .lc-section { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.lc-hero { padding-top: 56px; padding-bottom: 24px; text-align: center; }
.lc-date { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.lc-hero h1 { display: block; font-size: 64px; font-weight: 800; color: var(--maroon); margin: 0; line-height: 1; }
.lc-hero h1 span { color: var(--gold); }
.lc-lead { max-width: 680px; text-wrap: balance; margin: 14px auto 0; font-style: italic; font-size: 17px; color: var(--text); }

.lc-section { padding-top: 36px; }
.lc-title { font-family: var(--display); font-weight: 800; font-size: 40px; text-transform: none; letter-spacing: 0.01em; color: #333; text-align: center; margin: 0 0 24px; }
.lc-title span { color: var(--maroon); }
.lc-title.small { font-size: 30px; margin-bottom: 18px; }

.lc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.lc-grid.soon { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lc-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px; border: 1px solid #cfc8c6; border-radius: 10px; background: #fff; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
a.lc-card:hover { border-color: var(--gold-bright); box-shadow: 0 12px 28px rgba(93, 0, 19, 0.1); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.lc-card-icon { width: 46px; height: 46px; color: var(--gold-bright); }
.lc-card-icon svg { width: 100%; height: 100%; }
.lc-card h3 { font-family: var(--display); font-weight: 800; font-size: 26px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--maroon); margin: 4px 0 0; line-height: 1.1; }
.lc-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.lc-figures { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 0 0; margin: 2px 0 0; border-top: 1px solid var(--border); }
.lc-figures li { font-size: 13px; font-weight: 500; color: var(--text); }
.lc-figures li::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-bright); margin-right: 7px; vertical-align: 2px; }
.lc-open { align-self: flex-start; margin-top: auto; padding: 8px 18px; border: 1.5px solid var(--maroon); border-radius: 999px; color: var(--maroon); font-weight: 700; }
a.lc-card:hover .lc-open { background: var(--maroon); color: #fff; }
.lc-card.locked { background: #faf9f8; }
.lc-card.locked h3, .lc-card.soon h3 { color: #8a8483; }
.lc-card.locked .lc-card-icon, .lc-card.soon .lc-card-icon { color: #b9b2b0; }
.lc-note { margin-top: auto; font-size: 13px; color: var(--muted); font-style: italic; }
.lc-card.soon { padding: 20px; gap: 8px; background: #faf9f8; border-color: var(--border); }
.lc-card.soon h3 { font-size: 21px; }
.lc-card.soon p { font-size: 13px; }
.lc-card.soon .lc-card-icon { width: 34px; height: 34px; }
.lc-pill { align-self: flex-start; margin-top: auto; padding: 3px 12px; border-radius: 999px; background: #ece8e6; color: #7a7472; font-size: 12px; font-weight: 700; }

.lc-band { margin-top: 48px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 36px max(32px, calc((100% - 1180px) / 2)); background: linear-gradient(135deg, var(--maroon), var(--maroon-dark)); color: #fff; }
.lc-band h2 { font-size: 30px; text-transform: none; letter-spacing: 0.01em; color: var(--gold-bright); margin: 0 0 6px; }
.lc-band p { margin: 0; font-style: italic; color: rgba(255, 255, 255, 0.85); }
.lc-band-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lc-band-btn { padding: 10px 22px; border-radius: 999px; background: var(--gold-bright); color: var(--maroon-dark); font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase; }
.lc-band-btn:hover { background: #fff; color: var(--maroon); text-decoration: none; }

.lc-footer { margin-top: auto; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px max(32px, calc((100% - 1180px) / 2)); background: var(--maroon-dark); color: rgba(255, 255, 255, 0.8); font-size: 13px; }
.lc-band + .lc-footer { border-top: 1px solid rgba(225, 194, 107, 0.25); }
.lc:not(:has(.lc-band)) .lc-footer { margin-top: 56px; }
.lc-footer img { height: 30px; width: auto; }
.lc-footer-tag { margin-left: auto; font-style: italic; color: var(--gold-light); }

/* ===== Asset module ===== */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 10px 0 10px 16px; border-left: 2px solid var(--gold-light); position: relative; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--gold); }
.timeline li.ev-assigned::before, .timeline li.ev-transferred::before { background: var(--maroon); border-color: var(--maroon); }
.timeline li.ev-returned::before { background: var(--success); border-color: var(--success); }
.timeline li.ev-status::before { background: var(--gold-light); }
.timeline time { color: var(--muted); font-size: 13px; }
.timeline span { display: block; color: var(--muted); font-size: 13px; }
.timeline em { display: block; font-size: 13px; color: var(--text); }
.bars.stacked li { grid-template-columns: 140px 1fr 48px; }
.bars.stacked i { background: #e7dcc9; position: relative; }
.bars.stacked i b { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--maroon), var(--gold-bright)); border-radius: 999px; }
.bars.stacked em { font-style: normal; text-align: right; color: var(--maroon); font-weight: 700; font-variant-numeric: tabular-nums; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.key-assigned { background: var(--maroon); margin-left: 0; }
.key-free { background: #e7dcc9; }
.seg { display: flex; gap: 0; border: 1px solid #d6cfcc; border-radius: 8px; overflow: hidden; width: fit-content; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-left: 1px solid #d6cfcc; cursor: pointer; font-weight: 500; }
.seg label:first-child { border-left: 0; }
.seg label:has(input:checked) { background: var(--maroon); color: #fff; }
.seg input { accent-color: var(--gold); }
.holder-card .holder-name { font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--maroon); margin: 0; }
.holder-card.held { border-top: 4px solid var(--maroon); }
.holders { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; margin-top: 16px; }
.card.holder header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.card.holder h2 { margin: 6px 0 0; text-transform: none; font-size: 22px; }
.card.holder p { margin: 2px 0 0; }
.holder-count { text-align: center; border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; }
.holder-count strong { display: block; font-family: var(--display); font-size: 26px; color: var(--maroon); line-height: 1; }
.holder-count span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.consumed { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--gold-soft); border: 1px solid #f0e2bf; font-size: 12px; }
.row-low td { background: #fffaf0; }
.num.neg { color: var(--maroon); font-weight: 700; }
.num.pos { color: var(--success); font-weight: 700; }
.unit { font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--muted); }
.asset-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.asset-card { border-top: 4px solid var(--gold-bright); }
.asset-card h2 { text-transform: none; font-size: 22px; margin: 2px 0 4px; }
.asset-card .info-grid { margin-top: 12px; }
.link:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; }
  .brand img { max-width: 160px; }
  .user-box { margin-top: 12px; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-logo { display: block; }
  #nav { display: flex; flex-wrap: wrap; gap: 4px; }
  main { padding: 20px 16px; }
  .grid, .grid.four, .cols.wide-left, .clock-cols, .slip-cols, .holders { grid-template-columns: 1fr; }
  .lc-header { flex-wrap: wrap; padding: 14px 16px; }
  .lc-header img { height: 36px; }
  .lc-user { width: 100%; justify-content: space-between; }
  .lc-user > div { text-align: left; }
  .lc-hero, .lc-section { padding-left: 16px; padding-right: 16px; }
  .lc-hero { padding-top: 32px; }
  .lc-hero h1 { font-size: 44px; }
  .lc-grid, .lc-grid.soon { grid-template-columns: 1fr; }
  .lc-band, .lc-footer { padding-left: 16px; padding-right: 16px; }
  .lc-footer-tag { margin-left: 0; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .span-2 { grid-column: auto; }
}

@media print {
  .sidebar, .no-print, #toast { display: none !important; }
  body, main { background: #fff; padding: 0; }
  .payslip { border: 0; padding: 0; max-width: none; page-break-after: always; }
  .payslip:last-child { page-break-after: auto; }
  .net, .payslip header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
