/* VT Payroll Automation — single stylesheet, no external dependencies. */

/**
 * Virtual Teammate's own palette, taken from the marketing site and portal
 * (`c:/wamp64/www/vtnew/css/style.css` and `vtnew/portal/assets/portal.css`) rather than
 * sampled from a logo — those files are the brand's actual source of truth.
 *
 *   --vt-gold        #dfa949   --vt-violet       #8582c3
 *   --vt-gold-dk     #b8882e   --vt-violet-dk    #3919ba
 *   --vt-gold-lt     #f5e4b8   --vt-violet-deep  #2a1290
 *   --vt-dark        #1a1535   --vt-violet-lt    #e8e8f7
 *   --vt-body        #3d3860
 *
 * The styling is deliberately flat: no gradients, no frosting, hairline rules, and
 * hierarchy carried by type rather than by shadow. Colour is treated as scarce — violet
 * for anything interactive, gold for one spot accent, and nothing coloured behind a large
 * area.
 *
 * What each may be used for is fixed by contrast, measured not assumed:
 *
 *   violet-dk  #3919ba  10.4:1 on white as text, and 10.4:1 for white text on it — so it
 *                       carries links, the active state and outline buttons
 *   gold       #dfa949  2.1:1 on white: a FILL only, never text. Dark text on gold is
 *                       8.2:1, which is how it is used
 *   gold-lt    #f5e4b8  needs #7a5200 over it (5.5:1); the brand's own gold-dk is 2.5:1
 *   violet     #8582c3  3.5:1 — borders, large text and graphics only
 */
:root {
  --vt-gold: #dfa949;
  --vt-gold-dk: #b8882e;
  --vt-gold-lt: #f5e4b8;
  --vt-violet: #8582c3;
  --vt-violet-dk: #3919ba;
  --vt-violet-deep: #2a1290;
  --vt-violet-lt: #e8e8f7;
  --vt-dark: #1a1535;
  --vt-body: #3d3860;

  /* Warm off-white canvas, white surfaces: the document look, not a dashboard look. */
  --bg: #faf9f7;
  --panel: #ffffff;
  --panel-2: #faf9f7;
  --ink: #1a1535;
  --ink-2: #3d3860;
  --ink-3: #645f88;
  --line: #e7e5ee;
  --line-2: #f2f1f6;
  --accent: #3919ba;
  --accent-ink: #ffffff;
  --accent-soft: #e8e8f7;
  --good: #2f6b46;
  --good-soft: #ebf3ee;
  /* Gold cannot be read on white, so the semantic warning is its darkened cousin. */
  --warn: #7a5200;
  --warn-soft: #f9efd8;
  --bad: #9f2f2d;
  --bad-soft: #fbeceb;
  --radius: 8px;
  /* Practically invisible: depth comes from the hairline, not from a shadow. */
  --shadow: 0 1px 2px rgba(26, 21, 53, .04);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/**
 * Dark palette, applied two ways:
 *   - automatically when the OS asks for dark AND the user has not chosen light
 *   - explicitly when data-theme="dark" is set by the theme switcher
 *
 * The two blocks must hold the same values. They are duplicated deliberately: a
 * single source would need the light-dark() function, which is too new to rely on
 * here, and a wrong guess would leave every colour invalid rather than merely dated.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14102a;
    --panel: #1f1943;
    --panel-2: #272054;
    --ink: #ffffff;
    --ink-2: #c9c6e0;
    --ink-3: #9d98c0;
    --line: #332b63;
    --line-2: #272054;
    --accent: #a9a6de;
    --accent-ink: #14102a;
    --accent-soft: #272054;
    --good: #6fc793;
    --good-soft: #17301f;
    --warn: #dfa949;
    --warn-soft: #322612;
    --bad: #f08b88;
    --bad-soft: #33191c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

:root[data-theme="dark"] {
  --bg: #14102a;
  --panel: #1f1943;
  --panel-2: #272054;
  --ink: #ffffff;
  --ink-2: #c9c6e0;
  --ink-3: #9d98c0;
  --line: #332b63;
  --line-2: #272054;
  --accent: #a9a6de;
  --accent-ink: #14102a;
  --accent-soft: #272054;
  --good: #6fc793;
  --good-soft: #17301f;
  --warn: #dfa949;
  --warn-soft: #322612;
  --bad: #f08b88;
  --bad-soft: #33191c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

/* Tells the browser to theme its own widgets — scrollbars, form controls, the
   date picker — to match, which it cannot infer from custom properties. */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }

:root[data-theme="dark"]  { color-scheme: dark; }

/* The charcoal logo needs a white plate on dark backgrounds — see .brand-mark-img.
   Kept next to the palette so the two stay together. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-mark-img,
  :root:not([data-theme="light"]) .brand-logo {
    background: #fff;
    padding: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
  }
  :root:not([data-theme="light"]) .brand-logo { padding: 10px 14px; border-radius: 10px; }
}
:root[data-theme="dark"] .brand-mark-img,
:root[data-theme="dark"] .brand-logo {
  background: #fff;
  padding: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}
:root[data-theme="dark"] .brand-logo { padding: 10px 14px; border-radius: 10px; }

* { box-sizing: border-box; }

/* The HTML `hidden` attribute only sets display:none in the UA stylesheet, so any
   author rule such as `.fld { display: flex }` silently defeats it. Restore it. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  /* Line height 1.6 for reading, and no Roboto: the system face on each platform has more
     character than the generic fallback, and there is no webfont to load without a CDN. */
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
        "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Figures line up column to column, which matters more here than anywhere: a payroll
   table is read down its numbers. */
.data td, .data th, .num, .stat-value, .mono { font-variant-numeric: tabular-nums; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 22px; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.005em; }
h3 { font-size: 14px; margin: 0 0 8px; }
p  { margin: 0 0 10px; }
small { color: var(--ink-2); }

/* ---------------------------------------------------------------- topbar */
/**
 * A flat bar: the page surface, one hairline rule underneath, nothing else. It stays
 * sticky, but it no longer announces itself — the wordmark and the active item are the
 * only things on it carrying colour.
 */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

/**
 * Violet marks the page you are on. Gold is kept for the wordmark alone: it cannot be read
 * as text on a light surface, and spending it here would use up the one spot accent.
 *
 * The colour must be --accent, not the brand's violet-deep. --accent-soft is a pale violet
 * in light mode but a *dark* violet in dark mode, so a fixed dark violet on top of it was
 * invisible in the dark theme — both tokens have to flip together.
 */
.topbar .mainnav > a.on,
.topbar .navmenu.on > summary {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.topbar-in {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 650; }
.brand:hover { text-decoration: none; }

/**
 * The Virtual Teammate mark is dark charcoal on transparent, so on a dark
 * background it all but disappears. Rather than recolour it — which would lose the
 * amber dot — it sits on a small white plate in dark mode. The brand colours stay
 * exactly as supplied.
 */
.brand-mark-img {
  width: 28px; height: 28px; display: block; object-fit: contain; border-radius: 6px;
}
.brand-logo {
  max-width: 190px; width: 100%; height: auto; display: block;
}

/* Fallback lettermark, still used where no image is wanted. */
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.brand-text { letter-spacing: -.01em; white-space: nowrap; }

/* On a phone the name is wider than the space left beside the search box, and it
   pushes the sign-out menu off the row. The mark alone still identifies the app. */
@media (max-width: 560px) { .brand-text { display: none; } }

.mainnav { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: wrap; }
.mainnav > a {
  color: var(--ink-2);
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
}
.mainnav > a:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.mainnav > a.on { background: var(--accent-soft); color: var(--accent); }

/* Grouped nav drop-down — the screens used less than daily live in here. */
.navmenu { position: relative; }
.navmenu > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 10px; border-radius: 7px;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.navmenu > summary::-webkit-details-marker { display: none; }
.navmenu > summary:hover { background: var(--line-2); color: var(--ink); }
.navmenu.on > summary { background: var(--accent-soft); color: var(--accent); }
.navmenu .caret { font-size: 10px; opacity: .7; }
.navmenu[open] > summary .caret { transform: rotate(180deg); }
/* Panel-tinted glass, not navy: these open over the page, so they take the page's own
   surface colour and let what is behind show through just enough to read as a layer. */
.navmenu > .menu {
  position: absolute; left: 0; top: calc(100% + 6px);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(26, 21, 53, .06);
  min-width: 210px; padding: 6px; z-index: 50;
}
.navmenu > .menu a {
  display: block; padding: 8px 10px; border-radius: 6px;
  color: var(--ink); font-size: 14px; white-space: nowrap;
}
.navmenu > .menu a:hover { background: var(--line-2); text-decoration: none; }
.navmenu > .menu a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* Sub-headings inside a drop-down. They turn a long list into a few scannable groups,
   which is the whole reason the old flat "More" menu was hard to use. */
.navmenu > .menu .menu-group {
  display: block; padding: 9px 10px 3px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3);
}
.navmenu > .menu .menu-group:first-child { padding-top: 3px; }
/* The group before a destructive item gets a rule above it, so Clear records never
   reads as the next item in a routine list. */
.navmenu > .menu .menu-group + a { margin-bottom: 1px; }
.navmenu > .menu .menu-group:not(:first-child) {
  border-top: 1px solid var(--line); margin-top: 5px; padding-top: 8px;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Theme switcher: one button cycling System -> Light -> Dark. */
.themetoggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; flex: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink-2); cursor: pointer; font-size: 15px; line-height: 1;
  font-family: inherit;
}
.themetoggle:hover { background: var(--line-2); color: var(--ink); }
.themetoggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
}
/* Only the glyph for the active mode is shown. */
.themetoggle .ico { display: none; }
:root:not([data-theme]) .themetoggle .ico-system,
:root[data-theme="light"] .themetoggle .ico-light,
:root[data-theme="dark"]  .themetoggle .ico-dark { display: inline; }

.navsearch { display: flex; }
.navsearch input {
  width: 210px; padding: 7px 11px; font-size: 13px; border-radius: 8px;
  background: var(--panel-2);
}
.navsearch input:focus { width: 260px; background: var(--panel); }
@media (max-width: 1100px) { .navsearch input { width: 150px; } }

.usermenu { position: relative; }
.usermenu summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 8px;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--line-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 12px; font-weight: 650;
}
.who { display: flex; flex-direction: column; line-height: 1.15; }
.who strong { font-size: 13px; font-weight: 600; }
.who small { font-size: 11px; color: var(--ink-3); }
.usermenu .menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(26, 21, 53, .06);
  min-width: 190px; padding: 6px; z-index: 50;
}
.usermenu .menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 14px; }
.usermenu .menu a:hover { background: var(--line-2); text-decoration: none; }

/* ------------------------------------------------------------------ page */
.wrap { max-width: 1400px; margin: 0 auto; padding: 22px 20px 60px; }
body.bare .wrap { max-width: 860px; padding-top: 32px; }

.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.pagehead .sub { color: var(--ink-2); font-size: 14px; }
.pagehead-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* A .btn that opens a small menu — the Export control in a page head. Right-aligned
   because it sits at the end of the action row, where a left-aligned panel would
   hang off the page. */
.btnmenu { position: relative; }
.btnmenu > summary { list-style: none; cursor: pointer; }
.btnmenu > summary::-webkit-details-marker { display: none; }
.btnmenu .caret { font-size: 10px; opacity: .7; margin-left: 5px; }
.btnmenu[open] > summary { background: var(--line-2); color: var(--ink); }
.btnmenu > .menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(26, 21, 53, .06);
  min-width: 210px; padding: 6px; z-index: 50; text-align: left;
}
.btnmenu > .menu a {
  display: block; padding: 8px 10px; border-radius: 6px;
  color: var(--ink); font-size: 14px; white-space: nowrap;
}
.btnmenu > .menu a:hover { background: var(--line-2); text-decoration: none; }

/**
 * Frosted surfaces.
 *
 * --glass-card sits at a high alpha (82% light / 76% dark) rather than the 40–60% a
 * decorative glass mockup would use. That is not timidity: these cards carry payroll
 * figures, and every point of transparency is contrast taken away from a number somebody
 * pays from. At this alpha the backdrop washes read through the edges and the blur does
 * its work, while text keeps its full AA margin against the surface.
 *
 * A 1px inner highlight along the top edge is what actually makes a surface look like
 * glass rather than flat translucency — it is the lit edge of a pane.
 */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.card.tight { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--line-2);
}
.card-head h2 { margin: 0; }
.card-body { padding: 16px; }
.errcard { max-width: 680px; margin: 40px auto; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ----------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.stat-value { font-size: 23px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--ink-2); }
.stat.accent { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
.stat.accent .stat-value { color: var(--accent); }
.stat.good .stat-value { color: var(--good); }
.stat.warn .stat-value { color: var(--warn); }
.stat.bad  .stat-value { color: var(--bad); }

/* --------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 13px; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  font-family: inherit;
}
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-icon { padding: 6px 10px; font-size: 17px; line-height: 1; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 0; }
.fld > span { color: var(--ink-2); font-weight: 550; }
/* Fields fill their grid cell so long <option> text cannot clip the control. */
.fld > input, .fld > select, .fld > textarea { width: 100%; }
/* input[type=search] belongs here too — the top-bar search box was never in this list, so
   it kept the browser's own heavy border while every other field had a hairline. */
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=file], input[type=search], select, textarea {
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 14px; font-family: inherit; min-width: 0;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px; border-color: var(--accent);
}
textarea { resize: vertical; min-height: 64px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }

.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.formgrid > * { min-width: 0; }
.formrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.formrow > * { min-width: 0; }

/* --------------------------------------------------------- period picker */
.periodbar {
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 16px;
  display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.periodbar-left { display: flex; align-items: center; gap: 10px; }
.period-now { display: flex; flex-direction: column; line-height: 1.25; }
.period-now strong { font-size: 16px; }
.period-now small { font-size: 12px; color: var(--ink-3); }
.periodbar-right { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- tables */
/* Wide tables scroll horizontally inside their card rather than stretching the
   page. Because this makes the wrapper a scrollport in both axes, a sticky
   thead must sit at top:0 — any other offset pushes the header down on top of
   the first data row. */
.tablewrap { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td {
  padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
table.data thead th {
  position: sticky; top: 0; background: var(--panel-2); z-index: 5;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); font-weight: 650; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.data thead th a { color: inherit; white-space: nowrap; }
table.data tbody tr:nth-child(even) { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
table.data tbody tr:hover { background: var(--panel-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td {
  font-weight: 650; background: var(--panel-2);
  border-top: 2px solid var(--line); border-bottom: none;
  font-variant-numeric: tabular-nums;
}
table.data.compact th, table.data.compact td { padding: 7px 10px; font-size: 13px; }

/* Column sizing helpers — keep wide tables inside their card. */
table.data td.col-actions, table.data th.col-actions {
  white-space: nowrap; text-align: right; width: 1%;
}
table.data td.col-actions .btn { margin-left: 4px; }
table.data .col-bar { width: 66px; padding-left: 0; padding-right: 0; }
table.data th.col-text, table.data td.col-text { max-width: 200px; }

.person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person .avatar { width: 28px; height: 28px; font-size: 11px; flex: none; }
.person-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.person-txt strong,
.person-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-txt strong { font-weight: 600; }
.person-txt small { font-size: 12px; color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* Truncation only works on a block-level box, hence inline-block. */
.trunc {
  display: inline-block; max-width: 200px; vertical-align: bottom;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trunc.wide { max-width: 260px; }
.trunc.narrow { max-width: 130px; }
/* ------------------------------------------------------------ user manual */
/* Numbered steps with room to breathe: this is prose to be read, not a table. */
.manual { margin: 0; padding-left: 22px; }
.manual > li { margin-bottom: 18px; line-height: 1.6; }
.manual > li:last-child { margin-bottom: 0; }
.manual > li > div { margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.manual ul { margin: 8px 0 0; padding-left: 18px; }
.manual ul li { margin-bottom: 6px; }

.qa { margin: 0; }
.qa dt { font-weight: 600; margin-top: 14px; }
.qa dt:first-child { margin-top: 0; }
.qa dd { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }

.empty { padding: 34px 16px; text-align: center; color: var(--ink-2); }
.empty h3 { color: var(--ink); }

/* ----------------------------------------------------------------- misc */
/* Small caps on a washed pastel: the label reads as metadata rather than as a button. */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad  { background: var(--bad-soft); color: var(--bad); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }

.alert {
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 14px;
  font-size: 14px; border: 1px solid;
}
.alert.ok   { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, transparent); color: var(--good); }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert.err  { background: var(--bad-soft);  border-color: color-mix(in srgb, var(--bad) 30%, transparent);  color: var(--bad); }

.pre {
  font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; overflow-x: auto; color: var(--ink-2);
}

/* display:block is required — height and background are ignored on inline spans. */
.bar {
  display: block; height: 6px; width: 100%; min-width: 46px;
  background: var(--line-2); border-radius: 999px; overflow: hidden;
}
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* Inline row editor (Users table) — a fixed panel width keeps the open state
   from stretching its table column. */
.rowedit > summary { list-style: none; display: inline-flex; cursor: pointer; }
.rowedit > summary::-webkit-details-marker { display: none; }
.rowedit-panel {
  width: min(430px, 78vw); padding: 12px 0 4px;
  display: flex; flex-direction: column; gap: 10px; text-align: left;
}
.rowedit-panel .formgrid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.dl dt { color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; align-self: center; }
.dl dd { margin: 0; }

.spark { display: flex; align-items: flex-end; gap: 2px; height: 46px; }
.spark i { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .8; }
.spark i:hover { opacity: 1; }

/* -------------------------------------------------------------- payslip */
.payslip {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.payslip-head {
  padding: 22px 24px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: var(--panel-2);
}
.payslip-title { font-size: 20px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 2px; }
/* Print forces a white page, so the charcoal logo needs no dark-mode plate here. */
.payslip-logo { width: 150px; height: auto; display: inline-block; margin-bottom: 6px; }
.payslip-body { padding: 22px 24px; }
.payslip-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 24px; border-top: 2px solid var(--line); background: var(--accent-soft);
}
.payslip-total .lbl { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; color: var(--accent); }
.payslip-total .val { font-size: 27px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines th, .lines td { padding: 9px 0; border-bottom: 1px solid var(--line-2); text-align: left; }
.lines td.num, .lines th.num { text-align: right; font-variant-numeric: tabular-nums; }
.lines tr.sub td { font-weight: 650; border-top: 1px solid var(--line); border-bottom: none; }

.foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 20px; }

/* --------------------------------------------------------------- auth */
.authbox { max-width: 400px; margin: 8vh auto; }
.authbox .card { padding: 26px; }
.authbox h1 { text-align: center; margin-bottom: 4px; }
.authbox .sub { text-align: center; color: var(--ink-2); margin-bottom: 20px; font-size: 14px; }
.authbox .fld { margin-bottom: 13px; font-size: 13px; }
.authbox input { width: 100%; padding: 10px 12px; }
.authbox .btn { width: 100%; padding: 10px; }
.authlogo { display: grid; place-items: center; margin-bottom: 18px; }
.authlogo .brand-logo { max-width: 210px; }
.authlogo .brand-mark { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }

/* --------------------------------------------------------------- print */
@media print {
  .topbar, .foot, .noprint, .periodbar { display: none !important; }
  body, .payslip { background: #fff !important; color: #000 !important; }
  .wrap { padding: 0; max-width: none; }
  .payslip { border: none; box-shadow: none; }
  .payslip-total { background: #f2f2f2 !important; }
  .payslip-total .lbl, .payslip-total .val { color: #000 !important; }
  a { color: #000 !important; text-decoration: none !important; }
}

@media (max-width: 860px) {
  .topbar-in { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .mainnav { order: 3; flex-basis: 100%; }
  .who { display: none; }
  .wrap { padding: 16px 12px 50px; }
  .periodbar { flex-direction: column; align-items: stretch; }
}
