/* TimeTRAC (SelectROW) - design system, v5: the SelectROW app look (app.selectrow.net).
   White pages, bordered cards, a section nav with an underline, a sub-tab row, grey table headers, status pills,
   black primary buttons, a dark theme ([data-theme="dark"] on <html>). Laptop first; the same pages fit a phone. */
:root {
  color-scheme: light;
  /* SelectROW brand: burgundy #972d40 and gray #6d6e71 from the SR logo */
  --brand-900: #4a1620; --brand-800: #7d2434; --brand-700: #972d40; --brand-600: #b04a5d; --brand-100: #f6e7ea; --brand-50: #fbf5f6;
  --gray-700: #6d6e71; --gray-300: #d1d2d4;
  --ink: #111827; --ink-2: #374151; --muted: #6b7280; --line: #e5e7eb; --line-2: #f1f3f5; --bg: #ffffff; --bg-2: #f9fafb; --card: #ffffff; --hover: #f9fafb;
  --link: #2563eb; --black: #111827; --black-2: #1f2937;
  --green-600: #15803d; --green-100: #dcfce7; --green-50: #f0fdf4; --amber-600: #b45309; --amber-100: #fef3c7; --red-600: #dc2626; --red-100: #fee2e2; --red-50: #fef2f2; --blue-600: #2563eb; --blue-100: #dbeafe;
  --green-800: #166534; --green-200: #bbf7d0; --amber-800: #92400e; --amber-200: #fde68a; --amber-50: #fffbeb; --amber-500: #f59e0b; --red-800: #991b1b; --red-200: #fecaca; --blue-800: #1e40af; --blue-500: #3b82f6;
  --grey-100: #f1f5f9; --grey-200: #e2e8f0; --grey-700: #334155; --on-accent: #ffffff; --on-brand: #ffffff; --brand-solid: #972d40;
  --clock-in: #15803d; --clock-out: #dc2626; --switch: #b45309;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(17,24,39,.05), 0 1px 3px rgba(17,24,39,.04);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --tabbar-h: 64px; --topbar-h: 64px; --subnav-h: 50px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --brand-900: #f3d9de; --brand-800: #e3a9b4; --brand-700: #d9788b; --brand-600: #c75f74; --brand-100: #3a1f26; --brand-50: #241519;
  --ink: #e5e7eb; --ink-2: #cbd5e1; --muted: #9ca3af; --line: #2a303b; --line-2: #1f242d; --bg: #0f1218; --bg-2: #151a22; --card: #161b24; --hover: #1b212b;
  --link: #60a5fa; --black: #e5e7eb; --black-2: #cbd5e1;
  --green-600: #4ade80; --green-100: #14321f; --green-50: #0f2418; --amber-600: #fbbf24; --amber-100: #3b2a0a; --red-600: #f87171; --red-100: #3b1414; --red-50: #2a1010; --blue-600: #60a5fa; --blue-100: #1e2a44;
  --green-800: #86efac; --green-200: #1f4d2e; --amber-800: #fcd34d; --amber-200: #5a3f0e; --amber-50: #221a0a; --amber-500: #fbbf24; --red-800: #fca5a5; --red-200: #5a1f1f; --blue-800: #93c5fd; --blue-500: #60a5fa;
  --grey-100: #1b212b; --grey-200: #2a303b; --grey-700: #cbd5e1; --on-accent: #0f1218; --on-brand: #ffffff; --brand-solid: #972d40;
  --clock-in: #16a34a; --clock-out: #dc2626; --switch: #d97706;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .tiny { font-size: .78rem; } .center { text-align: center; }
.mono { font-family: var(--mono); } .right { text-align: right; } .nowrap { white-space: nowrap; } .bold { font-weight: 600; }
.h-big { font-size: 3rem; }
.inline { display: inline; }
.hidden { display: none !important; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: .75rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; } .mt-s { margin-top: .5rem; } .mb-s { margin-bottom: .5rem; }

/* ---- top bar: brand, section nav with underline, search, bell, theme, avatar ---- */
.topbar { display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem; background: var(--card); color: var(--ink); position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); min-height: var(--topbar-h); }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { height: 34px; width: 34px; border-radius: 7px; display: block; }
.brand-word { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.brand-word b { color: var(--brand-700); font-weight: 700; }
.brand-app { display: none; align-items: center; gap: .5rem; padding-left: .85rem; margin-left: .25rem; border-left: 1px solid var(--line); color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
@media (min-width: 1100px) { .brand-app { display: inline-flex; } }
.topnav { display: none; align-items: stretch; align-self: stretch; margin-left: 1rem; gap: .15rem; }
.topnav > .nav-item { position: relative; display: flex; align-items: stretch; }
.topnav > .nav-item > a, .topnav > .nav-item > button { display: inline-flex; align-items: center; gap: .3rem; padding: 0 .85rem; color: var(--ink-2); font: inherit; font-weight: 500; font-size: .95rem; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.topnav > .nav-item > a:hover, .topnav > .nav-item > button:hover { text-decoration: none; color: var(--ink); }
.topnav > .nav-item.active > a, .topnav > .nav-item.active > button { color: var(--brand-700); border-bottom-color: var(--brand-700); font-weight: 600; }
.topnav .chev { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; opacity: .7; }
.topnav .menu { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(17,24,39,.12); padding: .35rem; z-index: 50; }
.topnav .nav-item.open > .menu, .topnav .nav-item:focus-within > .menu { display: block; }
@media (hover: hover) { .topnav .nav-item:hover > .menu { display: block; } }
.topnav .menu a { display: block; padding: .5rem .7rem; border-radius: 7px; color: var(--ink-2); font-size: .92rem; }
.topnav .menu a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.topnav .menu a.active { color: var(--brand-700); font-weight: 600; background: var(--brand-50); }
.topnav .menu .group { padding: .5rem .7rem .15rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.search-box { display: none; align-items: center; gap: .5rem; min-width: 260px; max-width: 420px; flex: 1; height: 40px; padding: 0 .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); color: var(--muted); font: inherit; font-size: .92rem; cursor: text; text-align: left; }
.search-box:hover { border-color: var(--gray-300); }
.search-box svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; }
.search-box span { flex: 1; }
.search-box kbd { font-family: var(--font); font-size: .72rem; border: 1px solid var(--line); border-radius: 5px; padding: .05rem .35rem; color: var(--muted); background: var(--card); }
@media (min-width: 900px) { .search-box { display: inline-flex; } .icon-btn.search-icon { display: none; } }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .count { position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 .3rem; border-radius: 999px; background: var(--red-600); color: var(--on-accent); font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand-solid); color: var(--on-brand); font-weight: 700; font-size: .82rem; letter-spacing: .02em; cursor: pointer; display: grid; place-items: center; }
.avatar:hover { filter: brightness(1.08); }
.pop { position: relative; }
.pop .menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(17,24,39,.14); padding: .4rem; z-index: 60; }
.pop.open .menu { display: block; }
.pop .menu .who { padding: .5rem .7rem .55rem; border-bottom: 1px solid var(--line-2); margin-bottom: .3rem; }
.pop .menu .who b { display: block; font-size: .95rem; color: var(--ink); }
.pop .menu .who span { font-size: .8rem; color: var(--muted); }
.pop .menu a, .pop .menu button.item { display: flex; width: 100%; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: 8px; color: var(--ink-2); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.pop .menu a:hover, .pop .menu button.item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.pop .menu .item.danger { color: var(--red-600); }
.notif-list { max-height: 360px; overflow: auto; }
.notif { display: block; padding: .55rem .7rem; border-radius: 8px; color: var(--ink); }
.notif:hover { background: var(--hover); text-decoration: none; }
.notif .t { font-weight: 600; font-size: .9rem; }
.notif .s { font-size: .8rem; color: var(--muted); }
.notif-empty { padding: .9rem .7rem; color: var(--muted); font-size: .9rem; text-align: center; }

/* ---- sub-tabs row (the section's pages) ---- */
.subnav { display: flex; gap: .25rem; align-items: stretch; min-height: var(--subnav-h); padding: 0 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; position: sticky; top: var(--topbar-h); z-index: 30; }
.subnav a { display: inline-flex; align-items: center; padding: 0 .9rem; color: var(--muted); font-weight: 500; font-size: .95rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 .35rem; border-radius: 999px; background: var(--amber-600); color: var(--on-accent); font-size: .72rem; font-weight: 700; margin-left: .3rem; vertical-align: middle; line-height: 1; }
.subnav a .count-badge { margin-left: .35rem; }
@media (max-width: 899px) { .subnav { position: static; } }

/* ---- bottom tab bar (phones) ---- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); display: flex; z-index: 20; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .72rem; font-weight: 600; }
.tabbar a:hover { text-decoration: none; }
.tabbar a.active { color: var(--brand-700); }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 900px) { .topnav { display: flex; } body { padding-bottom: 2rem; } .tabbar { display: none !important; } }

/* ---- command palette (search / ⌘K) ---- */
.cmdk { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 10vh 1rem 1rem; background: rgba(17,24,39,.45); }
.cmdk.open { display: flex; }
.cmdk-box { width: 100%; max-width: 620px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.25); overflow: hidden; }
.cmdk-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: .9rem 1rem; font-size: 1.05rem; min-height: 56px; background: var(--card); color: var(--ink); }
.cmdk-box input:focus { outline: none; }
.cmdk-list { max-height: 50vh; overflow: auto; padding: .4rem; }
.cmdk-group { padding: .5rem .6rem .2rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cmdk-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 8px; color: var(--ink); cursor: pointer; }
.cmdk-item:hover, .cmdk-item.active { background: var(--hover); text-decoration: none; }
.cmdk-item .code { font-family: var(--mono); font-size: .78rem; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 5px; padding: .05rem .35rem; }
.cmdk-item .sub { color: var(--muted); font-size: .8rem; margin-left: auto; white-space: nowrap; }
.cmdk-empty { padding: 1rem .6rem; color: var(--muted); text-align: center; }
.cmdk-foot { display: flex; gap: 1rem; padding: .5rem .9rem; border-top: 1px solid var(--line-2); color: var(--muted); font-size: .75rem; }
.cmdk-foot kbd { font-family: var(--font); border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; }

/* ---- page + cards ---- */
.page { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1.25rem 1rem; }
.page.wide { max-width: 1600px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.15rem; margin-bottom: 1rem; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.card.tight { padding: .8rem .95rem; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.card-title h2, .card-title h3 { margin: 0; }
.announce { background: var(--amber-100); border: 1px solid var(--amber-200); color: var(--amber-800); border-radius: var(--radius-sm); padding: .6rem .9rem; margin-bottom: 1rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { display: inline-flex; align-items: baseline; gap: .6rem; margin-bottom: .1rem; }
.page-head h1 .records, h1 .records { font-size: .95rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.section-label { font-size: .85rem; font-weight: 600; color: var(--ink-2); padding-bottom: .4rem; border-bottom: 1px solid var(--line); margin: 1.1rem 0 .85rem; }

/* flash */
.flash { position: relative; padding: .7rem 2.4rem .7rem .9rem; border-radius: var(--radius-sm); margin-bottom: .75rem; font-weight: 500; border: 1px solid transparent; }
.flash-info { background: var(--blue-100); color: var(--blue-800); border-color: transparent; }
.flash-success { background: var(--green-100); color: var(--green-800); border-color: transparent; }
.flash-error { background: var(--red-100); color: var(--red-800); border-color: transparent; }
.flash-warning { background: var(--amber-100); color: var(--amber-800); border-color: transparent; }
.flash-close { position: absolute; right: .4rem; top: .3rem; border: 0; background: transparent; font-size: 1.3rem; line-height: 1; color: inherit; cursor: pointer; padding: .2rem .5rem; }

/* ---- buttons: black primary, bordered secondary ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 9px; padding: .55rem 1rem; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; background: var(--line-2); color: var(--ink); text-decoration: none; min-height: 40px; transition: filter .12s, transform .05s, background .12s; }
.btn:hover { filter: brightness(.97); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--black); color: var(--on-accent); }
.btn-success { background: var(--clock-in); color: #fff; }
.btn-danger { background: var(--clock-out); color: #fff; }
.btn-warn { background: var(--switch); color: #fff; } /* the clock colours stay saturated in both themes, so white text holds */
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); filter: none; }
.btn-link { background: transparent; color: var(--link); padding: .3rem .4rem; min-height: 0; }
.btn-sm { padding: .35rem .7rem; min-height: 34px; font-size: .86rem; border-radius: 8px; }
.btn-lg { padding: .9rem 1.4rem; font-size: 1.05rem; border-radius: 12px; min-height: 54px; }
.btn-block { width: 100%; }
.btn-clock { width: 100%; min-height: 84px; font-size: 1.35rem; border-radius: 16px; letter-spacing: .01em; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.btn-icon { padding: .4rem; min-height: 0; width: 36px; height: 36px; }

/* ---- forms ---- */
.field { display: grid; gap: .3rem; margin-bottom: .85rem; }
.field label, .label { font-size: .85rem; font-weight: 500; color: var(--ink-2); }
.field .help { font-size: .78rem; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; font: inherit; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); min-height: 42px; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right .65rem center; padding-right: 2rem; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--black); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.form-row { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row.three { grid-template-columns: 1fr 1fr 1fr; } }
.form-row > .field { align-content: start; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.req::after { content: " *"; color: var(--red-600); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 600; color: var(--ink); padding: 0 .4rem; }

/* typeahead */
.typeahead { position: relative; }
.typeahead-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(17,24,39,.12); max-height: 320px; overflow: auto; margin-top: 4px; }
.typeahead-item { padding: .6rem .75rem; cursor: pointer; border-bottom: 1px solid var(--line-2); display: grid; gap: 1px; }
.typeahead-item:hover, .typeahead-item.active { background: var(--hover); }
.typeahead-item .ti-title { font-weight: 600; }
.typeahead-item .ti-sub { font-size: .78rem; color: var(--muted); }
.typeahead-empty { padding: .7rem .75rem; color: var(--muted); font-size: .9rem; }
.chip-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: .35rem .75rem; font-size: .85rem; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.chip:hover, .chip.active { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-900); }

/* clock screen */
.clock-hero { text-align: center; padding: .5rem 0 .75rem; }
.clock-status { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.clock-status.on { color: var(--green-600); }
.clock-timer { font-family: var(--mono); font-size: 3.2rem; font-weight: 700; line-height: 1.1; color: var(--ink); margin: .25rem 0; font-variant-numeric: tabular-nums; }
.clock-job { font-weight: 600; font-size: 1.05rem; }
.clock-sub { color: var(--muted); font-size: .9rem; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .75rem 0; }
.total { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: .6rem .5rem; text-align: center; }
.total .v { font-size: 1.25rem; font-weight: 700; font-family: var(--mono); color: var(--ink); }
.total .l { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---- tables: grey 14px headers, roomy rows, light separators ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .7rem .8rem; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { background: var(--card); color: var(--muted); font-weight: 500; font-size: .84rem; letter-spacing: 0; text-transform: none; white-space: nowrap; position: sticky; top: 0; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: var(--hover); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr.total-row td { font-weight: 700; background: var(--bg-2); }
.table-sm th, .table-sm td { padding: .45rem .6rem; font-size: .86rem; }
.code-chip, .mono-chip { display: inline-block; font-family: var(--mono); font-size: .8rem; padding: .1rem .45rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }

/* pagination footer */
.pager { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: .75rem; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.pager .pages { display: inline-flex; align-items: center; gap: .5rem; }

/* ---- badges: sentence-case pills ---- */
.badge { display: inline-block; padding: .18rem .55rem; border-radius: 6px; font-size: .78rem; font-weight: 600; letter-spacing: 0; text-transform: none; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok, .badge-approved, .badge-active { background: var(--green-100); color: var(--green-800); }
.badge-warn, .badge-submitted, .badge-partial { background: var(--amber-100); color: var(--amber-800); }
.badge-bad, .badge-rejected, .badge-inactive { background: var(--red-100); color: var(--red-800); }
.badge-info, .badge-open, .badge-manual { background: var(--blue-100); color: var(--blue-800); }
.badge-none { background: var(--line-2); color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: .35rem; }
.dot.on { background: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }

/* entry list (timesheets) */
.day { margin-bottom: 1rem; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: .25rem .2rem; border-bottom: 1px solid var(--line); margin-bottom: .4rem; }
.day-head .d { font-weight: 600; color: var(--ink); }
.day-head .t { font-family: var(--mono); font-weight: 700; }
.entry { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; padding: .6rem .7rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .4rem; }
.entry.open { border-color: var(--green-600); box-shadow: 0 0 0 2px var(--green-100); }
.entry.locked { background: var(--bg-2); }
.entry .e-job { font-weight: 600; }
.entry .e-meta { font-size: .8rem; color: var(--muted); }
.entry .e-notes { font-size: .85rem; color: var(--ink-2); white-space: pre-wrap; grid-column: 1 / -1; }
.entry .e-hours { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; text-align: right; }
.entry .e-actions { grid-column: 1 / -1; display: flex; gap: .4rem; justify-content: flex-end; }
.week-nav { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.week-nav .wk { font-weight: 700; color: var(--ink); text-align: center; }
.week-bar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: .75rem; }
.week-bar a { display: grid; text-align: center; padding: .35rem 0; border-radius: 8px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-size: .72rem; }
.week-bar a:hover { text-decoration: none; background: var(--hover); }
.week-bar a.today { border-color: var(--ink); }
.week-bar a .h { font-family: var(--mono); font-weight: 700; color: var(--ink); font-size: .8rem; }

/* ---- KPI cards (label, big value, optional icon; .alert for the red ones) ---- */
.kpi { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 760px) { .kpi { grid-template-columns: repeat(4, 1fr); } }
.kpi .card { margin: 0; position: relative; }
.kpi .v { font-size: 1.75rem; font-weight: 700; font-family: var(--font); color: var(--ink); letter-spacing: -.02em; line-height: 1.15; }
.kpi .l { font-size: .82rem; color: var(--muted); letter-spacing: 0; text-transform: none; margin-top: .15rem; }
.kpi .card.alert, .card.alert { background: var(--red-50); border-color: var(--red-600); }
.kpi .card.alert .v { color: var(--red-600); }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: .75rem; }
.toolbar .field { margin: 0; }
.filters-label { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .9rem; color: var(--ink-2); align-self: center; margin-right: .25rem; }
.filters-label svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.pill-tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pill-tabs a { padding: .4rem .8rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; font-size: .9rem; }
.pill-tabs a.active { background: var(--black); color: var(--on-accent); border-color: var(--black); }
.pill-tabs a:hover { text-decoration: none; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
body.login-body .page { max-width: none; padding: 0; }
body.login-body { padding-bottom: 0; background: var(--bg-2); }
.login-wrap { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1rem; padding: 1.5rem 1rem; background: var(--bg-2); }
.login-card { width: min(100%, 420px); padding: 1.6rem 1.5rem 1.4rem; }
.login-brand { text-align: center; margin-bottom: 1.1rem; }
.login-wordmark { display: inline-flex; align-items: center; gap: .55rem; margin-bottom: .9rem; }
.login-wordmark .brand-mark { height: 40px; width: 40px; border-radius: 9px; }
.login-wordmark .brand-word { font-size: 1.35rem; }
.login-brand h1 { color: var(--ink); letter-spacing: -.01em; font-size: 1.5rem; margin-bottom: .25rem; }
.login-brand .app-tag { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.login-foot { margin: 0; }
.progress { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--blue-600); }
details.acc { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .8rem; margin-bottom: .5rem; background: var(--card); }
details.acc summary { cursor: pointer; font-weight: 600; }
.split { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 980px) { .split { grid-template-columns: 300px 1fr; } .split.wide-left { grid-template-columns: 380px 1fr; } }
.sidenav a { display: block; padding: .5rem .7rem; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.sidenav a.active, .sidenav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.sidenav .group { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .8rem .7rem .3rem; }
code, pre { font-family: var(--mono); font-size: .85rem; }
pre { background: #0f1720; color: #e6edf3; padding: .8rem 1rem; border-radius: var(--radius-sm); overflow-x: auto; }
.print-only { display: none; }
@media print { .topbar, .subnav, .tabbar, .btn, .toolbar, .flash { display: none !important; } .page { max-width: none; padding: 0; } .card { box-shadow: none; border: 1px solid #ccc; } .print-only { display: block; } }

/* Google Workspace sign-in */
.google-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: .75rem; }
.or-line { display: flex; align-items: center; gap: .6rem; margin: .25rem 0 .9rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
