/* Kanhara HRIS, product interface.

   Calm, editorial and exact. The print and menu brand (sage paper, Jost,
   square corners) stays with the marketing material; the software has its
   own system, built for reading records all day:

   - A neutral stone canvas with near-white cards on hairline borders. The
     sidebar sits on the canvas; the current page is a dark pill.
   - The platform's own interface typeface. Large figures are set light and
     tight, labels small and grey, so a number reads before its caption.
   - Charts carry texture: a diagonal hatch for the plan, the past or what is
     missing, a solid fill for what happened. Blue is normal, pink is a gap.
   - Rounded buttons. Blue moves work forward, red removes or undoes, white
     is everything else.
   - The Duty Roster keeps its grid and its X, AL and DP cell colours. */

:root {
  color-scheme: light;

  /* Surfaces and lines */
  --bg: #EEEEEC;
  --card: #F8F8F7;
  --surface: #FFFFFF;
  --surface-2: #FAFAF9;
  --hover: rgba(25, 25, 25, 0.045);
  --press: rgba(25, 25, 25, 0.08);
  --line: #E3E3E0;
  --line-soft: #ECECE9;
  --line-strong: #D5D5D1;

  /* Text */
  --text: #191919;
  --text-2: #84847F;
  --text-3: #ABABA6;
  --ink: #262626;

  /* Accent and meaning */
  --blue: #2D5FEA;
  --blue-hover: #3A6BF3;
  --blue-press: #2350D2;
  --blue-text: #2554D8;
  --blue-tint: #EBF0FE;
  --blue-tint-2: #D8E2FD;
  --pink: #E23D7C;
  --pink-tint: #FCE6EF;
  --orange: #F0821E;
  --peach: #FBEBD9;
  --hatch-blue: repeating-linear-gradient(-45deg, #3C68EE 0 1.5px, #DCE4FC 1.5px 4.6px);
  --hatch-blue-soft: repeating-linear-gradient(-45deg, #9BB3F6 0 1.3px, #EEF2FE 1.3px 4.6px);
  --hatch-pink: repeating-linear-gradient(-45deg, #E23D7C 0 1.5px, #FBE1EB 1.5px 4.6px);
  --hatch-grey: repeating-linear-gradient(-45deg, #B9B9B4 0 1.3px, #F2F2EF 1.3px 4.6px);
  --red: #D70015;
  --red-hover: #E5172B;
  --red-press: #B80012;
  --red-text: #C00016;
  --red-tint: #FDEEEF;
  --green-text: #16794A;
  --green: #22A06B;
  --green-tint: #E5F5EC;
  --amber-text: #955700;
  --amber: #D98A0B;
  --amber-tint: #FFF6E3;
  --grey-tint: #EFEFEC;

  --focus: 0 0 0 3px rgba(45, 95, 234, 0.25);
  --scrim: rgba(25, 25, 25, 0.32);

  /* Duty Roster cells, as specified for the roster */
  --cell-off: #F0D0CC;   /* X */
  --cell-al: #BFD6E6;    /* AL */
  --cell-dp: #C6DFBB;    /* DP */
  --cell-sunday: #F3F3F0;
  --cell-select: var(--blue-tint);

  /* Leave and request tones */
  --tone-al: #2F7FC1;
  --tone-dp: #3E8E4A;
  --tone-pending: #D98A0B;
  --tone-rejected: #D70015;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 20px;
  --radius-lg: 24px;
  --radius-pill: 980px;
  --shadow-card: none;
  --shadow-chip: 0 1px 2px rgba(25, 25, 25, 0.06), 0 0 0 1px rgba(25, 25, 25, 0.05);
  --shadow-pop: 0 24px 60px -12px rgba(25, 25, 25, 0.22), 0 0 0 1px rgba(25, 25, 25, 0.04);

  --text-xs: 11.5px;
  --text-sm: 12.5px;
  --text-body: 14px;
  --text-md: 15px;
  --text-heading: 17px;
  --text-title: 26px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-width: 252px;
  --gutter: 36px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: left;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3 { margin: 0; font-weight: 600; color: var(--text); }
h1 { font-size: 36px; line-height: 1.1; font-weight: 400; letter-spacing: -0.035em; }
h2 { font-size: 16px; line-height: 1.3; font-weight: 500; letter-spacing: -0.012em; }
h3 { font-size: var(--text-md); line-height: 1.35; letter-spacing: -0.01em; }
p { margin: 0 0 10px; }
img { max-width: 100%; display: block; }
hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.rule-accent { border-top-color: var(--line); }
ul, ol { padding-left: 20px; }

a { color: var(--blue-text); }
.link { color: var(--blue-text); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); }
main:focus { outline: none; box-shadow: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--text); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.muted { color: var(--text-2); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- app shell */
body:not(.auth-page) {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar { display: none; }

.sidenav {
  position: sticky; top: 0; align-self: start;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow-y: auto;
  scrollbar-width: thin;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 22px 18px; color: var(--text); text-decoration: none;
}
.brand img { width: 30px; height: auto; flex: none; padding: 3px; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-chip); box-sizing: content-box; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.brand-product { margin: 0; color: var(--text-2); font-size: var(--text-sm); }

.nav-list { list-style: none; margin: 0; padding: 4px 14px 12px; flex: 1; }
.nav-group {
  margin: 18px 0 4px; padding: 0 10px;
  font-size: var(--text-xs); font-weight: 500; color: var(--text-3);
}
.nav-list > .nav-group:first-child { margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 7px 11px; border-radius: 12px;
  color: var(--text); text-decoration: none; font-size: var(--text-body); font-weight: 450;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-icon { width: 18px; height: 18px; flex: none; color: var(--text-2); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
a.nav-item:not(.is-active):hover { background: var(--hover); }
.nav-item.is-active { background: var(--ink); color: #fff; font-weight: 500; box-shadow: 0 6px 14px -8px rgba(25, 25, 25, 0.6); }
.nav-item.is-active .nav-icon { color: #fff; }
.nav-item.is-upcoming { color: var(--text-3); cursor: default; }
.nav-soon { display: block; font-size: var(--text-xs); }

.nav-user { padding: 12px 14px 16px; margin-top: 8px; border-top: 1px solid var(--line); }
.nav-user-card { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 600; letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--orange);
}
.nav-user-text { min-width: 0; }
.nav-user-name { margin: 0; font-weight: 600; font-size: var(--text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user-role { margin: 0; color: var(--text-2); font-size: var(--text-sm); line-height: 1.35; }
.nav-user form { margin: 0; }
.nav-user-link {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 32px; padding: 5px 10px; border: none; border-radius: var(--radius-sm); background: none; cursor: pointer;
  color: var(--text); font-size: var(--text-body); text-align: left; text-decoration: none;
}
.nav-user-link:hover { background: var(--hover); }
.nav-user-link.is-active { background: var(--ink); color: #fff; }
.nav-user-link.is-active .nav-icon { color: #fff; }
.nav-env { margin: 10px 10px 2px; color: var(--text-3); font-size: var(--text-xs); }
.nav-scrim { display: none; }

main { min-width: 0; padding: 30px var(--gutter) 72px 8px; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px 24px; margin-bottom: 22px;
}
.page-sub { margin: 8px 0 0; color: var(--text-2); font-size: 14px; max-width: 760px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* -------------------------------------------------------------- surfaces
   A card is a white surface with a hairline edge. Sections, dashboard
   blocks and stand-alone tables are cards; anything inside a card is not. */
.card, .section, .block, .roster-notes > div:not(:empty), .setup-summary > div,
.balance-block, .figures, .config-list, .setup-list, .chart, .empty-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.section { margin-bottom: 20px; max-width: 880px; padding: 22px 24px; }
.section > h2 { margin-bottom: 14px; }
.section-narrow { max-width: 460px; }
.section-foot { margin: 12px 0 0; color: var(--text-2); }
.dash { max-width: 1240px; }

/* --------------------------------------------------------------- buttons
   Rounded, like Apple's. Blue moves work forward, red removes or rejects,
   white is everything else. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 18px;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-chip);
  font-size: var(--text-body); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: #FBFBFA; box-shadow: 0 2px 6px -2px rgba(25, 25, 25, 0.16), 0 0 0 1px rgba(25, 25, 25, 0.07); }
.btn:active { background: #F2F2F0; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 14px -8px rgba(45, 95, 234, 0.8); }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-primary:active { background: var(--blue-press); border-color: var(--blue-press); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 6px 14px -8px rgba(215, 0, 21, 0.7); }
.btn-danger:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn-danger:active { background: var(--red-press); border-color: var(--red-press); }
.btn.is-danger:not(.btn-danger) { color: var(--red-text); }
.btn.is-danger:not(.btn-danger):hover { background: var(--red-tint); border-color: #F2B8BE; }
.btn-quiet { background: rgba(25, 25, 25, 0.05); border-color: transparent; box-shadow: none; }
.btn-quiet:hover { background: rgba(25, 25, 25, 0.09); box-shadow: none; }
.btn-small { min-height: 30px; padding: 4px 14px; font-size: 13px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn.is-on { background: var(--blue-tint); border-color: var(--blue-tint-2); color: var(--blue-text); font-weight: 600; }
.btn-text {
  display: inline; background: none; border: none; padding: 0; cursor: pointer;
  color: var(--blue-text); font-size: inherit; font-weight: 500; text-decoration: none; border-radius: 4px;
}
.btn-text:hover { text-decoration: underline; text-underline-offset: 2px; }
.btn-text.is-danger { color: var(--red-text); }

/* ----------------------------------------------------------------- forms */
.form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field legend, .field-label { font-size: 13px; font-weight: 500; color: var(--text); }
.field-optional { font-weight: 400; color: var(--text-3); }
input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="email"], input[type="tel"],
input[type="time"], input[type="number"], input[type="month"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: 36px; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: var(--text-body); appearance: none; -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="date"], input[type="month"], input[type="time"] { min-height: 36px; }
select {
  padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' fill='none' stroke='%236E6E73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
input:hover:not(:focus):not([readonly]), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #B9B9BF; }
input:focus-visible, select:focus-visible, textarea:focus-visible,
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
input[readonly] { background: var(--surface-2); color: var(--text-2); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field.has-error input:focus, .field.has-error select:focus, .field.has-error textarea:focus { box-shadow: 0 0 0 3px rgba(215, 0, 21, 0.18); }
.field-hint { margin: 0; color: var(--text-2); font-size: var(--text-sm); }
.field-error { margin: 0; font-size: var(--text-sm); font-weight: 500; color: var(--red-text); }
.form-alert {
  margin: 0 0 16px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--red-tint); color: #7A0010; border: 1px solid #F6C9CE; font-weight: 500;
}
.form-alert ul { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: var(--text-body); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
fieldset { border: none; margin: 0; padding: 0; min-width: 0; }

.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; margin-bottom: 16px;
}
.filters .field { width: 180px; }
.filters .field-grow { flex: 1 1 260px; width: auto; max-width: 420px; }
.filters .field label { font-size: var(--text-sm); color: var(--text-2); }
input[type="search"] {
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8A8F' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center;
}

/* ---------------------------------------------------------------- tables
   A table on its own sits in a card. Inside a card or a dialog it is plain. */
.table-wrap {
  overflow-x: auto; position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  --table-inset: 20px;
}
.table-wrap > .loading, .table-wrap > .empty, .table-wrap > .empty-block, .table-wrap > .error-block { margin: 0; padding: 22px 20px; }
.table-wrap > .error-block { border: none; border-radius: 0; }
:is(.block, .section, dialog, .chart-table, .detail-section, .notice, .eval-box, .p-card, .card, .ov-card) .table-wrap {
  background: none; border: none; border-radius: 0; box-shadow: none; --table-inset: 0px;
}
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-body); }
table.data-narrow { max-width: 460px; }
table.data th, table.data td {
  padding: 13px 16px 13px 0; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
table.data th:first-child, table.data td:first-child { padding-left: var(--table-inset, 0px); }
table.data th:last-child, table.data td:last-child { padding-right: var(--table-inset, 0px); }
table.data thead th {
  padding-top: 14px; padding-bottom: 10px;
  font-size: var(--text-sm); font-weight: 450; color: var(--text-2);
  background: none; border-bottom: 1px solid var(--line); white-space: nowrap;
}

table.data tbody tr:last-child td, table.data tbody tr:last-child th { border-bottom: none; }
table.data tfoot td { font-weight: 600; border-bottom: none; border-top: 1px solid var(--line); }
table.data .num { text-align: right; }
table.data tbody tr { transition: background-color 0.12s ease; }
table.data tbody tr.is-clickable { cursor: pointer; }
table.data tbody tr.is-clickable:hover, table.data tbody tr:hover { background: rgba(255, 255, 255, 0.75); }
table.data tbody tr.is-inactive td { color: var(--text-3); }
table.data td.is-primary { min-width: 200px; }
.cell-main { font-weight: 500; color: var(--text); }
.cell-sub { display: block; color: var(--text-2); font-size: var(--text-sm); font-weight: 400; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; justify-content: flex-end; white-space: nowrap; }

/* Status: a small white pill, a coloured dot and words. */
.status, .tone, .flag {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 2px 9px 2px 8px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; line-height: 1.5;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-chip);
  --dot: var(--text-3);
}
.status::before, .tone::before, .flag::before {
  content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--dot);
}
.status { --dot: var(--green); }
.status.is-off { --dot: transparent; color: var(--text-2); }
.status.is-off::before { box-shadow: inset 0 0 0 1.5px var(--text-3); }
.status.is-partial { --dot: var(--blue); }
.flag { --dot: var(--orange); padding: 1px 8px; font-size: var(--text-xs); }
.cell-sub .flag, .cell-sub.flag { margin-top: 4px; }

.tone-al { --dot: var(--blue); }
.tone-dp, .tone-approved, .tone-credited { --dot: var(--green); }
.tone-pending { --dot: var(--orange); }
.tone-rejected { --dot: var(--pink); }
.tone-closed { --dot: transparent; color: var(--text-2); }
.tone-closed::before { box-shadow: inset 0 0 0 1.5px var(--text-3); }
.tone-required { --dot: transparent; color: #9A4B00; }
.tone-required::before { box-shadow: inset 0 0 0 1.5px var(--orange); }

.facts { margin: 12px 0 0; display: grid; gap: 6px; }
.facts > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; }

.empty, .loading { margin: 0; padding: 18px 0; color: var(--text-2); }
.empty-block { padding: 28px 30px; max-width: 560px; }
.empty-block h2 { margin-bottom: 6px; }
.empty-block p { color: var(--text-2); }
.empty-block .btn { margin-top: 10px; }
.loading::after {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 10px; vertical-align: -2px;
  border: 2px solid var(--line-strong); border-top-color: var(--blue); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-block {
  padding: 14px 16px; border-radius: var(--radius); max-width: 640px;
  background: var(--red-tint); border: 1px solid #F6C9CE; color: #5E000C;
}
.error-block p { margin: 0 0 8px; }

/* ------------------------------------------------------------------ tabs */
.tabs {
  display: flex; width: fit-content; max-width: 100%; gap: 2px; padding: 4px; margin-bottom: 22px;
  overflow-x: auto; scrollbar-width: none; border-radius: 999px;
  background: rgba(25, 25, 25, 0.055);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 7px 16px; margin: 0; border: none; border-radius: 999px; background: none; cursor: pointer;
  color: var(--text-2); font-size: var(--text-body); font-weight: 500; white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); font-weight: 500; background: #fff; box-shadow: 0 1px 3px rgba(25, 25, 25, 0.12), 0 0 0 0.5px rgba(25, 25, 25, 0.05); }
.tab:focus-visible { box-shadow: var(--focus); }
.tab-panel:focus { outline: none; box-shadow: none; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.panel-head p { margin: 4px 0 0; color: var(--text-2); max-width: 680px; }
.panel-note { color: var(--text-2); max-width: 720px; margin: 14px 0 0; }
.subsection { margin-top: 32px; }

/* --------------------------------------------------------------- dialogs */
dialog {
  border: none; border-radius: var(--radius-lg); color: var(--text); background: var(--card);
  padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: var(--scrim); }
dialog.is-wide { width: min(780px, calc(100vw - 32px)); }
dialog.is-drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(500px, 100vw);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.dialog-inner { display: flex; flex-direction: column; max-height: inherit; height: 100%; }
.dialog-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 24px 14px;
}
.dialog-head h2 { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.dialog-head p { margin: 4px 0 0; color: var(--text-2); }
.dialog-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.dialog-body > p:first-child { color: var(--text-2); }
.dialog-foot {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px;
  padding: 14px 24px 20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
dialog.is-drawer .dialog-foot { border-radius: 0 0 0 var(--radius-lg); }
.dialog-foot .foot-left { margin-right: auto; }
.dialog-close {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 4px 12px; border: none; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-chip);
}
.dialog-close:hover { color: var(--text); }

.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 48px)); }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 16px;
  font-size: var(--text-body); box-shadow: var(--shadow-pop);
  animation: toast-in 0.2s ease-out;
}
.toast.is-error { background: var(--red); font-weight: 500; }
.toast ul { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--text-2); font-size: var(--text-sm); }
.timeline .what { display: block; }
.code-chip { font-weight: 600; }

/* ---------------------------------------------------------------- roster */
.page-roster main { padding-bottom: 28px; }
.roster-head { margin-bottom: 16px; }
.month-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 520px) { #week-view-link { flex-basis: 100%; } }
.month-input { width: 168px !important; font-weight: 600; text-align: center; }

.roster-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-bottom: 12px;
}
.toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar-label { font-size: var(--text-sm); color: var(--text-2); font-weight: 500; }
.toolbar-group select { width: auto; min-width: 170px; }
.toolbar-actions { margin-left: auto; }

.palette {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px 10px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.palette-label { font-size: var(--text-sm); color: var(--text-2); font-weight: 500; margin: 0 4px 0 2px; }
.palette-sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 6px; }
.code-btn {
  min-width: 42px; min-height: 34px; padding: 4px 9px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
  font-size: var(--text-sm); font-weight: 600; line-height: 1.15; text-align: center;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.code-btn small { display: block; font-size: 10px; font-weight: 400; color: var(--text-2); }
.code-btn:hover { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.code-btn[disabled] { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.code-btn.is-x { background: var(--cell-off); border-color: transparent; }
.code-btn.is-al { background: var(--cell-al); border-color: transparent; }
.code-btn.is-dp { background: var(--cell-dp); border-color: transparent; }
.code-btn.is-x:hover, .code-btn.is-al:hover, .code-btn.is-dp:hover { border-color: var(--blue); }
.palette-hint { font-size: var(--text-sm); color: var(--text-2); margin-left: auto; }
.type-buffer { font-weight: 600; min-width: 34px; }

.roster-wrap {
  overflow: auto; max-height: calc(100dvh - var(--roster-top, 250px));
  min-height: 260px; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.roster-wrap.is-compact { min-height: 0; }
.roster-wrap:focus-visible { box-shadow: var(--focus); border-color: var(--blue); }
table.roster { border-collapse: separate; border-spacing: 0; font-size: var(--text-sm); user-select: none; -webkit-user-select: none; }
table.roster th, table.roster td {
  border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  height: 34px; padding: 0; text-align: center; font-weight: 400; background: var(--surface);
}
table.roster .col-emp {
  position: sticky; left: 0; z-index: 2; min-width: 204px; max-width: 204px; padding: 3px 12px 3px 14px;
  text-align: left; border-right: 1px solid var(--line); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.roster thead th {
  position: sticky; top: 0; z-index: 3; height: 44px; line-height: 1.15;
  background: var(--card); border-bottom: 1px solid var(--line);
}
table.roster thead th.col-emp { z-index: 5; vertical-align: bottom; padding-bottom: 8px; color: var(--text-2); font-weight: 600; }
.day-head { min-width: 40px; width: 40px; }
.day-head .wd { display: block; font-size: 10.5px; color: var(--text-2); font-weight: 500; }
.day-head .dn { display: block; font-size: var(--text-sm); font-weight: 600; }
.day-head.is-sunday, td.cell.is-sunday, td.sum.is-sunday { background: var(--cell-sunday); }
.day-head.is-sunday .wd { color: var(--red-text); font-weight: 600; }
.day-head.is-today .dn {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 50%; background: var(--blue); color: #fff;
}
.day-head.is-holiday .wd::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 3px; border-radius: 50%; background: var(--red); vertical-align: 1px; }
.emp-name { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.emp-meta { display: block; color: var(--text-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
tr.dept-row th {
  position: sticky; left: 0; text-align: left; height: 28px; padding: 0; font-size: 11.5px; font-weight: 600;
  color: var(--text-2); background: var(--surface-2); border-right: none; letter-spacing: 0.01em;
}
tr.dept-row th span { position: sticky; left: 0; display: inline-block; padding: 0 12px 0 14px; }

table.roster td.cell { min-width: 40px; width: 40px; cursor: cell; font-weight: 500; position: relative; }
table.roster td.cell.is-readonly { cursor: default; }
table.roster td.cell.is-empty { font-weight: 400; color: var(--text-3); }
td.cell.is-empty::after { content: "\00B7"; opacity: 0.6; }
table.roster td.cell.is-x { background: var(--cell-off); }
table.roster td.cell.is-al { background: var(--cell-al); }
table.roster td.cell.is-dp { background: var(--cell-dp); }
td.cell.is-selected { box-shadow: inset 0 0 0 1px var(--blue), inset 0 0 0 40px rgba(0, 113, 227, 0.12); }
td.cell.is-focus { box-shadow: inset 0 0 0 2px var(--blue), inset 0 0 0 40px rgba(0, 113, 227, 0.12); }
td.cell.is-changed::before { content: ""; position: absolute; top: 3px; left: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
td.cell.is-warning::after { content: "!"; position: absolute; top: 0; right: 3px; font-size: 10px; font-weight: 700; color: var(--red-text); opacity: 1; }
td.cell.is-saving { opacity: 0.55; }
td.row-total { min-width: 36px; padding: 0 4px; color: var(--text-2); font-variant-numeric: tabular-nums; }
th.total-head { min-width: 36px; font-size: 10.5px; color: var(--text-2); font-weight: 600; }
th.total-head.first, td.row-total.first { border-left: 1px solid var(--line); }

tbody.summary tr.sum-title th {
  position: sticky; left: 0; text-align: left; height: 38px; padding: 12px 0 0 14px; font-size: var(--text-body); font-weight: 600;
  border-top: 1px solid var(--line); border-right: none; background: var(--surface);
}
tbody.summary tr.sum-title th span { position: sticky; left: 14px; display: inline-block; }
tbody.summary th.col-emp { font-weight: 500; height: 28px; }
tbody.summary td { height: 28px; font-variant-numeric: tabular-nums; }
td.sum.is-zero { color: var(--text-3); opacity: 0.6; }
tr.sum-total th, tr.sum-total td { font-weight: 600 !important; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
tr.sum-muted th.col-emp { color: var(--text-2); }

.roster-notes { margin-top: 16px; display: grid; gap: 12px; max-width: 1080px; }
.roster-notes > div:not(:empty) { padding: 14px 18px; }
.warning-list { margin: 6px 0 0; padding: 0; list-style: none; }
.warning-list li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.warning-list li:last-child { border-bottom: none; }
.warning-list li::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 8px; border-radius: 50%; background: var(--amber-tint); color: var(--amber-text); font-size: 11px; font-weight: 700; }
.legend { color: var(--text-2); font-size: var(--text-sm); }
.legend p { margin: 0 0 4px; }
.legend .swatch { display: inline-block; width: 24px; height: 16px; margin-right: 6px; vertical-align: -3px; border-radius: 4px; border: 1px solid var(--line); text-align: center; font-size: 9.5px; line-height: 14px; color: var(--text); font-weight: 600; }
.legend .swatch.is-x { background: var(--cell-off); border-color: transparent; }
.legend .swatch.is-al { background: var(--cell-al); border-color: transparent; }
.legend .swatch.is-dp { background: var(--cell-dp); border-color: transparent; }
.legend .item { display: inline-block; margin-right: 18px; white-space: nowrap; }

body.is-focus-mode { grid-template-columns: minmax(0, 1fr); }
body.is-focus-mode .sidenav { display: none; }
body.is-focus-mode main { padding: 16px 20px 20px; }

/* ------------------------------------------------------------------ auth */
.auth-page { min-height: 100dvh; display: flex; flex-direction: column; }
.auth {
  width: min(400px, calc(100vw - 32px)); margin: auto; padding: 0 0 8vh;
}
.auth-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 34px 32px 28px;
  box-shadow: 0 30px 70px -30px rgba(25, 25, 25, 0.25);
}
.auth-logo { width: 52px; height: auto; margin: 0 auto 18px; }
.auth h1 { font-size: 26px; font-weight: 400; letter-spacing: -0.03em; text-align: center; }
.auth-sub { color: var(--text-2); margin: 6px 0 22px; text-align: center; }
.auth .form-actions .btn { width: 100%; min-height: 42px; font-size: var(--text-md); }
.auth-foot { margin: 18px 8px 0; color: var(--text-3); font-size: var(--text-sm); text-align: center; }
.auth hr { display: none; }

/* --------------------------------------------------------------- mobile */
@media (max-width: 900px) {
  :root { --gutter: 16px; }
  body:not(.auth-page) { display: block; }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    min-height: 54px; padding: 8px var(--gutter);
    background: rgba(238, 238, 236, 0.86); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-menu {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--grey-tint); border: none; border-radius: var(--radius-pill); padding: 6px 14px 6px 10px; min-height: 34px;
    cursor: pointer; font-size: 13px; font-weight: 500;
  }
  .topbar-menu .nav-icon { width: 18px; height: 18px; color: var(--text); }
  .topbar-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
  .topbar-title img { width: 22px; height: auto; }
  .sidenav {
    position: fixed; z-index: 50; left: 0; top: 0; width: min(290px, 86vw);
    transform: translateX(-102%); transition: transform 0.22s ease; visibility: hidden;
    box-shadow: var(--shadow-pop);
  }
  .sidenav.is-open { transform: none; visibility: visible; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: var(--scrim); }
  .nav-scrim[hidden] { display: none; }
  main { padding: 20px var(--gutter) 64px; }
  h1 { font-size: 23px; }
  .page-head { margin-bottom: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filters .field { width: calc(50% - 7px); }
  .filters .field-grow { flex-basis: 100%; max-width: none; }
  .toolbar-actions { margin-left: 0; }
  .palette-hint { display: none; }
  .roster-wrap { max-height: calc(100dvh - 150px); }
  table.roster .col-emp { min-width: 122px; max-width: 122px; padding-left: 10px; padding-right: 8px; }
  .page-roster .palette {
    position: sticky; bottom: 0; z-index: 20; margin: 0 calc(var(--gutter) * -1);
    padding: 8px var(--gutter); border-radius: 0; border-width: 1px 0 0;
    flex-wrap: nowrap; overflow-x: auto; order: 5;
    background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .page-roster .roster-app { display: flex; flex-direction: column; }
  .code-btn { min-height: 40px; min-width: 46px; flex: none; }
  .code-btn small { display: none; }
  .palette-sep { flex: none; }
  dialog.is-drawer { width: 100vw; border-radius: 0; }
  dialog.is-drawer .dialog-foot { border-radius: 0; }
  .toast-region { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .page-roster .toast-region { bottom: 70px; }
  .section { padding: 18px 16px; }

  /* Wide data tables become stacked records on small screens. */
  table.data.is-stacking thead { position: absolute; left: -9999px; }
  table.data.is-stacking, table.data.is-stacking tbody, table.data.is-stacking tr, table.data.is-stacking td { display: block; width: 100%; }
  table.data.is-stacking tr { padding: 12px var(--table-inset, 0px); border-bottom: 1px solid var(--line-soft); }
  table.data.is-stacking tbody tr:last-child { border-bottom: none; }
  table.data.is-stacking td, table.data.is-stacking td:first-child, table.data.is-stacking td:last-child { border: none; padding: 2px 0; }
  table.data.is-stacking td[data-label]::before { content: attr(data-label) ": "; color: var(--text-2); }
  table.data.is-stacking td.is-primary::before { content: none; }
  table.data.is-stacking .row-actions { justify-content: flex-start; padding-top: 6px; }
}

@media (max-width: 520px) {
  .filters .field { width: 100%; }
  .month-nav { width: 100%; }
  .month-input { flex: 1; width: auto !important; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .auth-card { padding: 26px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media print {
  .sidenav, .topbar, .roster-toolbar, .palette, .page-actions, .toast-region { display: none !important; }
  body:not(.auth-page) { display: block; background: #fff; }
  .roster-wrap { max-height: none; overflow: visible; border: none; box-shadow: none; }
  .card, .section, .block, .table-wrap, .metrics, .figures { box-shadow: none; }
}

/* ------------------------------------------------------------ attendance */
.notice {
  display: block; padding: 16px 20px; margin: 0 0 18px; max-width: 1080px;
  background: var(--peach); border: none; border-radius: var(--radius);
  color: #4A3410;
}
.notice-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; margin-bottom: 4px; color: #A25810; }
.notice-title::before {
  content: ""; width: 14px; height: 14px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l1.9 6.1L20 10l-6.1 1.9L12 18l-1.9-6.1L4 10l6.1-1.9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l1.9 6.1L20 10l-6.1 1.9L12 18l-1.9-6.1L4 10l6.1-1.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.notice p { margin: 0 0 4px; }
.notice p:last-child { margin-bottom: 0; }
.notice .notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.notice.is-quiet { background: var(--blue-tint); color: #1A2F66; }
.notice.is-quiet .notice-title { color: var(--blue-text); }

.date-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.date-nav input[type="date"] { width: 176px; font-weight: 600; }
.date-nav .date-label { margin-left: 6px; color: var(--text-2); }

/* Summary figures: one card, cells divided by hairlines. */
.metrics {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px;
  margin: 0 0 10px; background: none; border: none; box-shadow: none;
}
.metric {
  display: block; width: 100%; min-width: 0; padding: 15px 18px 14px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.metric:hover { background: #fff; }
.metric:focus-visible { box-shadow: var(--focus); }
.metric-count { display: block; font-size: 34px; font-weight: 300; line-height: 1.1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--text); }
.metric-label { display: block; margin-top: 3px; font-size: var(--text-sm); color: var(--text-2); }
.metric[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.metric[aria-pressed="true"] .metric-count, .metric[aria-pressed="true"] .metric-label { color: #fff; }
.metric-note { margin: 0 0 16px; color: var(--text-2); font-size: var(--text-sm); max-width: 1080px; }

.list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 18px 0 10px; }
.list-head h2 { font-size: var(--text-heading); }
.is-missing { font-weight: 600; color: var(--red-text); }
.is-missing::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; vertical-align: 1px; }

.detail-facts { display: grid; gap: 8px; margin: 0 0 18px; }
.detail-facts > div { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; }
.detail-facts dt { color: var(--text-2); }
.detail-facts dd { margin: 0; }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin-bottom: 8px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.code-block {
  margin: 6px 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line-soft);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.preview-table { font-size: var(--text-sm); }

/* Attendance marker on a roster cell: a small glyph, the shift code stays. */
.att-ind { position: absolute; right: 1px; bottom: 0; padding: 1px 2px; background: none; border: none; cursor: pointer; font-size: 9px; line-height: 1; color: var(--text); font-weight: 500; border-radius: 3px; }
.att-ind:hover, .att-ind:focus-visible { box-shadow: inset 0 0 0 1px var(--blue); }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .date-nav input[type="date"] { flex: 1; width: auto; }
  .date-nav .date-label { flex-basis: 100%; margin-left: 0; }
  .detail-facts > div { grid-template-columns: 110px minmax(0, 1fr); }
}

/* Wide record tables: let headers wrap so more columns fit without scrolling. */
table.data.is-compact thead th { white-space: normal; vertical-align: bottom; line-height: 1.3; }
table.data.is-compact th, table.data.is-compact td { padding-right: 12px; }
table.data.is-compact td.is-primary { min-width: 160px; }

/* ------------------------------------------------------------------ Leave */
.metrics.is-eight { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.balance-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 4px 0 20px; }
.balance-block { padding: 16px 20px 18px; }
.balance-block h3 { margin: 0 0 10px; }
.balance-block dl { margin: 0; display: grid; gap: 6px; }
.balance-block dl > div { display: flex; justify-content: space-between; gap: 12px; }
.balance-block dt { color: var(--text-2); }
.balance-block dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.balance-block .is-total { padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--line-soft); }
.balance-block .is-total dd, .balance-block .is-total dt { font-weight: 600; color: var(--text); }
.config-list {
  margin: 0 0 20px; padding: 0 20px; list-style: none; max-width: 1080px;
}
.config-list li { display: grid; grid-template-columns: 250px 200px minmax(0, 1fr); gap: 6px 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.config-list li:last-child { border-bottom: none; }
.config-list .config-detail { color: var(--text-2); }
.eval-box { border-radius: 14px; background: var(--blue-tint); padding: 12px 14px; margin: 4px 0 0; }
.eval-box ul { margin: 6px 0 0; padding-left: 18px; }
.eval-box .eval-errors { font-weight: 600; color: var(--red-text); }
.note-list { margin: 0; padding: 0; list-style: none; }
.note-list li { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.note-list li:last-child { border-bottom: none; }
.note-list li.is-unread .note-title { font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Roster: read-only AL and DP balance columns at the right, and a marker for
   leave that has been requested but not approved. */
table.roster th.bal-head, table.roster td.bal { min-width: 38px; width: 38px; text-align: center; font-variant-numeric: tabular-nums; cursor: default; }
table.roster th.bal-group { text-align: center; font-weight: 600; }
table.roster td.bal { color: var(--text); background: var(--surface-2); }
table.roster td.bal.is-first, table.roster th.bal-head.is-first, table.roster th.bal-group { border-left: 1px solid var(--line); }
table.roster td.bal.is-bal { font-weight: 600; }
table.roster td.bal.is-none { color: var(--text-3); }
table.roster td.bal:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.leave-pending { position: absolute; left: 1px; bottom: 0; padding: 1px 2px; background: none; border: none; cursor: pointer; font-size: 8.5px; line-height: 1; font-weight: 700; color: var(--amber-text); }
td.cell.has-pending-leave { box-shadow: inset 0 -2px 0 var(--tone-pending); }
td.cell.is-leave-locked { cursor: default; }

@media (max-width: 900px) {
  .metrics.is-eight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .balance-pair { grid-template-columns: minmax(0, 1fr); }
  .config-list { padding: 0 16px; }
  .config-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
.page-leave .tab-panel > form.form {
  max-width: 800px; margin-bottom: 30px; padding: 22px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.page-leave .panel-head { margin-top: 6px; }
table.roster th.bal-head .wd { display: block; font-size: 10.5px; font-weight: 600; color: var(--text); }
table.roster th.bal-head .dn { display: block; font-size: 9.5px; font-weight: 500; color: var(--text-2); letter-spacing: 0.02em; }
.note-list .flag { margin-left: 8px; }
@media (max-width: 900px) {
  table.data.is-stacking td.num { text-align: left; }
  table.data.is-stacking tfoot { display: none; }
  .page-leave .tab-panel > form.form { padding: 18px 16px; }
}

a.tab { text-decoration: none; white-space: nowrap; }

/* ------------------------------------------------------ Management pages
   Dashboard, analytics, payroll preparation and reports. */
.page-management main { max-width: none; }
.dash-greeting { margin: 0 0 14px; color: var(--text-2); }
.dash-greeting .strong { color: var(--text); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; max-width: 1280px; }
.dash-cell { min-width: 0; }
.dash-cell.is-wide { grid-column: 1 / -1; }
.block { margin: 0 0 20px; min-width: 0; padding: 18px 20px 16px; }
.dash-cell > .block { margin-bottom: 0; height: 100%; }
.block-head { margin-bottom: 12px; }
.block-head h2 { font-size: var(--text-md); }
.block-head p { margin: 3px 0 0; color: var(--text-2); font-size: var(--text-sm); max-width: 760px; }
.block > p:last-child { margin-bottom: 0; }
.metric[disabled] { cursor: default; }
.metric[disabled]:hover { background: none; }
.metrics + .defs, .figures + .defs { margin-top: 0; }

.defs { margin: 6px 0 18px; max-width: 1080px; color: var(--text-2); font-size: var(--text-sm); }
.defs summary { cursor: pointer; color: var(--blue-text); width: fit-content; list-style: none; font-weight: 500; }
.defs summary:hover { text-decoration: underline; text-underline-offset: 2px; }
.defs summary::-webkit-details-marker { display: none; }
.defs summary::after, .chart-table summary::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform 0.15s ease; }
.defs[open] summary::after, .chart-table[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.defs dl {
  margin: 10px 0 0; display: grid; gap: 8px; padding: 14px 18px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-chip);
}
.defs dl > div { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; }
.defs dt { color: var(--text); font-weight: 500; }
.defs dd { margin: 0; }

.link-rows { list-style: none; margin: 0; padding: 0; }
.link-rows li { border-bottom: 1px solid var(--line-soft); }
.link-rows li:last-child { border-bottom: none; }
.link-rows li > a, .link-rows li > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 8px; margin: 0 -8px; color: var(--text); text-decoration: none; border-radius: var(--radius-sm); }
.link-rows li > a:hover { background: var(--hover); }
.link-rows .cell-sub { display: block; }
.alert-line { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: var(--text-sm); color: var(--text-2); }
.note-list .row-actions { margin-top: 4px; }
.note-list p { margin: 2px 0 2px; }
.checks.is-column { flex-direction: column; gap: 10px; margin: 4px 0 6px; }
.coverage-status { margin: 0 0 12px; }
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0 0 16px; padding: 3px;
  background: rgba(25, 25, 25, 0.055); border-radius: var(--radius-pill);
}
.seg .btn { border: none; background: none; box-shadow: none; min-height: 30px; padding: 4px 14px; font-size: 13px; color: var(--text-2); }
.seg .btn:hover { background: none; box-shadow: none; color: var(--text); }
.seg .btn.is-on, .seg .btn[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(25, 25, 25, 0.12); }
.review-head { margin: 0 0 16px; }
.review-head p { margin: 4px 0 0; }
.review-head h2 { font-size: 20px; }
.field-presets .row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.filters .field-presets { width: auto; }
tr.is-total td { font-weight: 600; border-top: 1px solid var(--line); }

/* Plain figures: a label and a value, in a card. */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; margin: 0 0 16px; max-width: 1280px; padding: 6px 22px; }
.figure { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.figure dt { color: var(--text-2); }
.figure dd { margin: 0; font-size: 18px; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-align: right; }
.figure-note { display: block; font-weight: 400; font-size: var(--text-xs); color: var(--text-3); }

/* Charts */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 1280px; margin: 18px 0 8px; }
.chart {
  margin: 0 0 18px; min-width: 0; max-width: 1280px; padding: 22px 24px 18px;
}
.chart-grid > .chart { margin: 0; }
.chart figcaption, .chart > .chart-title { margin-bottom: 12px; }
.chart-title { display: block; font-size: 16px; font-weight: 500; letter-spacing: -0.012em; }
.chart-note { display: block; color: var(--text-2); font-size: var(--text-sm); font-weight: 400; margin-top: 2px; }
.bars { list-style: none; margin: 0; padding: 0; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) 64px; align-items: center; gap: 12px; width: 100%; padding: 7px 0; border: none; background: none; text-align: left; color: var(--text); border-bottom: 1px solid var(--line-soft); border-radius: 0; }
.bars > li:last-child .bar-row { border-bottom: none; }
.bar-row.is-button { cursor: pointer; }
.bar-row.is-button:hover { background: var(--surface-2); }
.bar-row.is-button:focus-visible { box-shadow: inset var(--focus); }
.bar-label { min-width: 0; overflow-wrap: anywhere; }
.bar-sub { display: block; color: var(--text-2); font-size: var(--text-sm); }
.bar { display: block; width: 100%; height: 10px; }
.bar-track { fill: var(--grey-tint); }
.bar-fill { fill: var(--blue); }
.bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-scroll { overflow-x: auto; position: relative; }
.chart-svg { display: block; width: 100%; min-width: 560px; max-width: 1080px; height: auto; }
.chart-axis { stroke: var(--line-strong); stroke-width: 1; }
.chart-grid-line, .chart-svg .chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-tick { fill: var(--text-2); font-size: 10.5px; font-family: var(--font); }
.chart-col.is-solid { fill: var(--blue); }
.chart-col.is-outline { fill: var(--surface); stroke: var(--text); stroke-width: 1; }
.chart-col.is-light { fill: var(--blue-tint-2); stroke: var(--blue); stroke-width: 1; }
.chart-line { stroke: var(--text); stroke-width: 2; }
.chart-flag { fill: var(--red); }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; padding: 0; font-size: var(--text-sm); color: var(--text-2); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 12px; height: 10px; flex: none; border-radius: 3px; }
.key-solid { background: var(--blue); }
.key-outline { border: 1px solid var(--text); }
.key-light { background: var(--blue-tint-2); border: 1px solid var(--blue); }
.key-line { height: 0; border-top: 2px solid var(--text); border-radius: 0; }
.key-flag { height: 5px; background: var(--red); }
.chart-table { margin-top: 10px; font-size: var(--text-sm); }
.chart-table summary { cursor: pointer; width: fit-content; list-style: none; color: var(--blue-text); font-weight: 500; }
.chart-table summary:hover { text-decoration: underline; text-underline-offset: 2px; }
.chart-table summary::-webkit-details-marker { display: none; }
.chart-table .table-wrap { margin-top: 8px; }

@media (max-width: 900px) {
  .dash-grid, .chart-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .figures { grid-template-columns: minmax(0, 1fr); padding: 4px 16px; }
  .defs dl > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .bar-row { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) 52px; gap: 8px; }
  .seg { display: flex; }
  .seg .btn { flex: 1 1 auto; }
  .block, .chart { padding: 16px; }
}
@media print {
  .page-management .tabs, .page-management .filters, .page-management .date-nav, .page-management .page-actions { display: none; }
}

/* Employee import */
.import h3 { margin: 18px 0 6px; }
.cell-list { margin: 4px 0 0; padding-left: 16px; font-size: var(--text-sm); }
.env-banner {
  grid-column: 1 / -1; margin: 0; padding: 7px var(--gutter);
  background: var(--amber-tint); color: #4A3000; border-bottom: 1px solid #F3DDAE;
  font-size: var(--text-sm); font-weight: 500; text-align: center;
}
.nav-env.is-staging { color: var(--amber-text); font-weight: 600; }

/* Settings: many sections, so the tab row wraps instead of hiding tabs off-screen. */
.tabs.is-wrapping { flex-wrap: wrap; border-radius: 20px; overflow-x: visible; }
@media (max-width: 900px) { .tabs.is-wrapping { flex-wrap: nowrap; overflow-x: auto; border-radius: 999px; } }

/* System setup */
.setup-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 6px 0 22px; max-width: 1080px; }
.setup-summary > div { padding: 16px 20px; }
.setup-summary h3 { margin-bottom: 6px; }
.setup-summary p { margin: 0 0 4px; }
.setup-list {
  list-style: decimal; margin: 0 0 12px; padding: 4px 20px 4px 44px; max-width: 1080px;
}
.setup-list li { padding: 12px 0 13px; border-bottom: 1px solid var(--line-soft); }
.setup-list li:last-child { border-bottom: none; }
.setup-list li::marker { color: var(--text-3); font-weight: 600; }
.setup-list p { margin: 3px 0 5px; color: var(--text-2); }
.setup-title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
@media (max-width: 900px) { .setup-summary { grid-template-columns: minmax(0, 1fr); } }

/* Duty Roster, week view: read-only, printable. */
.wk-table { min-width: 880px; }
.wk-table th.wk-emp { min-width: 180px; }
.wk-table thead th.is-today { box-shadow: inset 0 -2px 0 var(--blue); color: var(--blue-text); }
.wk-table tr.wk-dept th { padding-top: 14px; font-weight: 600; color: var(--text-2); font-size: var(--text-sm); background: var(--surface-2); }
.wk-cell { vertical-align: top; }
.wk-cell.is-x { background: var(--cell-off); }
.wk-cell.is-al { background: var(--cell-al); }
.wk-cell.is-dp { background: var(--cell-dp); }
.wk-code { display: block; font-weight: 600; }
.wk-time { display: block; font-size: var(--text-xs); color: var(--text-2); }
.wk-table tfoot th, .wk-table tfoot td { font-weight: 500; }
@media print {
  .page-roster-week .sidenav, .page-roster-week .topbar, .page-roster-week #week-controls, .page-roster-week .page-actions { display: none; }
  .page-roster-week main { padding: 0; }
  .wk-table { min-width: 0; font-size: 9px; }
}

.roster-notes > * { min-width: 0; }
@media (max-width: 520px) { .legend .item { display: block; white-space: normal; margin: 0 0 4px; } }

/* Settings: a section list on the left, the chosen section on the right. */
.settings-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 32px; align-items: start; }
.tabs.is-vertical {
  flex-direction: column; width: auto; gap: 2px; margin: 0; padding: 0; border-bottom: none; border-radius: 0; background: none;
  position: sticky; top: 24px; overflow: visible;
}
.tabs.is-vertical .tab {
  margin: 0; padding: 8px 12px; border-bottom: none; border-radius: var(--radius-sm);
  text-align: left; white-space: normal; color: var(--text); font-weight: 450;
}
.tabs.is-vertical .tab { border-radius: 12px; padding: 8px 12px; }
.tabs.is-vertical .tab:hover { background: var(--hover); }
.tabs.is-vertical .tab[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: var(--shadow-chip); }
.tabs.is-vertical .tab:focus-visible { box-shadow: var(--focus); border-radius: var(--radius-sm); }
@media (max-width: 900px) {
  .settings-layout { display: block; }
  .tabs.is-vertical { position: static; flex-direction: row; overflow-x: auto; margin-bottom: 20px; border-radius: 999px; padding: 4px; background: rgba(25, 25, 25, 0.055); }
  .tabs.is-vertical .tab { padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
}

/* =====================================================================
   Dashboard
   One question per card. Large light figures, small grey captions,
   hatched texture for plans and gaps, solid colour for what happened.
   ===================================================================== */
:root {
  --st-working: #2D5FEA;
  --st-clocked_out: #22A06B;
  --st-present: #4CB98A;
  --st-later: #B9B9B4;
  --st-no_record: #F0821E;
  --st-needs_review: #E23D7C;
  --st-leave: #27A2B8;
}
.kh-patterns { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.is-done { background: var(--green); }
.dot.is-live { background: var(--st-working); box-shadow: 0 0 0 0 rgba(45, 95, 234, 0.5); animation: live-dot 2.2s ease-out infinite; }
@keyframes live-dot { 70% { box-shadow: 0 0 0 6px rgba(45, 95, 234, 0); } 100% { box-shadow: 0 0 0 0 rgba(45, 95, 234, 0); } }
.muted { color: var(--text-2); }

/* Header tools: a date pill and filter pills, like a document toolbar. */
.page-management .page-head { align-items: center; }
.page-dashboard .page-sub { display: none; }
.page-dashboard .page-head > div:first-child { flex: 0 1 auto; }
.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.date-pill { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-chip); }
.pill-step {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%;
  background: none; color: var(--text-2); cursor: pointer;
}
.pill-step:hover { background: var(--hover); color: var(--text); }
.pill-date {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border: none; border-radius: 999px;
  background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.pill-date:hover { background: var(--hover); }
.date-pill-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: none; padding: 0; min-height: 0; }
.tools .filters { margin: 0; flex-wrap: nowrap; gap: 8px; }
.tools .filters .field { width: auto; }
.tools .filters .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tools select {
  min-height: 34px; padding: 4px 30px 4px 14px; border: none; border-radius: 999px; background-color: var(--surface);
  box-shadow: var(--shadow-chip); font-size: 13px; font-weight: 500;
}
.tools select:hover { box-shadow: 0 2px 6px -2px rgba(25, 25, 25, 0.16), 0 0 0 1px rgba(25, 25, 25, 0.07); }
.tools .btn .ico { margin-left: -2px; }

/* Layout. */
.ov { display: grid; gap: 16px; max-width: 1360px; }
.ov-top {
  display: grid; gap: 16px; align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-areas: "today why now" "trend why needs";
}
.ov-top > #widget-today { grid-area: today; }
.ov-top > #widget-why { grid-area: why; }
.ov-top > #widget-now { grid-area: now; }
.ov-top > #widget-trend { grid-area: trend; }
.ov-top > #widget-attention { grid-area: needs; }
.ov-top:not(:has(#widget-today)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "needs"; }
.ov-grid { display: grid; gap: 16px; align-items: stretch; }
.ov-grid.is-wide-left.n-2 { grid-template-columns: minmax(0, 2.12fr) minmax(0, 1fr); }
.ov-grid.is-even.n-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov-grid.is-even.n-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ov-card { display: flex; flex-direction: column; min-width: 0; padding: 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; }
.ov-card > * { flex: none; }
#widget-why .note-box { margin-top: auto; }
#widget-why .wf { margin-bottom: 18px; }
#widget-trend .tb-wrap { flex: 1 1 auto; grid-template-rows: minmax(150px, 1fr) auto; }
#widget-trend .tb { height: auto; }
.ov-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ov-card-head h2 { font-size: 16px; font-weight: 500; letter-spacing: -0.015em; }
.ov-card-head p { margin: 3px 0 0; color: var(--text-2); font-size: 12.5px; }
.card-aside { color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.card-text { margin: 0 0 14px; color: #4B4B47; font-size: 13.5px; line-height: 1.5; }
.card-foot { margin: 14px 0 0; font-size: 12.5px; }
.more {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-chip);
}
.more:hover { background: #FBFBFA; }
.link-more { display: inline-flex; align-items: center; gap: 2px; color: var(--text); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.link-more:hover { color: var(--blue-text); }
.ov-card .table-wrap { background: none; border: none; --table-inset: 0px; }
.ov-card .chart-table { margin-top: 10px; }

.ov-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px; background: var(--peach);
  color: #6B4310; font-size: 13px; font-weight: 500;
}
.ov-banner.is-blue { background: var(--blue-tint); color: #213D86; }
.ov-banner.is-inline { margin: 14px 0 0; }
.ov-banner-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--orange); }
.ov-banner.is-blue .ov-banner-dot { background: var(--blue); }

/* A large figure, set light. */
.kpi { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; }
.kpi-num { font-size: 64px; line-height: 0.95; font-weight: 300; letter-spacing: -0.055em; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-of { font-size: 26px; font-weight: 300; letter-spacing: -0.03em; color: var(--text-3); font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: 17px; font-weight: 400; letter-spacing: -0.02em; color: var(--text); }
.kpi-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 12.5px; }
.delta {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-chip); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.eyebrow { margin: 0 0 10px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.live-label { display: inline-flex; align-items: center; gap: 8px; color: var(--blue-text); }

/* Hatched progress. */
.hbar-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0 0 6px; }
.hbar { position: relative; display: block; height: 12px; overflow: hidden; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.hbar-fill { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 999px; background: var(--hatch-blue); transform-origin: left; transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
.hbar-label { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) { .hbar:not(.is-in) .hbar-fill { transform: scaleX(0); } }

.kv-list { margin: 8px 0 0; padding: 0; list-style: none; }
.kv-list > li + li { border-top: 1px solid var(--line); }
.kv {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 76px; align-items: center; gap: 10px; width: 100%;
  padding: 11px 0; border: none; background: none; font: inherit; color: var(--text); text-align: left;
}
button.kv { cursor: pointer; }
button.kv:hover .kv-label { color: var(--blue-text); }
.kv-label { color: #4B4B47; font-size: 13.5px; }
.kv-value { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.pill-note {
  justify-self: end; padding: 2px 8px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-chip);
  color: var(--text-2); font-size: 11.5px; white-space: nowrap;
}

/* Waterfall. */
.wf { position: relative; }
.wf-rows { margin: 0; padding: 0; list-style: none; }
.wf-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 4px 12px; min-height: 68px; padding-top: 6px; }
.wf-label { font-size: 13px; color: var(--text); }
.wf-value { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.wf-value.is-bad { color: var(--pink); font-weight: 500; }
.wf-row.is-result .wf-value, .wf-row.is-total .wf-value { color: var(--text); }
.wf-track { position: relative; grid-column: 1 / -1; height: 16px; }
.wf-bar { position: absolute; top: 0; bottom: 0; left: var(--a); width: var(--b); min-width: 2px; border-radius: 4px; transform-origin: left; }
.wf-bar.is-total { background: var(--hatch-grey); }
.wf-bar.is-step { background: var(--hatch-blue-soft); }
.wf-bar.is-problem { background: var(--hatch-pink); }
.wf-bar.is-result { background: var(--blue); box-shadow: 0 6px 14px -8px rgba(45, 95, 234, 0.9); }
.wf-bar.is-zero { background: var(--line-strong); }
.wf-row + .wf-row .wf-bar::after {
  content: ""; position: absolute; right: -0.5px; bottom: 100%; height: 52px; border-right: 1px dashed rgba(25, 25, 25, 0.22);
}
.wf-axis { position: relative; height: 18px; margin: 10px 0 0; border-top: 1px solid var(--line); }
.wf-tick { position: absolute; left: var(--x); top: 4px; transform: translateX(-50%); color: var(--text-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.wf-tick:first-child { transform: none; }
.wf-tick:last-child { transform: translateX(-100%); }
@media (prefers-reduced-motion: no-preference) {
  .wf:not(.is-in) .wf-bar { transform: scaleX(0); }
  .wf.is-in .wf-bar { animation: grow-x 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards; animation-delay: calc(var(--i) * 120ms); }
}
@keyframes grow-x { from { transform: scaleX(0); } }
.note-box { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-chip); }
.note-box p { margin: 0; color: var(--text-2); font-size: 12.5px; }
.note-box .note-strong { margin-bottom: 4px; color: var(--text); font-size: 13.5px; font-weight: 500; }

/* The one coloured card: right now, on a night-to-dawn sky. */
.insight {
  position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 360px; overflow: hidden;
  padding: 20px 22px 20px; border-radius: 24px; color: #fff; isolation: isolate;
  background:
    radial-gradient(70% 55% at 100% 100%, rgba(247, 178, 128, 0.95), rgba(247, 178, 128, 0) 70%),
    radial-gradient(60% 45% at 70% 92%, rgba(246, 206, 176, 0.7), rgba(246, 206, 176, 0) 70%),
    linear-gradient(162deg, #0E2A6B 0%, #1D47A8 38%, #5F86D8 68%, #C9C3D6 88%, #F1C6A2 100%);
  box-shadow: 0 30px 50px -36px rgba(14, 42, 107, 0.9);
}
.insight-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.insight-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); font-size: 12px; font-weight: 500;
}
.insight-chip .dot.is-live { background: #fff; }
.insight-count { color: rgba(255, 255, 255, 0.7); font-size: 12px; }
.insight-kpi { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 6px; }
.insight-num { font-size: 54px; line-height: 1; font-weight: 300; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.insight-unit { color: rgba(255, 255, 255, 0.75); font-size: 12.5px; }
.insight-title { margin: 6px 0 6px; max-width: 16em; color: #fff; font-size: 21px; font-weight: 400; line-height: 1.2; letter-spacing: -0.02em; }
.insight-body { margin: 0; max-width: 24em; color: rgba(255, 255, 255, 0.72); font-size: 12.5px; }
.insight-dial { position: absolute; right: -78px; bottom: -86px; z-index: -1; width: 300px; opacity: 0.9; }
.insight-btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin-top: auto; padding: 8px 12px 8px 14px; border-radius: 999px;
  background: #fff; color: var(--text); font-size: 13px; font-weight: 500; text-decoration: none; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.5);
}
.insight-btn:hover { background: #F6F6F4; }
.insight .dial-sky { opacity: 0.18; }
.insight .dial-ticks line { stroke: rgba(255, 255, 255, 0.35); }
.insight .dial-ticks text { fill: rgba(255, 255, 255, 0.7); }
.insight .dial-track { stroke: rgba(255, 255, 255, 0.12); }
.insight .dial-arc { stroke: rgba(255, 255, 255, 0.55); }
.insight .dial-arc.is-live { stroke: #fff; }
.insight .dial-hub { fill: rgba(255, 255, 255, 0.08); stroke: rgba(255, 255, 255, 0.25); }
.insight .dial-hand line { stroke: #fff; }
.insight .dial-hand-dot { fill: #1D47A8; stroke: #fff; }
.insight .dial-hand-pulse { fill: rgba(255, 255, 255, 0.45); }

/* The 24-hour dial. */
.dial { width: 100%; height: auto; overflow: visible; }
.dial-sky path { fill: none; stroke-width: 14; }
.dial-sky { opacity: 0.45; }
.dial-ticks line { stroke: rgba(25, 25, 25, 0.2); stroke-width: 1; stroke-linecap: round; }
.dial-ticks line.is-major { stroke-width: 1.5; }
.dial-ticks text { fill: var(--text-2); font-size: 11px; font-weight: 600; font-family: var(--font); }
.dial-track { fill: none; stroke: rgba(25, 25, 25, 0.06); }
.dial-arc { fill: none; stroke-linecap: round; cursor: pointer; transition: opacity 0.2s ease; }
.dial-arc:focus-visible { outline: none; opacity: 1; }
.dial-hub { fill: rgba(255, 255, 255, 0.7); }
.dial-center-top, .dial-center-bottom { display: none; }
.dial-hand line { stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
.dial-hand-dot { fill: #fff; stroke: var(--st-working); stroke-width: 3; }
.dial-hand-pulse { fill: rgba(45, 95, 234, 0.35); transform-box: fill-box; transform-origin: center; animation: hand-pulse 2.6s ease-out infinite; }
@keyframes hand-pulse { from { transform: scale(1); opacity: 0.9; } to { transform: scale(2.6); opacity: 0; } }

/* Trend: hatched for everyone scheduled, blue for those who clocked in. */
.tb-wrap { display: grid; gap: 8px; }
.tb { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; height: 150px; margin: 0; padding: 0; list-style: none; }
.tb > li { min-width: 0; }
.tb-day { display: grid; grid-template-rows: 16px minmax(0, 1fr); justify-items: center; width: 100%; height: 100%; padding: 0; border: none; background: none; font: inherit; cursor: pointer; }
.tb-value { color: var(--text); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tb-stack { position: relative; width: min(22px, 100%); height: 100%; }
.tb-ghost, .tb-fill { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); min-height: 2px; border-radius: 5px; }
.tb-ghost { background: var(--hatch-grey); }
.tb-fill { left: 3px; right: 3px; background: var(--hatch-blue); transform-origin: bottom; }
.tb-fill.is-current { left: 0; right: 0; background: var(--blue); box-shadow: 0 6px 14px -8px rgba(45, 95, 234, 0.9); }
.tb-day:hover .tb-ghost { filter: brightness(0.95); }
.tb-day.is-future { opacity: 0.4; }
.tb-ends { display: flex; justify-content: space-between; color: var(--text-3); font-size: 11px; }
@media (prefers-reduced-motion: no-preference) {
  .tb:not(.is-in) .tb-fill { transform: scaleY(0); }
  .tb.is-in .tb-fill { animation: grow-y 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards; animation-delay: calc(var(--i) * 45ms); }
}
@keyframes grow-y { from { transform: scaleY(0); } }

/* Needs you. */
.need-list { margin: 0; padding: 0; list-style: none; }
.need-list > li + li { border-top: 1px solid var(--line); }
.need { display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; align-items: center; gap: 12px; padding: 12px 0; color: var(--text); text-decoration: none; }
.need:hover .need-title { color: var(--blue-text); }
.need-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-chip); }
.need-icon.tone-pink { color: var(--pink); background: var(--pink-tint); box-shadow: none; }
.need-icon.tone-orange { color: #C66A0E; background: #FDEEDC; box-shadow: none; }
.need-icon.tone-blue { color: var(--blue); background: var(--blue-tint); box-shadow: none; }
.need-icon.tone-grey { color: var(--text-2); }
.need-text { min-width: 0; }
.need-title { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.need-sub { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--text-2); font-size: 12px; }
.need-ack { padding: 0; border: none; background: none; color: var(--blue-text); font: inherit; font-size: 12px; cursor: pointer; }
.need-ack:hover { text-decoration: underline; }
.need-go { color: var(--text-3); display: inline-flex; }
.all-clear { display: grid; justify-items: center; gap: 8px; padding: 24px 0 14px; color: var(--text-2); text-align: center; }
.all-clear .ico { color: var(--green); }
.all-clear p { margin: 0; }
.all-clear.is-quiet { justify-items: start; padding: 2px 0; text-align: left; gap: 6px; }

/* Legends. */
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; padding: 0; list-style: none; color: var(--text-2); font-size: 12px; }
.legend-row li { display: inline-flex; align-items: center; gap: 7px; }
.ov-card > .legend-row:last-child, .flow-wrap + .legend-row { margin: 10px 0 0; }
.key { display: inline-block; width: 14px; height: 10px; flex: none; border-radius: 3px; }
.key-blue { background: var(--blue); }
.key-teal { background: var(--st-leave); }
.key-hatch-blue { background: var(--hatch-blue); }
.key-hatch-pink { background: var(--hatch-pink); }
.key-ink { height: 0; border-top: 2px solid var(--text); border-radius: 0; }
.key-dash { height: 0; border-top: 2px dashed var(--pink); border-radius: 0; }
.key-now { width: 0; height: 12px; border-left: 2px solid var(--st-working); border-radius: 0; }

/* Liquid flow, hatched. */
.flow-wrap { margin: 0 -4px; }
.flow { display: block; width: 100%; height: auto; }
.flow-grid line { stroke: var(--line); stroke-width: 1; }
.flow-grid text { fill: var(--text-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.flow-grid .flow-hour { fill: var(--text-2); }
.flow-line { fill: none; stroke: var(--blue); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.flow-short { fill: rgba(226, 61, 124, 0.08); }
.flow-required { fill: none; stroke: var(--pink); stroke-width: 1.6; stroke-dasharray: 5 4; }
.flow-observed path { fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linejoin: round; }
.flow-observed circle { fill: var(--text); }
.flow-observed { transition: opacity 0.6s ease; }
.flow-observed.is-waiting { opacity: 0; }
.flow-now line { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; }
.flow-now rect { fill: var(--ink); }
.flow-now text { fill: #fff; font-size: 11px; font-weight: 500; font-family: var(--font); }
.flow-scrub line { stroke: rgba(25, 25, 25, 0.25); stroke-width: 1; }
.flow-scrub circle { fill: #fff; stroke: var(--blue); stroke-width: 2.5; }
.flow-catcher { fill: transparent; cursor: crosshair; }

/* Everyone on the roster. */
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.pf-legend-item {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border: none; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-chip); font: inherit; font-size: 12px; color: var(--text); cursor: pointer;
}
.pf-legend-item.is-on { background: var(--ink); color: #fff; }
.pf-legend-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.pf { display: grid; gap: 12px; }
.pf-row { display: grid; grid-template-columns: 136px minmax(0, 1fr); align-items: center; gap: 14px; }
.pf-dept { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.pf-dept-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-dept-count { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.pf-dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pf-dot {
  position: relative; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: none; border-radius: 50%;
  background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-chip);
  font: inherit; font-size: 10.5px; font-weight: 600; cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.pf-dot:hover, .pf-dot:focus-visible { transform: scale(1.14); z-index: 2; }
.st-working { --st: var(--st-working); }
.st-clocked_out { --st: var(--st-clocked_out); }
.st-present { --st: var(--st-present); }
.st-later { --st: var(--st-later); }
.st-no_record { --st: var(--st-no_record); }
.st-needs_review { --st: var(--st-needs_review); }
.st-leave { --st: var(--st-leave); }
.pf-dot.st-working, .pf-dot.st-clocked_out, .pf-dot.st-needs_review, .pf-dot.st-present { background: var(--st); color: #fff; box-shadow: none; }
.pf-dot.st-no_record { background: #FDEEDC; color: #B4600C; box-shadow: inset 0 0 0 1.5px var(--st); }
.pf-dot.st-leave { background: repeating-linear-gradient(-45deg, var(--st) 0 1.5px, #DDF1F5 1.5px 4.6px); color: #0F6676; box-shadow: none; }
.pf-dot.st-working::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none; animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(45, 95, 234, 0.4); } 50% { box-shadow: 0 0 0 6px rgba(45, 95, 234, 0); } }
.pf[data-focus]:not([data-focus=""]) .pf-dot { opacity: 0.15; }
.pf[data-focus="working"] .st-working, .pf[data-focus="clocked_out"] .st-clocked_out, .pf[data-focus="present"] .st-present,
.pf[data-focus="later"] .st-later, .pf[data-focus="no_record"] .st-no_record, .pf[data-focus="needs_review"] .st-needs_review,
.pf[data-focus="leave"] .st-leave { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .pf:not(.is-in) .pf-dot { opacity: 0; }
  .pf.is-in .pf-dot { animation: pf-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; animation-delay: calc(var(--i) * 12ms); }
}
@keyframes pf-in { from { opacity: 0; scale: 0.3; } }

/* Departments: present solid, still to come hatched, leave in teal. */
.dp-list { display: grid; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; }
.dp-list > li + li { border-top: 1px solid var(--line); }
.dp-item { display: grid; gap: 8px; width: 100%; padding: 12px 0; border: none; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.dp-head { display: flex; align-items: baseline; gap: 10px; }
.dp-name { font-size: 13.5px; font-weight: 500; }
.dp-of { color: var(--text-3); font-size: 12px; }
.dp-head .dp-words { margin-left: auto; text-align: right; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
button.dp-item:hover .dp-name { color: var(--blue-text); }
.dp-cov { font-size: 11px; }
.dp-bar {
  display: flex; width: var(--track); height: 10px; overflow: hidden; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transform-origin: left center; transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1); transition-delay: calc(var(--i) * 90ms);
}
.dp-seg { width: var(--w); height: 100%; }
.dp-seg.is-present { background: var(--blue); }
.dp-seg.is-waiting { background: var(--hatch-blue-soft); }
.dp-seg.is-leave { background: var(--st-leave); }
@media (prefers-reduced-motion: no-preference) { .dp-list:not(.is-in) .dp-bar { transform: scaleX(0); } }

/* Leave, holidays, payroll, decisions. */
.lv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lv-type { padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-chip); }
.lv-type h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; font-weight: 500; }
.lv-type h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.lv-type.is-dp h3::before { background: var(--green); }
.lv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.lv-fig { display: flex; flex-direction: column; min-width: 0; }
.lv-fig .kpi-num { font-size: 30px; letter-spacing: -0.045em; }
.lv-label { color: var(--text-2); font-size: 11.5px; }
.hol-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.hol { display: flex; align-items: center; gap: 12px; }
.hol-tile { display: grid; justify-items: center; width: 44px; flex: none; overflow: hidden; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-chip); }
.hol-month { width: 100%; padding: 2px 0; background: var(--pink); color: #fff; font-size: 10px; font-weight: 600; text-align: center; text-transform: uppercase; }
.hol-day { padding: 2px 0 4px; font-size: 18px; font-weight: 400; line-height: 1.15; }
.hol-name { display: block; font-size: 13.5px; font-weight: 500; }
.hol-sub { display: block; color: var(--text-2); font-size: 12px; }
.pr-list { margin: 0; padding: 0; list-style: none; }
.pr-list > li + li { border-top: 1px solid var(--line); }
.pr-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; color: var(--text); text-decoration: none; }
.pr-item:hover .pr-name { color: var(--blue-text); }
.pr-name { display: block; font-size: 13.5px; font-weight: 500; }
.pr-sub { display: block; color: var(--text-2); font-size: 12px; }
.mini-timeline { margin: 0; padding: 0; list-style: none; }
.mini-timeline li { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding: 0 0 14px; }
.mini-timeline li:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 12px; bottom: 0; border-left: 1px dashed var(--line-strong); }
.mt-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.mt-title { display: block; font-size: 13.5px; font-weight: 500; }
.mt-sub { display: block; color: var(--text-2); font-size: 12px; }

/* Tooltip. */
.viz-tip {
  position: fixed; z-index: 90; display: grid; gap: 2px; max-width: 280px; padding: 10px 13px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-pop); pointer-events: none; font-size: 12px; color: var(--text-2);
}
.viz-tip strong { color: var(--text); font-size: 13px; font-weight: 500; }

/* People, as small chips with an avatar. */
.av {
  flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-chip); font-size: 10.5px; font-weight: 600;
}
.av.st-working, .av.st-clocked_out, .av.st-needs_review { background: var(--st); color: #fff; box-shadow: none; }
.av.st-no_record { background: #FDEEDC; color: #B4600C; box-shadow: inset 0 0 0 1.5px var(--st); }
.av.st-leave { background: #DDF1F5; color: #0F6676; box-shadow: none; }
.chips-people { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.person-chip { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-chip); }
.person-name { display: block; font-size: 13px; font-weight: 500; line-height: 1.25; }
.person-sub { display: block; color: var(--text-2); font-size: 11.5px; line-height: 1.25; }

/* Live Workforce. */
.lw-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px 36px; align-items: center; padding: 26px 28px; }
.lw-side { display: grid; gap: 14px; }
.ribbon-wrap { display: grid; gap: 14px; }
.ribbon { display: flex; height: 14px; overflow: hidden; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.ribbon-seg { width: var(--w); height: 100%; background: var(--st); transform-origin: left center; transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1); transition-delay: calc(var(--i) * 90ms); }
.ribbon-seg.st-later, .ribbon-seg.st-no_record { background: repeating-linear-gradient(-45deg, var(--st) 0 1.5px, color-mix(in srgb, var(--st) 18%, #fff) 1.5px 4.6px); }
.ribbon-seg.st-leave { background: repeating-linear-gradient(-45deg, var(--st) 0 1.5px, #DDF1F5 1.5px 4.6px); }
.ribbon-seg + .ribbon-seg { box-shadow: -2px 0 0 #fff; }
@media (prefers-reduced-motion: no-preference) { .ribbon-wrap:not(.is-in) .ribbon-seg { transform: scaleX(0); } }
.ribbon-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ribbon-item {
  display: grid; grid-template-columns: 8px auto; grid-template-rows: auto auto; column-gap: 9px; align-items: center; width: 100%;
  padding: 10px 12px; border: none; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-chip);
  font: inherit; color: var(--text); text-align: left;
}
button.ribbon-item { cursor: pointer; }
button.ribbon-item:hover .ribbon-label { color: var(--blue-text); }
.ribbon-item .pf-swatch { grid-row: span 2; align-self: start; margin-top: 9px; }
.ribbon-value { font-size: 24px; font-weight: 300; letter-spacing: -0.04em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ribbon-label { color: var(--text-2); font-size: 12px; }
.ribbon-item.is-zero { opacity: 0.5; }

/* Shift timeline: the plan hatched, what was recorded solid, past the end in pink. */
.tl-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; }
.tl { position: relative; min-width: 800px; --tl-name: 220px; --tl-times: 128px; }
.tl-axis, .tl-row { display: grid; grid-template-columns: var(--tl-name) minmax(0, 1fr) var(--tl-times); align-items: center; gap: 12px; }
.tl-axis { height: 24px; }
.tl-ticks { position: relative; height: 100%; grid-column: 2; }
.tl-tick { position: absolute; left: var(--x); top: 4px; transform: translateX(-50%); color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.tl-tick:first-child { transform: none; }
.tl-tick:last-child { transform: translateX(-100%); }
.tl-group { margin-top: 12px; }
.tl-group-head { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; font-size: 13px; font-weight: 500; }
.tl-group-count { color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-rows { margin: 0; padding: 0; list-style: none; }
.tl-rows > li + li { border-top: 1px solid var(--line); }
.tl-row { width: 100%; min-height: 50px; padding: 6px 0; border: none; background: none; font: inherit; color: var(--text); text-align: left; }
button.tl-row { cursor: pointer; }
button.tl-row:hover .tl-person { color: var(--blue-text); }
.tl-row .tl-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tl-who { min-width: 0; }
.tl-person { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sub { display: block; color: var(--text-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 22px; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / 8) 100%; }
.tl-plan { position: absolute; left: var(--a); width: var(--b); top: 6px; height: 8px; border-radius: 3px; background: var(--hatch-blue-soft); }
.tl-actual { position: absolute; left: var(--a); width: var(--b); top: 15px; height: 7px; border-radius: 3px; background: var(--blue); transform-origin: left center; }
.tl-actual.st-needs_review { background: var(--pink); }
.tl-actual.is-open { background: linear-gradient(90deg, var(--blue) 75%, rgba(45, 95, 234, 0.15)); }
.tl-actual.st-needs_review.is-open { background: linear-gradient(90deg, var(--pink) 75%, rgba(226, 61, 124, 0.15)); }
.tl-over { position: absolute; left: var(--a); width: var(--b); top: 15px; height: 7px; border-radius: 3px; background: var(--hatch-pink); transform-origin: left center; }
.tl-actual.st-working::after {
  content: ""; position: absolute; right: -4px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2.5px var(--blue); animation: live-dot 2s ease-out infinite;
}
.tl-mark { position: absolute; left: var(--a); top: 13px; width: 3px; height: 11px; margin-left: -1.5px; border-radius: 2px; background: var(--pink); }
.tl-times { color: var(--text-2); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-now {
  position: absolute; top: 0; bottom: 0; z-index: 3; pointer-events: none; width: 0; border-left: 1px solid var(--text);
  left: calc(var(--tl-name) + 12px + (100% - var(--tl-name) - var(--tl-times) - 24px) * var(--x-frac, 0));
}
.tl-now-label { position: absolute; top: 0; left: -19px; width: 38px; padding: 2px 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: 10.5px; font-weight: 500; text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .tl:not(.is-in) :is(.tl-actual, .tl-over) { transform: scaleX(0); }
  .tl.is-in :is(.tl-actual, .tl-over) { animation: grow-x 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards; animation-delay: calc(var(--i) * 30ms + 150ms); }
}

/* Staffing Coverage. */
.flow-wrap.is-large .flow { max-height: 330px; }
.gap-list { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.gap-list li { padding: 9px 12px; border-radius: 12px; background: var(--pink-tint); color: #8A1A46; font-size: 13px; }
.cov-quality { margin: 12px 0 0; color: var(--text-2); font-size: 12.5px; }
.hm-scroll { overflow-x: auto; }
.hm { display: grid; gap: 4px; min-width: 820px; }
.hm-row { display: grid; grid-template-columns: 150px repeat(24, minmax(0, 1fr)); gap: 4px; align-items: center; width: 100%; padding: 0; border: none; background: none; font: inherit; color: var(--text); text-align: left; }
button.hm-row { cursor: pointer; }
button.hm-row:hover .hm-dept { color: var(--blue-text); }
.hm-head { padding-bottom: 2px; }
.hm-hour { color: var(--text-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.hm-name { display: flex; flex-direction: column; min-width: 0; padding-right: 8px; }
.hm-dept { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-peak { color: var(--text-2); font-size: 11.5px; }
.hm-cell {
  display: grid; place-items: center; height: 38px; border-radius: 8px; font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums;
  background: var(--surface); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hm-cell:hover { transform: scale(1.08); }
.hm-cell.l1, .hm-key.l1 { background: #E3EAFD; color: #3355B8; box-shadow: none; }
.hm-cell.l2, .hm-key.l2 { background: #B9CBFA; color: #1F3F9E; box-shadow: none; }
.hm-cell.l3, .hm-key.l3 { background: #7C9BF2; color: #fff; box-shadow: none; }
.hm-cell.l4, .hm-key.l4 { background: var(--blue); color: #fff; box-shadow: 0 6px 12px -8px rgba(45, 95, 234, 0.9); }
.hm-cell.is-short, .hm-key.is-short { background: var(--hatch-pink); color: #8A1A46; box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .hm-scroll:not(.is-in) .hm-cell { opacity: 0; }
  .hm-scroll.is-in .hm-cell { animation: cell-in 0.5s ease backwards; }
  .hm-scroll.is-in .hm-row:nth-child(2) .hm-cell { animation-delay: 0.05s; }
  .hm-scroll.is-in .hm-row:nth-child(3) .hm-cell { animation-delay: 0.12s; }
  .hm-scroll.is-in .hm-row:nth-child(4) .hm-cell { animation-delay: 0.19s; }
  .hm-scroll.is-in .hm-row:nth-child(5) .hm-cell { animation-delay: 0.26s; }
  .hm-scroll.is-in .hm-row:nth-child(n + 6) .hm-cell { animation-delay: 0.33s; }
}
@keyframes cell-in { from { opacity: 0; transform: scale(0.85); } }
.sg { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sg-col { padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-chip); }
.sg-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.sg-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.sg-code { font-weight: 600; }
.sg-hours { flex: 1; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.sg-count { min-width: 22px; padding: 1px 8px; border-radius: 999px; background: var(--bg); font-size: 11.5px; font-weight: 600; text-align: center; }
.sg-people { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.sg-people .person-chip { padding: 4px 6px; border-radius: 12px; background: none; box-shadow: none; }

/* Activity. */
.seg-bar { display: flex; width: fit-content; max-width: 100%; gap: 2px; padding: 4px; overflow-x: auto; scrollbar-width: none; border-radius: 999px; background: rgba(25, 25, 25, 0.055); }
.seg-pill {
  flex: none; padding: 7px 14px; border: none; border-radius: 999px; background: none; cursor: pointer;
  color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.seg-pill:hover { color: var(--text); }
.seg-pill.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(25, 25, 25, 0.12); }
.area-roster { --area: #2D5FEA; }
.area-attendance { --area: #27A2B8; }
.area-leave { --area: #22A06B; }
.area-dp { --area: #E8A33A; }
.area-payroll { --area: #6B6B66; }
.area-people { --area: #A7A7A2; }
.area-portal { --area: #F0821E; }
.area-staffing { --area: #7C9BF2; }
.area-calendar { --area: #E23D7C; }
.area-dot { background: var(--area); }
.ab { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 8px; height: 180px; margin: 0 0 6px; padding: 0; list-style: none; }
.ab > li { min-width: 0; }
.ab-day { display: grid; grid-template-rows: 18px minmax(0, 1fr) 16px 14px; justify-items: center; width: 100%; height: 100%; padding: 0; border: none; background: none; font: inherit; color: var(--text); }
button.ab-day { cursor: pointer; }
.ab-total { font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ab-col { display: flex; flex-direction: column-reverse; width: min(22px, 70%); height: 100%; gap: 2px; transform-origin: bottom; }
.ab-seg { height: var(--h); min-height: 3px; border-radius: 4px; background: repeating-linear-gradient(-45deg, var(--area) 0 1.5px, color-mix(in srgb, var(--area) 20%, #fff) 1.5px 4.6px); }
.ab > li:last-child .ab-seg { background: var(--area); }
.ab-day.is-zero .ab-col { background: linear-gradient(to top, var(--line) 2px, transparent 2px); }
.ab-label { color: var(--text-2); font-size: 11px; font-weight: 500; }
.ab-date { color: var(--text-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) {
  .ab:not(.is-in) .ab-col { transform: scaleY(0); }
  .ab.is-in .ab-col { animation: grow-y 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards; animation-delay: calc(var(--i) * 40ms); }
}
.at { margin: 0; padding: 0; list-style: none; }
.at-day + .at-day { margin-top: 18px; }
.at-day-head { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 500; }
.at-day-count { padding: 0 7px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-chip); color: var(--text-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.at-list { position: relative; margin: 0; padding: 0; list-style: none; }
.at-list::before { content: ""; position: absolute; left: 75px; top: 10px; bottom: 10px; border-left: 1px dashed var(--line-strong); }
.at-item { position: relative; display: grid; grid-template-columns: 48px 32px minmax(0, 1fr); align-items: start; gap: 12px; padding: 7px 0; }
.at-time { padding-top: 8px; color: var(--text-2); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.at-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--area) 14%, #fff); color: var(--area); box-shadow: 0 0 0 4px var(--card); }
.at-icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.at-body { min-width: 0; padding: 8px 14px 10px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-chip); }
.at-line { margin: 0; font-size: 13.5px; }
.at-action { font-weight: 500; }
.at-actor { color: var(--text-2); }
.at-detail { margin: 2px 0 0; color: var(--text-2); font-size: 12.5px; }
.at-entity { display: inline-block; margin-top: 6px; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--text-2); font-size: 11px; }
@media (prefers-reduced-motion: no-preference) {
  .at:not(.is-in) .at-item { opacity: 0; }
  .at.is-in .at-item { animation: at-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards; animation-delay: calc(var(--i) * 35ms); }
}
@keyframes at-in { from { opacity: 0; translate: 0 8px; } }

/* Date navigation on other pages: the same pill as the dashboard toolbar. */
.date-nav { padding: 3px; gap: 2px; width: fit-content; max-width: 100%; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-chip); }
.date-nav .btn { box-shadow: none; background: none; }
.date-nav .btn:hover { background: var(--hover); box-shadow: none; }
.date-nav input[type="date"] { border-color: transparent; border-radius: 999px; }
.date-nav .date-label { padding-right: 12px; }

@media (max-width: 1280px) {
  .ov-top { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "today now" "why why" "trend needs"; }
  .ov-grid.is-even.n-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .ov-grid.is-wide-left.n-2, .lw-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  main { padding: 20px var(--gutter) 64px; }
  h1 { font-size: 30px; }
  .page-management .page-head { align-items: flex-start; }
  .tools { justify-content: flex-start; }
  .tools .filters { flex-wrap: wrap; }
  .ov-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "today" "now" "why" "trend" "needs"; }
  .ov-grid.is-even.n-3, .ov-grid.is-even.n-2 { grid-template-columns: minmax(0, 1fr); }
  .ov-card { padding: 18px; border-radius: 22px; }
  .kpi-num { font-size: 54px; }
  .pf-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .lv { grid-template-columns: minmax(0, 1fr); }
  .lw-hero { padding: 20px 18px; }
  .tl { --tl-name: 150px; --tl-times: 0px; min-width: 640px; }
  .tl-times { display: none; }
  .ab { gap: 4px; height: 150px; }
  .ab-date { display: none; }
  .at-item { grid-template-columns: 40px 28px minmax(0, 1fr); gap: 8px; }
  .at-list::before { left: 61px; }
  .at-icon { width: 28px; height: 28px; }
  .date-nav { width: 100%; border-radius: 20px; }
}
@media print {
  .tools, .seg-bar { display: none !important; }
  .insight { color: var(--text); background: #fff; border: 1px solid var(--line); }
}

/* =====================================================================
   People: photos and the employee profile
   ===================================================================== */
.person-av {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; overflow: hidden; border-radius: 50%;
  background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-chip); font-size: 12px; font-weight: 600; letter-spacing: 0;
}
.person-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-av.is-xl { width: 112px; height: 112px; font-size: 34px; font-weight: 300; letter-spacing: -0.02em; }
.person-link { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.person-link:hover .cell-main { color: var(--blue-text); }
.person-link .cell-main, .person-link .cell-sub { display: block; }

.crumbs { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; color: var(--text-2); font-size: 13px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text); }

.pf-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px 26px; margin: 0 0 24px; }
.pf-photo { position: relative; padding: 0; border: none; background: none; border-radius: 50%; }
.pf-photo.is-editable { cursor: pointer; }
.pf-photo-edit {
  position: absolute; right: 2px; bottom: 2px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-chip);
}
.pf-photo.is-editable:hover .person-av { filter: brightness(0.96); }
.pf-id h1 { margin: 0 0 8px; font-size: 40px; }
.pf-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.pf-code { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.pf-line { margin: 0 0 2px; font-size: 14px; }
.pf-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-self: start; }

/* Two columns that stack their own cards, so a short card never leaves a hole beside a tall one:
   the record on the left, what happens over time on the right. */
.pf-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; gap: 16px; }
.pf-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pf-col:empty { display: none; }
.pf-slot > .loading { padding: 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; }

.pf-dl { display: grid; margin: 0; }
.pf-dl > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pf-dl > div:first-child { border-top: none; padding-top: 0; }
.pf-dl dt { color: var(--text-2); font-size: 13px; }
.pf-dl dd { margin: 0; font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.pf-sub { display: block; color: var(--text-2); font-size: 12px; }
/* Details not recorded yet, gathered on one line instead of a row each. */
.pf-missing { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pf-dl:empty + .pf-missing, .pf-missing:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.pf-missing-label { margin-right: 2px; color: var(--text-2); font-size: 12px; }
.pf-missing-item { padding: 3px 10px; border-radius: 999px; background: rgba(25, 25, 25, 0.05); color: var(--text-2); font-size: 12px; }
.pf-address { white-space: pre-line; }
.pf-mono { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.pf-note { display: flex; align-items: center; gap: 6px; margin: 14px 0 0; color: var(--text-2); font-size: 12px; }

.pf-contract-now { margin: 0 0 16px; }
.pf-contract-type { margin: 0 0 8px; font-size: 14px; font-weight: 500; }
.pf-contract-bar { display: grid; gap: 6px; margin: 4px 0 0; }
.pf-contract-ends { display: flex; justify-content: space-between; color: var(--text-2); font-size: 12px; }
.pf-list { margin: 0; padding: 0; list-style: none; }
.pf-list > li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.pf-list-main { min-width: 0; }
.pf-list-title { display: block; font-size: 13.5px; font-weight: 500; }
.pf-list-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.pf-list > li.is-void .pf-list-title { color: var(--text-3); text-decoration: line-through; }
.delta.is-up { color: var(--green-text); }
.delta.is-down { color: var(--pink); }

.pf-locked { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 18px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-chip); }
.pf-locked-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--hatch-grey); color: var(--text); }
.pf-locked-title { margin: 0 0 2px; font-weight: 500; }
.pf-locked p { margin: 0; font-size: 12.5px; }
.pf-salary-now { margin: 0 0 8px; }
.pf-salary-now p { margin: 0; font-size: 12.5px; }
.kpi-num.is-money { font-size: 44px; letter-spacing: -0.04em; }
.pf-salary-chart { display: block; width: 100%; height: auto; margin: 6px 0 10px; }
.pf-salary-dot { fill: #fff; stroke: var(--blue); stroke-width: 2.5; }
.pf-salary-axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); }

.att-strip { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 4px; margin: 0 0 12px; }
.att-cell { aspect-ratio: 1; min-width: 0; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.att-cell.is-complete { background: var(--blue); box-shadow: none; }
.att-cell.is-in-only { background: #F7B267; box-shadow: none; }
.att-cell.is-missing { background: var(--hatch-pink); box-shadow: none; }
.att-cell.is-review { background: var(--pink); box-shadow: none; }
.att-cell.is-pending { background: var(--hatch-grey); box-shadow: none; }
.att-cell[tabindex]:hover, .att-cell[tabindex]:focus-visible { transform: scale(1.15); }
.att-key-in { background: #F7B267; }
.att-key-review { background: var(--pink); }
.key-hatch-grey { background: var(--hatch-grey); }
@media (prefers-reduced-motion: no-preference) {
  .att-strip:not(.is-in) .att-cell { opacity: 0; }
  .att-strip.is-in .att-cell { animation: cell-in 0.4s ease backwards; }
}
.pf-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.pf-stat { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-chip); }
.pf-stat-num { font-size: 28px; font-weight: 300; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pf-stat-num.is-blue { color: var(--blue); }
.pf-stat-num.is-orange { color: #C66A0E; }
.pf-stat-num.is-pink { color: var(--pink); }
.pf-stat-label { color: var(--text-2); font-size: 11.5px; }

.shift-strip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.shift-tile {
  display: grid; justify-items: center; gap: 2px; padding: 8px 2px 10px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-chip);
  border-top: 3px solid var(--c, transparent);
}
.shift-tile.is-today { box-shadow: 0 0 0 1.5px var(--ink); }
.shift-wd { color: var(--text-2); font-size: 11px; }
.shift-day { font-size: 18px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.shift-code { font-size: 12px; font-weight: 600; color: var(--text); }
.shift-tile.is-off .shift-code, .shift-tile.is-off_day .shift-code { color: #9B3A33; }
.shift-tile.is-off, .shift-tile.is-off_day { background: #FBEAE7; box-shadow: none; }
.shift-tile.is-al { background: #E3EEF7; box-shadow: none; }
.shift-tile.is-dp { background: #E6F2E1; box-shadow: none; }
.shift-tile.is-unpublished { background: var(--hatch-grey); box-shadow: none; }
.shift-tile.is-unpublished .shift-code, .shift-tile.is-unassigned .shift-code { color: var(--text-3); font-weight: 400; }
.shift-mix .legend-row { margin: 6px 0 0; }
.shift-mix .legend-row b { color: var(--text); }

.photo-dialog { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px; }
.photo-dialog .btn { margin-bottom: 8px; }
.photo-preview .person-av { box-shadow: 0 0 0 1px var(--line); }

/* Photos in the dashboard pictures. */
.pf-dot.has-photo { overflow: visible; background: none; padding: 0; }
.pf-dot.has-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.pf-dot.has-photo { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--st, var(--line-strong)); }
.pf-dot.has-photo.st-later { outline: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--line-strong); opacity: 0.85; }
.av.has-photo { background: none; padding: 0; overflow: hidden; box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--st, var(--line-strong)); }
.av.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* One column: the cards keep a reading order across both stacks. */
@media (max-width: 1100px) {
  .pf-grid { display: flex; flex-direction: column; }
  .pf-col { display: contents; }
  .pf-personal { order: 1; } .pf-employment { order: 2; } .pf-contract { order: 3; } .pf-sensitive { order: 4; } .pf-salary { order: 5; }
  .pf-attendance { order: 6; } .pf-slot-shifts { order: 7; } .pf-slot-leave { order: 8; } .pf-history { order: 9; }
}
@media (max-width: 900px) {
  .pf-hero { grid-template-columns: auto minmax(0, 1fr); }
  .pf-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .pf-id h1 { font-size: 30px; }
  .person-av.is-xl { width: 84px; height: 84px; font-size: 26px; }
  .pf-dl > div { grid-template-columns: 110px minmax(0, 1fr); }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .att-strip { grid-template-columns: repeat(15, minmax(0, 1fr)); }
  .shift-strip { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .pf-locked { grid-template-columns: auto minmax(0, 1fr); }
  .pf-locked .btn { grid-column: 1 / -1; justify-self: start; }
  .photo-dialog { grid-template-columns: minmax(0, 1fr); justify-items: start; }
}
.link-plain { color: inherit; text-decoration: none; }
.link-plain:hover { color: var(--blue-text); }
.pf-leave .lv-type .kpi { gap: 6px; }
.pf-leave .lv-type .kpi-num { font-size: 44px; }
.pf-leave .lv-type .kpi-unit { font-size: 12.5px; color: var(--text-2); }

/* ------------------------------------------------------------ verified badge */
/* Beside a name, sized to the text it follows. Given by a Super Admin. */
.vbadge { display: inline-block; flex: none; width: 1.05em; height: 1.05em; margin-left: 0.28em; vertical-align: -0.17em; }
.vbadge.is-hero { width: 0.62em; height: 0.62em; margin-left: 0.2em; vertical-align: 0; }

/* An on/off switch, as on Apple devices. */
.switch {
  position: relative; flex: none; width: 46px; height: 28px; padding: 0; border: none; border-radius: 999px;
  background: #DCDCD8; cursor: pointer; transition: background 0.2s ease;
}
.switch-knob {
  position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  transition: transform 0.24s cubic-bezier(0.3, 1.35, 0.5, 1);
}
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ------------------------------------------------------- editing in place */
.pf-hero { scroll-margin-top: 88px; }
.pf-photo-col { display: flex; flex-direction: column; align-items: center; gap: 10px; align-self: start; }
.pf-photo.has-draft .person-av { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--blue); }
.pf-photo-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pf-photo-note { color: var(--text-2); font-size: 12px; white-space: nowrap; }
.pf-photo-btns { display: flex; gap: 6px; }
.pf-photo-remove { font-size: 12.5px; }

.pf-verify {
  display: flex; align-items: center; gap: 14px; max-width: 580px; margin: 16px 0 0; padding: 12px 18px 12px 14px;
  border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-chip);
}
.pf-verify-title { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; font-size: 13.5px; font-weight: 500; }
.pf-verify-title .vbadge { width: 17px; height: 17px; margin: 0; }
.pf-verify-state { margin-left: 2px; color: var(--text-2); font-weight: 400; }
.pf-verify .pf-sub { font-size: 12px; }

.pf-card { transition: box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.3s ease; }
.pf-card.is-editing { border-color: var(--blue-tint-2); box-shadow: 0 0 0 3px var(--blue-tint), 0 22px 44px -32px rgba(45, 95, 234, 0.5); }
.pf-grid.is-editing [inert] { opacity: 0.4; filter: grayscale(0.5); }
.pf-edit { display: grid; gap: 16px; }
.pf-fields { display: grid; gap: 14px; }
.pf-fields.is-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.pf-edit-note { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text-2); font-size: 12.5px; }
.pf-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.pf-card > .pf-edit:not(:last-child) { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.pf-employment.is-editing .pf-dl { margin-bottom: 14px; }
.pf-list > li.is-editing { flex-wrap: wrap; }
.pf-list > li > .pf-edit { flex-basis: 100%; padding: 6px 0 4px; }

.pf-savebar {
  position: sticky; bottom: 18px; z-index: 30; display: flex; align-items: center; gap: 14px;
  width: fit-content; max-width: 100%; margin: 22px auto 0; padding: 9px 9px 9px 18px;
  border-radius: 999px; background: rgba(30, 30, 32, 0.9); color: #fff;
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
  animation: savebar-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15) backwards;
}
.pf-savebar-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); transition: background 0.2s ease, box-shadow 0.2s ease; }
.pf-savebar.is-dirty .pf-savebar-dot { background: var(--orange); box-shadow: 0 0 0 4px rgba(240, 130, 30, 0.25); }
.pf-savebar-text { display: flex; flex-direction: column; min-width: 0; margin: 0; font-size: 13px; line-height: 1.3; }
.pf-savebar-text b { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.pf-savebar-status { color: rgba(255, 255, 255, 0.62); font-size: 12px; }
.pf-savebar-actions { display: flex; gap: 8px; margin-left: 10px; }
.pf-savebar .btn:not(.btn-primary) { background: rgba(255, 255, 255, 0.13); border-color: transparent; color: #fff; box-shadow: none; }
.pf-savebar .btn:not(.btn-primary):hover { background: rgba(255, 255, 255, 0.2); }
@keyframes savebar-in { from { opacity: 0; transform: translateY(26px) scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .pf-savebar { animation: none; } .switch-knob { transition: none; } }
@media (max-width: 900px) {
  .pf-verify { margin-top: 12px; }
  .pf-fields.is-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .pf-savebar { width: auto; padding-left: 14px; border-radius: 22px; }
  .pf-savebar-text b { display: none; }
  .pf-savebar-actions { margin-left: auto; }
}

/* ------------------------------------------------- Settings, Fingerspot */
.fs-block { margin: 0 0 16px; padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.fs-block h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 16px; font-weight: 500; }
.fs-block h4 { margin: 0 0 8px; color: var(--text-2); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.fs-device.is-active { border-color: #BFE3CB; }
.fs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; margin: 12px 0 10px; }
.fs-facts > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fs-facts dt { color: var(--text-2); font-size: 12px; }
.fs-facts dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.fs-facts.is-compact { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; }
.fs-device-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px 20px; margin-bottom: 10px; }
.fs-stage { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.fs-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; color: var(--text-2); }
.fs-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 0 0 14px; }
.fs-check { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.fs-check li { display: flex; align-items: flex-start; gap: 10px; }
.fs-check-mark { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.fs-check li.is-ok .fs-check-mark { background: var(--blue); color: #fff; }
.fs-check li.is-missing .fs-check-mark { box-shadow: inset 0 0 0 1.5px var(--orange); }
.fs-check li.is-optional .fs-check-mark { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.fs-check li.is-missing { color: var(--text); }
.fs-check li.is-optional { color: var(--text-2); }
.fs-steps { margin: 10px 0 4px; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }
.fs-device .toolbar-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.fs-device .tabs { max-width: 100%; margin: 6px 0 12px; overflow-x: auto; scrollbar-width: none; }
.fs-device .tabs .tab { flex: none; white-space: nowrap; }
.fs-url { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
@media (max-width: 760px) {
  .fs-columns { grid-template-columns: minmax(0, 1fr); }
  .fs-device-head { grid-template-columns: minmax(0, 1fr); }
  .fs-stage { align-items: flex-start; text-align: left; }
}
