/* ---------------------------------------------------------------------------
   The ATAD Apps look — the design system shared by Tools, Documents, Petty
   Cash and the Staff Portal (30 Sep 2026). Dark is the default; light is one
   click away on the sun/moon switch (js/theme.js, localStorage "atad-theme").

   Loaded by every page whose <body class="theme-atad"> opts in, right after
   style.css. Like the theme it replaced, every rule here only overrides a
   variable or a class style.css already defines — the markup never depends on
   this file to work, only to look right.

   Three rules from the old look are load-bearing and are kept below, each
   marked LOAD-BEARING: table padding adds height, never width; the dense
   tables keep their own padding; and paper is white whatever the screen does.
   --------------------------------------------------------------------------- */

/* ===========================================================================
   Tokens. Dark first, because dark is the default; light redefines the same
   names and nothing else. Only these values change between the two — the
   layout never does.
   =========================================================================== */
body.theme-atad {
  --bg: #0E131D;
  --panel: #151C29;
  --panel-2: #1B2433;
  --line: #263045;
  --text: #E9ECF2;
  --muted: #9AA4B7;
  --faint: #838DA1;
  /* One action colour: the one filled button of a screen, the active nav
     pill, links and focus rings — nowhere else. */
  --accent: #35B9A9;
  --accent-hover: #4CC8B8;
  --accent-ink: #062320;
  --accent-soft: #12302E;
  /* Status colours carry meaning only, always as a soft fill with the
     matching text: red blocked or taken off, amber needs a look, green done. */
  --red: #F2877A;   --red-soft: #3A1D1C;   --red-line: #5A2E2B;
  --amber: #EBB55A; --amber-soft: #382A12;
  --green: #6CCB94; --green-soft: #15301F;
  /* An open dropdown has to read as laid ON TOP of the window that opened it. */
  --raised: #212B3D;
  --raised-line: #33405A;
  --scrim: rgba(3, 6, 12, .66);
  --float: 0 10px 28px rgba(0, 0, 0, .5);
  --r-chip: 6px; --r-control: 8px; --r-button: 10px; --r-card: 14px;

  /* The names style.css and the pages already use, pointed at the new values
     so every screen follows without being edited. */
  --bg-alt: var(--panel-2);
  --border: var(--line);
  --text-muted: var(--muted);
  --primary: var(--accent);
  --primary-dark: var(--accent-hover);
  --primary-soft: var(--accent-soft);
  --link: var(--accent);
  --danger: var(--red);
  --danger-text: var(--red);
  --danger-bg: var(--red-soft);
  --success-bg: var(--green-soft);
  --radius: var(--r-card);
  /* Cards are told apart by a line, never a shadow. Only what floats over the
     page — a window, a dropdown — casts one. */
  --shadow: none;
  --shadow-lg: var(--float);
  /* The bar is 68px. Frozen table headers park directly under it; this must
     follow any change to the bar's height. */
  --sticky-top: calc(68px + var(--atad-sat, env(safe-area-inset-top, 0px)));

  /* Two families. Plus Jakarta Sans sets everything; IBM Plex Mono sets staff
     codes and the figures in a money column, so a column of salaries reads as
     a column. Both come from Google Fonts with display=swap, so the page is
     readable in the system face while they arrive. */
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-sans: var(--sans);

  font-family: var(--sans);
  font-size: 14px;
  line-height: 21px;
  letter-spacing: 0;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[data-theme="light"] body.theme-atad {
  --bg: #F5F4EF;
  --panel: #FFFFFF;
  --panel-2: #F9F8F4;
  --line: #E2DFD6;
  --text: #171A21;
  --muted: #565E6D;
  --faint: #666D7C;
  --accent: #0F7469;
  --accent-hover: #0B5F56;
  --accent-ink: #FFFFFF;
  --accent-soft: #DDF1EE;
  --red: #A8322A;   --red-soft: #FBE6E3;   --red-line: #EBC3BE;
  --amber: #8A5800; --amber-soft: #FBEFD8;
  --green: #1D6F43; --green-soft: #E0F2E7;
  --raised: #FFFFFF;
  --raised-line: #D5D1C6;
  --scrim: rgba(3, 6, 12, .45);
  --float: 0 10px 28px rgba(23, 26, 33, .16);
}

/* The page behind the page: no white flash between two dark pages. */
html { background: #0E131D; }
html[data-theme="light"] { background: #F5F4EF; color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

/* A button, a dropdown and a text field do not inherit the page's typeface
   unless told to. */
body.theme-atad button,
body.theme-atad input,
body.theme-atad select,
body.theme-atad textarea,
body.theme-atad optgroup,
body.theme-atad option { font-family: inherit; }

/* Figures that must line up: money columns, codes, editable amounts. */
body.theme-atad td.num,
body.theme-atad th.num,
body.theme-atad .mono,
body.theme-atad .amount,
body.theme-atad input.editf,
body.theme-atad input[type=number],
body.theme-atad .code-cell {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
body.theme-atad td.num { font-size: 13px; }
body.theme-atad th.num { font-family: var(--sans); }
body.theme-atad .mono { font-size: 0.93em; }
/* The payslip stays in the sans face: it is printed one to a sheet, and a
   wider figure face is exactly how a slip ends up on two. */
body.theme-atad .slip td.num,
body.theme-atad .slip th.num,
body.theme-atad .slip .amount { font-family: var(--sans); font-size: inherit; }
body.theme-atad .stat-card .value { font-variant-numeric: tabular-nums; }

body.theme-atad a { color: var(--link); text-decoration: none; }
body.theme-atad a:hover { text-decoration: underline; text-underline-offset: 2px; }
body.theme-atad ::selection { background: rgba(53, 185, 169, .32); }

/* ===========================================================================
   Type. Page title 28/34, section 17/24, body 14/21, label 13/18, caption
   12/16. Headings are Title Case and weight carries emphasis.
   =========================================================================== */
body.theme-atad h1 { font-size: 28px; line-height: 34px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; text-wrap: balance; }
body.theme-atad h2 { font-size: 17px; line-height: 24px; font-weight: 700; margin: 0 0 14px; text-wrap: balance; }
body.theme-atad h3 { font-size: 15px; line-height: 22px; font-weight: 700; }
body.theme-atad .subtitle { color: var(--muted); font-size: 14px; line-height: 21px; margin: 0 0 24px; max-width: 78ch; text-wrap: pretty; }
body.theme-atad .hint { font-size: 12px; line-height: 16px; color: var(--faint); }
body.theme-atad p.hint,
body.theme-atad .panel > p { max-width: 78ch; }
body.theme-atad p { text-wrap: pretty; }
body.theme-atad label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

body.theme-atad .page-wrap { padding: 32px 40px 80px; max-width: 1280px; }
body.theme-atad .page-wrap.wide { max-width: 1480px; }
@media (max-width: 1180px) { body.theme-atad .page-wrap { padding-left: 24px; padding-right: 24px; } }

/* ===========================================================================
   The bar: 68px, the card colour, a line under it. The ring and "Payroll" on
   the left, the sections as pills, the switch and the account on the right.
   =========================================================================== */
body.theme-atad .topnav {
  box-sizing: border-box;
  height: calc(68px + var(--atad-sat, env(safe-area-inset-top, 0px)));
  padding: var(--atad-sat, env(safe-area-inset-top, 0px)) 28px 0;
  gap: 16px;
  background: var(--panel);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
body.theme-atad .topnav .brand { gap: 10px; text-decoration: none; color: var(--text); }
body.theme-atad .brand-mark { width: 34px; height: 34px; display: block; flex-shrink: 0; }
body.theme-atad .topnav .brand-text {
  display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap;
  padding: 0; border: none;
}
body.theme-atad .topnav .brand-text .co { font-size: 16px; font-weight: 700; letter-spacing: .01em; }
body.theme-atad .topnav .brand-text .sub {
  font-size: 12px; font-weight: 400; color: var(--muted); opacity: 1;
  text-transform: none; letter-spacing: 0;
}
body.theme-atad .topnav-links { gap: 2px; margin-left: 8px; }
body.theme-atad .topnav-links a,
body.theme-atad .nav-group-btn {
  position: static;
  padding: 8px 12px;
  margin: 0;
  border-radius: var(--r-control);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  transition: background-color .15s ease, color .15s ease;
}
body.theme-atad .topnav-links a:hover,
body.theme-atad .nav-group-btn:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
body.theme-atad .topnav-links a.active,
body.theme-atad .nav-group-btn.active,
body.theme-atad .nav-group-btn.is-open { background: var(--accent-soft); color: var(--accent); }
body.theme-atad .topnav-links a.active::after { display: none; }
/* The strip scrolls sideways, and a scroll container clips anything painted
   outside it — so the focus ring sits inside the pill. */
body.theme-atad .topnav-links a:focus-visible,
body.theme-atad .nav-group-btn:focus-visible { outline-offset: -3px; }
body.theme-atad .topnav-links.is-scrollable {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent 100%);
}

/* The Bills menu hangs off the bar (not the strip, which clips). */
body.theme-atad .nav-menu {
  background: var(--raised);
  border: 1px solid var(--raised-line);
  border-radius: var(--r-card);
  padding: 6px;
  box-shadow: var(--float);
}
body.theme-atad .nav-menu a { color: var(--text); border-radius: var(--r-control); padding: 10px 12px; }
body.theme-atad .nav-menu a:hover,
body.theme-atad .nav-menu a:focus-visible,
body.theme-atad .nav-menu a.active { background: var(--accent-soft); text-decoration: none; }
body.theme-atad .nav-menu a.active .nav-menu-label { color: var(--accent); }
body.theme-atad .nav-menu-label { font-size: 13px; font-weight: 600; }
body.theme-atad .nav-menu-note { font-size: 12px; color: var(--faint); }

body.theme-atad .topnav-right { gap: 10px; }
body.theme-atad .topnav-sep { display: none; }
body.theme-atad .topnav-right .nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
body.theme-atad .topnav-right button#logoutBtn {
  height: 36px; padding: 0 12px;
  background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-button);
  font-size: 13px; font-weight: 600;
}
body.theme-atad .topnav-right button#logoutBtn:hover { background: var(--panel-2); }

@media (max-width: 1500px) and (min-width: 1151px) {
  /* The bell and the longer "Return To Staff Portal" took the room the wordmark had. */
  body.theme-atad .topnav-links a,
  body.theme-atad .nav-group-btn { padding: 8px 9px; }
  body.theme-atad .topnav .brand-text { display: none; }
}
@media (max-width: 1320px) {
  body.theme-atad .topnav { padding: 0 20px; gap: 12px; }
  body.theme-atad .topnav-right { gap: 8px; }
  body.theme-atad .topnav-right button#logoutBtn { padding: 0 10px; font-size: 12.5px; }
  body.theme-atad .topnav-links a,
  body.theme-atad .nav-group-btn { padding: 8px 9px; }
}
@media (max-width: 1150px) {
  body.theme-atad .topnav .brand-text { display: none; }
  body.theme-atad .topnav-links a,
  body.theme-atad .nav-group-btn { padding: 8px 8px; font-size: 12.5px; }
}

/* ---- The light/dark switch: a 40px square showing the current mode ----- */
body.theme-atad .theme-switch {
  position: relative;
  width: 40px; height: 40px; flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-button);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s ease, border-color .15s ease;
}
body.theme-atad .theme-switch:hover { color: var(--text); border-color: var(--raised-line); }
body.theme-atad .theme-knob { display: none; }
body.theme-atad .theme-ico {
  position: absolute; top: 50%; left: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  color: currentColor; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
body.theme-atad .theme-switch .theme-sun { opacity: 1; transform: none; }
body.theme-atad .theme-switch .theme-moon { opacity: 0; transform: rotate(-30deg) scale(.7); }
body.theme-atad .theme-switch[aria-checked="true"] .theme-sun { opacity: 0; transform: rotate(30deg) scale(.7); }
body.theme-atad .theme-switch[aria-checked="true"] .theme-moon { opacity: 1; transform: none; }
body.theme-atad .theme-float { position: fixed; top: calc(16px + var(--atad-sat, env(safe-area-inset-top, 0px))); right: 16px; z-index: 60; }

/* Both logos are in the page; the appearance decides which one is drawn. */
body.theme-atad .on-dark { display: none; }
html:not([data-theme="light"]) body.theme-atad .on-light { display: none; }
html:not([data-theme="light"]) body.theme-atad .on-dark { display: block; }

/* ===========================================================================
   Buttons. 44px, radius 10, 13px semibold. The plain .btn is the filled
   accent one — the main action of a screen. .secondary is outlined. Danger is
   red text on a red line, never a red slab.
   =========================================================================== */
body.theme-atad .btn {
  min-height: 44px;
  padding: 0 18px;
  gap: 8px;
  border: 1px solid var(--accent);
  border-radius: var(--r-button);
  background-color: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  justify-content: center;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
body.theme-atad .btn:hover { background-color: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
body.theme-atad .btn:active { transform: translateY(1px); }
body.theme-atad a.btn { color: var(--accent-ink); }
body.theme-atad .btn .ico { width: 18px; height: 18px; flex-shrink: 0; }

body.theme-atad .btn.secondary,
body.theme-atad a.btn.secondary {
  background-color: transparent;
  border-color: var(--line);
  color: var(--text);
}
body.theme-atad .btn.secondary:hover { background-color: var(--panel-2); border-color: var(--raised-line); }

body.theme-atad .btn.danger,
body.theme-atad a.btn.danger {
  background-color: transparent;
  border-color: var(--red-line);
  color: var(--red);
}
body.theme-atad .btn.danger:hover { background-color: var(--red-soft); border-color: var(--red); }

body.theme-atad .btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; line-height: 16px; }
body.theme-atad .btn.small .ico { width: 16px; height: 16px; }
body.theme-atad .btn.block { width: 100%; }

/* A button repeated down a table is never the loudest thing on the screen:
   inside a table every button is outlined. */
body.theme-atad table .btn:not(.danger):not(.wa) {
  background-color: transparent;
  border-color: var(--line);
  color: var(--text);
}
body.theme-atad table .btn:not(.danger):not(.wa):hover { background-color: var(--panel-2); border-color: var(--raised-line); }
body.theme-atad table a.btn:not(.danger):not(.wa) { color: var(--text); }

body.theme-atad .btn:disabled,
body.theme-atad .btn:disabled:hover {
  opacity: 1;
  cursor: not-allowed;
  background-color: var(--panel-2);
  border-color: var(--line);
  color: var(--faint);
  transform: none;
}

/* An icon-only button is a square, not a pill with nothing in it. */
body.theme-atad .btn.icon-only { width: 44px; padding: 0; }
body.theme-atad .btn.small.icon-only { width: 36px; min-width: 36px; }
body.theme-atad .btn.small.icon-only.paperclip.has-count { width: auto; padding: 0 10px 0 8px; }
body.theme-atad table .btn.secondary.icon-only { border-color: transparent; color: var(--muted); }
body.theme-atad table .btn.secondary.icon-only:hover,
body.theme-atad table .btn.secondary.icon-only:focus-visible { border-color: var(--line); background-color: var(--panel-2); color: var(--text); }

/* WhatsApp keeps its own green, the one colour here that is somebody else's —
   it is how the mark is recognised. In a table the glyph carries it alone. */
body.theme-atad .btn.wa { background-color: #25d366; border-color: #25d366; color: #062312; }
body.theme-atad .btn.wa:hover { background-color: #1fb457; border-color: #1fb457; }
body.theme-atad table .btn.wa.icon-only { background-color: transparent; border-color: transparent; color: #25d366; }
html[data-theme="light"] body.theme-atad table .btn.wa.icon-only { color: #148a3e; }
body.theme-atad table .btn.wa.icon-only:hover { background-color: #25d366; border-color: #25d366; color: #062312; }

body.theme-atad .link-btn { color: var(--link); }
body.theme-atad .linkish { color: var(--muted); }
body.theme-atad .linkish:hover { color: var(--text); }

/* ===========================================================================
   Fields. panel-2, a line, radius 8, 44px. Focus is an accent ring.
   =========================================================================== */
body.theme-atad input[type=text],
body.theme-atad input[type=number],
body.theme-atad input[type=email],
body.theme-atad input[type=password],
body.theme-atad input[type=date],
body.theme-atad input[type=month],
body.theme-atad input[type=tel],
body.theme-atad input[type=search],
body.theme-atad select,
body.theme-atad textarea {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  /* background-COLOR, never the shorthand: the shorthand resets repeat,
     position and size, which tiled the select's chevron across the field. */
  background-color: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
body.theme-atad textarea { padding: 10px 12px; min-height: 64px; }
body.theme-atad input[type=tel],
body.theme-atad input[type=search],
body.theme-atad input[type=month] { width: 100%; }
body.theme-atad input::placeholder,
body.theme-atad textarea::placeholder { color: var(--faint); opacity: 1; }
body.theme-atad input:focus,
body.theme-atad select:focus,
body.theme-atad textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
body.theme-atad input:disabled,
body.theme-atad select:disabled,
body.theme-atad textarea:disabled { opacity: .55; cursor: not-allowed; }

/* Our chevron, not the platform's. */
body.theme-atad select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' stroke='%239AA4B7' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
}
html[data-theme="light"] body.theme-atad select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' stroke='%23565E6D' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body.theme-atad select::-ms-expand { display: none; }
body.theme-atad option { background-color: var(--panel); color: var(--text); }

body.theme-atad input[type=date],
body.theme-atad input[type=month] { font-variant-numeric: normal; }
body.theme-atad input[type=date]::-webkit-calendar-picker-indicator,
body.theme-atad input[type=month]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
html:not([data-theme="light"]) body.theme-atad input[type=date]::-webkit-calendar-picker-indicator,
html:not([data-theme="light"]) body.theme-atad input[type=month]::-webkit-calendar-picker-indicator { filter: invert(1); }

/* Checkbox: rounded, filled accent, a tick in the ink colour. */
body.theme-atad input[type=checkbox] {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin: 0;
  border: 1.5px solid var(--raised-line);
  border-radius: 5px;
  background-color: transparent;
  flex-shrink: 0; cursor: pointer; vertical-align: middle;
  transition: background-color .15s ease, border-color .15s ease;
}
body.theme-atad input[type=checkbox]:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10' fill='none'%3E%3Cpath d='M1.5 5.2 4.4 8 10.5 1.8' stroke='%23062320' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
html[data-theme="light"] body.theme-atad input[type=checkbox]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10' fill='none'%3E%3Cpath d='M1.5 5.2 4.4 8 10.5 1.8' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body.theme-atad input[type=radio] { accent-color: var(--accent); }

/* An on/off setting is a switch: the two overtime entitlements, and any
   checkbox marked .switch. */
body.theme-atad .ot-checks input[type=checkbox],
body.theme-atad input[type=checkbox].switch {
  width: 40px; height: 24px;
  border: none; border-radius: 12px;
  background-color: var(--line);
  background-image: none;
  position: relative;
  transition: background-color .2s ease;
}
body.theme-atad .ot-checks input[type=checkbox]::after,
body.theme-atad input[type=checkbox].switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--muted);
  transition: transform .2s ease, background-color .2s ease;
}
body.theme-atad .ot-checks input[type=checkbox]:checked,
body.theme-atad input[type=checkbox].switch:checked { background-color: var(--accent); background-image: none; }
body.theme-atad .ot-checks input[type=checkbox]:checked::after,
body.theme-atad input[type=checkbox].switch:checked::after { transform: translateX(16px); background: var(--accent-ink); }
body.theme-atad .ot-checks { border: none; background: transparent; padding: 4px 0 0; gap: 14px; flex-direction: column; }
body.theme-atad .ot-checks label { gap: 4px 10px; font-weight: 600; font-size: 14px; flex-wrap: wrap; }
body.theme-atad .ot-checks label .hint { flex-basis: 100%; margin: 0 0 0 50px; font-weight: 400; }

/* The file chooser is the one control the browser draws itself. */
body.theme-atad input[type=file] {
  width: auto; max-width: 100%; padding: 0; border: none; background: none;
  font-size: 13px; color: var(--muted); cursor: pointer;
}
body.theme-atad input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; font-size: 13px;
  height: 40px; padding: 0 16px; margin-right: 12px;
  color: var(--text); background-color: transparent;
  border: 1px solid var(--line); border-radius: var(--r-button);
  cursor: pointer;
}
body.theme-atad input[type=file]::file-selector-button:hover { background-color: var(--panel-2); }

/* ===========================================================================
   Focus you can see: one accent ring, 2.5px, following each shape's radius.
   =========================================================================== */
body.theme-atad :focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
body.theme-atad input:focus-visible,
body.theme-atad select:focus-visible,
body.theme-atad textarea:focus-visible { outline: none; }
body.theme-atad input[type=checkbox]:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; box-shadow: none; }

/* ===========================================================================
   Cards and tiles.
   =========================================================================== */
body.theme-atad .panel,
body.theme-atad .stat-card,
body.theme-atad .portal-card,
body.theme-atad .bill-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: none;
}
body.theme-atad .panel { padding: 20px; margin-bottom: 20px; }
body.theme-atad .panel-header { gap: 12px 16px; flex-wrap: wrap; }
body.theme-atad .panel-header h2 { margin: 0; }

/* A tile: label, then the big figure, then a caption. Pages write the figure
   first; the label is moved above it here. */
body.theme-atad .stat-row { gap: 16px; margin-bottom: 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
body.theme-atad .stat-card {
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
  min-width: 0;
}
body.theme-atad .stat-card .label {
  order: -1;
  font-size: 13px; line-height: 18px; font-weight: 600;
  color: var(--muted);
  text-transform: none; letter-spacing: 0;
}
body.theme-atad .stat-card .value {
  font-size: 34px; line-height: 38px; font-weight: 700; letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
body.theme-atad .stat-card .value.mid { font-size: 28px; line-height: 34px; }
body.theme-atad .stat-card .caption,
body.theme-atad .stat-card .cap { font-size: 12px; line-height: 16px; color: var(--faint); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
body.theme-atad .stat-card.is-accent { border-color: var(--accent); }
body.theme-atad .stat-card.is-accent .value { color: var(--accent); }
body.theme-atad .stat-card .value.red { color: var(--red); }
body.theme-atad .stat-card .value.amber { color: var(--amber); }
body.theme-atad .stat-card .value.green { color: var(--green); }
body.theme-atad a.stat-card { color: inherit; text-decoration: none; }
body.theme-atad .stat-card.stat-action { transition: border-color .15s ease, background-color .15s ease; }
body.theme-atad .stat-card.stat-action:hover,
body.theme-atad button.stat-card.stat-action:hover { border-color: var(--raised-line); background: var(--panel); text-decoration: none; }

/* ===========================================================================
   Tables. 12px faint headings, a line between rows, panel-2 under the cursor.
   LOAD-BEARING: padding adds height, never width. Sideways padding stays at
   11px — the Staff table painted outside its card the day it grew.
   =========================================================================== */
body.theme-atad table { font-size: 14px; line-height: 21px; }
body.theme-atad table th,
body.theme-atad table td { padding: 12px 11px; border-bottom: 1px solid var(--line); }
body.theme-atad table thead th {
  background: var(--panel);
  color: var(--faint);
  font-size: 12px; line-height: 16px; font-weight: 600;
  text-transform: none; letter-spacing: 0;
  padding-top: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
body.theme-atad table tbody tr { transition: background-color .12s ease; }
body.theme-atad table tbody tr:hover { background: var(--panel-2); }
body.theme-atad table tbody tr:last-child td { border-bottom: none; }
body.theme-atad td.sn, body.theme-atad th.sn,
body.theme-atad td.serial-col, body.theme-atad th.serial-col { color: var(--faint); font-family: var(--mono); font-size: 12px; }

/* A row that opens a panel says so: the cursor changes and its name reads as
   a link. */
body.theme-atad tbody tr.row-open { cursor: pointer; }
body.theme-atad tbody tr.row-open:hover .row-open-label,
body.theme-atad tbody tr.row-open:focus-visible .row-open-label { color: var(--accent); }
/* Inside a scrolling wrapper an outline outside the row is clipped. */
body.theme-atad tbody tr.row-open:focus-visible { outline: 2.5px solid var(--accent); outline-offset: -2px; }

body.theme-atad table tbody tr.row-edited,
body.theme-atad table tbody tr.row-edited:hover { background: var(--amber-soft); }
@keyframes atadRowFlash { from { background: var(--amber-soft); } to { background: transparent; } }
body.theme-atad table tbody tr.row-added,
body.theme-atad table tbody tr.row-added:hover { background: var(--green-soft); }
body.theme-atad tr.unmatched-row { background: var(--amber-soft); }
body.theme-atad tr.needs-answer > td { background: var(--red-soft); }
body.theme-atad tr.group-row td { background: var(--panel-2); font-weight: 600; }
body.theme-atad .table-scroll.is-scrolling thead th.sn,
body.theme-atad .table-scroll.is-scrolling thead th.name-cell,
body.theme-atad .table-scroll.is-scrolling thead th.actions-cell { background: var(--panel); }
body.theme-atad .table-scroll.is-scrolling td.name-cell { box-shadow: 1px 0 0 var(--line); }
body.theme-atad .table-scroll.is-scrolling td.actions-cell { box-shadow: -1px 0 0 var(--line); }

/* Name over designation, in one cell. */
body.theme-atad .cell-name { font-weight: 600; line-height: 20px; }
body.theme-atad .cell-sub { font-size: 12px; line-height: 16px; color: var(--faint); font-weight: 400; }
body.theme-atad .cell-sub .mono { font-size: 12px; }

/* Sort direction as a small chevron. */
/* Sorting and filtering on every list table (js/tableTools.js). The arrow
   sits in the heading's own side padding, absolutely placed, so a sorted
   column is not one pixel wider than an unsorted one — a wider run table
   gains a sideways scrollbar and loses its frozen header. */
body.theme-atad th.tt-sortable { cursor: pointer; user-select: none; }
body.theme-atad th.tt-sortable:hover { color: var(--text); }
body.theme-atad th.tt-sortable[aria-sort="ascending"],
body.theme-atad th.tt-sortable[aria-sort="descending"] { color: var(--accent); }
body.theme-atad th.tt-sortable[aria-sort="ascending"]::after,
body.theme-atad th.tt-sortable[aria-sort="descending"]::after {
  position: absolute; right: 1px; top: 50%; transform: translateY(-50%);
  font-size: 8px; line-height: 1; color: var(--accent);
}
body.theme-atad th.tt-sortable[aria-sort="ascending"]::after { content: "\25B2"; }
body.theme-atad th.tt-sortable[aria-sort="descending"]::after { content: "\25BC"; }
body.theme-atad th.tt-sortable:focus-visible { outline: 2.5px solid var(--accent); outline-offset: -3px; }
body.theme-atad tr.tt-hide { display: none !important; }
body.theme-atad .table-tools {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 0 0 10px;
}
body.theme-atad .table-tools .search-box { width: 260px; max-width: 100%; }
body.theme-atad .table-tools .search-box > input { height: 36px; }
body.theme-atad .table-tools .tt-count { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
@media (max-width: 760px) {
  body.theme-atad .table-tools .search-box { width: 100%; }
  /* Headings are not frozen on a phone, so the arrow needs its own anchor. */
  body.theme-atad .panel table thead th.tt-sortable { position: relative !important; }
}
@media print {
  body.theme-atad .table-tools { display: none !important; }
  body.theme-atad th.tt-sortable::after { content: none !important; }
  body.theme-atad tr.tt-hide { display: table-row !important; }
}
body.theme-atad th.sortable { cursor: pointer; user-select: none; }
body.theme-atad th.sortable:hover { color: var(--text); }
body.theme-atad th.sortable .arrow { display: inline-flex; align-items: center; margin-left: 4px; opacity: .35; vertical-align: middle; }
body.theme-atad th.sortable .arrow svg { width: 9px; height: 9px; display: block; }
body.theme-atad th.sortable.sorted .arrow { opacity: .9; }

/* LOAD-BEARING: the dense tables keep their own padding. A payslip prints
   sixty to a run, one to a sheet; the loans list carries twelve columns. */
body.theme-atad .slip th,
body.theme-atad .slip td { padding: 10px 12px; }
body.theme-atad .slip tr.sub-row td { padding-top: 4px; padding-bottom: 4px; }
body.theme-atad table.one-line th,
body.theme-atad table.one-line td { padding: 9px 10px; font-size: 13px; }
body.theme-atad .bill-card th,
body.theme-atad .bill-card td { padding: 7px 8px; }
body.theme-atad .mapping-table th,
body.theme-atad .mapping-table td { padding: 8px 10px; }
body.theme-atad table.one-line td.num { font-size: 12px; letter-spacing: -0.02em; }

/* The run table: thirteen columns of editable figures that must fit their
   panel (the frozen header dies the moment it scrolls sideways). */
body.theme-atad #payslipsWrap table { font-size: 13px; }
body.theme-atad #payslipsWrap th,
body.theme-atad #payslipsWrap td { padding: 8px 5px; }
body.theme-atad #payslipsWrap tbody tr { background: transparent; }
body.theme-atad #payslipsWrap tbody tr:hover { background: var(--panel-2); }
body.theme-atad #payslipsWrap input.editf {
  min-height: 34px; height: 34px;
  padding: 0 6px; font-size: 12px; letter-spacing: -0.02em;
  border-color: transparent;
  background-color: var(--panel-2);
  border-radius: 6px;
  text-align: right;
}
body.theme-atad #payslipsWrap input.editf:hover { border-color: var(--line); }
body.theme-atad #payslipsWrap input.editf:focus { border-color: var(--accent); background-color: var(--bg); }
body.theme-atad #payslipsWrap .btn.small { min-height: 34px; padding: 0 8px; font-size: 12px; }
body.theme-atad #payslipsWrap .row-actions { gap: 4px; }
body.theme-atad #payslipsWrap td.num { font-size: 12px; letter-spacing: -0.02em; }
body.theme-atad #payslipsWrap .btn.small.icon-only { width: 34px; min-width: 34px; padding: 0; }

/* ===========================================================================
   Status: a chip — a soft fill with the matching text. Replaces the dot.
   =========================================================================== */
body.theme-atad .badge,
body.theme-atad .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border-radius: var(--r-chip);
  font-size: 12px; line-height: 16px; font-weight: 600;
  white-space: nowrap;
  background: var(--panel-2);
  color: var(--muted);
}
body.theme-atad .badge::before { display: none; }
body.theme-atad .badge.active,
body.theme-atad .badge.released,
body.theme-atad .chip.green { background: var(--green-soft); color: var(--green); }
body.theme-atad .badge.draft,
body.theme-atad .chip.amber { background: var(--amber-soft); color: var(--amber); }
body.theme-atad .badge.finalized,
body.theme-atad .chip.teal { background: var(--accent-soft); color: var(--accent); }
/* A run HR has sent and the admin has not yet finalized: outlined amber, so it
   reads as "waiting on a person" beside the filled amber of a draft. */
body.theme-atad .badge.submitted { background: transparent; color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
body.theme-atad .badge.inactive,
body.theme-atad .chip.grey { background: var(--panel-2); color: var(--muted); }
body.theme-atad .badge.danger,
body.theme-atad .chip.red { background: var(--red-soft); color: var(--red); }
body.theme-atad .chip.dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; background: currentColor; }
/* Shown only in the phone layout of a .stack-sm list. */
body.theme-atad .stack-only { display: none; }

/* A segmented control: one of a few, the chosen one in the accent's soft fill. */
body.theme-atad .seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-button);
  flex-wrap: wrap;
}
body.theme-atad .seg button {
  min-height: 36px; padding: 0 12px;
  border: none; border-radius: var(--r-control);
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
body.theme-atad .seg button:hover { color: var(--text); }
body.theme-atad .seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
body.theme-atad .seg button .n { font-family: var(--mono); font-weight: 500; font-size: 12px; margin-left: 4px; opacity: .85; }

/* A search field with its glass inside. */
body.theme-atad .search-box { position: relative; display: block; }
body.theme-atad .search-box > svg {
  position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  color: var(--faint); pointer-events: none;
}
body.theme-atad .search-box > input { padding-left: 38px; width: 100%; }

/* ===========================================================================
   Notes inside a panel.
   =========================================================================== */
body.theme-atad .panel-note { background: var(--accent-soft); border: none; border-radius: var(--r-control); color: var(--text); }
body.theme-atad .note-amber { background: var(--amber-soft); color: var(--amber); border-radius: var(--r-control); padding: 10px 12px; font-size: 13px; line-height: 18px; }
body.theme-atad .error-text { color: var(--red); background: var(--red-soft); border: none; border-radius: var(--r-control); }
body.theme-atad .success-text { color: var(--green); background: var(--green-soft); border: none; border-radius: var(--r-control); }
body.theme-atad .pill { background: var(--panel-2); border-radius: var(--r-chip); color: var(--text); }
body.theme-atad .pill.addition { background: var(--green-soft); color: var(--green); }
body.theme-atad .pill.deduction { background: var(--red-soft); color: var(--red); }
body.theme-atad .bulk-bar { background: var(--accent-soft); border: none; border-radius: var(--r-button); }
body.theme-atad .skip-box,
body.theme-atad .hist-grid > div { background: var(--panel-2); border: none; border-radius: var(--r-control); }
body.theme-atad .owed-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: none; }
body.theme-atad .owed-card .label { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
body.theme-atad .owed-card .value { font-weight: 700; }
body.theme-atad .owed-card.accent { border-color: var(--accent); background: var(--panel); }
body.theme-atad .owed-card.accent .value { color: var(--accent); }
body.theme-atad .chip-sunday { border-radius: var(--r-chip); }
body.theme-atad .not-entitled { color: var(--faint); }

/* The month picker line on the bill pages, and what that month feeds. */
body.theme-atad .month-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
body.theme-atad .month-field label { margin: 0; white-space: nowrap; }
body.theme-atad .month-field input { width: auto; }
body.theme-atad .month-note { flex-basis: 100%; margin-top: 8px; display: flex; justify-content: flex-end; }
body.theme-atad .month-note:empty { display: none; }
body.theme-atad .month-flag {
  max-width: 360px; padding: 8px 12px; border-radius: var(--r-control);
  background: var(--panel-2); color: var(--muted);
  font-size: 12.5px; line-height: 1.45; text-align: left;
}
body.theme-atad .month-flag.warn { background: var(--red-soft); color: var(--red); }
body.theme-atad .month-flag.warn a { color: var(--red); text-decoration: underline; }

/* The filter bar, shared. */
body.theme-atad .filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
body.theme-atad .filter-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
body.theme-atad .filter-field.grow { flex: 1 1 280px; min-width: 220px; max-width: 360px; }
body.theme-atad .filter-field label { margin: 0; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--faint); }
body.theme-atad .filter-field select,
body.theme-atad .filter-field input { margin: 0; }
body.theme-atad .filter-bar > .btn { align-self: flex-end; }

/* ===========================================================================
   Windows (.modal). Radius 14, a header row with the title and the close
   button, a body that scrolls, and the buttons pinned to the bottom.
   The markup is the same everywhere: .modal > .modal-close + h2 + … +
   .modal-actions. The close button floats into the header strip and both
   stick to the top of the scrolling window.
   =========================================================================== */
body.theme-atad .modal-backdrop {
  background: var(--scrim);
  align-items: center;
  overflow: hidden;
  padding: calc(24px + var(--atad-sat, env(safe-area-inset-top, 0px))) 16px 24px;
  animation: atadFade .15s ease both;
}
body.theme-atad .modal {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--float);
  padding: 0 24px 20px;
  max-height: calc(100vh - 48px - var(--atad-sat, env(safe-area-inset-top, 0px)));
  max-height: calc(100dvh - 48px - var(--atad-sat, env(safe-area-inset-top, 0px)));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  animation: atadRise .15s ease both;
}
body.theme-atad .modal > .modal-close {
  position: sticky; top: 14px; float: right; z-index: 4;
  width: 40px; height: 40px;
  margin: 14px -8px -54px 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-button);
  background: var(--panel-2); color: var(--muted);
  font-size: 22px; line-height: 1;
}
body.theme-atad .modal > .modal-close:hover { color: var(--text); background: var(--panel-2); border-color: var(--raised-line); }
body.theme-atad .modal > .modal-close + h2,
body.theme-atad .modal > .modal-head {
  position: sticky; top: 0; z-index: 3;
  margin: 0 -24px 16px;
  padding: 20px 76px 16px 24px;
  min-height: 68px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 20px; line-height: 26px;
}
/* A window with no heading still keeps its content clear of the button. */
body.theme-atad .modal > .modal-close:first-child + :not(h2):not(.modal-head) { margin-top: 20px; }
body.theme-atad .modal h2 + .hint,
body.theme-atad .modal h2 + p.hint { margin-top: 0; }
body.theme-atad .modal h2:not(:first-of-type) { font-size: 17px; line-height: 24px; }
body.theme-atad .modal .modal-head h2 { margin: 0; font-size: 20px; line-height: 26px; }
body.theme-atad .modal .modal-head .modal-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
body.theme-atad .modal .modal-head .modal-sub .mono { font-size: 12px; color: var(--faint); }

/* A window's buttons wrap onto a second row rather than push it wider, and
   the last row of buttons stays pinned to the bottom, so Save is always in
   reach. Negative margins match the window's 24px / 20px padding. */
body.theme-atad .modal-actions { flex-wrap: wrap; gap: 10px; row-gap: 10px; margin-top: 20px; }
body.theme-atad .modal-actions > span { flex-wrap: wrap; }
body.theme-atad .modal > .modal-actions:last-child,
body.theme-atad .modal form > .modal-actions:last-child,
body.theme-atad .modal > form:last-child > .modal-actions:last-child {
  position: sticky; bottom: -20px; z-index: 2;
  margin: 20px -24px -20px; padding: 14px 24px 18px;
  background-color: var(--panel);
  border-top: 1px solid var(--line);
}
body.theme-atad .modal thead th { top: 0; }
/* Inside a window the payslip is already on a card. */
body.theme-atad .modal .slip { border: none; border-radius: 0; background: transparent; }
body.theme-atad .confirm-body { font-size: 14px; line-height: 21px; }
@media (max-width: 480px) {
  body.theme-atad .modal-backdrop { padding: 12px 8px; }
  body.theme-atad .modal { padding: 0 16px 16px; }
  body.theme-atad .modal > .modal-close { margin-right: -4px; }
  body.theme-atad .modal > .modal-close + h2,
  body.theme-atad .modal > .modal-head { margin: 0 -16px 14px; padding: 18px 64px 14px 16px; }
  body.theme-atad .modal > .modal-actions:last-child,
  body.theme-atad .modal form > .modal-actions:last-child,
  body.theme-atad .modal > form:last-child > .modal-actions:last-child { margin: 16px -16px -16px; padding: 12px 16px 14px; bottom: -16px; }
  body.theme-atad .modal-actions > span { width: 100%; }
  body.theme-atad .modal-actions > span > .btn,
  body.theme-atad .modal-actions > .btn { flex: 1 1 auto; }
}

/* ===========================================================================
   Messages and pickers — things that float over the page.
   =========================================================================== */
body.theme-atad .toast {
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--raised-line);
  border-radius: var(--r-button);
  box-shadow: var(--float);
  font-size: 13.5px;
}
body.theme-atad .toast-success { background: var(--green-soft); color: var(--green); border-color: transparent; }
body.theme-atad .toast-error { background: var(--red-soft); color: var(--red); border-color: transparent; }
html:not([data-theme="light"]) body.theme-atad .toast-success,
html:not([data-theme="light"]) body.theme-atad .toast-error { border-color: rgba(255,255,255,.06); }

body.theme-atad .suggest-box,
body.theme-atad .picker-panel {
  background: var(--raised);
  border: 1px solid var(--raised-line);
  border-radius: var(--r-button);
  box-shadow: var(--float);
  padding: 4px;
}
body.theme-atad .suggest-item { border-radius: var(--r-control); color: var(--text); }
body.theme-atad .suggest-item:hover,
body.theme-atad .suggest-item.active { background: var(--accent-soft); }
body.theme-atad .suggest-item .code { color: var(--faint); font-family: var(--mono); }
body.theme-atad .suggest-item.is-none:hover { background: none; }
body.theme-atad .suggest-item.is-blank { border-top-color: var(--line); }
body.theme-atad .picker > .picker-clear { color: var(--faint); }
body.theme-atad .picker > .picker-clear:hover { background: var(--line); color: var(--text); }
body.theme-atad .picker > .picker-input.is-empty { color: var(--faint); }

/* ===========================================================================
   Empty states: a symbol, then the sentence.
   =========================================================================== */
body.theme-atad .empty-state { padding: 34px 20px 36px; font-size: 14px; color: var(--muted); }
body.theme-atad .empty-state::before {
  content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 12px;
  background-color: var(--faint);
  -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 14h4l1.5 2.5h7L17 14h4'/%3E%3Cpath d='M5.5 5.5h13L21 14v3.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5V14z'/%3E%3C/svg%3E");
  mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 14h4l1.5 2.5h7L17 14h4'/%3E%3Cpath d='M5.5 5.5h13L21 14v3.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5V14z'/%3E%3C/svg%3E");
  opacity: .7;
}
body.theme-atad .empty-state.people::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.4'/%3E%3Cpath d='M2.6 19.6a6.6 6.6 0 0 1 12.8 0'/%3E%3Cpath d='M16.5 5.6a3.4 3.4 0 0 1 0 6.6M18 14.4a6.6 6.6 0 0 1 3.4 5.2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.4'/%3E%3Cpath d='M2.6 19.6a6.6 6.6 0 0 1 12.8 0'/%3E%3Cpath d='M16.5 5.6a3.4 3.4 0 0 1 0 6.6M18 14.4a6.6 6.6 0 0 1 3.4 5.2'/%3E%3C/svg%3E"); }
body.theme-atad .empty-state.runs::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2.4'/%3E%3Cpath d='M8 8h8M8 12h8M8 16h5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2.4'/%3E%3Cpath d='M8 8h8M8 12h8M8 16h5'/%3E%3C/svg%3E"); }
body.theme-atad .empty-state.money::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='19' height='12' rx='2.4'/%3E%3Ccircle cx='12' cy='12' r='2.6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='19' height='12' rx='2.4'/%3E%3Ccircle cx='12' cy='12' r='2.6'/%3E%3C/svg%3E"); }
body.theme-atad .empty-state.search::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.4 15.4 21 21'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.4 15.4 21 21'/%3E%3C/svg%3E"); }

/* ===========================================================================
   Sign in and not found: one card on the page's own ground.
   =========================================================================== */
body.theme-atad .login-shell,
body.theme-atad .login-wrap { background: var(--bg); }
body.theme-atad .login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: none;
  padding: 36px 32px 30px;
  animation: atadRise .15s ease both;
}
body.theme-atad .login-card h1 { font-size: 22px; line-height: 28px; }
body.theme-atad .login-card .login-logo { height: 56px; }

/* ===========================================================================
   The employee's own page, on a phone. Header with the logo, the name and
   the code; a month switcher; the net salary; what made it up.
   =========================================================================== */
body.theme-atad.portal { background: var(--bg); }
body.theme-atad .portal-shell { max-width: 560px; padding: 0 0 48px; }
body.theme-atad .portal-head {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: calc(18px + var(--atad-sat, env(safe-area-inset-top, 0px))) 16px 14px;
  margin: 0 0 16px;
}
body.theme-atad .portal-bar { margin-bottom: 14px; }
body.theme-atad .portal-bar img { height: 40px; }
body.theme-atad .portal-bar .theme-switch { margin: 0 0 0 auto; flex-shrink: 0; }
/* Return To Staff Portal on the payslip page: only added when a portal session exists. */
body.theme-atad .portal-bar .portal-back {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto;
  min-height: 44px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: var(--r-button);
  color: var(--text); background: transparent; text-decoration: none;
  font: 600 13px/1.2 var(--sans);
}
body.theme-atad .portal-bar .portal-back svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
body.theme-atad .portal-bar .portal-back ~ .theme-switch { margin-left: 0; }
@media (max-width: 460px) { body.theme-atad .portal-bar .portal-back span { display: none; } body.theme-atad .portal-bar .portal-back { padding: 0 12px; min-width: 44px; justify-content: center; } }
body.theme-atad .portal-name { font-size: 20px; line-height: 26px; font-weight: 700; }
body.theme-atad .portal-sub { font-size: 12px; line-height: 16px; color: var(--faint); margin-top: 2px; }
body.theme-atad .portal-body { padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }
body.theme-atad .portal-intro { font-size: 13px; color: var(--muted); margin: 0; }
body.theme-atad .portal-card { padding: 16px 18px; border-radius: var(--r-card); }
body.theme-atad .portal-card:hover { border-color: var(--raised-line); }
body.theme-atad .portal-month { font-weight: 600; }
body.theme-atad .portal-net-label { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--faint); }
body.theme-atad .portal-net strong { font-family: var(--mono); font-weight: 500; }
body.theme-atad .portal-empty { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); }
body.theme-atad .pay-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px; }
body.theme-atad .pay-label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--muted); }
body.theme-atad .pay-net { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
body.theme-atad .pay-net .cur { font-size: 13px; font-weight: 600; color: var(--muted); }
body.theme-atad .pay-net .big { font-size: 34px; line-height: 38px; font-weight: 700; font-variant-numeric: tabular-nums; }
body.theme-atad .pay-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--faint); }
body.theme-atad .pay-lines { margin: 0; padding: 0; list-style: none; }
body.theme-atad .pay-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
body.theme-atad .pay-lines li > span:first-child { color: var(--muted); min-width: 0; }
body.theme-atad .pay-lines li > span:last-child { font-family: var(--mono); white-space: nowrap; }
body.theme-atad .pay-lines li.minus > span:last-child { color: var(--red); }
body.theme-atad .pay-lines li.sub > span:first-child { padding-left: 14px; font-size: 13px; }
body.theme-atad .pay-lines li.sub { border-bottom-style: dashed; }
body.theme-atad .pay-lines + .pay-label { margin-top: 14px; }
body.theme-atad .pay-total { display: flex; justify-content: space-between; padding: 12px 0 2px; font-weight: 700; }
body.theme-atad .pay-total span:last-child { font-family: var(--mono); font-weight: 600; color: var(--accent); }
body.theme-atad .loan-bar { height: 8px; border-radius: 4px; background: var(--panel-2); margin-top: 10px; overflow: hidden; }
body.theme-atad .loan-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
body.theme-atad .month-seg { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
body.theme-atad .month-seg::-webkit-scrollbar { display: none; }

/* ===========================================================================
   Steps: the five stages of a payroll run.
   =========================================================================== */
body.theme-atad .run-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
body.theme-atad .run-steps li {
  display: flex; gap: 10px; align-items: center; min-width: 0;
  padding: 12px 14px; border-radius: var(--r-button);
  background: var(--panel-2); border: 1px solid var(--line);
}
body.theme-atad .run-steps li.is-current { background: var(--accent-soft); border-color: var(--accent); }
body.theme-atad .run-steps .step-n {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--panel); color: var(--muted);
}
body.theme-atad .run-steps li.is-done .step-n { background: var(--green-soft); color: var(--green); }
body.theme-atad .run-steps li.is-current .step-n { background: var(--amber-soft); color: var(--amber); }
body.theme-atad .run-steps .step-t { font-size: 13px; line-height: 18px; font-weight: 600; }
body.theme-atad .run-steps .step-c { font-size: 12px; line-height: 16px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.theme-atad .run-steps li > div { min-width: 0; }
@media (max-width: 1000px) {
  body.theme-atad .run-steps { grid-template-columns: repeat(5, minmax(150px, 1fr)); overflow-x: auto; scrollbar-width: none; }
}

/* ===========================================================================
   The "Needs You" list on the dashboard.
   =========================================================================== */
body.theme-atad .needs-list { list-style: none; margin: 0; padding: 0; }
body.theme-atad .needs-list li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
body.theme-atad .needs-list li:last-child { border-bottom: none; }
body.theme-atad .needs-list .chip.dot { margin-top: 6px; flex-shrink: 0; }
body.theme-atad .needs-list .needs-main { flex: 1 1 auto; min-width: 0; }
body.theme-atad .needs-list .needs-title { font-size: 14px; font-weight: 600; }
body.theme-atad .needs-list .needs-text { font-size: 13px; line-height: 18px; color: var(--faint); margin-top: 3px; }
body.theme-atad .needs-list .btn { flex-shrink: 0; }
/* VPFIX: on a phone the Vendor Portal failures put the chip, the words and Try Again on rows of their own, never squeezed side by side. */
@media (max-width: 759px) {
  body.theme-atad #vpList .needs-list li { flex-wrap: wrap; }
  body.theme-atad #vpList .needs-list .needs-main { flex-basis: 100%; }
}
body.theme-atad .needs-clear { color: var(--muted); padding: 14px 0 4px; font-size: 14px; }

/* ===========================================================================
   Movement: short, after the data is in. 0.15s at most — every tenth here is
   added to every click. None at all for anyone who asks for less motion.
   =========================================================================== */
@keyframes atadRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes atadFade { from { opacity: 0; } to { opacity: 1; } }
body.theme-atad .panel,
body.theme-atad .stat-card { animation: atadRise .15s ease both; }
body.theme-atad .stat-row .stat-card:nth-child(2) { animation-delay: .02s; }
body.theme-atad .stat-row .stat-card:nth-child(3) { animation-delay: .04s; }
body.theme-atad .stat-row .stat-card:nth-child(4) { animation-delay: .06s; }
@media (prefers-reduced-motion: reduce) {
  body.theme-atad *, body.theme-atad *::before, body.theme-atad *::after {
    animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important;
  }
}

/* ===========================================================================
   Documents list, payslip, misc furniture.
   =========================================================================== */
body.theme-atad .doc-list { border-top-color: var(--line); }
body.theme-atad .doc-list li { border-bottom-color: var(--line); }
body.theme-atad .slip { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); }
body.theme-atad .slip-header { border-bottom: 1px solid var(--line); }
body.theme-atad .net-row td { border-top: 2px solid var(--text); }
body.theme-atad .slip tr.sub-row td { color: var(--muted); }
body.theme-atad .page-back { margin-bottom: 14px; }

/* ===========================================================================
   Phone. Below 760px the strip of sections gives way to a tab bar at the
   bottom (Home, Staff, Runs, Loans, More), gutters are 16px, the main button
   of a screen spans the width, and the lists marked .stack-sm become rows.
   =========================================================================== */
body.theme-atad .tabbar { display: none; }
body.theme-atad .more-sheet[hidden] { display: none; }
@media (max-width: 760px) {
  body.theme-atad { --sticky-top: calc(60px + var(--atad-sat, env(safe-area-inset-top, 0px))); }
  body.theme-atad .topnav { height: calc(60px + var(--atad-sat, env(safe-area-inset-top, 0px))); padding: var(--atad-sat, env(safe-area-inset-top, 0px)) 12px 0 16px; gap: 10px; }
  body.theme-atad .topnav-links,
  body.theme-atad .topnav-right #logoutBtn,
  body.theme-atad .topnav-right .nav-name { display: none; }
  body.theme-atad .topnav .brand-text { display: flex; }
  body.theme-atad .topnav .brand { flex: 1 1 auto; min-width: 0; }
  body.theme-atad .brand-mark { width: 30px; height: 30px; }
  body.theme-atad .page-wrap { padding: 20px 16px calc(96px + var(--atad-sab, env(safe-area-inset-bottom, 0px))); }
  body.theme-atad h1 { font-size: 24px; line-height: 30px; }
  body.theme-atad .panel { padding: 16px; }
  body.theme-atad .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body.theme-atad .stat-card { padding: 14px; }
  body.theme-atad .stat-card .value { font-size: 24px; line-height: 30px; }
  body.theme-atad .stat-card .value.mid { font-size: 20px; line-height: 26px; }
  body.theme-atad .panel-header { flex-direction: column; align-items: stretch; }
  body.theme-atad .panel-header > div:last-child:not(:first-child) { width: 100%; }
  body.theme-atad .page-head-actions { width: 100%; }
  body.theme-atad .page-head-actions > .btn:not(.secondary) { flex: 1 1 100%; order: -1; }
  body.theme-atad .page-head-actions > .btn.secondary { flex: 1 1 auto; }
  body.theme-atad .filter-field:has(> .seg) { flex-basis: 100%; }
  body.theme-atad .btn.primary-wide { width: 100%; }
  body.theme-atad .filter-field.grow { max-width: none; min-width: 0; flex-basis: 100%; }
  body.theme-atad .filter-field { flex: 1 1 140px; min-width: 0; }
  body.theme-atad .seg { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  body.theme-atad .seg button { flex: 1 0 auto; }

  /* A table that has no phone layout of its own scrolls inside itself rather
     than pushing the page sideways. */
  body.theme-atad .panel table:not(.stack-sm):not(.ot-table):not(.cmp-table):not(.day-table):not(.slip table) {
    display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch;
  }
  body.theme-atad .panel table:not(.stack-sm):not(.ot-table):not(.cmp-table) thead th { position: static; }

  /* A list that becomes rows: name and code · designation on the left, the
     figure and the chip on the right. Cells carry data-cell to say where
     they go; anything unmarked is dropped. */
  body.theme-atad table.stack-sm,
  body.theme-atad table.stack-sm tbody { display: block; width: 100%; }
  body.theme-atad table.stack-sm thead { display: none; }
  body.theme-atad table.stack-sm tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main fig" "main chip";
    column-gap: 12px; row-gap: 4px; align-items: center;
    padding: 12px 14px; min-height: 64px;
    border-bottom: 1px solid var(--line);
  }
  body.theme-atad table.stack-sm tr:last-child { border-bottom: none; }
  body.theme-atad table.stack-sm td { display: none; padding: 0; border: none; }
  body.theme-atad table.stack-sm td[data-cell="main"] { display: block; grid-area: main; min-width: 0; }
  body.theme-atad table.stack-sm td[data-cell="fig"] { display: block; grid-area: fig; text-align: right; }
  body.theme-atad table.stack-sm td[data-cell="chip"] { display: block; grid-area: chip; text-align: right; }
  body.theme-atad table.stack-sm tr.group-row { display: block; min-height: 0; padding: 8px 14px; background: var(--panel-2); }
  body.theme-atad table.stack-sm tr.group-row td { display: block; background: none; }
  body.theme-atad .stack-sm .stack-only { display: inline; }
  body.theme-atad .stack-sm div.stack-only { display: block; }
  body.theme-atad .panel.flush-sm { padding: 0; overflow: hidden; }
  body.theme-atad .panel.flush-sm > .panel-pad { padding: 16px; }

  /* The bar at the bottom. */
  body.theme-atad .tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
    height: calc(64px + var(--atad-sab, env(safe-area-inset-bottom, 0px)));
    padding: 6px 6px var(--atad-sab, env(safe-area-inset-bottom, 0px));
    background: var(--panel);
    border-top: 1px solid var(--line);
  }
  body.theme-atad .tabbar a,
  body.theme-atad .tabbar button {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: none; background: none; cursor: pointer;
    font: 600 11px/14px var(--sans);
    color: var(--muted); text-decoration: none;
    border-radius: var(--r-button);
  }
  body.theme-atad .tabbar svg { width: 22px; height: 22px; }
  body.theme-atad .tabbar .is-active { color: var(--accent); }
  body.theme-atad .tabbar a:focus-visible,
  body.theme-atad .tabbar button:focus-visible { outline-offset: -3px; }
  body.theme-atad.modal-open .tabbar { display: none; }

  body.theme-atad .more-sheet {
    position: fixed; inset: 0; z-index: 45;
    background: var(--scrim);
    display: flex; align-items: flex-end;
    animation: atadFade .15s ease both;
  }
  body.theme-atad .more-panel {
    width: 100%;
    max-height: 80vh; overflow-y: auto;
    background: var(--panel);
    border-top: 1px solid var(--line);
    border-radius: var(--r-card) var(--r-card) 0 0;
    padding: 8px 12px calc(76px + var(--atad-sab, env(safe-area-inset-bottom, 0px)));
  }
  body.theme-atad .more-panel a,
  body.theme-atad .more-panel button.more-item {
    display: flex; align-items: center; gap: 12px; width: 100%;
    min-height: 48px; padding: 0 12px;
    border: none; background: none; border-radius: var(--r-button);
    color: var(--text); font: 600 15px/20px var(--sans); text-align: left; text-decoration: none;
  }
  body.theme-atad .more-panel a.active { background: var(--accent-soft); color: var(--accent); }
  body.theme-atad .more-panel .more-note { font-weight: 400; font-size: 12px; color: var(--faint); margin-left: auto; }
  body.theme-atad .more-panel hr { border: none; border-top: 1px solid var(--line); margin: 8px 0; }
  body.theme-atad .more-panel .more-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
  /* A payslip on a phone screen: the header wraps instead of pushing the
     page sideways. Paper is unaffected (print has its own width). */
  body.theme-atad .slip { padding: 20px 16px; }
  body.theme-atad .modal .slip { padding: 0; }
  body.theme-atad .slip-header { flex-wrap: wrap; gap: 10px; }
  body.theme-atad .slip-meta { text-align: left; }
  body.theme-atad .slip-meta * { white-space: normal; overflow-wrap: anywhere; }
  body.theme-atad .toast-host { bottom: calc(76px + var(--atad-sab, env(safe-area-inset-bottom, 0px))); right: 12px; left: 12px; max-width: none; align-items: stretch; }
}
@media (max-width: 380px) {
  body.theme-atad .stat-row { grid-template-columns: minmax(0, 1fr); }
}

/* ===========================================================================
   LOAD-BEARING: paper is white whatever the screen is doing. The variables
   are reset rather than elements named one at a time, so anything added to a
   payslip later cannot print as a black bar.
   =========================================================================== */
@media print {
  html, html[data-theme] { background: #fff !important; }
  body.theme-atad,
  html[data-theme] body.theme-atad {
    --bg: #ffffff; --panel: #ffffff; --panel-2: #ffffff; --bg-alt: #ffffff;
    --line: #d9d6cc; --border: #d9d6cc;
    --text: #171A21; --muted: #565E6D; --faint: #666D7C; --text-muted: #565E6D;
    --accent: #0F7469; --accent-soft: #DDF1EE; --primary-soft: #DDF1EE;
    --red: #A8322A; --red-soft: #FBE6E3; --danger-bg: #FBE6E3;
    --green: #1D6F43; --green-soft: #E0F2E7; --success-bg: #E0F2E7;
    --amber: #8A5800; --amber-soft: #FBEFD8;
    background: #fff !important;
    color: #171A21 !important;
  }
  body.theme-atad .panel,
  body.theme-atad .stat-card,
  body.theme-atad .slip,
  body.theme-atad .portal-card,
  body.theme-atad .owed-card,
  body.theme-atad .bill-card,
  body.theme-atad .modal {
    box-shadow: none !important;
    animation: none !important;
    background: #fff !important;
    color: #171A21 !important;
  }
  body.theme-atad .on-dark { display: none !important; }
  body.theme-atad .on-light { display: block !important; }
  body.theme-atad .slip th,
  body.theme-atad .slip td,
  body.theme-atad .slip .hint { color: #171A21 !important; }
  body.theme-atad .tabbar, body.theme-atad .more-sheet { display: none !important; }

  /* A4 landscape with these margins leaves 711px; the slip is held to one
     sheet by tighter metrics on paper than on screen. */
  body.theme-atad .page-wrap { padding-top: 0; padding-bottom: 0; }
  body.theme-atad .slip { font-size: 13px; line-height: 1.34; }
  body.theme-atad .slip table { line-height: 17px; }
  body.theme-atad .slip .hint { line-height: 14px; }
  body.theme-atad .slip th,
  body.theme-atad .slip td { padding-top: 7px; padding-bottom: 7px; }
}

/* ===========================================================================
   Phone typing boxes are never smaller than 16px (Bug Sweep B9, 8 Oct 2026).
   iPhone Safari zooms the whole page in when a typing box under 16px is
   tapped, and does not zoom back out. Phone width only (the app's own 760px
   breakpoint, plus touch screens up to 932px for a phone held sideways): on a PC the run table keeps its 12px fields, so it still fits
   its panel and its header still freezes. !important because it has to beat
   id-level rules (#payslipsWrap input.editf), inline styles and the shared
   pickers' own 14px boxes, which are copies we do not edit.
   =========================================================================== */
@media screen and (max-width: 760px), screen and (pointer: coarse) and (max-width: 932px) {
  input, select, textarea, .input { font-size: 16px !important; }
}

/* The pinned Payslip / Remove column of a table that scrolls sideways (the run
   table on a phone) took its background from a see-through row, so the figures
   scrolling under it showed through the buttons (B9, 8 Oct 2026). */
body.theme-atad .table-scroll.is-scrolling tbody td.actions-cell { background-color: var(--panel); }
