:root {
  --bg: #FAFAF7; --bg-elev: #FFFFFF; --bg-side: #161B26; --bg-side-2: #1F2533;
  --ink: #1A1A1A; --ink-2: #4A4A4A; --ink-3: #8A8A85;
  --ink-side: #E8E6E0; --ink-side-2: #8E94A4;
  --line: #E8E5DD; --line-2: #D8D4C9;
  --accent: #0E5B5B; --accent-2: #0A4A4A; --accent-soft: #E1EEEC;
  --warn: #B84B2C; --warn-soft: #FAEAE2;
  --gold: #A8800F; --gold-soft: #F5EBC8;
  --green: #2E6B45; --green-soft: #DFEDE1;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'IBM Plex Sans', sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.mono { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* Login */
.login {
  height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #161B26 0%, #0E5B5B 100%);
}
.login-card { background: var(--bg-elev); border-radius: 14px; padding: 32px 36px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-card h1 { font-family: 'IBM Plex Serif', serif; font-style: italic; font-size: 26px; margin-bottom: 4px; }
.login-card .sub { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; font-family: 'IBM Plex Mono', monospace; margin-bottom: 24px; }
.login-card label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-family: 'IBM Plex Mono', monospace; display: block; margin-bottom: 4px; margin-top: 14px; }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; font-size: 13px; outline: 0; }
.login-card input:focus { border-color: var(--accent); }
.login-card button { width: 100%; margin-top: 22px; padding: 11px; background: var(--ink); color: #fff; border: 0; border-radius: 7px; font-size: 13px; font-weight: 500; }
.login-card button:hover { background: var(--accent); }
.login-err { color: var(--warn); font-size: 12px; margin-top: 10px; min-height: 18px; }
.login-hint { margin-top: 16px; padding: 10px 12px; background: var(--bg); border-radius: 6px; font-size: 11px; color: var(--ink-3); font-family: 'IBM Plex Mono', monospace; line-height: 1.6; }

/* Layout shell */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.side { background: var(--bg-side); color: var(--ink-side); display: flex; flex-direction: column; }
.side-head { padding: 18px 18px 14px; border-bottom: 1px solid #000; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'IBM Plex Serif', serif; font-style: italic; font-size: 20px; color: #fff; }
.brand-mark { width: 30px; height: 30px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 14px; font-style: normal; color: #fff; }
.brand-sub { color: var(--ink-side-2); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 6px; font-family: 'IBM Plex Mono', monospace; }
.company-switch { margin: 14px 12px 4px; background: var(--bg-side-2); border-radius: 8px; padding: 10px 12px; cursor: pointer; position: relative; }
.company-switch .label { font-size: 10px; color: var(--ink-side-2); text-transform: uppercase; letter-spacing: 0.1em; font-family: 'IBM Plex Mono', monospace; }
.company-switch .name { font-weight: 600; font-size: 14px; color: #fff; margin-top: 2px; display: flex; align-items: center; justify-content: space-between; }
.dd { position: absolute; top: calc(100% + 4px); left: 12px; right: 12px; background: var(--bg-side-2); border: 1px solid #000; border-radius: 8px; padding: 4px; z-index: 20; display: none; }
.dd.show { display: block; }
.dd a { display: block; padding: 8px 10px; color: var(--ink-side); border-radius: 6px; cursor: pointer; font-size: 13px; }
.dd a:hover { background: var(--accent); color: #fff; }
.dd a.active { color: #fff; background: rgba(14,91,91,0.5); }
.nav { padding: 10px 8px; flex: 1; }
.nav-section { font-size: 10px; color: var(--ink-side-2); text-transform: uppercase; letter-spacing: 0.12em; padding: 14px 12px 6px; font-family: 'IBM Plex Mono', monospace; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; color: var(--ink-side); border-radius: 6px; cursor: pointer; font-size: 14px; user-select: none; }
.nav a:hover { background: var(--bg-side-2); }
.nav a.active { background: var(--accent); color: #fff; }
.nav a .badge { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-side-2); }
.nav a.active .badge { color: rgba(255,255,255,0.7); }
.side-foot { padding: 12px 16px; border-top: 1px solid #000; font-size: 11px; color: var(--ink-side-2); font-family: 'IBM Plex Mono', monospace; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-foot button { background: transparent; border: 0; color: var(--ink-side-2); font-family: inherit; cursor: pointer; padding: 4px 8px; border-radius: 4px; font-size: 11px; }
.side-foot button:hover { background: var(--bg-side-2); color: #fff; }

/* Main */
.main { overflow: auto; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--bg-elev); position: sticky; top: 0; z-index: 5; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.crumbs .sep { color: var(--ink-3); }
.crumbs .cur { color: var(--ink); font-weight: 500; }
.crumbs a { cursor: pointer; }
.crumbs a:hover { color: var(--accent); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--bg); border-radius: 7px; font-size: 12px; color: var(--ink-2); }
.user-chip .role { font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.user-chip .role.foreman { background: var(--gold-soft); color: var(--gold); }
.user-chip .role.super_admin { background: #1A1F2C; color: #F0BD30; }
.bell { position: relative; padding: 6px 10px; border-radius: 7px; cursor: pointer; border: 1px solid var(--line); background: var(--bg-elev); display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.bell:hover { border-color: var(--ink-3); }
.bell .count { background: var(--warn); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 999px; font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.bell.empty .count { background: var(--ink-3); }

.content { padding: 28px; width: 100%; box-sizing: border-box; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; gap: 24px; flex-wrap: wrap; }
.page-title { font-size: 28px; font-weight: 600; letter-spacing: -0.015em; }
.page-title .sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; font-family: 'IBM Plex Mono', monospace; margin-bottom: 6px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg-elev); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .12s; }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-warn { color: var(--warn); border-color: transparent; background: transparent; }
.btn-warn:hover { background: var(--warn-soft); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; position: relative; }
.stat .l { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; font-family: 'IBM Plex Mono', monospace; }
.stat .v { font-size: 24px; font-weight: 600; margin-top: 6px; letter-spacing: -0.01em; font-family: 'IBM Plex Mono', monospace; }
.stat .v small { font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 4px; }
.stat .admin-only { position: absolute; bottom: 6px; right: 10px; font-size: 9px; color: var(--accent); font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.08em; text-transform: uppercase; }

.alerts { display: grid; gap: 8px; margin-bottom: 18px; }
.alert { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-elev); font-size: 13px; }
.alert .ico { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.alert.warn { border-left: 3px solid var(--warn); }
.alert.warn .ico { background: var(--warn-soft); color: var(--warn); }
.alert.gold { border-left: 3px solid var(--gold); }
.alert.gold .ico { background: var(--gold-soft); color: var(--gold); }
.alert .body { flex: 1; line-height: 1.45; }
.alert .body strong { font-weight: 600; }
.alert .body small { display: block; color: var(--ink-3); font-size: 11px; margin-top: 2px; font-family: 'IBM Plex Mono', monospace; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.search { flex: 1; max-width: 380px; display: flex; align-items: center; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 7px; padding: 0 10px 0 12px; }
.search input { flex: 1; border: 0; outline: 0; padding: 9px 0; font-size: 13px; background: transparent; }
.chip { padding: 6px 10px; border: 1px solid var(--line); background: var(--bg-elev); border-radius: 999px; font-size: 12px; cursor: pointer; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .sub { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; font-family: 'IBM Plex Mono', monospace; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 600; text-align: left; padding: 12px 18px; background: #FCFBF7; border-bottom: 1px solid var(--line); font-family: 'IBM Plex Mono', monospace; }
td { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.row-link { cursor: pointer; }
tr.row-link:hover { background: #FCFBF6; }
td.num { font-family: 'IBM Plex Mono', monospace; text-align: right; }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-row { display: flex; align-items: center; gap: 12px; }
.avatar-row .meta { display: flex; flex-direction: column; line-height: 1.3; }
.avatar-row .meta .name { font-weight: 500; }
.avatar-row .meta .sub { font-size: 11px; color: var(--ink-3); font-family: 'IBM Plex Mono', monospace; }

.tag { display: inline-flex; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; background: var(--bg); border: 1px solid var(--line); }
.tag.t-active { background: var(--green-soft); color: var(--green); border-color: transparent; }
.tag.t-arch { color: var(--ink-3); }
.tag.t-pos { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.t-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.t-gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.tag-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }

.detail-grid { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.profile { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.profile-head .name { font-size: 18px; font-weight: 600; margin-top: 12px; }
.profile-head .role { font-size: 11px; color: var(--ink-3); margin-top: 4px; font-family: 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: 0.08em; }
.profile-fields { padding-top: 16px; display: grid; gap: 10px; }
.field { display: grid; grid-template-columns: 100px 1fr; gap: 12px; align-items: baseline; font-size: 12px; }
.field .l { color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; font-size: 10px; font-family: 'IBM Plex Mono', monospace; }

/* Timesheet two-column layout */
.ts-body { display: flex; gap: 20px; align-items: flex-start; }
.ts-main { flex: 1; min-width: 0; }
.ts-sidebar { width: 320px; flex-shrink: 0; position: sticky; top: 16px; }

/* Timesheet table */
.ts-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ts-table th { padding: 9px 12px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); background: #FCFBF7; font-weight: 600; font-family: 'IBM Plex Mono', monospace; border-bottom: 2px solid var(--line); text-align: left; white-space: nowrap; }
.ts-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ts-table tbody tr:last-child td { border-bottom: 0; }
.ts-table tbody tr:hover td { background: var(--bg); }
.ts-table tfoot td { padding: 8px 12px; background: var(--bg); font-size: 12px; border-top: 2px solid var(--line); }
.ts-table .num { font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
.ts-table .muted { color: var(--ink-3); }
.ts-table .check { width: 16px; height: 16px; cursor: pointer; }
.shift-confirmed td { background: transparent; }
.shift-pending td { background: #FEFDF7; }
.shift-note { display: block; font-size: 11px; color: var(--ink-3); font-style: italic; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

.badge-sm { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
.badge-sm.plus { background: var(--green-soft); color: var(--green); }
.badge-sm.minus { background: var(--warn-soft); color: var(--warn); }

.icon-btn { width: 26px; height: 26px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 4px; display: inline-grid; place-items: center; font-size: 14px; }
.icon-btn:hover { background: var(--bg); color: var(--warn); }
.adj-row .dt { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-3); }
.adj-row .scope { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--ink-3); text-transform: uppercase; }

.linen { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: linear-gradient(135deg, #FAEAE2 0%, #F5EBC8 100%); border: 1px solid var(--line); border-radius: 10px; margin: 18px 0; }
.linen .label { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.08em; font-family: 'IBM Plex Mono', monospace; }
.linen .count { font-size: 28px; font-weight: 600; font-family: 'IBM Plex Mono', monospace; min-width: 50px; text-align: center; }
.linen .price { font-size: 11px; color: var(--ink-3); font-family: 'IBM Plex Mono', monospace; }
.linen .ctrl { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.linen .ctrl button { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 16px; font-weight: 600; }
.linen .total { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--ink-2); padding: 0 8px; }

.calc { background: linear-gradient(180deg, var(--bg-elev) 0%, #F4F2EC 100%); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.calc h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; display: flex; justify-content: space-between; }
.calc-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.calc-line .v { font-family: 'IBM Plex Mono', monospace; }
.calc-line.minus .v { color: var(--warn); }
.calc-line.plus .v { color: var(--green); }
.calc-divider { height: 1px; background: var(--line); margin: 8px 0; }
.calc-total { display: flex; justify-content: space-between; padding: 12px 0; }
.calc-total .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-family: 'IBM Plex Mono', monospace; }
.calc-total .v { font-size: 26px; font-weight: 600; font-family: 'IBM Plex Mono', monospace; }
.calc-formula { margin-top: 14px; padding: 10px 12px; background: var(--bg); border-radius: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-2); border: 1px dashed var(--line-2); }
.calc-admin { margin-top: 14px; padding: 12px; border-radius: 8px; background: #1A1F2C; color: #E8E6E0; border: 1px solid #000; }
.calc-admin .head { font-size: 10px; color: #8E94A4; text-transform: uppercase; letter-spacing: 0.1em; font-family: 'IBM Plex Mono', monospace; margin-bottom: 8px; }
.calc-admin .calc-line { color: #B5BAC9; }
.calc-admin .calc-line .v { color: #fff; }
.calc-admin .calc-line.profit .v { color: #6FE5A4; font-size: 16px; font-weight: 600; }

.row-flex { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.col-grow { flex: 1; min-width: 560px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20,20,20,0.45); display: none; place-items: center; z-index: 50; backdrop-filter: blur(2px); }
.modal-bg.show { display: grid; }
.modal { background: var(--bg-elev); border-radius: 12px; width: 540px; max-width: 92vw; max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.18); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-head .sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-family: 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: 0.08em; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #FCFBF7; }
.form-row { display: grid; gap: 5px; margin-bottom: 14px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-family: 'IBM Plex Mono', monospace; }
.form-row input, .form-row select, .form-row textarea { border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; font-size: 13px; outline: 0; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--accent); }
.form-row textarea { resize: vertical; min-height: 70px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--bg-elev); padding: 8px 14px; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.seg button.active { background: var(--ink); color: #fff; }
.seg button.bonus.active { background: var(--green); color: #fff; }
.seg button.penalty.active { background: var(--warn); color: #fff; }

/* Toast */
.toast { position: fixed; bottom: 20px; right: 20px; padding: 12px 18px; background: var(--ink); color: #fff; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 100; transform: translateY(100px); opacity: 0; transition: all .25s; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error { background: var(--warn); }

/* Log rows */
.log-row { display: grid; grid-template-columns: 130px 90px 1fr; gap: 14px; padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.log-row .ts { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-3); }
.log-row .who { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: var(--bg); display: inline-block; text-align: center; font-family: 'IBM Plex Mono', monospace; }
.log-row .who.admin { background: var(--accent-soft); color: var(--accent); }
.log-row .who.foreman { background: var(--gold-soft); color: var(--gold); }
.log-row .who.system { background: var(--bg); color: var(--ink-3); }
.log-row .who.super_admin { background: #1A1F2C; color: #F0BD30; }

/* Bar chart */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.bar-chart { padding: 18px; }
.bar-chart .row { display: grid; grid-template-columns: 160px 1fr 100px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13px; }
.bar-chart .track { height: 14px; background: var(--bg); border-radius: 4px; }
.bar-chart .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.bar-chart .v { font-family: 'IBM Plex Mono', monospace; text-align: right; }

@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .content { padding: 18px; }
}

/* ============ LANDING PAGE ============ */
.landing { min-height: 100vh; background: #FAFAF7; color: var(--ink); font-family: 'IBM Plex Sans', sans-serif; }
.landing-head { background: var(--bg-side); color: #fff; padding: 18px 0; }
.landing-head-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.landing-head .brand { font-size: 18px; font-family: 'IBM Plex Serif', serif; font-style: italic; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.landing-head .brand-mark { background: var(--accent); color: #fff; padding: 4px 8px; border-radius: 4px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; font-style: normal; }
.landing-login { color: #fff; text-decoration: none; opacity: .8; font-size: 13px; padding: 8px 16px; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; transition: all .2s; }
.landing-login:hover { opacity: 1; background: rgba(255,255,255,.08); }

.landing-hero { max-width: 1100px; margin: 0 auto; padding: 80px 24px 60px; text-align: center; }
.landing-hero h1 { font-size: 44px; font-family: 'IBM Plex Serif', serif; font-style: italic; font-weight: 500; line-height: 1.15; margin-bottom: 16px; }
.landing-hero p { font-size: 17px; color: var(--ink-2); max-width: 640px; margin: 0 auto; line-height: 1.6; }

.landing-section { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }
.landing-section h2 { font-size: 26px; font-family: 'IBM Plex Serif', serif; font-style: italic; font-weight: 500; margin-bottom: 24px; }

.landing-ads { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.ad-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; transition: all .2s; }
.ad-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.ad-img { height: 180px; background: var(--bg) center/cover; }
.ad-img.placeholder { display: grid; place-items: center; font-size: 40px; opacity: .3; }
.ad-body { padding: 18px 20px; }
.ad-body h3 { font-size: 16px; margin-bottom: 6px; font-weight: 600; }
.ad-body p { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

.landing-form-section { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 40px; max-width: none; padding: 50px 24px; }
.landing-form-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; align-items: start; }
.landing-form { display: flex; flex-direction: column; gap: 14px; }
.landing-form label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-family: 'IBM Plex Mono', monospace; display: flex; flex-direction: column; gap: 6px; }
.landing-form input, .landing-form textarea { font-family: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-transform: none; letter-spacing: 0; }
.landing-form input:focus, .landing-form textarea:focus { outline: 0; border-color: var(--accent); }
.landing-form textarea { resize: vertical; min-height: 80px; }
.landing-form .consent { flex-direction: row; align-items: flex-start; gap: 8px; font-size: 12px; text-transform: none; letter-spacing: 0; font-family: inherit; color: var(--ink-2); line-height: 1.5; }
.landing-form .consent input { width: auto; margin-top: 2px; }
.landing-form button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 6px; }
.landing-form button:hover { opacity: .9; }
.form-status { font-size: 13px; padding: 10px 12px; border-radius: 6px; display: none; }
.form-status.ok { background: #E8F5F0; color: #0A5C3A; display: block; }
.form-status.err { background: var(--warn-soft); color: var(--warn); display: block; }

.landing-foot { max-width: 1100px; margin: 0 auto; padding: 30px 24px; display: flex; justify-content: space-between; align-items: center; color: var(--ink-3); font-size: 12px; font-family: 'IBM Plex Mono', monospace; }
.landing-foot a { color: var(--ink-3); text-decoration: none; opacity: .7; }
.landing-foot a:hover { opacity: 1; color: var(--accent); }

@media (max-width: 760px) {
  .landing-hero h1 { font-size: 32px; }
  .landing-hero { padding: 50px 24px 40px; }
  .landing-form-grid { grid-template-columns: 1fr; gap: 30px; }
}

/* ============ COLLAPSIBLE SIDEBAR ============ */
.sidebar-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
  font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.app.sidebar-collapsed .sidebar-toggle::after { content: " ▶"; font-size: 9px; opacity: .6; }
.nav a { gap: 11px; }
.nav-ico { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; display: inline-block; }
.nav-label { flex: 1; }
.brand-text { transition: opacity .15s; }

.app.sidebar-collapsed { grid-template-columns: 60px 1fr; }
.app.sidebar-collapsed .side .nav-label { display: none; }
.app.sidebar-collapsed .side .nav-section { display: none; }
.app.sidebar-collapsed .side .company-switch { padding: 6px; }
.app.sidebar-collapsed .side .company-switch .label,
.app.sidebar-collapsed .side .company-switch .name { display: none; }
.app.sidebar-collapsed .side .company-switch::before { content: "🏢"; display: block; text-align: center; font-size: 16px; padding: 6px 0; }
.app.sidebar-collapsed .side .company-switch .dd { left: 4px; right: 4px; min-width: 200px; }
.app.sidebar-collapsed .side-head .brand-text,
.app.sidebar-collapsed .side-head .brand-sub { display: none; }
.app.sidebar-collapsed .side-head { padding: 14px 8px; text-align: center; }
.app.sidebar-collapsed .side-head .brand { justify-content: center; }
.app.sidebar-collapsed .nav { padding: 6px 4px; }
.app.sidebar-collapsed .nav a { padding: 11px 6px; justify-content: center; }
.app.sidebar-collapsed .side-foot { padding: 10px 6px; flex-direction: column; gap: 6px; font-size: 9px; }
.app.sidebar-collapsed .side-foot span { display: none; }

/* ============ BRIGADE TIMESHEET (clean grid) ============ */
.brigade-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg-elev);
  position: relative;
}
.brigade-tbl {
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 12px;
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}
.brigade-tbl th,
.brigade-tbl td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0;
  margin: 0;
  text-align: center;
  vertical-align: middle;
  height: 42px;
  box-sizing: border-box;
}
.brigade-tbl tr:last-child td { border-bottom: 0; }
.brigade-tbl th:last-child,
.brigade-tbl td:last-child { border-right: 0; }

/* Header */
.brigade-tbl thead th {
  background: #F2EFE6;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-2);
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  white-space: nowrap;
  border-bottom: 2px solid var(--line-2);
  padding: 6px 4px;
  height: 44px;
  position: sticky;
  top: 0;
  z-index: 4;
}
.brigade-tbl thead th .dn {
  font-size: 9px;
  font-weight: 500;
  opacity: .55;
  display: block;
  margin-top: 2px;
}
.brigade-tbl thead th.weekend { color: var(--warn); background: #EFE5DC; }

/* Employee column (sticky left) */
.brigade-tbl .emp-col {
  text-align: left;
  padding: 8px 14px;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  position: sticky;
  left: 0;
  background: var(--bg-elev);
  z-index: 2;
  border-right: 2px solid var(--line-2) !important;
}
.brigade-tbl thead .emp-col { background: #F2EFE6; z-index: 5; }
.brigade-tbl tfoot .emp-col { background: var(--bg); }
.brigade-tbl .emp-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brigade-tbl .emp-info .avatar { width: 26px; height: 26px; font-size: 11px; flex-shrink: 0; }
.brigade-tbl .emp-info > div { min-width: 0; flex: 1; }
.brigade-tbl .emp-name {
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brigade-tbl .emp-pos {
  font-size: 10px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brigade-tbl tr:hover .emp-col[data-nav-emp] {
  color: var(--accent);
  cursor: pointer;
  background: var(--accent-soft);
}

/* Day cells: fixed width, fixed height */
.brigade-tbl .day-col {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
}
.brigade-tbl .day-cell {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
  position: relative;
  transition: background-color .1s, box-shadow .1s;
}
.brigade-tbl .day-cell.weekend { background: #FAF8F2; }
.brigade-tbl .day-cell.confirmed { background: #D4EFE3; color: #0A5C3A; font-weight: 600; }
.brigade-tbl .day-cell.pending { background: #FEF3DA; color: #8C5E00; font-weight: 600; }

/* CROSSHAIR HOVER */
/* Column highlight (via JS .col-hi class) */
.brigade-tbl .col-hi {
  background-color: #FFF6D6 !important;
}
.brigade-tbl thead .col-hi {
  background-color: #F5DC8A !important;
  color: var(--ink) !important;
}
.brigade-tbl tfoot .col-hi {
  background-color: #F5DC8A !important;
}

/* Row highlight */
.brigade-tbl tbody tr:hover .day-cell,
.brigade-tbl tbody tr:hover .sum-cell,
.brigade-tbl tbody tr:hover .emp-col {
  background-color: #FFF6D6 !important;
}

/* Direct cell hover — sharp outline */
.brigade-tbl .day-cell:hover,
.brigade-tbl .sum-cell.editable:hover {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background-color: var(--accent-soft) !important;
  color: var(--accent) !important;
  z-index: 2;
}

/* Summary columns */
.brigade-tbl .sum-col {
  width: 80px;
  min-width: 80px;
  padding: 6px 8px;
}
.brigade-tbl .sum-cell {
  font-family: 'IBM Plex Mono', monospace;
  padding: 6px 10px;
  white-space: nowrap;
  background: #FCFBF7;
}
.brigade-tbl .sum-cell.num { text-align: right; font-variant-numeric: tabular-nums; }
.brigade-tbl .sum-cell.minus { color: var(--warn); }
.brigade-tbl .sum-cell.plus { color: var(--green); }

/* Total column */
.brigade-tbl .total-col {
  background: #ECF7EF !important;
  border-left: 2px solid var(--line-2);
  font-weight: 600;
}
.brigade-tbl .total-col strong { color: var(--accent); font-size: 13px; }
.brigade-tbl tbody tr:hover .total-col { background: #DAF1E0 !important; }

/* Footer (totals) */
.brigade-tbl tfoot td {
  background: #F2EFE6;
  border-top: 2px solid var(--line-2);
  font-weight: 600;
  padding: 8px 8px;
  height: 40px;
  position: sticky;
  bottom: 0;
  z-index: 3;
}
.brigade-tbl tfoot .day-foot {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-3);
  width: 38px;
  min-width: 38px;
}
.brigade-tbl tfoot .day-foot.has-hours { color: var(--accent); font-weight: 700; }
.brigade-tbl tfoot .emp-col {
  z-index: 6;
  background: #F2EFE6;
}

/* tag inside summary */
.brigade-tbl .sum-cell .tag { font-size: 10px; padding: 2px 6px; }

/* Editable summary cells */
.brigade-tbl .sum-cell.editable {
  cursor: pointer;
  position: relative;
  transition: background-color .12s, color .12s;
}
.brigade-tbl .sum-cell.editable:hover {
  background: var(--accent-soft) !important;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  z-index: 1;
}
.brigade-tbl .sum-cell.editable::after {
  content: " ✎";
  font-size: 9px;
  opacity: 0;
  margin-left: 4px;
  transition: opacity .12s;
}
.brigade-tbl .sum-cell.editable:hover::after {
  opacity: .6;
}

/* ============ ADS CAROUSEL ============ */
.ads-carousel {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
}
.ads-track {
  display: flex;
  gap: 18px;
  animation: ads-marquee var(--marquee-duration, 30s) linear infinite;
  width: max-content;
}
.ads-track .ad-card {
  width: 320px;
  flex-shrink: 0;
}
.ads-carousel:hover .ads-track { animation-play-state: paused; }
@keyframes ads-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 9px)); }
}
@media (max-width: 760px) {
  .ads-track .ad-card { width: 280px; }
}
