/* ── Blue Ribbon EMS — clean, light-first design ───── */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800;12..96,900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --bg:             #f4f5f8;
  --bg-elev:        #ffffff;
  --bg-card:        #ffffff;
  --bg-card-2:      #eef0f5;
  --bg-input:       #ffffff;
  --border:         #e2e5ec;
  --border-strong:  #cbd1dd;
  --text:           #0e1a3a;
  --text-secondary: #44506b;
  --text-muted:     #667189;
  --primary:        #1b3fd1;
  --primary-dark:   #142fa8;
  --primary-soft:   #e9edfc;
  --accent:         #1b3fd1;
  --accent-2:       #1b3fd1;
  --success:        #15803d;
  --success-soft:   #e7f6ec;
  --warning:        #b45309;
  --warning-soft:   #fdf3e0;
  --danger:         #c62828;
  --danger-soft:    #fdecec;
  --grad:           #1b3fd1;
  --primary-btn:    #1b3fd1;
  --gold:           #c79a2b;
  --ms-1:           #c9d4fa;
  --ms-2:           #8ea4f1;
  --ms-3:           #3d5de0;
  --radius:         12px;
  --radius-sm:      8px;
  --transition:     150ms ease;
  --shadow:         0 10px 30px rgba(15,23,42,.12);
  --shadow-sm:      0 1px 2px rgba(15,23,42,.06);
  --display:        'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --bg:             #05080f;
  --bg-elev:        #0a0f1c;
  --bg-card:        #0b1322;
  --bg-card-2:      #0d1828;
  --bg-input:       #0a1220;
  --border:         #1a2438;
  --border-strong:  #243049;
  --text:           #e7edf7;
  --text-secondary: #8b97ad;
  --text-muted:     #6f7b90;
  --primary:        #20bbf0;
  --primary-dark:   #5fd0f5;
  --primary-soft:   rgba(32,187,240,.15);
  --accent:         #2dffb7;
  --accent-2:       #20d6ff;
  --success:        #2dffb7;
  --success-soft:   rgba(45,255,183,.12);
  --warning:        #ffb547;
  --warning-soft:   rgba(255,181,71,.12);
  --danger:         #ff5a72;
  --danger-soft:    rgba(255,90,114,.12);
  --grad:           linear-gradient(95deg, #2dffb7 0%, #20d6ff 100%);
  --primary-btn:    linear-gradient(95deg, #2dffb7 0%, #20d6ff 100%);
  --shadow:         0 10px 30px rgba(0,0,0,.5);
  --shadow-sm:      none;
  --gold:           #ffcf5c;
  --ms-1:           #0f3d4d;
  --ms-2:           #137c99;
  --ms-3:           #20bbf0;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.form-control:focus-visible { outline: none; }

/* ── Layout ────────────────────────────────────────── */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ── Top navigation ────────────────────────────────── */
.sidebar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 32px; border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky; top: 0; z-index: 100;
}
.sidebar-logo { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-right: 24px; }
.sidebar-logo-img { display: block; height: 56px; width: auto; max-width: 260px; object-fit: contain; }
.login-logo-img { height: 96px; max-width: 300px; }
.brand-sub { font-size: 9px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; line-height: 1; }
.sidebar-section { display: contents; }
.sidebar-section-label { display: none; }
.sidebar-nav { display: flex; list-style: none; gap: 2px; align-items: center; }
.sidebar-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 13.5px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.sidebar-nav a:hover { background: var(--bg-card-2); color: var(--text); text-decoration: none; }
.sidebar-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar-nav svg { flex: none; }

.sidebar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-left: 16px; }
.sidebar-user-name { display: block; font-weight: 600; font-size: 13px; color: var(--text); }
.sidebar-user-role { display: block; font-size: 12px; color: var(--text-muted); }
.sidebar-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 36px; height: 36px; border-radius: var(--radius-sm); cursor: pointer;
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.sidebar-action-btn:hover { background: var(--bg-card-2); color: var(--text); text-decoration: none; }
:root[data-theme="dark"] .icon-moon, :root:not([data-theme="dark"]) .icon-sun { display: none; }

/* Account menu */
.user-menu { position: relative; }
.user-menu-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text); cursor: pointer; text-align: left;
  transition: var(--transition);
}
.user-menu-btn:hover { background: var(--bg-card-2); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: 12px;
}
:root[data-theme="dark"] .user-avatar { background: var(--grad); color: #06121a; }
.user-menu-caret { color: var(--text-muted); font-size: 11px; }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 300;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow);
}
.user-menu-panel[hidden] { display: none; }
.user-menu-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu-head-name { font-weight: 600; color: var(--text); }
.user-menu-head-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; word-break: break-all; }
.user-menu-panel a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text); font-size: 13px; }
.user-menu-panel a:hover { background: var(--bg-card-2); text-decoration: none; }
.user-menu-panel a.user-menu-logout { color: var(--danger); }

/* Notification bell */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
}
.notif-panel { min-width: 320px; max-width: 360px; }
.notif-panel .notif-item { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.notif-panel .notif-item small { color: var(--text-muted); font-size: 11px; }
.notif-panel .notif-item.unread { background: var(--primary-soft); }
.notif-panel .notif-item.unread > span { font-weight: 600; }
.notif-panel .notif-all { text-align: center; color: var(--primary); font-weight: 600; margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0; padding-top: 11px; }
.notif-empty { padding: 14px 12px; font-size: 13px; color: var(--text-muted); }
.notif-row { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-row:last-child { border-bottom: 0; }
.notif-row:hover { background: var(--bg-card-2); text-decoration: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: transparent; }
.notif-row.unread .notif-dot { background: var(--primary); }
.notif-row.unread .notif-text { font-weight: 600; }
.notif-text { flex: 1; min-width: 0; }
.notif-time { flex: none; font-size: 12px; color: var(--text-muted); }

.topbar { display: none; }
#sidebar-toggle { display: none; }
@media (max-width: 900px) { #sidebar-toggle { display: inline-flex !important; margin-right: auto; } }

/* ── Page content ──────────────────────────────────── */
.page-content { padding: 32px 32px 56px; flex: 1; max-width: 1360px; width: 100%; margin: 0 auto; }
.page-header { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.page-title { font-weight: 800; font-size: clamp(34px, 5vw, 56px); line-height: 1.1; letter-spacing: -.03em; color: var(--text); }
.page-desc { font-size: 15px; line-height: 1.6; color: var(--text-secondary); margin-top: 10px; max-width: 640px; }
.eyebrow { display: block; font-size: 12px; color: var(--text-muted); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 10px; }
.eyebrow .dot { margin: 0 8px; }

/* ── Timesheet header ──────────────────────────────── */
.ts-sheet-header {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 26px 0;
}
.ts-breadcrumb { margin: 0 0 14px; font-size: 13px; }
.ts-breadcrumb a { color: var(--primary); font-weight: 500; }
.ts-sheet-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.ts-sheet-name { margin: 0; font-weight: 800; font-size: clamp(22px, 3vw, 28px); line-height: 1.2; color: var(--text); }
.ts-sheet-type-badge {
  display: inline-block; font-size: 12px; font-weight: 500; color: var(--text-secondary);
  background: var(--bg-card-2); border-radius: 6px; padding: 4px 10px;
}
.ts-sheet-subtitle { margin: 8px 0 0; font-size: 14px; color: var(--text-secondary); max-width: 720px; }
.ts-meta-bar { display: flex; flex-wrap: nowrap; align-items: stretch; width: 100%; margin-top: 20px; padding: 16px 0 18px; border-top: 1px solid var(--border); overflow-x: auto; }
.ts-meta-field { flex: 1 1 0; min-width: 0; padding: 0 18px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.ts-meta-field:first-child { padding-left: 0; }
.ts-meta-field:last-child { border-right: none; padding-right: 0; }
.ts-meta-field--wide { flex: 1.35 1 0; }
.ts-meta-label { display: block; font-size: 12px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.ts-meta-value { display: block; font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35; word-break: break-word; }
.ts-meta-value .badge { vertical-align: middle; }
@media (max-width: 960px) {
  .ts-meta-bar { flex-wrap: wrap; overflow-x: visible; gap: 14px 0; }
  .ts-meta-field { flex: 1 1 calc(33.333% - 12px); min-width: 140px; border-right: none; padding: 0 16px 0 0; }
  .ts-meta-field--wide { flex: 1 1 100%; padding-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
}
@media (max-width: 560px) { .ts-meta-field { flex: 1 1 50%; } }
.ts-list-id { color: var(--primary); font-weight: 600; }
.ts-list-row:hover { background: var(--bg-card-2); }

/* ── Cards ─────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.card-title { font-weight: 800; font-size: 16px; color: var(--text); }
.card-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.card-body { padding: 22px 24px; }
.card-footer { padding: 14px 24px; border-top: 1px solid var(--border); }

/* ── Stat cards ────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-card-icon {
  position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; background: var(--bg-card-2);
}
.stat-card-icon.blue   { color: var(--primary); background: var(--primary-soft); }
.stat-card-icon.green  { color: var(--success); background: var(--success-soft); }
.stat-card-icon.yellow { color: var(--warning); background: var(--warning-soft); }
.stat-card-icon.red    { color: var(--danger);  background: var(--danger-soft); }
.stat-card-icon.gray   { color: var(--text-secondary); }
.stat-card-label { order: 1; font-size: 13px; color: var(--text-secondary); font-weight: 500; padding-right: 44px; }
.stat-card-value { order: 2; font-weight: 800; font-size: 30px; line-height: 1.15; color: var(--text); letter-spacing: -.01em; }
/* Dashboard KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 24px; }
.kpi {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: 28px 12px; min-height: 150px;
  padding: 20px 22px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); color: inherit;
  transition: border-color var(--transition), transform var(--transition);
}
.kpi:hover { border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; color: inherit; }
.kpi-icon { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--bg-card-2); border: 1px solid var(--border); }
.kpi-primary { color: var(--primary); }
.kpi-warning { color: var(--warning); }
.kpi-label { justify-self: end; text-align: right; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--text-secondary); }
.kpi-value { grid-column: 1 / -1; align-self: end; font-family: var(--display); font-weight: 800; font-size: 38px; line-height: 1; letter-spacing: -.02em; color: var(--primary); }
.stat-card-link { display: block; color: inherit; }
.stat-card-link:hover { text-decoration: none; color: inherit; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition); white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 11px 20px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--primary-btn); color: #fff !important; }
:root[data-theme="dark"] .btn-primary { color: #06121a !important; }
:root[data-theme="dark"] .btn-primary:hover { background: var(--primary-btn); filter: brightness(1.08); }
.btn-primary:hover { background: #142fa8; }
.btn-outline { background: var(--bg-card); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--bg-card-2); }
.btn-success { background: #15803d; color: #fff; }
.btn-success:hover { background: #166534; }
.btn-danger  { background: #c62828; color: #fff; }
.btn-danger:hover { background: #b71c1c; }

/* ── Forms ─────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-label { font-size: 13px; color: var(--text); font-weight: 500; }
.form-control {
  background: var(--bg-input); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 12px; color: var(--text); font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
select.form-control, select {
  background-color: var(--bg-input); color: var(--text); border-color: var(--border-strong);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
                    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 32px;
}
select option { background: var(--bg-card); color: var(--text); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-control::placeholder { color: var(--text-muted); }
.form-hint { font-size: 12px; color: var(--text-muted); }
.req { color: var(--danger); }
.form-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.form-check input[type=checkbox], input[type=checkbox] { accent-color: var(--primary); }
.form-check-label { font-size: 13px; color: var(--text-secondary); }

/* ── Tables ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
table.table th {
  text-align: left; font-size: 12px; color: var(--text-muted); font-weight: 600;
  padding: 11px 20px; background: var(--bg-card-2); border-bottom: 1px solid var(--border);
}
table.table td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--text); vertical-align: middle; }
table.table tr:last-child td { border-bottom: none; }
table.table tbody tr:hover { background: var(--bg-card-2); }
table.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.badge-blue   { color: var(--primary); background: var(--primary-soft); }
.badge-green  { color: var(--success); background: var(--success-soft); }
.badge-red    { color: var(--danger);  background: var(--danger-soft); }
.badge-yellow { color: var(--warning); background: var(--warning-soft); }
.badge-gray   { color: var(--text-secondary); background: var(--bg-card-2); }

/* ── Alerts ────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px;
  margin-bottom: 18px; display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--border); background: var(--bg-card-2); color: var(--text);
}
.alert-success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.alert-error   { background: var(--danger-soft);  border-color: transparent; color: var(--danger); }
.alert-warning { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.alert-info    { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.alert a { color: inherit; text-decoration: underline; }

/* ── Modals ────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .15s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; overflow-x: hidden;
  transform: translateY(8px); transition: transform .15s;
}
.modal-body { overflow-x: hidden; }
.modal * { min-width: 0; }
.modal .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-width: 0; }
.modal .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.modal .form-control, .modal input, .modal select, .modal textarea { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.modal input[type=checkbox] { width: auto; }
@media (max-width: 640px) { .modal .form-row, .modal .form-row.cols-3 { grid-template-columns: 1fr; } }
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header { padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-weight: 800; font-size: 18px; color: var(--text); }
.modal-close { background: transparent; border: 1px solid var(--border); cursor: pointer; color: var(--text-secondary); padding: 4px 10px; border-radius: var(--radius-sm); }
.modal-close:hover { background: var(--bg-card-2); color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Tabs ──────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; overflow-y: hidden; }
.tab-btn, .tabs a {
  padding: 10px 14px; font-size: 13.5px; font-weight: 500; white-space: nowrap;
  color: var(--text-secondary); background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: var(--transition);
}
.tab-btn:hover, .tabs a:hover { color: var(--text); text-decoration: none; }
.tab-btn.active, .tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Timesheet calendar (legacy) ───────────────────── */
.ts-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 20px; }
.ts-day-header { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 8px; }
.ts-day { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 10px 10px; min-height: 96px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--bg-card); position: relative; }
.ts-day.weekend { background: var(--bg-card-2); }
.ts-day.holiday { background: var(--warning-soft); }
.ts-day.empty   { background: transparent; border-color: transparent; }
.ts-day-num { position: absolute; top: 8px; left: 12px; font-size: 13px; font-weight: 600; color: var(--text); }
.ts-day.weekend .ts-day-num { color: var(--text-muted); }
.ts-day.holiday .ts-day-num { color: var(--warning); }
.ts-day-tag { margin-top: 22px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.holiday-tag { background: var(--warning-soft); color: var(--warning); }
.weekend-tag { background: var(--bg-card-2); color: var(--text-muted); }
.ts-day-unit { font-size: 11px; color: var(--text-muted); margin-top: -2px; }
.ts-hours-input { margin-top: 22px; width: 70px; padding: 7px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); text-align: center; font-size: 15px; font-weight: 600; background: var(--bg-input); color: var(--text); }
.ts-hours-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ts-hours-input:disabled { color: var(--text-muted); background: transparent; }
.ts-total-bar { display: flex; align-items: center; gap: 10px; }
.ts-total-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.ts-total-value { font-size: 28px; font-weight: 800; color: var(--text); }

.month-picker { display: flex; align-items: center; gap: 10px; }
.month-picker select { padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text); font-size: 13px; font-weight: 500; }

/* ── File drop ─────────────────────────────────────── */
.file-drop { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 24px; text-align: center; cursor: pointer; background: var(--bg-card-2); transition: var(--transition); }
.file-drop:hover, .file-drop.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.file-drop-icon { display: none; }
.file-drop p { color: var(--text-secondary); font-size: 13px; }
.file-drop strong { color: var(--primary); }
.file-drop input[type=file] { display: none; }
.file-chosen { display: flex; align-items: center; gap: 12px; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 12px; }
.file-chosen-name { font-size: 13px; color: var(--text); font-weight: 500; flex: 1; }

/* ── Onboarding doc list ───────────────────────────── */
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item { display: flex; align-items: center; gap: 16px; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; background: var(--bg-card); box-shadow: var(--shadow-sm); }
.doc-item-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--bg-card-2); }
.doc-item-icon.pending  { color: var(--text-muted); }
.doc-item-icon.uploaded { color: var(--primary); background: var(--primary-soft); }
.doc-item-icon.verified { color: var(--success); background: var(--success-soft); }
.doc-item-icon.rejected { color: var(--danger); background: var(--danger-soft); }
.doc-item-info { flex: 1; min-width: 0; }
.doc-item-name { font-size: 14px; font-weight: 600; color: var(--text); }
.doc-item-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.doc-item-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.doc-progress-bar { height: 6px; background: var(--bg-card-2); border-radius: 999px; overflow: hidden; }
.doc-progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s ease; }

/* ── Sign-in (split screen) ────────────────────────── */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.login-hero {
  padding: 40px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, #0e1a3a 0%, #1b3fd1 100%); color: #fff;
}
:root[data-theme="dark"] .login-hero { background: linear-gradient(180deg, rgba(5,8,15,.35) 0%, rgba(5,8,15,.85) 100%), linear-gradient(135deg, #0a2540 0%, #15405e 50%, #1b5571 100%); }
.login-hero-header { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.login-hero-header .brand-sub { color: rgba(255,255,255,.8); font-size: 11px; letter-spacing: .26em; }
.login-hero-headline { font-weight: 800; font-size: 38px; line-height: 1.15; letter-spacing: -.02em; color: #fff; max-width: 520px; }
.login-hero-eyebrow { font-size: 13px; color: rgba(255,255,255,.75); font-weight: 500; margin-bottom: 14px; }
.login-hero-desc { font-size: 15px; color: rgba(255,255,255,.82); max-width: 460px; margin-top: 18px; line-height: 1.6; }
.login-hero-meta { display: none; }
.login-form-side { padding: 64px 72px; display: flex; flex-direction: column; justify-content: center; background: var(--bg-card); }
.login-form-wrap { max-width: 340px; width: 100%; }
.login-eyebrow { display: none; }
.login-title { font-weight: 800; font-size: 28px; letter-spacing: -.01em; color: var(--text); line-height: 1.2; }
.login-sub { font-size: 14px; color: var(--text-secondary); margin: 8px 0 26px; }
.login-form-side .form-group { margin-bottom: 12px; gap: 4px; }
.login-form-side .form-control { padding: 7px 11px; font-size: 13px; }
.login-form-side .form-label { font-size: 12px; }
.login-form-side .btn-block { padding: 9px; font-size: 13px; margin-top: 4px; }
.login-meta-link { font-size: 13px; color: var(--text-secondary); margin-top: 18px; }
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-form-side { padding: 48px 24px; }
}

/* ── Footer ────────────────────────────────────────── */
.app-footer { padding: 20px 32px; border-top: 1px solid var(--border); text-align: center; font-size: 12px; color: var(--text-muted); }
.app-footer strong { color: var(--text-secondary); font-weight: 600; }

/* ── Empty state ───────────────────────────────────── */
.empty-state { text-align: center; padding: 44px 24px; }
.empty-icon { display: none; }
.empty-title { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.empty-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Helpers ───────────────────────────────────────── */
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.p-0 { padding: 0 !important; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 14px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ── Analytics ─────────────────────────────────────── */
.ana-bar-row { display: grid; grid-template-columns: 160px 1fr 110px; gap: 14px; align-items: center; padding: 7px 0; }
.ana-bar-label { font-size: 13px; color: var(--text); font-weight: 500; }
.ana-bar-track { background: var(--bg-card-2); height: 8px; border-radius: 999px; overflow: hidden; }
.ana-bar-fill  { height: 100%; border-radius: 999px; transition: width .4s ease; }
.ana-bar-value { font-size: 12.5px; color: var(--text-secondary); text-align: right; }
.ana-chart { display: flex; gap: 10px; align-items: flex-end; height: 210px; overflow-x: auto; padding-bottom: 10px; }
.ana-chart-col { flex: 1 1 0; min-width: 40px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ana-chart-bars { width: 100%; max-width: 36px; display: flex; flex-direction: column-reverse; align-items: stretch; height: 170px; justify-content: flex-end; }
.ana-chart-bar { width: 100%; border-radius: 4px 4px 0 0; }
.ana-chart-bar.std { background: var(--primary); }
.ana-chart-bar.ot  { background: var(--warning); margin-bottom: 2px; }
.ana-chart-label { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.ana-legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.ana-legend.std { background: var(--primary); }
.ana-legend.ot  { background: var(--warning); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { padding: 10px 16px; flex-wrap: wrap; }
  .sidebar-nav { order: 3; width: 100%; overflow-x: auto; padding: 6px 0 0; scrollbar-width: none; }
  .sidebar-user { margin-left: auto; }
  .page-content { padding: 22px 16px 40px; }
  .form-row, .form-row.cols-3 { grid-template-columns: 1fr; }
  .ts-calendar { gap: 4px; }
  .ts-day { min-height: 70px; padding: 8px 4px; }
  .ts-hours-input { width: 100%; margin-top: 18px; }
  .user-menu-btn > span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Logo sits on the blue sign-in panel */


/* -- Type roles: Bricolage Grotesque for titles and figures, Inter for text -- */
.page-title, .card-title, .modal-title, .login-title, .login-hero-headline, .ts-sheet-name,
.stat-card-value, .ts-total-value, .ms-title, .ms-hours { font-family: var(--display); }
table.table td, .ts-meta-value, .ana-bar-value, .stat-card-value, .ms-cell, .mt-grid { font-variant-numeric: tabular-nums; }

/* -- Month strip (dashboard) ------------------------- */
.ms-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.ms-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 12px; }
.ms-hours { font-size: 30px; font-weight: 800; line-height: 1; }
.ms-hours small { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.month-strip { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; }
.ms-cell {
  position: relative; height: 56px; border-radius: 6px; background: var(--bg-card-2);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  font-size: 11px; color: var(--text-muted);
}
.ms-cell.weekend { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.ms-cell.holiday { background: repeating-linear-gradient(135deg, var(--bg-card-2) 0 4px, var(--border) 4px 8px); }
.ms-cell.lvl-1 { background: var(--ms-1); color: var(--text); }
.ms-cell.lvl-2 { background: var(--ms-2); color: var(--text); }
.ms-cell.lvl-3 { background: var(--ms-3); color: #fff; }
:root[data-theme="dark"] .ms-cell.lvl-3 { color: #06121a; font-weight: 600; }
.ms-cell.gap::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 0 0 6px 6px; background: var(--warning); }
.ms-cell.today { outline: 2px solid var(--gold); outline-offset: 2px; color: var(--text); font-weight: 600; }
.ms-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: 12px; color: var(--text-muted); }
.ms-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ms-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--bg-card-2); }
.ms-legend i.l3 { background: var(--ms-3); }
.ms-legend i.wk { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.ms-legend i.gp { box-shadow: inset 0 -3px 0 var(--warning); }
.ms-legend i.td { box-shadow: 0 0 0 2px var(--gold); }
.ms-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.ms-note { font-size: 13.5px; color: var(--text-secondary); }
.ms-note strong { color: var(--text); font-weight: 600; }
@media (max-width: 700px) {
  .month-strip { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .ms-cell { height: 42px; }
  .ms-cell:first-child { grid-column-start: var(--dow, 1); }
}

/* -- At-a-glance list (dashboard) -------------------- */
.glance { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--border); color: var(--text); }
.glance:last-child { border-bottom: none; }
.glance:hover { background: var(--bg-card-2); text-decoration: none; }
.glance-label { font-weight: 500; }
.glance-sub { display: block; font-size: 12.5px; color: var(--text-muted); font-weight: 400; margin-top: 2px; }
.glance-value { font-family: var(--display); font-size: 20px; font-weight: 800; white-space: nowrap; }
