/* Quickobook Employee — design system: clean, flat, the logo blue on white.
   Class names are shared by every view. */

:root {
  color-scheme: light;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --brand: #31acff; --brand-hover: #1c9df5; --brand-active: #0f8fe6; --on-brand: #ffffff;
  /* The logo blue is too light for text on white: --brand-dark is for links and
     text on white, --on-brand for text on the blue. */
  --brand-dark: #0b6fb8; --brand-deep: #0a4a7f; --brand-soft: #d6eeff;
  --gradient: #31acff;
  --gradient-vivid: #31acff;

  --ink: #0b1324; --ink-soft: #334155; --muted: #64748b; --muted-soft: #94a3b8;
  --line: #dfeaf4; --line-soft: #edf5fb;
  --bg: #f4faff; --surface: #ffffff; --surface-alt: #f8fafc; --surface-raised: #ffffff;
  --hover: #eff8ff;

  --ok: #059669; --ok-bg: #ecfdf5; --ok-line: #a7f3d0;
  --warn: #b45309; --warn-bg: #fffbeb; --warn-line: #fde68a;
  --bad: #e11d48; --bad-bg: #fff1f2; --bad-line: #fecdd3;
  --info: #0369a1; --info-bg: #f0f9ff; --info-line: #bae6fd;
  --violet: #7c3aed; --violet-bg: #f5f3ff; --violet-line: #ddd6fe;
  --indigo: #4f46e5; --indigo-bg: #eef2ff;

  --sidebar-bg: #dff1ff; --sidebar-bg-alt: rgba(255,255,255,.65); --sidebar-ink: #0a4a7f; --sidebar-ink-strong: #062a47; --sidebar-line: rgba(10,74,127,.15);

  --radius-sm: 10px; --radius: 14px; --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.04);
  --shadow: 0 12px 32px -14px rgba(15,23,42,.22);
  --shadow-lg: 0 24px 60px -20px rgba(15,23,42,.35);
  --ring: 0 0 0 4px rgba(49,172,255,.18);
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
::selection { background: rgba(49,172,255,.22); }
a { color: var(--brand-dark); text-decoration: none; transition: color .15s; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, monospace; font-size: .92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
svg { flex-shrink: 0; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }

/* ───────────────────────── Shell */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar-bg); color: var(--sidebar-ink);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; isolation: isolate;
  border-right: 1px solid var(--sidebar-line);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px; min-width: 0; }
/* The logo carries the Quickobook wordmark; only the "Employee portal" label sits beside it. */
.sidebar .brand > span, .auth-art .brand > span { min-width: 0; white-space: nowrap; font-size: 0; }
.sidebar .brand > span small, .auth-art .brand > span small { font-size: 10.5px; line-height: 1.3; }
.sidebar .brand, .auth-art .brand { flex-direction: column; align-items: flex-start; gap: 8px; }
.brand img { height: 34px; background: #fff; border-radius: 10px; padding: 4px 7px; box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); }
.brand span { color: var(--sidebar-ink-strong); font-weight: 800; font-size: 15.5px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--sidebar-ink); font-weight: 600; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.nav-group { display: grid; gap: 2px; }
.nav-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--sidebar-ink); padding: 0 12px 6px; font-weight: 700; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px;
  color: var(--sidebar-ink); font-weight: 600; font-size: 13.5px; position: relative;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav-link:hover { background: var(--sidebar-bg-alt); color: var(--sidebar-ink-strong); text-decoration: none; }
.nav-link:active { transform: scale(.98); }
.nav-link.is-active { color: var(--brand-deep); background: #fff; box-shadow: 0 6px 16px -8px rgba(15,23,42,.45); }
.nav-link.is-active svg { color: var(--brand-dark); }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 0 7px; line-height: 19px; min-width: 19px; text-align: center;
  
}
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--sidebar-line); padding-top: 14px; display: grid; gap: 8px; }
.me { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--sidebar-bg-alt); }
.sidebar .avatar { background: #fff; color: var(--brand-deep); }
.me strong { color: var(--sidebar-ink-strong); display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me span { font-size: 11.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 32px; min-height: 76px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.topbar.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(15,23,42,.35); }
.topbar h1 { font-size: 22px; }
.topbar .muted { font-size: 13px; margin-top: 2px; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); display: inline-grid; place-items: center; cursor: pointer; transition: all .18s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--muted-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.date-chip { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.content { padding: 8px 32px 56px; display: grid; gap: 20px; align-content: start; }
.menu-toggle { display: none; }
.scrim { display: none; }

/* Entrance: each block of the page rises in, one after another */
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }
.content > * { animation: rise .25s ease-out both; }

/* ───────────────────────── Avatars */
.avatar {
  width: 36px; height: 36px; border-radius: 12px; background: var(--gradient); color: var(--on-brand);
  display: inline-grid; place-items: center; font-weight: 800; font-size: 12.5px; flex-shrink: 0; letter-spacing: .02em;
  }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; border-radius: 22px; }

/* ───────────────────────── Cards and grids */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px; min-width: 0;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: grid; gap: 12px; align-content: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* ───────────────────────── Hero */
.hero {
  background: var(--gradient-vivid); animation: rise .5s var(--ease) both;
  color: var(--on-brand); border-radius: 24px; padding: 28px 30px; display: flex; justify-content: space-between; gap: 20px;
  align-items: center; flex-wrap: wrap; position: relative; overflow: hidden; isolation: isolate;
  box-shadow: none;
}
.hero h1 { font-size: 28px; letter-spacing: -.02em; }
.hero p { font-weight: 500; }
.hero .clock { font-size: 40px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero-actions { display: flex; gap: 14px; align-items: center; position: relative; z-index: 1; flex-wrap: wrap; }
.hero .btn-light { background: #fff; color: var(--brand-deep); box-shadow: none; }
.hero .btn-light:hover { background: #f0fbff; }
.hero .btn-ghost { background: rgba(255,255,255,.25); color: var(--on-brand); border-color: rgba(255,255,255,.5); }

/* ───────────────────────── Stats */
.stat { display: grid; gap: 4px; position: relative; }
.card.stat { overflow: hidden; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px; }
.stat-icon svg { width: 19px; height: 19px; }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }

/* ───────────────────────── Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 11px; padding: 9px 16px;
  font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; line-height: 1.2; white-space: nowrap;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(15,23,42,.08);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s, background .18s;
}
.btn:hover { text-decoration: none; background: var(--brand-hover); }
.btn:active { background: var(--brand-active); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn svg { width: 16px; height: 16px; }
.btn-secondary { background: var(--surface); color: var(--ink-soft); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-alt); color: var(--ink); border-color: var(--muted-soft); }
.btn-ok { background: #059669; color: #fff; } .btn-ok:hover { background: #047857; }
.btn-bad { background: #dc2626; color: #fff; } .btn-bad:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 13px; }
.btn-link { background: none; border: 0; color: var(--brand-dark); padding: 0; font-weight: 700; cursor: pointer; font: inherit; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
a.btn:not([href]) { opacity: .5; pointer-events: none; }

/* ───────────────────────── Forms */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .two { grid-column: span 2; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.field small { color: var(--muted); font-size: 12px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px;
  font: inherit; font-size: 14px; background: var(--surface); color: var(--ink); min-width: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--muted-soft); }
.input:hover { border-color: color-mix(in srgb, var(--muted-soft) 70%, var(--line)); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 16px; }
textarea.input { min-height: 96px; resize: vertical; }
.input.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 46px; }
.password-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 9px; display: grid; place-items: center; transition: all .15s; }
.password-toggle:hover { color: var(--ink); background: var(--line-soft); }
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle .when-shown, .password-toggle.is-shown .when-hidden { display: none; }
.password-toggle.is-shown .when-shown { display: block; }
.error { color: var(--bad); font-size: 12px; font-weight: 600; }
.check { display: inline-flex; gap: 9px; align-items: center; font-weight: 600; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.days-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.days-picker label { border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; cursor: pointer; font-weight: 700; font-size: 12.5px; background: var(--surface); transition: all .15s; }
.days-picker label:hover { border-color: var(--brand); }
.days-picker input { display: none; }
.days-picker label:has(input:checked) { background: var(--gradient); border-color: transparent; color: var(--on-brand); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; grid-column: 1 / -1; padding-top: 12px; border-top: 1px dashed var(--line); margin-top: 4px; }
.section-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* ───────────────────────── Alerts (flash messages slide in) */
.alert { border-radius: 14px; padding: 12px 16px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; }
.alert svg { margin-top: 1px; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.content > .alert { animation: alert-in .45s var(--ease) both; }
@keyframes alert-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ───────────────────────── Tables */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-alt); }
th:first-child { border-top-left-radius: 10px; } th:last-child { border-top-right-radius: 10px; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: var(--hover); }
.person { display: flex; align-items: center; gap: 11px; }
.person strong { display: block; }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); font-weight: 500; }
.card.empty { border-style: dashed; }

/* ───────────────────────── Pills */
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.pill-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.pill-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.pill-violet { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-line); }
.pill-muted { background: var(--line-soft); color: var(--muted); border-color: var(--line); }

/* ───────────────────────── Tabs */
.tabs { display: flex; gap: 4px; background: var(--line-soft); padding: 4px; border-radius: 13px; width: fit-content; flex-wrap: wrap; border: 1px solid var(--line); }
.tabs a { padding: 7px 14px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 13px; transition: all .18s var(--ease); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ───────────────────────── Attendance calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-head { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; text-align: center; padding-bottom: 2px; }
.cal-day { border: 1px solid var(--line); border-radius: 14px; padding: 9px 10px; min-height: 90px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); position: relative; transition: transform .18s var(--ease), box-shadow .18s; }
.cal-day:not(.cal-blank):hover { border-color: var(--muted-soft); }
.cal-day .num { font-weight: 800; font-size: 13px; }
.cal-day .what { font-size: 11.5px; font-weight: 700; }
.cal-day .time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day .acts { position: absolute; top: 8px; right: 8px; font-size: 10.5px; font-weight: 800; color: var(--info); background: var(--info-bg); border-radius: 999px; padding: 0 7px; }
.cal-blank { border: 0; background: none; }
.st-present { border-color: var(--ok-line); background: var(--ok-bg); } .st-present .what { color: var(--ok); }
.st-half_day, .st-half_leave { border-color: var(--warn-line); background: var(--warn-bg); } .st-half_day .what, .st-half_leave .what { color: var(--warn); }
.st-leave { border-color: var(--violet-line); background: var(--violet-bg); } .st-leave .what { color: var(--violet); }
.st-holiday { border-color: var(--info-line); background: var(--info-bg); } .st-holiday .what { color: var(--info); }
.st-off, .st-not_joined, .st-exited, .st-upcoming { background: var(--surface-alt); } .st-off .what, .st-upcoming .what, .st-not_joined .what, .st-exited .what { color: var(--muted-soft); }
.st-absent { border-color: var(--bad-line); background: var(--bad-bg); } .st-absent .what { color: var(--bad); }
.st-today { border: 2px solid var(--brand); box-shadow: var(--ring); } .st-today .what { color: var(--brand-dark); }
.st-untracked { background: var(--ok-bg); border-style: dashed; opacity: .85; } .st-untracked .what { color: var(--ok); }
.st-wfh { border-color: color-mix(in srgb, var(--indigo) 35%, transparent); background: var(--indigo-bg); } .st-wfh .what { color: var(--indigo); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 600; align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ───────────────────────── HR registers */
.register { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.register th, .register td { padding: 0; border-bottom: 1px solid var(--line-soft); text-align: center; }
.register th { padding: 7px 2px; min-width: 28px; }
.register th.sticky, .register td.sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; padding: 9px 12px; min-width: 200px; border-right: 1px solid var(--line); }
.register th.sticky { background: var(--surface-alt); }
.register th.weekend { color: var(--muted-soft); }
.register th.reg-group { border-left: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.register tbody tr:hover td.sticky { background: var(--hover); }
.dot, .lv { width: 25px; height: 25px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 800; font-size: 10.5px; margin: 3px 2px; border: 0; padding: 0; cursor: pointer; font-family: inherit; vertical-align: middle; transition: transform .15s var(--ease), box-shadow .15s; }
button.dot:not([disabled]):hover, button.lv:hover { box-shadow: inset 0 0 0 2px var(--brand); }
.d-present { background: var(--ok-bg); color: var(--ok); }
.d-half_day, .d-half_leave { background: var(--warn-bg); color: var(--warn); }
.d-leave { background: var(--violet-bg); color: var(--violet); }
.d-holiday { background: var(--info-bg); color: var(--info); }
.d-absent { background: var(--bad-bg); color: var(--bad); }
.d-today { background: var(--surface); color: var(--brand-dark); box-shadow: inset 0 0 0 2px var(--brand); }
.d-off, .d-upcoming, .d-not_joined, .d-exited { background: transparent; color: var(--muted-soft); cursor: default; }
.d-late { box-shadow: inset 0 -3px 0 var(--warn); }
.d-untracked { background: var(--ok-bg); color: var(--ok); opacity: .7; }
.d-wfh { background: var(--indigo-bg); color: var(--indigo); }
.d-short { box-shadow: inset 0 -3px 0 var(--bad); }
.d-missed { outline: 2px dashed var(--warn); outline-offset: -2px; }
.lv-none { background: var(--line-soft); color: transparent; }
.lv-none:hover { background: var(--brand-soft); }
.lv-off { background: transparent; color: var(--muted-soft); cursor: default; }
.lv-CL { background: var(--violet-bg); color: var(--violet); }
.lv-SL { background: var(--info-bg); color: var(--info); }
.lv-PL { background: var(--ok-bg); color: var(--ok); }
.lv-LWP { background: var(--bad-bg); color: var(--bad); }
.lv-half { font-size: 9.5px; box-shadow: inset 0 -3px 0 var(--warn); }
.lv-pending { box-shadow: inset 0 0 0 2px currentColor; background: var(--surface); }
.legend .lv { cursor: default; margin: 0 4px 0 0; }
.legend .lv:hover { transform: none; box-shadow: none; }

/* ───────────────────────── Leave balances */
.balance { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 9px; }
.balance-top { display: flex; justify-content: space-between; align-items: baseline; }
.balance-num { font-size: 32px; font-weight: 800; letter-spacing: -.03em; }
.balance-over { color: var(--warn); font-weight: 700; }
.bar { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; transform-origin: left; animation: grow .9s var(--ease) both .2s; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar .used { background: var(--gradient); }
.bar .pending { background: #fbbf24; }
.bar .left { background: color-mix(in srgb, var(--ok) 45%, transparent); }

/* ───────────────────────── Timeline (work log) */
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 74px 22px 1fr; gap: 10px; }
.tl-time { text-align: right; font-size: 12px; color: var(--muted); padding-top: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.tl-line { position: relative; }
.tl-line::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-line::after { content: ""; position: absolute; left: 5px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.tl-body { padding: 10px 0 14px; border-bottom: 1px solid var(--line-soft); }
.tl-day { font-weight: 800; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 18px 0 6px 106px; }

/* ───────────────────────── Payslip */
.slip { max-width: 840px; }
.slip-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.slip-head img { height: 38px; }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; }
.kv div span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.kv div strong { font-weight: 700; }
.slip-table td, .slip-table th { padding: 10px 12px; }
.slip-net { background: var(--gradient); color: var(--on-brand); border-radius: 16px; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.slip-net strong { font-size: 28px; letter-spacing: -.03em; }

/* ───────────────────────── Announcements */
.note { border-left: 3px solid var(--brand); padding: 6px 0 6px 14px; display: grid; gap: 4px; border-radius: 0 10px 10px 0; transition: background .15s; }
.note:hover { background: var(--hover); }
.note.pinned { border-color: var(--warn); background: color-mix(in srgb, var(--warn-bg) 60%, transparent); }

/* ───────────────────────── Pagination */
.pager { display: flex; gap: 6px; justify-content: flex-end; padding-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; font-weight: 700; font-size: 12.5px; background: var(--surface); color: var(--ink-soft); }
.pager a:hover { border-color: var(--brand); color: var(--brand-dark); text-decoration: none; }
.pager span.is-current { background: var(--gradient); color: var(--on-brand); border-color: transparent; }
.pager span.is-disabled { color: var(--muted-soft); }

/* ───────────────────────── Dialogs */
dialog { border: 1px solid var(--line); border-radius: 22px; padding: 0; box-shadow: var(--shadow-lg); width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
dialog[open] { animation: pop .28s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(2,6,23,.55); backdrop-filter: blur(4px); }
dialog form { padding: 22px; display: grid; gap: 14px; }

/* ───────────────────────── Login */
.auth-page { min-height: 100vh; background: #f4faff; color: #0b1324; display: grid; grid-template-columns: minmax(420px, 1.05fr) 1fr; }
.auth-art {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--brand); color: var(--on-brand);
  padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-art .brand { padding: 0; }
.auth-art .eyebrow { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--on-brand); margin-bottom: 14px; }
.auth-art h1 { color: var(--on-brand); font-size: clamp(30px, 3vw, 42px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; max-width: 520px; }
.auth-art .lead { color: var(--on-brand); font-weight: 500; font-size: 15.5px; max-width: 480px; margin-top: 14px; line-height: 1.6; }
.auth-features { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 18px; max-width: 480px; }
.auth-features li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.auth-features i { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-style: normal; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35); color: var(--on-brand); }
.auth-features i svg { width: 18px; height: 18px; }
.auth-features strong { display: block; color: var(--on-brand); font-size: 14px; font-weight: 700; }
.auth-features span { color: var(--on-brand); font-size: 13.5px; font-weight: 500; }
.auth-foot { color: var(--on-brand); font-weight: 500; font-size: 12.5px; display: flex; gap: 8px 20px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.35); padding-top: 18px; }

.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card {
  width: 100%; max-width: 400px; display: grid; gap: 18px; padding: 36px 34px; border-radius: 20px;
  background: #fff; border: 1px solid #e5e9f0; box-shadow: 0 10px 30px -18px rgba(15,23,42,.25);
  position: relative;
}
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.auth-card .muted { color: #64748b; }
.auth-card .input { background: #fff; border-color: #dfe4ec; color: #0b1324; padding-left: 42px; height: 46px; }
.auth-card .input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(49,172,255,.14); }
.auth-card .field > span { color: #334155; }
.with-icon { position: relative; display: block; }
.with-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #94a3b8; pointer-events: none; z-index: 1; transition: color .15s; }
.with-icon:focus-within > svg { color: var(--brand); }
.auth-card .btn-lg { height: 48px; font-size: 15px; }
.auth-card .btn .spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: var(--on-brand); animation: rot .7s linear infinite; }
.auth-card .btn.is-loading .spinner { display: block; }
.auth-card .btn.is-loading .label-icon { display: none; }
@keyframes rot { to { transform: rotate(360deg); } }
.auth-card .alert-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.auth-card .alert-bad { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.auth-card .error { color: #e11d48; }
.auth-card .check { color: #334155; }
.auth-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: #64748b; font-weight: 600; }
.auth-clock { font-variant-numeric: tabular-nums; }
.auth-help { text-align: center; font-size: 12.5px; color: #64748b; border-top: 1px solid #eef1f6; padding-top: 16px; }
.shake { animation: shake .4s var(--ease) both; }
@keyframes shake { 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }

/* ───────────────────────── Responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-page { grid-template-columns: 1fr 1fr; }
  .auth-features { display: none; }
  .auth-art { padding: 36px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 40; transform: translateX(-100%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(2,6,23,.5); backdrop-filter: blur(2px); animation: rise .2s both; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 12px 16px; min-height: 64px; }
  .topbar h1 { font-size: 19px; }
  .date-chip { display: none; }
  .content { padding: 8px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .two { grid-column: auto; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .card { padding: 18px; }
  .hero { padding: 22px; }
  .hero .clock { font-size: 32px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form { min-height: 100vh; }
  .auth-card { padding: 28px 22px; }
  .cal { gap: 4px; }
  .cal-day { min-height: 62px; padding: 6px; border-radius: 10px; }
  .cal-day .time { display: none; }
  .tl-item { grid-template-columns: 56px 22px 1fr; }
  .tl-day { padding-left: 88px; }
}
@media (max-width: 520px) { .grid-4 { grid-template-columns: 1fr 1fr; } .stat-value { font-size: 24px; } }

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

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .shell { display: block; } .content { padding: 0; } .card { border: 0; box-shadow: none; }
  .content > * { animation: none !important; }
}

/* Field visits and tracking */
.track-bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.track-bar .btn { margin-left: auto; }
.track-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--warn); flex: none; box-shadow: 0 0 0 4px var(--warn-bg); }
.track-dot.is-on { background: var(--ok); box-shadow: 0 0 0 4px rgba(22,163,74,.15); animation: track-pulse 2s infinite; }
.track-dot.is-off { background: var(--bad); box-shadow: 0 0 0 4px rgba(220,38,38,.12); }
@keyframes track-pulse { 50% { box-shadow: 0 0 0 7px rgba(22,163,74,.05); } }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-bar .field { min-width: 150px; flex: 1 1 150px; }
.filter-bar .btn { flex: none; }
.track-grid { align-items: start; }
.route-map { height: 520px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line, #e2e8f0); z-index: 0; }
.track-grid .dt-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.track-grid .dt-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; }
.track-grid .dt-buttons .dt-button { font: 600 12px Inter, sans-serif; border-radius: 8px; padding: 5px 10px; }
.track-grid .dataTables_filter input { border: 1px solid #cbd5e1; border-radius: 8px; padding: 5px 8px; }
@media (max-width: 860px) { .route-map { height: 360px; } }
#points-table td:nth-child(2) { min-width: 190px; }
@media (min-width: 1101px) { .track-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); } }
.track-grid .dataTables_wrapper { overflow-x: auto; }

/* Location chip in the top bar for field staff */
.loc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none; background: var(--warn-bg); color: var(--warn); white-space: nowrap; }
.loc-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.loc-chip.is-on { background: rgba(22,163,74,.12); color: var(--ok); }
.loc-chip.is-on .loc-chip-dot { animation: track-pulse 2s infinite; }
.loc-chip.is-off { background: rgba(220,38,38,.1); color: var(--bad); }
.alert[hidden] { display: none; }

/* Visit purpose and yes/no choices */
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; background: var(--surface, #fff); }
.choice:has(input:checked) { border-color: var(--brand); background: rgba(14,165,233,.08); }
.work-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.work-yes { color: var(--ok); }
.work-no { color: var(--bad); }

.choice-buttons .choice { flex: 1 1 0; justify-content: center; font-weight: 600; }

/* Field: target bars, doctor picker */
.bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.bar span.is-done { background: var(--ok); }
.doctor-picker { position: relative; }
.doctor-results { position: absolute; left: 0; right: 0; top: 64px; z-index: 20; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.12); max-height: 300px; overflow-y: auto; }
.doctor-results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.doctor-results li[data-i]:hover { background: var(--line-soft); }
