/* CA Attendance: the live ca-attendance stylesheet (first part) plus the compatibility layer for this version's markup (second part). */
:root { --radius: 10px; }
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
:root {
  /* 18 Nov 2026 — recolored to the owner's enterprise-SaaS brief (Deep Navy nav/headings,
     Royal Blue primary actions, Cool Grey background, white cards). Same variable NAMES as
     before, so every existing reference resolves unchanged — visual-only change. */
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface2: #F8F9FC;
  --border: #E2E6EF;
  --border2: #CBD2E0;
  --accent: #2563EB;
  --accent-light: #EFF4FE;
  --accent3: #059669;
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --warn: #D97706;
  --warn-light: #FFFBEB;
  --text: #0F172A;
  --text2: #334155;
  --muted: #64748B;
  --muted2: #94A3B8;
  --sidebar-bg: #172554;
  --sidebar-text: #CBD5E1;
  --sidebar-muted: #7C8DB5;
  --sidebar-border: rgba(255,255,255,0.08);
  --heading: #172554;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; font-variant-numeric: tabular-nums; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; overflow: hidden; }
svg.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }

/* ── LOGIN ──────────────────────────────────────────────────── */
#login-screen {
  position: fixed; inset: 0; background: var(--sidebar-bg);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px;
  width: 400px; box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}
.login-logo { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 18px; color: var(--accent); margin-bottom: 4px; }
.login-firm { font-size: 12px; color: var(--muted); margin-bottom: 32px; }
.login-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 20px; margin-bottom: 6px; color: var(--heading); }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.login-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; display: block; }
.login-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; font-family: 'Inter', sans-serif;
  outline: none; transition: border-color 0.12s, box-shadow 0.12s; margin-bottom: 16px;
}
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.login-btn {
  width: 100%; background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer; transition: background 0.13s; margin-top: 4px;
}
.login-btn:hover { background: #1D4ED8; }
.login-btn:disabled { background: var(--muted2); cursor: not-allowed; }
.login-error {
  background: var(--danger-light); border: 1px solid #fecaca; border-radius: 6px;
  padding: 10px 12px; font-size: 12px; color: var(--danger); margin-bottom: 16px; display: none;
}
.pw-wrap { position: relative; margin-bottom: 16px; }
.pw-wrap .login-input { margin-bottom: 0; padding-right: 40px; }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--muted); font-size: 14px; user-select: none; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar { width: 224px; min-width: 224px; background: var(--sidebar-bg); display: flex; flex-direction: column; z-index: 100; }
.logo { padding: 16px 16px 14px; border-bottom: 1px solid var(--sidebar-border); }
.logo-mark { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 13px; color: #fff; letter-spacing: 0.02em; line-height: 1.3; }
.logo-sub { font-size: 9px; color: var(--sidebar-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 3px; }
.sidebar-section { padding: 14px 12px 6px; }
.sidebar-section-label { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sidebar-muted); padding: 0 8px; margin-bottom: 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--sidebar-text); transition: all 0.13s; user-select: none; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-icon { font-size: 13px; width: 17px; text-align: center; }
.sidebar-divider { height: 1px; background: var(--sidebar-border); margin: 8px 12px; }
.user-info { margin-top: auto; border-top: 1px solid var(--sidebar-border); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-name { font-size: 12px; color: #fff; font-weight: 600; }
.user-role { font-size: 10px; color: var(--sidebar-muted); }
.logout-btn { margin-left: auto; font-size: 11px; color: var(--sidebar-muted); cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.logout-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ── MAIN ────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 54px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 12px; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.topbar-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 15px; color: var(--heading); flex: 1; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.badge-owner   { background: #EFF4FE; color: #2563EB; border: 1px solid #c7d7fa; }
.badge-manager { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.badge-senior  { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.badge-employee{ background: #f0fdf4; color: #059669; border: 1px solid #bbf7d0; }
.btn { padding: 7px 14px; border-radius: 8px; border: none; cursor: pointer; font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500; transition: all 0.13s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1D4ED8; }
.btn-ghost { background: var(--surface); color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { border-color: var(--muted); background: var(--surface2); }
.btn-sm { padding: 5px 11px; font-size: 11px; }
.btn-danger-soft { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.btn-danger-soft:hover { background: #fee2e2; }
.btn-success-soft { background: #f0fdf4; color: var(--accent3); border: 1px solid #bbf7d0; }
.btn-success-soft:hover { background: #dcfce7; }
.content { flex: 1; overflow-y: auto; padding: 24px; background: var(--bg); }
.view { display: none; }
.view.active { display: block; }

/* ── KPI CARDS ───────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 16px; position: relative; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.kpi-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; border-radius: 10px 10px 0 0; }
.kpi-card.kpi-info::before { background: var(--accent); }
.kpi-card.kpi-warn::before { background: var(--warn); }
.kpi-card.kpi-danger::before { background: var(--danger); }
.kpi-card.kpi-ok::before { background: var(--accent3); }
.kpi-card.kpi-purple::before { background: #7c3aed; }
.kpi-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; font-weight: 600; }
.kpi-value { font-family: 'Inter', sans-serif; font-size: 30px; font-weight: 800; line-height: 1; margin-bottom: 5px; }
.kpi-sub { font-size: 11px; color: var(--muted); }

/* ── STATUS CHIPS ────────────────────────────────────────── */
.status-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 4px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.s-present   { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
.s-absent    { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.s-leave     { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.s-halfday   { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.s-holiday   { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.s-wfh       { background: #EFF4FE; color: #2563EB; border: 1px solid #c7d7fa; }
.s-late      { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.s-pending   { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.s-awaiting-hr { background: #EFF4FE; color: #2563EB; border: 1px solid #c7d7fa; }
.s-approved  { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
.s-rejected  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.s-cancelled { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }
.leave-type-chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-family: 'Inter', sans-serif; font-weight: 600; }
.lt-casual   { background: #EFF4FE; color: #2563EB; border: 1px solid #c7d7fa; }
.lt-sick     { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.lt-earned   { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
.lt-unpaid   { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }
.lt-comp_off { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.lt-wfh      { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }

/* ── TABLE ───────────────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.table-wrap table { width: 100%; border-collapse: collapse; }
thead th { padding: 11px 16px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface2); }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f0f5ff; }
tbody td { padding: 12px 16px; font-size: 13px; vertical-align: middle; color: var(--text2); }

/* ── PANEL ───────────────────────────────────────────────── */
.panel-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.3); z-index: 200; display: none; align-items: flex-start; justify-content: flex-end; }
.panel-overlay.open { display: flex; }
.detail-panel { width: 500px; height: 100vh; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; animation: slideIn 0.2s ease; box-shadow: -4px 0 24px rgba(0,0,0,0.08); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.panel-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; background: var(--surface2); }
.panel-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 400; display: none; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15); animation: modalIn 0.18s ease; }
@keyframes modalIn { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface2); border-radius: 12px 12px 0 0; position: sticky; top: 0; z-index: 1; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface2); border-radius: 0 0 12px 12px; position: sticky; bottom: 0; }
.modal-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; color: var(--heading); }
.close-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border2); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.12s; }
.close-btn:hover { color: var(--text); border-color: var(--muted); }
.form-group { margin-bottom: 14px; }
.form-label { font-size: 11px; color: var(--muted); margin-bottom: 5px; display: block; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.form-input, .form-select { width: 100%; background: var(--surface); border: 1px solid var(--border2); border-radius: 7px; padding: 8px 12px; color: var(--text); font-size: 13px; font-family: 'Inter', sans-serif; outline: none; transition: border-color 0.12s, box-shadow 0.12s; }
.form-input:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
textarea.form-input { resize: vertical; min-height: 60px; }

/* ── TABS ────────────────────────────────────────────────── */
.tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid var(--border); gap: 0; overflow-x: auto; }
.tab { padding: 8px 16px; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.13s; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── FILTER BAR ──────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.filter-select { background: var(--surface); border: 1px solid var(--border2); color: var(--text2); border-radius: 7px; padding: 7px 10px; font-size: 12px; font-family: 'Inter', sans-serif; cursor: pointer; outline: none; }
.search-input { background: var(--surface); border: 1px solid var(--border2); color: var(--text); border-radius: 7px; padding: 7px 12px; font-size: 12px; font-family: 'Inter', sans-serif; outline: none; width: 220px; }
.search-input:focus { border-color: var(--accent); }

/* ── DASH CARDS ──────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.dash-card-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 13px; color: var(--heading); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; justify-content: space-between; }

/* ── CALENDAR ────────────────────────────────────────────── */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-month-label { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 16px; color: var(--heading); }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
/* min-width:0 on every direct grid item: a 1fr grid can still be forced wider than its
   container if an item's own "automatic minimum size" (which defaults to its content's
   natural width, not 0) exceeds its fair share. Found on mobile — Fri/Sat pushed past the
   screen edge with no way to scroll to them (18 Nov 2026 pilot test). */
.cal-day-header { text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; padding: 6px 0; min-width: 0; }
.cal-day { min-height: 78px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; cursor: pointer; transition: all 0.13s; position: relative; }
.cal-day:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-day.empty:hover { border-color: transparent; box-shadow: none; }
.cal-day.today { border-color: var(--accent); background: var(--accent-light); }
.cal-day.holiday-day { background: #ecfeff; border-color: #a5f3fc; }
.cal-day.weekend { background: var(--surface2); }
.cal-day-num { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 4px; }
.cal-day.today .cal-day-num { color: var(--accent); font-weight: 800; }
.cal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 1px; }
.cal-dot.present  { background: var(--accent3); }
.cal-dot.absent   { background: var(--danger); }
.cal-dot.leave    { background: var(--warn); }
.cal-dot.halfday  { background: #7c3aed; }
.cal-dot.holiday  { background: #0891b2; }
.cal-dot.wfh      { background: var(--accent); }
.cal-day-label { font-size: 9px; color: var(--muted); font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }

/* ── CHECK IN CARD ───────────────────────────────────────── */
.checkin-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  display: flex; align-items: center; gap: 20px;
}
.checkin-clock { font-family: 'Inter', sans-serif; font-size: 40px; font-weight: 800; color: var(--heading); line-height: 1; letter-spacing: -1px; }
.checkin-date { font-size: 12px; color: var(--muted); margin-top: 4px; }
.checkin-status { flex: 1; }
.checkin-status-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 6px; }
.checkin-time-val { font-family: 'Inter', sans-serif; font-size: 18px; font-weight: 600; color: var(--text); }
.checkin-actions { display: flex; gap: 10px; }
.checkin-btn {
  padding: 12px 24px; border-radius: 8px; border: none; font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; letter-spacing: 0.01em;
}
.checkin-btn-in { background: var(--accent3); color: #fff; }
.checkin-btn-in:hover { background: #047857; }
.checkin-btn-out { background: var(--danger); color: #fff; }
.checkin-btn-out:hover { background: #b91c1c; }
.checkin-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── LEAVE BALANCE CARDS ─────────────────────────────────── */
.balance-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.balance-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.balance-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; }
.balance-val { font-family: 'Inter', sans-serif; font-size: 26px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.balance-sub { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.balance-bar-wrap { height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.balance-bar { height: 100%; border-radius: 3px; transition: width 0.4s; }

/* ── SECTION HEADER ──────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; color: var(--heading); display: flex; align-items: center; gap: 8px; }
.section-count { background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px; font-size: 11px; color: var(--muted); font-family: 'Inter', sans-serif; }

/* ── FIELD ROW ───────────────────────────────────────────── */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.field-value { font-size: 13px; color: var(--text2); font-weight: 500; }

/* ── APPROVAL ROW ────────────────────────────────────────── */
.approval-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); transition: all 0.13s; }
.approval-card:hover { border-color: var(--border2); box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.approval-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.approval-emp { display: flex; align-items: center; gap: 10px; }
.approval-emp-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.approval-emp-name { font-weight: 700; font-size: 13px; color: var(--text); }
.approval-emp-role { font-size: 11px; color: var(--muted); margin-top: 1px; }
.approval-details { display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.approval-detail-item { }
.approval-detail-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 2px; }
.approval-detail-val { font-size: 12px; color: var(--text2); font-weight: 500; }
.approval-reason { font-size: 12px; color: var(--muted); background: var(--surface2); border-radius: 6px; padding: 8px 10px; border: 1px solid var(--border); margin-bottom: 12px; font-style: italic; }
.approval-actions { display: flex; gap: 8px; }

/* ── HOLIDAY ITEM ────────────────────────────────────────── */
.holiday-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.holiday-date-badge { background: var(--accent); color: #fff; border-radius: 8px; padding: 6px 10px; text-align: center; min-width: 44px; flex-shrink: 0; }
.holiday-date-day { font-family: 'Inter', sans-serif; font-size: 18px; font-weight: 800; line-height: 1; }
.holiday-date-mon { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; }
.holiday-info { flex: 1; }
.holiday-name { font-size: 13px; font-weight: 600; color: var(--text); }
.holiday-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.holiday-type-chip { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 20px; }
.ht-national { background: #EFF4FE; color: #2563EB; border: 1px solid #c7d7fa; }
.ht-regional { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
.ht-firm { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }

/* ── MISC ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.loading-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 40px 24px; color: var(--muted); font-size: 13px; }
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 15px; color: var(--text2); margin-bottom: 6px; }
.notif-dot { width: 6px; height: 6px; background: var(--danger); border-radius: 50%; display: inline-block; margin-left: 4px; vertical-align: middle; flex-shrink: 0; }
.notif-badge { background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; padding: 2px 6px; border-radius: 10px; margin-left: auto; flex-shrink: 0; font-family: 'Inter', sans-serif; }
.activity-entry { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f3f4f6; }
.activity-entry:last-child { border-bottom: none; }
.activity-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.activity-text { font-size: 12px; color: var(--text); font-weight: 500; }
.activity-meta { font-size: 10px; color: var(--muted2); margin-top: 2px; }
.info-box { background: var(--accent-light); border: 1px solid #c7d7fa; border-radius: 8px; padding: 12px 14px; font-size: 12px; color: #2563EB; margin-bottom: 16px; }
.warn-box { background: var(--warn-light); border: 1px solid #fde68a; border-radius: 8px; padding: 12px 14px; font-size: 12px; color: #92400e; margin-bottom: 16px; }

/* ── REPORTS ─────────────────────────────────────────────── */
.report-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.report-row:last-child { border-bottom: none; }
.report-emp-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.report-emp-name { font-size: 12px; font-weight: 600; color: var(--text); min-width: 140px; }
.report-bar-wrap { flex: 1; background: var(--surface2); border-radius: 3px; height: 8px; overflow: hidden; border: 1px solid var(--border); }
.report-bar { height: 100%; border-radius: 3px; background: var(--accent3); }
.report-stat { font-family: 'Inter', sans-serif; font-size: 11px; color: var(--muted); min-width: 60px; text-align: right; }
.attendance-pct { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 800; min-width: 40px; text-align: right; }

/* ── MOBILE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none !important; }
  body { flex-direction: row; overflow: hidden; }
  .main { width: 100vw; height: 100vh; flex-direction: column; overflow: hidden; }
  /* .login-card had no mobile handling at all — a fixed 400px card with 40px padding on
     literally the first screen every single person sees, on any phone narrower than ~400px
     (most of them). Found during the 18 Nov 2026 audit, not from a reported screenshot. */
  .login-card { width: 400px; max-width: calc(100vw - 32px); padding: 28px 22px; }
  .topbar { padding: 0 12px; height: 52px; flex-shrink: 0; gap: 6px; }
  .topbar-title { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .badge { font-size: 8px; padding: 2px 6px; flex-shrink: 0; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #topbar-actions { flex-shrink: 0; }
  /* overflow-x:auto is a safety net — anything that still manages to overflow (a wide
     dropdown, a future screen) is reachable by a sideways swipe instead of silently
     clipped by .main's overflow:hidden, which is what happened to the Calendar grid.
     100vh is unreliable on mobile browsers whose address bar shows/hides (the real visible
     area can be smaller than 100vh reports), which let the last bit of content tuck under
     the fixed bottom nav even though the calc looked right on paper (found 18 Nov 2026, a
     pilot tester couldn't see the bottom of several screens). 100dvh is the correct unit for
     this and is widely supported now; kept as a second declaration so a browser that doesn't
     know dvh just keeps using the vh line above it. The bottom padding is also bumped well
     past the nav's own 60px as a second, unit-independent safety margin. */
  .content { padding: 12px 12px 88px; height: calc(100vh - 52px - 60px); height: calc(100dvh - 52px - 60px); overflow-y: auto; overflow-x: auto; }

  /* ── bottom nav — reduced 18 Nov 2026 from up to 14 items (needed horizontal scrolling) to
     4 fixed daily-use tabs + "More", which opens a sheet for everything else. ── */
  #mobile-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 60px; background: var(--sidebar-bg);
    display: flex; align-items: center; justify-content: space-around;
    padding: 0 4px;
    border-top: 1px solid var(--sidebar-border); z-index: 500;
  }
  .mobile-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    cursor: pointer; padding: 6px 12px; border-radius: 8px;
    color: var(--sidebar-muted); font-size: 9px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
  }
  .mobile-nav-item .nav-icon { font-size: 16px; }
  .mobile-nav-item.active { color: #fff; background: rgba(37,99,235,0.3); }

  /* ── "More" sheet grid — 2 columns of icon+label tiles for everything not in the 4 fixed
     tabs; reuses .panel-overlay/.detail-panel/.modal-header/.modal-title/.close-btn for the
     sheet chrome itself (same classes the Calendar day-detail panel and every modal use). ── */
  .more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 20px 24px; overflow-y: auto; }
  .more-grid-item {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 14px; border: 1px solid var(--border); border-radius: 10px;
    cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text2);
    background: var(--surface2); transition: all 0.13s;
  }
  .more-grid-item .nav-icon { color: var(--accent); }
  .more-grid-item.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
  /* .panel-overlay's own z-index (200) sits BELOW #mobile-nav (500) — fine for the Calendar
     day-detail panel it was built for, since that's never open at the same time as the nav
     matters, but the More sheet reuses the same class while the nav is always on screen, so
     without this override the nav bar rendered on top of the sheet's bottom row, cutting it
     off (found from a pilot-test screenshot, 18 Nov 2026). */
  #more-sheet-overlay { z-index: 600; }

  /* ── grids ── */
  .kpi-grid { grid-template-columns: repeat(2,1fr) !important; gap: 8px; margin-bottom: 12px; }
  .kpi-value { font-size: 22px; }
  .balance-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .dash-grid { grid-template-columns: 1fr; gap: 12px; }

  /* ── filters & search ── */
  .filter-bar { flex-direction: column; gap: 8px; }
  .search-input { width: 100%; }
  .filter-select { width: 100%; }

  /* ── tables scroll horizontally — edge fade hints it's swipeable rather than reading as
     abruptly cut off (found alongside the bottom-nav redesign, 18 Nov 2026). ── */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, black calc(100% - 20px), transparent);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 20px), transparent); }
  .table-wrap table { min-width: 620px; }

  /* ── panel slides up from bottom ── */
  .panel-overlay { align-items: flex-end; }
  .detail-panel { width: 100vw; max-height: 92vh; height: auto; border-radius: 20px 20px 0 0; border-left: none; border-top: 1px solid var(--border); animation: slideUp 0.22s ease; }
  @keyframes slideUp { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

  /* ── modals & forms ── */
  .modal { width: calc(100vw - 24px); margin: 12px; }
  .form-row { grid-template-columns: 1fr; gap: 8px; }
  .modal-footer { flex-wrap: wrap; gap: 6px; }
  .modal-footer .btn { flex: 1 1 auto; text-align: center; }

  /* ── check-in widget ── */
  .checkin-card { flex-direction: column; align-items: flex-start; gap: 14px; }
  .checkin-clock { font-size: 28px; }
  .checkin-actions { width: 100%; }
  .checkin-btn { flex: 1; text-align: center; }

  /* ── calendar ── */
  .cal-grid { gap: 2px; }
  .cal-day { min-height: 44px; padding: 3px 4px; }
  .cal-day-num { font-size: 10px; }
  .cal-dot { width: 5px; height: 5px; }

  /* ── approvals ── */
  .field-row { grid-template-columns: 1fr; gap: 8px; }
  .approval-actions { flex-direction: column; }
  .approval-details { gap: 8px; }
  .approval-card { padding: 12px 14px; }

  /* ── section headers ── */
  .section-header { flex-wrap: wrap; gap: 8px; }
  .section-header .btn { font-size: 11px; }

  /* ── balance cards ── */
  .balance-val { font-size: 22px; }

  /* ── report rows ── */
  .report-emp-name { min-width: 100px; font-size: 11px; }
  .attendance-pct { min-width: 34px; font-size: 12px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .balance-grid { grid-template-columns: 1fr 1fr; }
  .topbar-title { font-size: 11px; }
  .badge { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════
   Above this line: the live ca-ops stylesheet, as it is. Below: the same look for the markup this Cloudflare version draws,
   plus the phone "More" sheet. Keep both parts in step with the live app when its look changes.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
html, body { height: 100%; }
#app { display: flex; width: 100%; height: 100vh; overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3 { font-family: 'Syne', sans-serif; }
code, .mono, .ticket-number, .money { font-family: 'DM Mono', monospace; }
@media (min-width: 769px) { #mobile-nav { display: none; } }
.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1200; }
.toast { background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); max-width: calc(100vw - 32px); overflow-wrap: anywhere; }
.toast.error { background: var(--danger); }

/* login */
.login-screen { position: fixed; inset: 0; background: var(--sidebar-bg); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card img.login-logo-img { display: block; max-width: 100%; height: auto; margin: 0 auto 18px; background: #fff; border-radius: 8px; }
.login-card .field { margin-bottom: 16px; }
.login-card .field label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; }
.login-card .field input { width: 100%; background: var(--surface2); border: 1px solid var(--border2); border-radius: 8px; padding: 10px 14px; font-size: 13px; outline: none; }
.login-card .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.login-card .btn-primary { width: 100%; padding: 12px; font-size: 14px; font-weight: 600; border-radius: 8px; }
.login-card .hint { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.login-card .error { background: var(--danger-light); border: 1px solid #fecaca; border-radius: 6px; padding: 10px 12px; font-size: 12px; color: var(--danger); margin-bottom: 16px; }

/* sidebar (logo, workspace list, work types, user block) */
.sidebar { overflow-y: auto; }
.sidebar .logo img { display: block; width: 100%; height: auto; border-radius: 6px; background: #fff; }
.sidebar .logo .logo-mark { color: #fff; }
.sidebar-section-label { cursor: default; justify-content: space-between; }
.sidebar-section-label[data-collapse-section] { cursor: pointer; }
.nav-item { text-decoration: none; }
.user-info .user-name { max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .role-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; background: #eff4ff; color: #1a56db; border: 1px solid #c7d7fa; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-tools { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.topbar-title { flex: 0 1 auto; }
.topbar .spacer { flex: 1; }

/* controls the Cloudflare views draw with bare elements: look like the live ones */
.btn { border: 1px solid var(--border2); background: var(--surface); color: var(--text2); }
.btn:hover { border-color: var(--muted); background: var(--surface2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1648c0; border-color: #1648c0; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn[hidden], .nav-item[hidden], .tab[hidden] { display: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.content input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .content select, .content textarea,
.modal input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .modal select, .modal textarea,
.detail-panel input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .detail-panel select, .detail-panel textarea {
  background: var(--surface); border: 1px solid var(--border2); color: var(--text); border-radius: 7px; padding: 7px 10px; font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; max-width: 100%; }
.content input:focus, .content select:focus, .content textarea:focus, .modal input:focus, .modal select:focus, .modal textarea:focus, .detail-panel input:focus, .detail-panel select:focus, .detail-panel textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,86,219,0.08); }
.filter-bar input, .filter-bar select { font-size: 12px; }
.filter-bar input[type=search] { min-width: 200px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { width: 100%; }
.field textarea { resize: vertical; min-height: 60px; }
.hint { color: var(--muted); font-size: 12px; }

/* summary cards: the Cloudflare views still using .kpi-row / .label / .value get the live card look */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi-row .kpi-card .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; font-weight: 600; }
.kpi-row .kpi-card .value { font-family: 'Syne', sans-serif; font-size: 30px; font-weight: 800; line-height: 1; margin-bottom: 5px; }
.kpi-row .kpi-card { cursor: pointer; }
.kpi-card.kpi-selected { outline: 2px solid var(--accent); outline-offset: -1px; }

/* tabs */
.tab-strip { display: flex; margin-bottom: 20px; border-bottom: 2px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab-strip::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; }

/* tables (the Cloudflare table helper draws .table-wrap > table) */
.table-wrap { overflow-x: auto; }
.table-wrap th { padding: 11px 16px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface2); white-space: nowrap; }
.table-wrap th .th-sort { background: none; border: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; padding: 0; cursor: pointer; }
.table-wrap td { padding: 12px 16px; font-size: 13px; vertical-align: middle; color: var(--text2); border-bottom: 1px solid var(--border); }
.table-wrap tbody tr:last-child td { border-bottom: none; }
.table-wrap td.num, .table-wrap th.num { text-align: right; }
.table-wrap tbody tr[data-open] { cursor: pointer; }
.table-wrap tbody tr[data-open]:hover { background: #f0f5ff; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; margin-top: -20px; margin-bottom: 20px; }
.field-input { width: 100px !important; text-align: right; }
.field-input[type="text"] { width: 100% !important; text-align: left; }

/* chips for the views that still draw .badge-status-* / .badge-priority-*: same look as the live status and priority chips */
.badge-status-billed, .badge-status-paid, .badge-status-nonbillable, .badge-status-pending, .badge-status-review, .badge-status-default, .badge-status-billing,
.badge-priority-high, .badge-priority-medium, .badge-priority-low { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.badge-status-billed { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.badge-status-paid { background: #f0fdf4; color: #14532d; border: 1px solid #86efac; }
.badge-status-nonbillable, .badge-status-default { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.badge-status-pending, .badge-status-billing { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.badge-status-review { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.badge-priority-high { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.badge-priority-medium { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge-priority-low { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }

/* modal: the live look (centre card, header band) */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 400; display: flex; align-items: center; justify-content: center; padding: 12px; }
.overlay .modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 520px; max-width: 100%; max-height: calc(100vh - 24px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15); padding: 0; animation: modalIn 0.18s ease; }
.overlay .modal > h3 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; color: var(--text); padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--border); background: var(--surface2); border-radius: 12px 12px 0 0; }
.overlay .modal > :not(h3) { margin-left: 20px; margin-right: 20px; }
.overlay .modal > :nth-child(2) { margin-top: 16px; }
.overlay .modal > :last-child { margin-bottom: 20px; }
.overlay .modal .modal-body { margin: 0; padding: 20px; }

/* detail panel: the live look (side sheet; full-width sheet on a phone) */
.detail-panel-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.3); z-index: 200; display: flex; align-items: flex-start; justify-content: flex-end; }
.detail-panel { width: 520px; max-width: 100vw; height: 100vh; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; animation: slideIn 0.22s ease; position: relative; padding: 0; }
.detail-panel > .panel-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-shrink: 0; background: var(--surface2); }
.detail-panel > .panel-header h3 { font-family: 'Syne', sans-serif; font-size: 15px; margin: 0; }
.detail-panel > .panel-header .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.detail-panel > .panel-body { flex: 1; overflow-y: auto; padding: 20px; }
.detail-panel .section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.detail-panel .section:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.detail-panel .section h4 { margin: 0 0 8px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.detail-panel-close { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border2); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 14px; flex-shrink: 0; }
.detail-panel-close:hover { color: var(--text); border-color: var(--muted); }
.task-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; margin-bottom: 6px; }
.task-row.done .task-name { text-decoration: line-through; color: var(--muted2); }
.progress-bar { height: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress-bar > div { height: 100%; background: var(--accent3); }
.activity-item { padding: 8px 0; border-bottom: 1px solid #f3f4f6; font-size: 12px; }
.activity-item .when { color: var(--muted2); font-size: 10px; margin-top: 2px; }
.lock-msg { color: var(--muted); font-size: 12px; padding: 8px 0; }
.notes-banner { background: var(--warn-light); color: #92400e; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px; font-size: 12px; margin-bottom: 12px; }
.chip-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { background: var(--accent-light); color: var(--accent); border: 1px solid #c7d7fa; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chip button { background: none; border: none; color: inherit; font-size: 13px; padding: 0; cursor: pointer; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0; vertical-align: middle; }
.autocomplete-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; background: var(--surface); border: 1px solid var(--border2); border-radius: 7px; margin-top: 2px; max-height: 220px; overflow: auto; box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.autocomplete-row { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.autocomplete-row:hover { background: var(--surface2); }
.section { margin-bottom: 18px; }

/* phone: five bottom items plus "More" (the same pattern as the live Attendance app) */
@media (max-width: 768px) {
  #mobile-nav { padding: 0 4px; gap: 0; }
  #mobile-nav .mobile-nav-item { flex: 1 1 0; min-width: 0; padding: 6px 2px; font-size: 9px; }
  #mobile-nav .mobile-nav-item .nav-icon { font-size: 19px; width: auto; }
  #mobile-nav .mobile-nav-item.active { color: #fff; background: rgba(26,86,219,.35); }
  .topbar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 12px; row-gap: 6px; }
  .topbar-title { flex: 1 1 auto; }
  .topbar-tools { margin-left: 0; width: 100%; order: 3; flex-wrap: wrap; }
  .topbar-tools select, .topbar-tools .btn { flex: 1 1 auto; }
  .content { height: auto; flex: 1; padding: 12px 12px 76px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
  .kpi-row .kpi-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi-row .kpi-card .value { font-size: 22px; }
  .filter-bar input[type=search] { min-width: 0; width: 100%; }
  .filter-bar > * { flex: 1 1 140px; min-width: 0; }
  .filter-bar .btn { flex: 0 0 auto; }
  .detail-panel-overlay { align-items: flex-end; }
  .detail-panel { width: 100vw; max-height: 92vh; height: auto; border-radius: 20px 20px 0 0; border-left: none; border-top: 1px solid var(--border); }
  .detail-panel::before { content: ''; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 36px; height: 4px; border-radius: 3px; background: var(--border2); z-index: 2; }
  .detail-panel > .panel-header { padding-top: 22px; }
  .login-card { width: 100%; padding: 28px 22px; }
}
#more-sheet-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 600; display: flex; align-items: flex-end; }
#more-sheet { background: var(--surface); width: 100%; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); max-height: 80vh; overflow-y: auto; animation: slideUp 0.22s ease; }
#more-sheet h3 { font-size: 14px; margin: 0 0 12px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-grid-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--text2); text-align: center; cursor: pointer; background: var(--surface2); }
.more-grid-item .nav-icon { font-size: 22px; width: auto; }
.more-grid-item.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.kpi-card.kpi-purple::before { background: #7e22ce; }
.kpi-card.kpi-darkgreen::before { background: #14532d; }
.kpi-card.kpi-selected { outline: 2px solid var(--accent); outline-offset: -1px; }
.kpi-grid { cursor: default; }
.tabs-scroll { position: relative; }
.tabs-scroll .tabs { overflow-x: auto; scrollbar-width: none; }
.tabs-scroll .tabs::-webkit-scrollbar { display: none; }
.topbar-tools .filter-select { font-size: 11px; padding: 5px 8px; }
.topbar-tools .btn { font-size: 11px; }
.wt-chip { background: #eff4ff; border: 1px solid #c7d7fa; color: #1d4ed8; }
@media (max-width: 768px) {
  .topbar-tools select { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .topbar-tools .btn-primary { flex: 1 1 100%; }
  .topbar-tools #export-csv { display: none; }
  .topbar-tools .btn { flex: 1 1 auto; }
  .topbar .role-badge { max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
}

.topbar-actions, .topbar-user { display: flex; gap: 8px; align-items: center; }
.kpi-warn .value { color: var(--warn); }
.checkin-widget { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.checkin-done { background: #ecfdf5; border: 1px solid #bbf7d0; color: #065f46; border-radius: var(--radius); padding: 14px; font-size: 13px; }
.cal-tag-base { font-size: 9px; border-radius: 4px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-tag-holiday { background: var(--danger-light); color: var(--danger); }
.cal-tag-leave { background: var(--warn-light); color: var(--warn); }
.cal-tag-present { background: #ecfdf5; color: #065f46; }

/* attendance-only */
body, .content, input, select, textarea, button { font-family: 'Inter', sans-serif; }
.topbar-user { display: flex; align-items: center; gap: 8px; }
.sidebar .logo { flex-direction: column; align-items: flex-start; gap: 8px; }
.sidebar .logo img { width: 100%; }
.nav-item .notif-badge { margin-left: auto; }
.cal-tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 600; margin-top: 3px; }
@media (max-width: 768px) { .kpi-grid .kpi-card:last-child:nth-child(odd) { grid-column: 1 / -1; } }

.cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: nowrap; }
.cal-toolbar strong { font-size: 15px; white-space: nowrap; }
.cal-toolbar .filter-select { margin-left: auto; min-width: 0; max-width: 55%; }
.cal-toolbar .btn { flex: 0 0 auto; min-width: 36px; height: 34px; }
@media (max-width: 768px) { .cal-tag { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; font-size: 9px; padding: 1px 3px; } }

.phone-head { display: none; }
@media (max-width: 768px) {
  .phone-head { display: flex; align-items: center; background: var(--sidebar-bg); padding: 8px 14px; flex-shrink: 0; }
  .phone-head img { height: 28px; background: #fff; border-radius: 5px; padding: 3px 5px; }
  .filter-bar > * { flex: 0 0 auto !important; width: 100%; }
  .filter-bar .btn { width: auto; }
  .filter-bar input, .filter-bar select { height: 40px; }
}
@media (max-width: 768px) { #app { flex-direction: column !important; height: 100dvh; } .main { min-height: 0; flex: 1; } }

/* ===== phone: bigger tap areas, folding filters, full-screen details with a Back link ===== */
.fb-toggle { display: none; }
@media (max-width: 768px) {
  .fb-toggle { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 40px; font-weight: 600; }
  .filter-bar.fb-collapsed > *:not(.fb-toggle):not([type=search]) { display: none !important; }
  .btn, .btn-sm { min-height: 40px; }
  .nav-item, .more-grid-item { min-height: 44px; }
  select, .filter-select, .form-select, input[type=text], input[type=search], input[type=date], input[type=number] { min-height: 40px; font-size: 16px; }
  table td, table th { padding-top: 12px; padding-bottom: 12px; }
  .tab, .tabs .tab { padding-top: 12px; padding-bottom: 12px; }
  /* detail panels: whole screen, Back link on top-left instead of a small cross */
  .detail-panel { width: 100vw !important; max-width: 100vw; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; }
  .detail-panel::before { display: none !important; }
  .detail-panel .panel-header { padding-top: 14px; flex-direction: row-reverse; justify-content: flex-end; gap: 12px; align-items: center; }
  .detail-panel .panel-header .close-btn, .detail-panel .panel-header [data-action=close-panel], .detail-panel .panel-header #panel-close {
    width: auto !important; height: 40px !important; padding: 0 14px; border-radius: 20px; font-size: 0 !important; display: inline-flex; align-items: center; flex-shrink: 0;
  }
  .detail-panel .panel-header .close-btn::before, .detail-panel .panel-header [data-action=close-panel]::before, .detail-panel .panel-header #panel-close::before { content: '‹ Back'; font-size: 14px; font-weight: 600; color: var(--accent); }
}
.kpi-link { cursor: pointer; } .kpi-link:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(26,86,219,.1); }
@media (max-width: 768px) { .filter-bar .fb-toggle { flex: 1 1 100% !important; width: 100%; } }

/* ===== phone: tables become cards ===== */
@media (max-width: 768px) {
  table.rt-cards { min-width: 0 !important; width: 100%; border-collapse: separate; border-spacing: 0; }
  table.rt-cards thead { display: none; }
  table.rt-cards tbody { display: block; }
  table.rt-cards tr { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin: 0 0 10px; padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
  table.rt-cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0 !important; border: none !important; white-space: normal !important; text-align: right; min-height: 0; background: transparent !important; }
  table.rt-cards td:first-child { display: block; text-align: left; font-weight: 700; font-size: 15px; padding: 2px 0 8px !important; margin-bottom: 4px; border-bottom: 1px solid var(--border) !important; position: static; box-shadow: none; }
  table.rt-cards td::before { content: attr(data-label); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); text-align: left; flex-shrink: 0; }
  table.rt-cards td:first-child::before { content: none; }
  table.rt-cards td.rt-empty { display: none; }
  table.rt-cards td.rt-span { display: block; text-align: center; }
  table.rt-cards td.rt-span::before { content: none; }
  .table-wrap:has(table.rt-cards), .table-scroll:has(table.rt-cards), .card:has(> table.rt-cards) { background: transparent; border: none; box-shadow: none; overflow: visible; }
}
@media (max-width: 768px) {
  table.rt-cards td.rt-lead { display: none; }
  table.rt-cards td.rt-title { display: block; text-align: left; font-weight: 700; font-size: 15px; padding: 2px 0 8px !important; margin-bottom: 4px; border-bottom: 1px solid var(--border) !important; }
  table.rt-cards td.rt-title::before { content: none; }
}

/* Special Access (owner) */
.access-legend { display: grid; gap: 4px; font-size: 12px; color: var(--muted); margin: 10px 0 14px; }
.access-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.access-table th, .access-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.access-check { display: inline-flex; gap: 8px; align-items: center; min-height: 32px; }
