:root {
  --ink: #1a1d1f;
  --text: #33383f;
  --muted: #6f767e;
  --line: #efefef;
  --field: #9a9fa5;
  --surface: #f4f4f4;
  --paper: #fcfcfc;
  --sidebar: var(--paper);
  --subtle: #f4f4f4;
  --hover: #efefef;
  --nav-active: #efefef;
  --action: #2a85ff;
  --action-hover: #0069f6;
  --action-ink: #fcfcfc;
  --focus: #2a85ff;
  --chart-track: #efefef;
  --chart-progress: #2a85ff;
  --panel-shadow: none;
  --menu-paper: #fff;
  --menu-border: transparent;
  --menu-shadow: 0 40px 64px -12px #00000014, 0 0 14px -4px #0000000d, 0 32px 48px -8px #0000001a;
  --popup-shadow: 0 0 14px -4px #0000000d, 0 32px 48px -8px #0000001a;
  --selected-shadow: inset 0 -2px 1px #0000000d, inset 0 1px 1px #fff;
  --theme-track: #f4f4f4;
  --theme-selected: #fcfcfc;
  --theme-shadow: 0 4px 8px -4px rgb(0 0 0 / 25%), inset 0 -1px 1px #0000000a, inset 0 2px 0 #ffffff40;
  --key-shadow: inset 0 -1px 2px #0000000d, inset 0 -1px 1px #0000000a, inset 0 2px 0 #ffffff40;
  --backdrop: rgb(244 244 244 / 80%);
  --page-gutter: 40px;
}

:root[data-theme="dark"] {
  --ink: #fcfcfc;
  --text: #efefef;
  --muted: #9a9fa5;
  --line: #272b30;
  --field: #6f767e;
  --surface: #111315;
  --paper: #1a1d1f;
  --sidebar: var(--paper);
  --action: #2a85ff;
  --action-hover: #0069f6;
  --action-ink: #fcfcfc;
  --focus: #2a85ff;
  --chart-progress: #2a85ff;
  --subtle: #272b30;
  --hover: #33383f;
  --nav-active: #272b30;
  --chart-track: #272b30;
  --menu-paper: #111315;
  --menu-border: #272b30;
  --selected-shadow: inset 0 -2px 1px #0006, inset 0 1px 1px #ffffff1c;
  --theme-track: #111315;
  --theme-selected: #272b30;
  --theme-shadow: 0 4px 8px -4px rgb(0 0 0 / 25%), inset 0 -1px 1px #0000007d, inset 0 2px 1px #ffffff0f;
  --key-shadow: inset 0 -1px 2px #0000000d, inset 0 -1px 1px #0000000a, inset 0 1px 0 #ffffff14;
  --backdrop: rgb(39 43 48 / 90%);
}

body { font-size: 15px; font-weight: 600; line-height: 1.6; letter-spacing: -.01em }
.shell { background: var(--surface); overflow: visible }
.workspace { overflow: visible }
.shell-top {
  position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: flex-start;
  min-height: 96px; padding: 24px var(--page-gutter); gap: 14px; background: var(--paper);
  border: 0; box-shadow: inset 1px 0 var(--surface), inset 0 -1px var(--line);
}
:root[data-theme="dark"] .shell-top { box-shadow: inset 1px 0 var(--surface), inset 0 -1px var(--surface) }
.header-tools { margin-left: auto; gap: 15px }
.page-title { margin-bottom: 24px }
.page-title #heading { border: 0; margin: 0; font-size: 40px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em }
.page-title .employee-greeting { background: transparent; font-size: .875rem }
#main { width: 100%; max-width: 1280px; margin-inline: auto; padding: 40px var(--page-gutter) }
.panel { border: 0; border-radius: 8px; box-shadow: none }
.panel-head h2, .dashboard-widget-heading h2 { font-size: 1.06rem; font-weight: 750 }
.button {
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px;
  font-size: 15px; font-weight: 700; line-height: 1.6; color: var(--ink);
  background: transparent; box-shadow: inset 0 0 0 2px var(--line);
}
.button:hover { background: transparent; box-shadow: inset 0 0 0 2px var(--ink) }
.button.primary { background: var(--action); color: var(--action-ink); box-shadow: none }
.button.primary:hover { background: var(--action-hover); box-shadow: none }
#time-off-navigation button[aria-current="page"],
.signs-toolbar nav button[aria-current="page"],
.appearance-options button[aria-pressed="true"] { background: var(--nav-active); color: var(--ink) }

.utility-button, .command-trigger {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 0 12px; border: 2px solid transparent; border-radius: 12px; background: var(--subtle); color: var(--muted);
}
.utility-button { justify-content: center; background: transparent; min-width: 44px }
.command-trigger { width: min(34vw, 360px); text-align: left; font-size: 15px; font-weight: 600 }
.command-trigger kbd {
  margin-left: auto; min-width: 56px; padding: 3px 6px; border-radius: 8px; text-align: center;
  color: var(--ink); background: var(--menu-paper); box-shadow: var(--key-shadow); font: 600 16px/26px Figtree; white-space: nowrap;
}
:root[data-theme="dark"] .command-trigger kbd { background: var(--paper) }
.utility-button:hover, .command-trigger:hover { background: var(--hover) }
.header-quick-add { display: grid; place-items: center; width: 48px; height: 48px; padding: 0 }
.header-quick-add .icon { width: 21px; height: 21px }
.quick-add { position: relative }
.quick-add-options {
  position: absolute; z-index: 2; inset-block-start: calc(100% + 8px); inset-inline-end: 0;
  width: min(19rem, calc(100vw - 32px)); max-height: min(65dvh, 28rem); overflow-y: auto;
  padding: 8px; border: 1px solid var(--menu-border); border-radius: 16px;
  background: var(--menu-paper); box-shadow: var(--menu-shadow);
}
.quick-add-options .icon { flex: 0 0 auto }
:is(.header-quick-add, .dialog-head .close) .spin-on-hover { transform-box: view-box; transform-origin: 50% 50% }
#header-account .account { margin: 0; padding: 0 }
#header-account .account-trigger { min-height: 44px; gap: 9px; padding: 4px 8px; color: var(--text) }
#header-account .account-avatar { background: var(--sage); color: var(--sage-ink); font-weight: 750 }
#header-account .account-name { font-weight: 650; font-size: .875rem }
#header-account .account-chevron { transform: rotate(225deg); margin-top: -4px }
#header-account .account-menu {
  inset: calc(100% + 8px) 0 auto auto; z-index: 10; width: 240px;
  max-height: min(530px, calc(100dvh - 105px)); overflow-y: auto;
  background: var(--menu-paper); border-color: var(--menu-border); border-radius: 16px; box-shadow: var(--menu-shadow);
}

.command-body { display: grid; gap: 12px; padding: 8px var(--dialog-padding) 24px }
.command-body input { width: 100%; min-height: 46px; background: var(--subtle); font-size: 1rem }
.command-results { display: grid; gap: 2px }
.command-results button {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left;
}
.command-results button:hover, .command-results button:focus-visible { background: var(--hover) }
.command-results .icon { color: var(--muted) }
.command-empty { color: var(--muted); padding: 10px 2px }

.nav-branch summary {
  display: flex; align-items: center; min-height: 48px; gap: 12px; padding: 0 12px;
  border-radius: 12px; color: var(--muted); cursor: pointer; list-style: none; font-size: 15px;
}
.sidebar-label {
  position: fixed; z-index: 20; transform: translateY(-50%);
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--menu-paper); color: var(--ink); box-shadow: var(--menu-shadow);
  font-size: .875rem; font-weight: 500; white-space: nowrap; pointer-events: none;
}
.nav-branch summary::-webkit-details-marker { display: none }
.nav-branch summary:hover, #hub-navigation button:hover { background: var(--hover) }
.nav-branch summary i {
  width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg); margin: -4px 3px 0 auto;
}
.nav-branch[open] summary i { transform: rotate(225deg); margin-top: 4px }
.nav-branch .branch-active { color: var(--ink); font-weight: 700 }
.nav-children { display: grid; margin: 2px 0 4px 23px; padding-left: 10px; border-left: 2px solid var(--line) }
#hub-navigation .nav-children button { min-height: 48px; padding-block: 0; font-size: 15px }
.nav-children .icon { display: none }
#hub-navigation button[aria-current="page"], #hub-navigation .section-active { box-shadow: var(--selected-shadow); font-weight: 600 }
#hub-navigation button[aria-current="page"]::before, #hub-navigation .section-active::before { display: none }
.away-mobile { display: none }
.rail-footer { display: grid; gap: 12px; margin-top: auto; padding-top: 18px; border-top: 2px solid var(--line) }
.rail-demo { display: flex; align-items: baseline; gap: 8px; font-size: .8125rem; font-weight: 700 }
.rail-demo small { color: var(--muted); font-weight: 500; font-size: .75rem }
.theme-switch {
  --switch-spacing: 4px;
  --switch-travel: calc(100% + var(--switch-spacing));
  --switch-dark-offset: var(--switch-travel) 0;
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--switch-spacing); padding: var(--switch-spacing);
  border-radius: 20px; background: var(--theme-track);
}
.theme-switch::before {
  content: ""; position: absolute; inset: var(--switch-spacing) auto var(--switch-spacing) var(--switch-spacing);
  width: calc(50% - 1.5 * var(--switch-spacing)); border-radius: 16px;
  background: var(--theme-selected); box-shadow: var(--theme-shadow); pointer-events: none;
}
:root[data-theme="dark"] .theme-switch::before { translate: var(--switch-dark-offset) }
.theme-switch button {
  position: relative; display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 32px;
  border: 0; border-radius: 16px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600;
}
.theme-switch button[aria-pressed="true"] { color: var(--ink) }
.theme-switch svg { width: 24px; height: 24px; flex-shrink: 0 }

@media (min-width: 761px) {
  .shell { grid-template-columns: 340px minmax(0, 1fr) }
  .shell.sidebar-collapsed { grid-template-columns: 96px minmax(0, 1fr) }
  .sidebar { position: sticky; height: 100dvh; min-height: 0; padding: 24px; overflow-y: auto; border: 0; scrollbar-width: none }
  .sidebar > .logo { margin: 0 0 24px }
  .sidebar > .logo img { width: 68px }
  #hub-navigation { padding-bottom: 24px }
  #hub-navigation button { min-height: 48px; padding: 0 12px; border-radius: 12px; color: var(--muted) }
  #hub-navigation button[aria-current="page"], #hub-navigation .section-active { color: var(--ink) }
  #hub-navigation :is(button, summary) .icon { width: 24px; height: 24px }
  #hub-navigation .nav-caption { padding-block: 10px 6px; letter-spacing: .055em; font-weight: 700 }
  .sidebar-collapsed .sidebar { padding-inline: 10px }
  .sidebar-collapsed .sidebar > .logo { margin-inline: auto }
  .sidebar-collapsed :is(.nav-caption, #hub-navigation button span, .nav-branch summary span, .nav-branch summary i, .rail-demo, .theme-switch span) {
    position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap;
  }
  .sidebar-collapsed #hub-navigation :is(button, summary) { justify-content: center; padding-inline: 0 }
  .sidebar-collapsed .nav-children { margin-left: 4px; padding-left: 6px }
  .sidebar-collapsed .nav-children .icon { display: inline-block; width: 17px; height: 17px }
  .sidebar-collapsed .theme-switch {
    --switch-dark-offset: 0 var(--switch-travel);
    grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr;
  }
  .sidebar-collapsed .theme-switch::before {
    inset: var(--switch-spacing) var(--switch-spacing) auto var(--switch-spacing);
    width: auto; height: calc(50% - 1.5 * var(--switch-spacing));
  }
}

.lab-overview { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 8px; align-items: start }
.lab-overview > .panel { margin: 0 }
.lab-overview > :is(.lab-balance, .lab-calendar) { align-self: stretch }
.lab-balance {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px;
  padding: 24px; min-height: 273px;
}
.lab-balance-copy { flex: 1 1 220px }
.lab-balance-label, .lab-card-head { display: flex; align-items: center; gap: 16px }
.lab-balance-label::before, .lab-card-head::before {
  content: ''; flex: 0 0 16px; height: 32px; border-radius: 4px; background: #b5e4ca;
}
.lab-balance-label::before { background: #ffbc99 }
.lab-calendar .lab-card-head::before { background: #b1e5fc }
#hub-apps-card .lab-card-head::before { background: #cabdff }
.lab-balance-label h2, .lab-card-head h2 { font-weight: 600; font-size: 20px; line-height: 1.6; letter-spacing: -.02em }
.lab-icon {
  display: grid; place-items: center; flex: 0 0 34px;
  width: 34px; height: 34px; border-radius: 8px; background: var(--tone, var(--subtle)); color: var(--tone-ink, var(--text));
}
.lab-balance-value { margin-top: 18px; font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1.25 }
.lab-balance-context { margin-top: 8px; color: var(--muted); font-size: .875rem }
.lab-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 21px }
/* Core chart colours. Hourly leave has a total but no allowance. */
.leave-balance-ring[data-balance="vacation"] { --balance-color: #2a85ff }
.leave-balance-ring[data-balance="sick"] { --balance-color: #83bf6e }
.leave-balance-ring[data-balance="hourly"] { --balance-color: #8e59ff; --balance-track-tint: 45% }
.leave-balance-ring[data-balance] .leave-balance-progress { stroke: var(--balance-color, var(--chart-progress)) }
.leave-balance-ring[data-balance] .leave-balance-track {
  stroke: color-mix(in srgb, var(--balance-color, var(--chart-progress)) var(--balance-track-tint, 18%), var(--chart-track));
}
.lab-balance .leave-balance-ring { width: clamp(85px, 10vw, 141px); flex: 0 0 auto; font-size: .875rem }
.lab-calendar, .lab-links { padding: 24px }
.lab-calendar { display: flex; flex-direction: column; align-items: stretch; gap: 13px }
.lab-calendar > .button { margin-top: auto; align-self: start }
.lab-dates { margin: 0; padding: 0; list-style: none }
.lab-dates li {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 3px 10px;
  padding-block: 11px; border-bottom: 1px solid var(--line); font-size: .875rem;
}
.lab-dates time, .lab-empty { color: var(--muted); font-size: .875rem }
.lab-links .lab-card-head { margin-bottom: 8px }
.lab-shortcut {
  display: grid; width: 100%; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px;
  padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  color: var(--ink); font-size: .9375rem; text-align: left;
}
.lab-shortcut:last-child { border-bottom: 0; padding-bottom: 1px }
.lab-shortcut > strong { overflow-wrap: anywhere }
.lab-shortcut > strong, .lab-dates strong, .dashboard-dates strong,
.employee-manager strong, .command-results button, .button:not(.primary) {
  font-weight: 500;
}
.lab-chevron { color: var(--muted) }

.login-card { grid-template-columns: 1fr 1fr; width: min(850px, 100%); min-height: min(520px, calc(100dvh - 100px)) }
.login-welcome { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; background: var(--surface); color: var(--ink) }
.login-tagline { color: var(--ink); font-size: .875rem; font-weight: 700; letter-spacing: .08em }
:root[data-theme="dark"] :is(.login-brand, .logo) img { filter: brightness(0) invert(1) }
.login-demo { margin-top: 18px }
.login-preview-note { text-align: left; margin: 9px 0 16px }

@media (prefers-reduced-motion: no-preference) {
  .shell { transition: grid-template-columns 190ms ease }
  .theme-switch::before { transition: translate 210ms ease }
  :is(.shell-top, .sidebar, .workspace, .panel, .button, .utility-button, .command-trigger, .theme-switch button) {
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  }
  .account[open] .account-menu, .quick-add-options:not([hidden]) { animation: menu-reveal 200ms ease-out both }
  #hub-navigation .nav-clicked { animation: nav-press 200ms ease-out }
  @keyframes nav-press {
    0% { transform: scale(.97) }
    65% { transform: scale(1.015) }
    100% { transform: scale(1) }
  }
  @keyframes menu-reveal { from { opacity: 0; transform: translateY(-5px) } to { opacity: 1; transform: translateY(0) } }
}

dialog {
  --dialog-padding: clamp(18px, 4vw, 28px);
  width: min(600px, calc(100% - 28px));
  background: var(--menu-paper);
  border: 0; border-radius: 16px; box-shadow: var(--popup-shadow);
}
dialog::backdrop { backdrop-filter: none }
.dialog-head { gap: 16px; padding: 20px var(--dialog-padding); border-bottom: 0 }
dialog > form:not(.detail-form) { gap: 20px; padding: 8px var(--dialog-padding) 24px }
dialog .form-grid { gap: 18px }
dialog .control { gap: 9px }
dialog .control select { min-height: 48px }
dialog .actions { gap: 12px }
dialog > form:not(.detail-form) > .actions { padding-top: 6px }
dialog > .empty { margin: 8px var(--dialog-padding) 24px }
dialog > .mobile-app-list { padding: 8px var(--dialog-padding) 24px }
#dialog:has(> .detail-form) > .dialog-head { padding-block: 22px }
.detail-form-body { padding-block: 10px 32px }
.detail-form-section .control { gap: 9px }
.picker-month { padding: 8px var(--dialog-padding) 10px }
.picker-grid { gap: 4px; padding: 8px var(--dialog-padding) 22px }
.dialog-head .close { display: grid; place-items: center; background: var(--nav-active); border: 0; border-radius: 50% }
.control :is(input:not([type="checkbox"], [type="radio"]), textarea), .command-body input {
  min-height: 48px; padding: 0 10px; border: 2px solid transparent;
  border-radius: 12px; background: var(--subtle); font-size: 15px;
}
.control textarea { padding-block: 10px }
.control :is(input, textarea):focus, .command-body input:focus { background: var(--menu-paper); border-color: var(--field) }
select { border: 0; min-height: 40px; border-radius: 12px; box-shadow: inset 0 0 0 2px var(--line) }

@media (min-width: 761px) and (max-width: 1339px) {
  :root { --page-gutter: 24px }
  .shell { grid-template-columns: 300px minmax(0, 1fr) }
  .sidebar { padding: 16px }
  .shell-top { min-height: 80px; padding-block: 16px }
  #main { padding-top: 32px }
}
@media (min-width: 761px) and (max-width: 1110px) {
  .shell:not(.sidebar-collapsed) { grid-template-columns: 222px minmax(0, 1fr) }
  .lab-overview { grid-template-columns: minmax(0, 1fr) }
  .header-tools { gap: 6px }
}

@media (max-width: 760px) {
  .shell-top { min-height: 58px; padding: max(7px, env(safe-area-inset-top, 0px)) 16px 7px; gap: 6px }
  .shell-top .header-tools { display: flex }
  .command-trigger { width: auto; flex: 1; min-width: 0; justify-content: center }
  .command-trigger kbd { display: none }
  .lab-card-head h2, .lab-balance-label h2 { font-size: 18px }
  .rail-footer, .nav-branch { display: none }
  .away-mobile { display: contents }
  #main { padding: 24px 16px }
  .page-title { margin-bottom: 16px }
  .page-title #heading { font-size: 32px; line-height: 1.25; letter-spacing: -.03em }
  .page-title #employee-greeting { font-size: .875rem }
  .lab-overview { grid-template-columns: minmax(0, 1fr); gap: 13px }
  .lab-balance, .lab-calendar, .lab-links { padding: 18px }
  .lab-balance { min-height: auto }
  .lab-balance-copy { flex-basis: 160px }
  .lab-shortcut { min-height: 54px }
  .login-card { grid-template-columns: 1fr; max-width: 460px; min-height: 0 }
  .login-welcome { gap: 28px; min-height: 0; padding: 24px 28px }
  .login-brand img { width: 54px }
}

.absence-date-range time { white-space: nowrap }
.lab-dates .absence-date-range { color: var(--muted) }
.dashboard-dates .absence-date-range {
  padding: 3px 8px; border-radius: 7px; background: var(--tone); color: var(--tone-ink);
}
.dashboard-dates .absence-date-range time { padding: 0; background: transparent }

.cal-week {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: var(--calendar-date-height, 34px) repeat(var(--event-lanes), auto) minmax(6px, 1fr);
}
.cal-week .cal-cell { grid-row: 1 / -1 }
.cal-week .cal-entry { z-index: 1; min-width: 0; align-self: start; margin-inline: 6px }
@media (max-width: 760px) {
  .cal-week { --calendar-date-height: 28px }
  .cal-week .cal-entry { margin-inline: 2px }
}
