:root,
html[data-theme="midnight-blue"] {
  --canvas: #f3f6fa;
  --surface: #ffffff;
  --surface-subtle: #f7f9fc;
  --ink: #1f293b;
  --muted: #667085;
  --line: #dce3ed;
  --line-strong: #c5d0df;
  --primary: #2f6fbd;
  --primary-dark: #245793;
  --primary-soft: #d8e8fb;
  --accent: #168b80;
  --accent-soft: #d2f0eb;
  --sidebar: #202b46;
  --sidebar-ink: #edf3fb;
  --sidebar-muted: #aebbd0;
  --sidebar-subtle: #8191aa;
  --sidebar-avatar: #384867;
  --feature: #2d4770;
  --feature-muted: #c2d2e8;
  --focus-ring: rgba(47, 111, 189, 0.34);
  --coral: #b64b55;
  --coral-soft: #f9e9eb;
  --gold: #87611e;
  --gold-soft: #f8f0dc;
  --shadow: 0 12px 30px rgba(31, 41, 59, 0.08);
  --teal: var(--primary);
  --teal-dark: var(--primary-dark);
  --teal-soft: var(--primary-soft);
  --primary-ink: var(--primary-dark);
}

html[data-theme="soft-graphite"] {
  --canvas: #f4f6f8;
  --surface-subtle: #f7f8fa;
  --ink: #252c35;
  --muted: #6c7480;
  --line: #dfe3e8;
  --line-strong: #c9d0d8;
  --primary: #426fa9;
  --primary-dark: #315581;
  --primary-soft: #dce7f5;
  --accent: #b34c7e;
  --accent-soft: #f4dbe7;
  --sidebar: #272f3a;
  --sidebar-ink: #f2f4f7;
  --sidebar-muted: #b7bec8;
  --sidebar-subtle: #8e98a6;
  --sidebar-avatar: #424d5c;
  --feature: #3e4a59;
  --feature-muted: #d0d6de;
  --focus-ring: rgba(66, 111, 169, 0.34);
  --shadow: 0 12px 30px rgba(37, 44, 53, 0.08);
}

html[data-theme="coastal-teal"] {
  --canvas: #f2f7f7;
  --surface-subtle: #f6faf9;
  --ink: #203238;
  --muted: #65777b;
  --line: #d7e4e3;
  --line-strong: #bfd2d0;
  --primary: #087f78;
  --primary-dark: #00635d;
  --primary-soft: #d2f1ed;
  --accent: #637fcf;
  --accent-soft: #e0e7fb;
  --sidebar: #183d4a;
  --sidebar-ink: #edf7f8;
  --sidebar-muted: #afd0d4;
  --sidebar-subtle: #82aeb4;
  --sidebar-avatar: #2d5a67;
  --feature: #235866;
  --feature-muted: #c3dde0;
  --focus-ring: rgba(8, 127, 120, 0.34);
  --shadow: 0 12px 30px rgba(32, 50, 56, 0.08);
}

html[data-theme="forest-green"] {
  --canvas: #f2f6f3;
  --surface-subtle: #f6f9f7;
  --ink: #203129;
  --muted: #66766e;
  --line: #d8e3dc;
  --line-strong: #c0d1c6;
  --primary: #267a50;
  --primary-dark: #1c5f3e;
  --primary-soft: #d6f0e1;
  --accent: #ae6f24;
  --accent-soft: #f4e3cd;
  --sidebar: #17392f;
  --sidebar-ink: #eef7f2;
  --sidebar-muted: #b3d0c1;
  --sidebar-subtle: #83a994;
  --sidebar-avatar: #315849;
  --feature: #275544;
  --feature-muted: #c5ddd2;
  --focus-ring: rgba(38, 122, 80, 0.34);
  --shadow: 0 12px 30px rgba(32, 49, 41, 0.08);
}

html[data-theme="meadow-green"] {
  --canvas: #f5f8f3;
  --surface-subtle: #f8faf6;
  --ink: #26342a;
  --muted: #68766b;
  --line: #dce5da;
  --line-strong: #c7d5c4;
  --primary: #327d45;
  --primary-dark: #255f34;
  --primary-soft: #d9f1dc;
  --accent: #d18b16;
  --accent-soft: #f9e5c6;
  --sidebar: #294a3b;
  --sidebar-ink: #f1f7f2;
  --sidebar-muted: #bfd2c3;
  --sidebar-subtle: #91ad97;
  --sidebar-avatar: #426450;
  --feature: #3d6848;
  --feature-muted: #d3e3d5;
  --focus-ring: rgba(50, 125, 69, 0.34);
  --shadow: 0 12px 30px rgba(38, 52, 42, 0.08);
}

html[data-theme="rosewood-pink"] {
  --canvas: #fff3f8;
  --surface-subtle: #fff7fa;
  --ink: #3a2030;
  --muted: #7d6070;
  --line: #f0d4e1;
  --line-strong: #ddb6c9;
  --primary: #c12d76;
  --primary-dark: #932058;
  --primary-soft: #f9d7e7;
  --accent: #367fa8;
  --accent-soft: #dcecf5;
  --sidebar: #5f1f42;
  --sidebar-ink: #fbf1f6;
  --sidebar-muted: #e5b7cd;
  --sidebar-subtle: #c17b9e;
  --sidebar-avatar: #7c3659;
  --feature: #8a2656;
  --feature-muted: #f0bfd6;
  --focus-ring: rgba(193, 45, 118, 0.34);
  --shadow: 0 12px 30px rgba(53, 37, 46, 0.08);
}

html[data-theme="blush-pink"] {
  --canvas: #fff4f9;
  --surface-subtle: #fff8fb;
  --ink: #3c2231;
  --muted: #7d6170;
  --line: #f0d6e2;
  --line-strong: #ddb9ca;
  --primary: #c23f7e;
  --primary-dark: #94305d;
  --primary-soft: #fbdbe8;
  --accent: #269385;
  --accent-soft: #d8f1ed;
  --sidebar: #6a254b;
  --sidebar-ink: #fff3f7;
  --sidebar-muted: #ecc1d5;
  --sidebar-subtle: #ca83a5;
  --sidebar-avatar: #873c62;
  --feature: #982e62;
  --feature-muted: #f3c4da;
  --focus-ring: rgba(194, 63, 126, 0.34);
  --shadow: 0 12px 30px rgba(57, 42, 49, 0.08);
}

html[data-theme="saffron-night"] {
  --canvas: #f6f5f1;
  --surface-subtle: #faf9f6;
  --ink: #322f27;
  --muted: #756f61;
  --line: #e4e0d5;
  --line-strong: #d2cbbb;
  --primary: #916500;
  --primary-dark: #6f4c00;
  --primary-soft: #f8e8b0;
  --accent: #3576ad;
  --accent-soft: #dae8f6;
  --sidebar: #302d25;
  --sidebar-ink: #f8f4e9;
  --sidebar-muted: #cec5ab;
  --sidebar-subtle: #a99c79;
  --sidebar-avatar: #4b473a;
  --feature: #514724;
  --feature-muted: #e3d8b5;
  --focus-ring: rgba(145, 101, 0, 0.34);
  --shadow: 0 12px 30px rgba(50, 47, 39, 0.08);
}

html[data-theme="sunlit-yellow"] {
  --canvas: #f8f8f3;
  --surface-subtle: #fbfbf7;
  --ink: #343126;
  --muted: #777263;
  --line: #e6e3d8;
  --line-strong: #d4cebd;
  --primary: #8f6700;
  --primary-dark: #6d4e00;
  --primary-soft: #ffedab;
  --accent: #3e7e9e;
  --accent-soft: #d9ebf4;
  --sidebar: #3e3a2a;
  --sidebar-ink: #fffbed;
  --sidebar-muted: #d5cba9;
  --sidebar-subtle: #b1a36f;
  --sidebar-avatar: #5a543d;
  --feature: #62521e;
  --feature-muted: #eadfb9;
  --focus-ring: rgba(143, 103, 0, 0.34);
  --shadow: 0 12px 30px rgba(52, 49, 38, 0.08);
}

html[data-theme="ember-orange"] {
  --canvas: #f8f3f1;
  --surface-subtle: #fbf7f5;
  --ink: #352924;
  --muted: #796b65;
  --line: #eaded9;
  --line-strong: #d8c5bd;
  --primary: #bf421f;
  --primary-dark: #923017;
  --primary-soft: #f9d9ce;
  --accent: #168d94;
  --accent-soft: #d5eff0;
  --sidebar: #452a24;
  --sidebar-ink: #fff4f0;
  --sidebar-muted: #ddbbae;
  --sidebar-subtle: #b98b7a;
  --sidebar-avatar: #624239;
  --feature: #6f3b2c;
  --feature-muted: #edcabd;
  --focus-ring: rgba(191, 66, 31, 0.34);
  --shadow: 0 12px 30px rgba(53, 41, 36, 0.08);
}

html[data-theme="apricot-orange"] {
  --canvas: #fff8f5;
  --surface-subtle: #fffaf8;
  --ink: #392c27;
  --muted: #7d6d66;
  --line: #eddfd9;
  --line-strong: #dcc8bf;
  --primary: #b94a28;
  --primary-dark: #8e361d;
  --primary-soft: #fbded2;
  --accent: #3184a8;
  --accent-soft: #d8ebf4;
  --sidebar: #52362f;
  --sidebar-ink: #fff5f1;
  --sidebar-muted: #e0c1b5;
  --sidebar-subtle: #bb9080;
  --sidebar-avatar: #6d4f46;
  --feature: #794939;
  --feature-muted: #f0d0c3;
  --focus-ring: rgba(185, 74, 40, 0.34);
  --shadow: 0 12px 30px rgba(57, 44, 39, 0.08);
}

html[data-theme="plum-purple"] {
  --canvas: #f5f2f7;
  --surface-subtle: #f9f6fa;
  --ink: #2f2835;
  --muted: #716878;
  --line: #e2dce7;
  --line-strong: #cec4d7;
  --primary: #7b40a5;
  --primary-dark: #5c2d7e;
  --primary-soft: #ebdcf7;
  --accent: #168f82;
  --accent-soft: #d5f1ed;
  --sidebar: #352844;
  --sidebar-ink: #f7f1fb;
  --sidebar-muted: #cbb9d7;
  --sidebar-subtle: #9f86b1;
  --sidebar-avatar: #514064;
  --feature: #513d66;
  --feature-muted: #d9cbe3;
  --focus-ring: rgba(123, 64, 165, 0.34);
  --shadow: 0 12px 30px rgba(47, 40, 53, 0.08);
}

html[data-theme="lavender-purple"] {
  --canvas: #f8f5fa;
  --surface-subtle: #fbf8fc;
  --ink: #332c38;
  --muted: #756b7b;
  --line: #e6dfe9;
  --line-strong: #d2c8d8;
  --primary: #7650a8;
  --primary-dark: #583a82;
  --primary-soft: #eadff7;
  --accent: #328aaa;
  --accent-soft: #d8edf5;
  --sidebar: #433650;
  --sidebar-ink: #faf4fd;
  --sidebar-muted: #d2c0dc;
  --sidebar-subtle: #a794b2;
  --sidebar-avatar: #5e4e6b;
  --feature: #5d4b6e;
  --feature-muted: #dfd2e6;
  --focus-ring: rgba(118, 80, 168, 0.34);
  --shadow: 0 12px 30px rgba(51, 44, 56, 0.08);
}

html[data-theme="night-mode"] {
  color-scheme: dark;
  --canvas: #111827;
  --surface: #192231;
  --surface-subtle: #202c3d;
  --surface-hover: #263449;
  --surface-disabled: #2a3545;
  --control-background: #121a28;
  --weekend-background: #151e2c;
  --ink: #edf3fb;
  --muted: #aab8cb;
  --line: #334155;
  --line-strong: #4a5b72;
  --primary: #2e75c5;
  --primary-dark: #225b9d;
  --primary-soft: #21456e;
  --accent: #14b8a6;
  --accent-soft: #114a43;
  --sidebar: #0b1120;
  --sidebar-ink: #f2f6fc;
  --sidebar-muted: #a8b6ca;
  --sidebar-subtle: #7889a1;
  --sidebar-avatar: #243148;
  --feature: #315f99;
  --feature-muted: #c4d8f2;
  --focus-ring: rgba(46, 117, 197, 0.48);
  --coral: #ff9aa2;
  --coral-soft: #4a252d;
  --gold: #edc86e;
  --gold-soft: #463919;
  --heat-1: #193633;
  --heat-2: #1f524a;
  --heat-3: #287469;
  --heat-4: #339588;
  --calendar-muted-overlay: rgba(11, 17, 32, 0.42);
  --primary-ink: #93c5fd;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  min-height: 100%;
  --surface: #ffffff;
  --surface-hover: #fbfcfc;
  --surface-disabled: #f1f3f2;
  --control-background: #ffffff;
  --weekend-background: #f4f5f5;
  --coral: #b64b55;
  --coral-soft: #f9e9eb;
  --gold: #87611e;
  --gold-soft: #f8f0dc;
  --heat-1: #edf6f2;
  --heat-2: #cfe8df;
  --heat-3: #8bc5b4;
  --heat-4: #3d9684;
  --calendar-muted-overlay: rgba(244, 246, 245, 0.44);
  --calendar-count-background: var(--ink);
  --calendar-count-ink: var(--canvas);
  --teal: var(--primary);
  --teal-dark: var(--primary-dark);
  --teal-soft: var(--primary-soft);
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary-ink);
  text-decoration: none;
}

a:hover {
  color: var(--primary-ink);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  bottom: 0;
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  left: 0;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0;
  width: 240px;
  z-index: 20;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 0.96rem;
  font-weight: 760;
  gap: 0.7rem;
}

.sidebar .brand,
.brand-light {
  color: var(--sidebar-ink);
}

.brand:hover,
.sidebar .brand:hover,
.brand-light:hover {
  color: inherit;
}

.side-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 2.4rem;
}

.side-nav a {
  align-items: center;
  border-radius: 6px;
  color: var(--sidebar-muted);
  display: flex;
  font-size: 0.9rem;
  font-weight: 650;
  gap: 0.7rem;
  min-height: 42px;
  padding: 0 0.75rem;
}

.side-nav a:hover,
.side-nav a.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--sidebar-ink);
}

.nav-group {
  color: var(--sidebar-subtle);
  font-size: 0.68rem;
  font-weight: 750;
  margin: 1.5rem 0 0.35rem;
  padding: 0 0.75rem;
  text-transform: uppercase;
}

.sidebar-account {
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  display: grid;
  gap: 0.35rem;
  padding: 1rem 0.35rem 0;
}

.sidebar-profile {
  align-items: center;
  border-radius: 6px;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 32px minmax(0, 1fr);
  margin: -0.35rem;
  padding: 0.35rem;
}

.sidebar-profile:hover,
.sidebar-profile.active {
  background: rgba(255, 255, 255, 0.08);
}

.account-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.account-name strong,
.account-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name strong {
  color: var(--sidebar-ink);
  font-size: 0.82rem;
}

.account-name small {
  color: var(--sidebar-subtle);
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

.sidebar-session {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
}

.sidebar-session form {
  margin: 0;
}

.sign-out {
  background: transparent;
  border: 0;
  color: var(--sidebar-muted);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.2rem 0;
}

.sign-out:hover {
  color: var(--sidebar-ink);
}

.application-version {
  color: var(--sidebar-subtle);
  font-size: 0.68rem;
  font-weight: 650;
}

.mobile-header {
  display: none;
}

.content {
  margin-left: 240px;
  min-height: 100vh;
  padding: 2.5rem 3rem 4rem;
}

.page-header {
  align-items: flex-end;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-title h1,
.auth-form h2,
.auth-intro h1,
.empty-page h1 {
  letter-spacing: 0;
}

.page-title h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0;
}

.page-title > p:last-child {
  color: var(--muted);
  margin: 0.45rem 0 0;
}

.eyebrow {
  color: var(--primary-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

.eyebrow-light {
  color: var(--feature-muted);
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 750;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  white-space: nowrap;
}

.button-primary {
  background: var(--teal);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--teal-dark);
  color: #ffffff;
}

.button-secondary,
.button-quiet {
  background: var(--control-background);
  border-color: var(--line);
  color: var(--ink);
}

.button-secondary:hover,
.button-quiet:hover {
  background: var(--surface-subtle);
  border-color: var(--line-strong);
  color: var(--ink);
}

.button-small {
  font-size: 0.76rem;
  min-height: 32px;
  padding: 0.3rem 0.55rem;
}

.button-danger {
  color: var(--coral);
}

.button-danger-solid {
  background: #bd3f37;
  border-color: #bd3f37;
  color: #ffffff;
}

.button-danger-solid:hover {
  background: #a8322c;
  border-color: #a8322c;
  color: #ffffff;
}

.button-wide {
  width: 100%;
}

.button:disabled {
  background: var(--surface-disabled);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.page-actions {
  align-items: center;
  display: flex;
  gap: 0.65rem;
}

.metric-grid {
  display: grid;
  gap: 0;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  margin-bottom: 1.5rem;
}

.metric {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 1.25rem;
}

.metric:first-child {
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
}

.metric:last-child {
  border-radius: 0 8px 8px 0;
}

.metric-featured {
  background: var(--feature);
  border-color: var(--feature);
  color: #ffffff;
}

.metric-heading {
  align-items: center;
  color: var(--feature-muted);
  display: flex;
  font-size: 0.78rem;
  font-weight: 700;
  justify-content: space-between;
}

.metric-year {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
}

.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-value {
  font-size: 2.35rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 1.25rem;
}

.metric-unit {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

.metric-featured .metric-unit,
.metric-featured .metric-foot {
  color: var(--feature-muted);
}

.metric-foot {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: auto;
}

.allowance-track {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  height: 5px;
  margin: auto 0 0.55rem;
  overflow: hidden;
}

.allowance-track span {
  background: var(--accent);
  display: block;
  height: 100%;
}

.dashboard-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.8fr);
}

.surface,
.table-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.table-surface {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.surface {
  padding: 1.25rem;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.section-heading h2,
.dialog-heading h2,
.empty-state h3 {
  font-size: 1rem;
  letter-spacing: 0;
  margin: 0;
}

.count-label,
.privacy-label {
  color: var(--muted);
  font-size: 0.74rem;
}

.empty-state {
  align-items: center;
  display: flex;
  gap: 1rem;
  min-height: 190px;
  padding: 2rem;
}

.empty-state p {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0.35rem 0 0;
}

.empty-date,
.date-tile {
  align-items: center;
  background: var(--teal-soft);
  border-radius: 6px;
  color: var(--primary-ink);
  display: flex;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  justify-content: center;
}

.empty-date {
  font-size: 1.3rem;
  font-weight: 850;
  height: 58px;
  width: 58px;
}

.leave-list {
  margin-top: 1rem;
}

.leave-item {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 44px minmax(140px, 1fr) minmax(140px, auto);
  padding: 0.8rem 0;
}

.date-tile {
  flex-direction: column;
  height: 44px;
  width: 44px;
}

.date-tile strong {
  font-size: 0.9rem;
}

.date-tile small {
  font-size: 0.58rem;
  text-transform: uppercase;
}

.leave-person,
.leave-dates {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
}

.leave-person small,
.leave-dates small {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

.leave-dates {
  text-align: right;
}

.insight-list {
  margin: 1rem 0;
}

.insight-list div {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  font-size: 0.8rem;
  justify-content: space-between;
  padding: 0.78rem 0;
}

.insight-list dt {
  color: var(--muted);
}

.insight-list dd {
  font-weight: 750;
  margin: 0;
}

.text-link {
  align-items: center;
  display: flex;
  font-size: 0.8rem;
  font-weight: 750;
  justify-content: space-between;
}

.table-section {
  margin-top: 2rem;
}

.table-section > .section-heading {
  margin-bottom: 0.85rem;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  border-collapse: collapse;
  font-size: 0.8rem;
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
}

.person-cell {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  min-width: 180px;
}

.person-cell > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.person-cell small {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

.avatar {
  align-items: center;
  background: var(--primary-soft);
  border-radius: 50%;
  color: var(--primary-ink);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 850;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.avatar-small {
  background: var(--sidebar-avatar);
  color: #ffffff;
  height: 32px;
  width: 32px;
}

.status {
  border-radius: 4px;
  display: inline-flex;
  font-size: 0.66rem;
  font-weight: 800;
  margin-right: 0.25rem;
  padding: 0.24rem 0.42rem;
}

.status-active {
  background: var(--teal-soft);
  color: var(--primary-ink);
}

.status-disabled {
  background: var(--surface-disabled);
  color: var(--muted);
}

.status-admin {
  background: var(--gold-soft);
  color: var(--gold);
}

.metric-link {
  color: inherit;
  text-decoration: none;
  transition: background-color 140ms ease;
}

.metric-link:hover {
  background: var(--surface-subtle);
}

.status-manager {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pending {
  background: var(--gold-soft);
  color: var(--gold);
}

.status-rejected {
  background: var(--coral-soft);
  color: #8e2d26;
}

.status-closure {
  background: var(--gold-soft);
  color: var(--gold);
}

.row-muted {
  color: #87908e;
}

.row-actions {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

.row-actions form {
  margin: 0;
}

.toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.year-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.year-tabs a {
  border-bottom: 2px solid transparent;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 750;
  padding: 0.65rem 0.1rem;
}

.year-tabs a:hover,
.year-tabs a.active {
  border-bottom-color: var(--teal);
  color: var(--primary-ink);
}

.holiday-date {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.holiday-table {
  min-width: 720px;
  table-layout: fixed;
}

.holiday-column-date,
.holiday-column-day {
  width: 14%;
}

.holiday-column-name {
  width: 32%;
}

.holiday-column-type {
  width: 20%;
}

.holiday-column-actions {
  width: 20%;
}

.absence-type-table {
  min-width: 980px;
}

.colour-label {
  align-items: center;
  display: inline-flex;
  gap: 0.55rem;
  white-space: nowrap;
}

.colour-swatch {
  background: var(--swatch-colour);
  border: 1px solid rgba(15, 26, 24, 0.16);
  border-radius: 3px;
  display: inline-block;
  height: 18px;
  width: 18px;
}

.colour-field input[type="color"] {
  cursor: pointer;
  height: 42px;
  max-width: 96px;
  padding: 0.25rem;
}

.table-empty {
  color: var(--muted);
  padding: 2rem !important;
  text-align: center !important;
}

.search-field input {
  min-width: 290px;
}

.notice {
  border: 1px solid;
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
}

.notice-success {
  background: var(--teal-soft);
  border-color: #bcded7;
  color: var(--primary-ink);
}

.notice-error,
.validation-summary {
  background: var(--coral-soft);
  border-color: #ecc6c0;
  color: #8e2d26;
}

.temporary-password {
  background: var(--control-background);
  border: 1px solid #bcded7;
  border-radius: 4px;
  color: var(--ink);
  padding: 0.1rem 0.35rem;
  user-select: all;
}

.text-danger {
  color: var(--coral);
}

.dialog {
  background: transparent;
  border: 0;
  max-height: 92vh;
  max-width: 600px;
  padding: 0;
  width: calc(100% - 2rem);
}

.dialog::backdrop {
  background: rgba(15, 26, 24, 0.55);
}

.dialog-panel {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(15, 26, 24, 0.22);
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.4rem;
}

.dialog-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.6rem;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.icon-button:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.allowance-year-list {
  border-top: 1px solid var(--line);
}

.allowance-year-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(120px, 1fr) 110px auto auto auto;
  min-height: 62px;
  padding: 0.65rem 0;
}

.allowance-year-label {
  display: flex;
  flex-direction: column;
}

.allowance-year-label small,
.allowance-days-unit {
  color: var(--muted);
  font-size: 0.72rem;
}

.allowance-days-field input {
  min-height: 36px;
}

.allowance-year-readonly {
  grid-template-columns: 1fr auto;
}

.allowance-add-form {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(120px, 0.7fr) minmax(140px, 1fr) auto;
  padding-top: 0.25rem;
}

.profile-page > .surface + .surface {
  margin-top: 1.25rem;
}

.calendar-subscription-link {
  align-items: end;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.calendar-subscription-link .field {
  min-width: 0;
}

.calendar-subscription-link input {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.76rem;
}

.copy-feedback {
  color: var(--muted);
  font-size: 0.72rem;
  margin: 0;
}

.copy-feedback:empty,
.calendar-subscription-feedback:empty {
  display: none;
}

[data-calendar-subscription] .calendar-subscription-create-actions {
  border-top: 1px solid var(--line);
  margin-top: 0;
  padding-top: 0.75rem;
}

.calendar-subscription-actions {
  justify-content: space-between;
}

[data-calendar-subscription][aria-busy="true"] {
  opacity: 0.72;
}

.calendar-subscription-feedback {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  margin: 0;
}

.calendar-subscription-feedback[data-state="success"] {
  color: var(--primary-ink);
}

.calendar-subscription-feedback[data-state="error"] {
  color: var(--coral);
}

.calendar-subscription-warning {
  align-items: flex-start;
  flex-direction: column;
  margin: 0;
}

.calendar-subscription-guide {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
  padding-top: 1rem;
}

.calendar-subscription-guide h3 {
  font-size: 0.9rem;
  margin: 0;
}

.calendar-subscription-guide ol {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.25rem;
}

.calendar-subscription-guide li,
.calendar-subscription-notes p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.calendar-subscription-guide strong {
  color: var(--ink);
}

.calendar-subscription-notes {
  display: grid;
  gap: 0.35rem;
}

.calendar-subscription-notes p {
  margin: 0;
}

.admin-subsection {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-top: 1rem;
}

.admin-subsection > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.admin-subsection small {
  color: var(--muted);
}

.theme-feedback {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  margin: -0.35rem 0 0;
}

.theme-feedback[data-state="saved"] {
  color: var(--primary-ink);
}

.theme-feedback[data-state="error"] {
  color: var(--coral);
}

.theme-choice-list {
  border-top: 1px solid var(--line);
  column-gap: 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-choice {
  align-items: center;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 18px 74px minmax(0, 1fr);
  min-height: 68px;
  padding: 0.75rem 0;
}

.theme-choice input {
  accent-color: var(--primary);
  height: 17px;
  margin: 0;
  width: 17px;
}

.theme-swatches {
  display: flex;
  gap: 4px;
}

.theme-swatches span {
  background: var(--theme-swatch);
  border: 1px solid rgba(31, 41, 59, 0.12);
  border-radius: 4px;
  display: block;
  height: 28px;
  width: 20px;
}

.theme-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.theme-copy strong {
  font-size: 0.8rem;
}

.theme-copy small {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

.field-wide {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label,
.label-row label {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 750;
}

.field input,
.field select,
.field textarea,
.search-field input {
  background: var(--control-background);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  width: 100%;
}

.notice-warning {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

.field textarea {
  line-height: 1.5;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.search-field input:hover {
  border-color: #9fadaa;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus {
  border-color: var(--teal);
  outline: 3px solid var(--focus-ring);
}

.holiday-layout {
  align-items: start;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
}

.holiday-form {
  padding: 1.4rem;
}

.holiday-section-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
}

.holiday-section-heading h2,
.holiday-summary h2,
.nearby-panel h2,
.holiday-history h2 {
  font-size: 1rem;
  letter-spacing: 0;
  margin: 0;
}

.holiday-live-label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.7rem;
  gap: 0.4rem;
}

.holiday-live-label > span {
  background: var(--teal);
  border-radius: 50%;
  height: 7px;
  width: 7px;
}

.holiday-date-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

.holiday-date-block {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
}

.portion-fieldset {
  border: 0;
  margin: 1rem 0 0;
  min-width: 0;
  padding: 0;
}

.portion-fieldset legend {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 750;
  margin-bottom: 0.4rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented-control input {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.segmented-control label {
  background: var(--control-background);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 750;
  min-width: 0;
  padding: 0.5rem 0.3rem;
  text-align: center;
}

.segmented-control label:first-of-type {
  border-radius: 5px 0 0 5px;
}

.segmented-control label:last-of-type {
  border-radius: 0 5px 5px 0;
}

.segmented-control label + input + label {
  border-left: 0;
}

.segmented-control input:checked + label {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--primary-ink);
}

.segmented-control input:focus-visible + label {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.holiday-notes {
  margin-top: 1rem;
}

.holiday-approvers {
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
  padding-top: 1.1rem;
}

.holiday-approvers .label-row > strong {
  font-size: 0.78rem;
}

.holiday-muted {
  color: var(--muted);
  font-size: 0.76rem;
  margin: 0.65rem 0 0;
}

.approver-list {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.8rem;
}

.approver-item {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  min-width: 0;
}

.approver-item > span:last-child,
.nearby-person {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.approver-item strong,
.nearby-person strong {
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approver-item small,
.nearby-person small {
  color: var(--muted);
  font-size: 0.66rem;
  margin-top: 0.15rem;
}

.holiday-actions {
  margin-top: 1.5rem;
}

.holiday-delete {
  margin-right: auto;
}

.absence-impact {
  border-top: 1px solid var(--line);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
}

.absence-impact[hidden] {
  display: none;
}

.holiday-preview {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}

.holiday-summary,
.nearby-panel {
  padding: 1.2rem;
}

.holiday-status {
  background: var(--surface-subtle);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  padding: 0.25rem 0.4rem;
}

.holiday-total {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-bottom: 1rem;
}

.holiday-total strong {
  color: var(--primary-ink);
  font-size: 2.2rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.holiday-total span {
  color: var(--muted);
  font-size: 0.76rem;
}

.balance-row {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 0;
}

.balance-row-heading {
  align-items: center;
  display: flex;
  font-size: 0.78rem;
  justify-content: space-between;
}

.balance-row-heading span,
.balance-row-detail {
  color: var(--muted);
  font-size: 0.68rem;
}

.balance-row > strong {
  font-size: 0.76rem;
}

.allowance-warning,
.preview-error {
  background: var(--coral-soft);
  border: 1px solid #ecc6c0;
  border-radius: 6px;
  color: #8e2d26;
  font-size: 0.74rem;
  margin-top: 1rem;
  padding: 0.75rem;
}

.allowance-warning {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.allowance-warning[hidden],
.preview-error[hidden] {
  display: none;
}

.nearby-heading {
  align-items: flex-start;
}

.nearby-window {
  color: var(--muted);
  font-size: 0.7rem;
  margin: 0.7rem 0 0;
}

.nearby-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.nearby-group h3,
.request-away-group h3 {
  color: var(--ink);
  font-size: 0.7rem;
  margin: 0;
}

.nearby-group-empty {
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  margin: 0.45rem 0 0;
  padding-top: 0.7rem;
}

.nearby-item {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  padding: 0.7rem 0;
}

.nearby-item .avatar {
  height: 32px;
  width: 32px;
}

.nearby-dates {
  color: var(--muted);
  font-size: 0.68rem;
  text-align: right;
}

.nearby-empty {
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.holiday-history {
  margin-top: 1.5rem;
}

.holiday-history > .section-heading {
  margin-bottom: 0.8rem;
}

.holiday-history-table {
  table-layout: fixed;
}

.field > span {
  color: var(--coral);
  font-size: 0.7rem;
}

.label-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.label-row > span {
  color: var(--muted);
  font-size: 0.68rem;
}

.checkbox-field {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 0.7rem;
  padding: 0.8rem;
}

.checkbox-field input {
  accent-color: var(--teal);
  height: 17px;
  margin: 0.1rem 0 0;
  width: 17px;
}

.checkbox-field span {
  display: flex;
  flex-direction: column;
}

.checkbox-field strong {
  font-size: 0.78rem;
}

.checkbox-field small {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.2rem;
}

.dialog-actions,
.form-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.3rem;
  padding-top: 1rem;
}

.absence-date-tile {
  background: color-mix(in srgb, var(--absence-colour) 14%, var(--surface));
  color: var(--absence-colour);
}

.absence-form {
  margin-top: 1rem;
  max-width: 820px;
}

.absence-notes {
  margin-top: 1rem;
}

.absence-notes p {
  margin: 0.45rem 0 0;
  white-space: pre-wrap;
}

.calendar-page-header {
  margin-bottom: 1.35rem;
}

.calendar-toolbar {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  min-height: 64px;
  padding: 0.7rem;
}

.calendar-period-controls {
  align-items: center;
  display: flex;
  gap: 0.55rem;
  min-width: 0;
}

.calendar-period-controls h2 {
  font-size: 1rem;
  margin: 0 0 0 0.45rem;
  min-width: 0;
}

.calendar-toolbar .icon-button {
  flex: 0 0 auto;
  font-size: 1.05rem;
}

.calendar-scope {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(4, 1fr);
}

.calendar-scope a {
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  min-width: 64px;
  padding: 0.52rem 0.65rem;
  text-align: center;
}

.calendar-scope a:first-child {
  border-radius: 5px 0 0 5px;
}

.calendar-scope a:last-child {
  border-radius: 0 5px 5px 0;
}

.calendar-scope a + a {
  border-left: 0;
}

.calendar-scope a.active {
  background: var(--teal-soft);
  color: var(--primary-ink);
}

.calendar-workspace {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: 250px minmax(0, 1fr);
}

.calendar-filters,
.calendar-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-filters {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1rem;
  position: sticky;
  top: 1rem;
}

.calendar-filter-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
}

.calendar-filter-heading .eyebrow {
  margin-bottom: 0.2rem;
}

.calendar-filter-heading h2 {
  font-size: 0.95rem;
  margin: 0;
}

.calendar-filter-heading > span {
  color: var(--muted);
  font-size: 0.67rem;
}

.calendar-team-list {
  margin-top: 0.8rem;
}

.calendar-team {
  border-top: 1px solid var(--line);
}

.calendar-team:last-child {
  border-bottom: 1px solid var(--line);
}

.calendar-team-heading {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  padding: 0.65rem 0;
}

.calendar-team-disclosure {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex: 0 0 26px;
  height: 26px;
  justify-content: center;
  padding: 0;
}

.calendar-team-disclosure::after {
  border-bottom: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  content: "";
  height: 6px;
  transform: rotate(45deg);
  transition: transform 140ms ease;
  width: 6px;
}

.calendar-team-disclosure[aria-expanded="true"]::after {
  transform: rotate(225deg);
}

.calendar-team-disclosure:hover {
  background: var(--surface-subtle);
}

.calendar-team-heading > label {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  flex: 1;
  gap: 0.55rem;
  min-width: 0;
}

.calendar-team input,
.calendar-people-list input,
.calendar-type-list input {
  accent-color: var(--teal);
  flex: 0 0 auto;
  height: 16px;
  margin: 0.08rem 0 0;
  width: 16px;
}

.calendar-team-heading span {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.calendar-team-heading strong {
  font-size: 0.74rem;
}

.calendar-team-heading small {
  color: var(--muted);
  font-size: 0.64rem;
  margin-top: 0.1rem;
}

.calendar-people-list {
  display: grid;
  gap: 0.5rem;
  padding: 0 0 0.75rem 1.55rem;
}

.calendar-people-list[hidden] {
  display: none;
}

.calendar-people-list label,
.calendar-type-list label {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  min-width: 0;
}

.calendar-people-list span,
.calendar-type-list > label > span:last-of-type {
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-type-heading {
  margin-top: 1.35rem;
}

.calendar-type-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.calendar-type-list .colour-swatch {
  flex: 0 0 auto;
}

.calendar-holiday-swatch {
  --swatch-colour: var(--teal);
}

.calendar-type-list small {
  color: var(--muted);
  font-size: 0.61rem;
  margin-left: auto;
}

.calendar-type-list .filter-disabled {
  opacity: 0.68;
}

.calendar-filter-actions {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr 1fr;
  margin-top: 1.25rem;
}

.calendar-filter-error {
  font-size: 0.72rem;
  margin: 0.65rem 0 0;
}

.calendar-surface {
  min-height: 590px;
  overflow: hidden;
}

.calendar-empty {
  margin: 18vh auto;
  max-width: 360px;
  padding: 1rem;
  text-align: center;
}

.calendar-empty h2 {
  font-size: 1.1rem;
  margin: 0;
}

.calendar-empty > p:last-child {
  color: var(--muted);
  font-size: 0.78rem;
}

.calendar-day-view {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 590px;
}

.calendar-day-summary {
  align-items: center;
  background: var(--feature);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1rem;
}

.calendar-day-summary > span {
  color: var(--feature-muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.calendar-day-summary > strong {
  font-size: 4rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 0.45rem 0;
}

.calendar-day-summary > small {
  color: var(--feature-muted);
  font-size: 0.72rem;
}

.calendar-day-content {
  padding: 1.25rem;
}

.bank-holiday-banner {
  align-items: center;
  background: var(--gold-soft);
  border: 1px solid #e7d69e;
  border-radius: 6px;
  color: #6a4d0f;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  padding: 0.65rem 0.75rem;
}

.bank-holiday-banner span {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bank-holiday-banner strong {
  font-size: 0.76rem;
}

.calendar-day-entries {
  display: grid;
}

.calendar-day-entry {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 5px minmax(0, 1fr) minmax(110px, auto);
  padding: 0.8rem 0;
}

.calendar-day-entry:first-child {
  border-top: 1px solid var(--line);
}

.calendar-entry-colour {
  align-self: stretch;
  background: var(--entry-colour);
  border-radius: 3px;
  min-height: 34px;
}

.calendar-day-entry > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.calendar-day-entry > div:last-child {
  text-align: right;
}

.calendar-day-entry strong {
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-entry small {
  color: var(--muted);
  font-size: 0.66rem;
  margin-top: 0.15rem;
}

.calendar-no-entries {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  padding: 3rem 1rem;
  text-align: center;
}

.calendar-no-entries strong {
  color: var(--ink);
  font-size: 0.85rem;
}

.calendar-no-entries span {
  font-size: 0.72rem;
  margin-top: 0.3rem;
}

.calendar-week-scroll {
  overflow-x: auto;
}

.calendar-week {
  border-collapse: collapse;
  min-width: 900px;
  table-layout: fixed;
  width: 100%;
}

.calendar-week th,
.calendar-week td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  height: 84px;
  padding: 0.55rem;
  vertical-align: top;
}

.calendar-week th:first-child {
  text-align: left;
  width: 150px;
}

.calendar-week thead th {
  background: var(--surface-subtle);
  height: 64px;
  text-align: center;
}

.calendar-week thead th span,
.calendar-week tbody th small {
  color: var(--muted);
  display: block;
  font-size: 0.62rem;
}

.calendar-week thead th strong {
  display: block;
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.calendar-week tbody th strong {
  display: block;
  font-size: 0.72rem;
}

.calendar-week .weekend {
  background: var(--weekend-background);
}

.calendar-entry-pill {
  background: color-mix(in srgb, var(--entry-colour) 12%, var(--surface));
  border: 0;
  border-left: 3px solid var(--entry-colour);
  border-radius: 3px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  margin-bottom: 0.25rem;
  max-width: 100%;
  padding: 0.35rem;
  text-align: left;
  width: 100%;
}

.calendar-entry-pill span {
  font-size: 0.64rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.calendar-entry-pill small {
  color: var(--muted);
  font-size: 0.57rem;
  margin-top: 0.1rem;
}

.calendar-bank-holiday-row th,
.calendar-bank-holiday-row td {
  background: var(--gold-soft);
  height: 54px;
}

.calendar-bank-holiday-row button {
  background: transparent;
  border: 0;
  color: #6a4d0f;
  cursor: pointer;
  font-size: 0.61rem;
  font-weight: 750;
  padding: 0;
}

.calendar-month {
  min-width: 620px;
}

.calendar-weekdays,
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  padding: 0.7rem;
  text-align: right;
}

.calendar-month-grid {
  min-height: 535px;
}

.calendar-date-cell {
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 106px;
  padding: 0.55rem;
  text-align: left;
}

.calendar-date-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-date-cell.empty {
  background: var(--surface-subtle);
}

.calendar-date-cell.weekend {
  background-color: var(--weekend-background);
}

.calendar-date-cell:hover,
.calendar-year-day:hover {
  box-shadow: inset 0 0 0 2px var(--teal);
}

.calendar-date-number {
  font-size: 0.72rem;
  font-weight: 750;
}

.calendar-date-cell.outside-month {
  background-image: linear-gradient(var(--calendar-muted-overlay), var(--calendar-muted-overlay));
}

.calendar-date-cell.outside-month .calendar-date-number {
  color: #929c99;
}

.calendar-date-cell > strong {
  align-self: flex-end;
  font-size: 0.68rem;
  margin-top: auto;
}

.bank-holiday-marker {
  color: var(--gold);
  font-size: 0.58rem;
  font-weight: 750;
  margin-top: 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heat-1 {
  background-color: var(--heat-1);
}

.heat-2 {
  background-color: var(--heat-2);
}

.heat-3 {
  background-color: var(--heat-3);
}

.heat-4 {
  background-color: var(--heat-4);
  color: #ffffff;
}

.calendar-date-cell.weekend.heat-1,
.calendar-date-cell.weekend.heat-2,
.calendar-date-cell.weekend.heat-3,
.calendar-date-cell.weekend.heat-4 {
  background-image: linear-gradient(rgba(230, 233, 232, 0.35), rgba(230, 233, 232, 0.35));
}

.calendar-year {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calendar-year-month {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 0;
  padding: 0.85rem;
}

.calendar-year-month:nth-child(3n) {
  border-right: 0;
}

.calendar-year-month h2 {
  font-size: 0.76rem;
  margin: 0 0 0.55rem;
}

.calendar-year-weekdays,
.calendar-year-grid {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-year-weekdays span {
  color: var(--muted);
  font-size: 0.5rem;
  padding-bottom: 0.18rem;
  text-align: center;
}

.calendar-year-day {
  align-items: center;
  aspect-ratio: 1;
  background-color: var(--surface-subtle);
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  container-type: inline-size;
  cursor: pointer;
  display: flex;
  font-size: 0.5rem;
  justify-content: center;
  min-width: 0;
  padding: 0;
  position: relative;
}

.calendar-year-day.heat-1 {
  background-color: var(--heat-1);
}

.calendar-year-day.heat-2 {
  background-color: var(--heat-2);
}

.calendar-year-day.heat-3 {
  background-color: var(--heat-3);
}

.calendar-year-day.heat-4 {
  background-color: var(--heat-4);
  color: #ffffff;
}

.calendar-year-day.empty {
  background: transparent;
}

.calendar-year-day > span:first-child {
  font-size: clamp(0.56rem, 28cqi, 0.86rem);
  line-height: 1;
}

.calendar-year-day > strong {
  align-items: center;
  aspect-ratio: 1;
  background: var(--calendar-count-background);
  border-radius: 50%;
  color: var(--calendar-count-ink);
  display: flex;
  font-size: 0.5rem;
  font-size: clamp(0.4rem, 24cqi, 0.62rem);
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: clamp(1px, 4cqi, 2px);
  top: clamp(1px, 4cqi, 2px);
  width: 16px;
  width: clamp(12px, 52cqi, 19px);
}

@container (max-width: 40px) {
  .calendar-year-day:has(> strong) > span:first-child {
    transform: translateX(-100%);
  }
}

.calendar-year-markers {
  bottom: 2px;
  display: grid;
  gap: 1px;
  left: 3px;
  pointer-events: none;
  position: absolute;
  right: 3px;
}

.calendar-year-markers > i {
  background: var(--calendar-marker-colour);
  border-radius: 999px;
  display: block;
  height: clamp(2px, 7cqi, 5px);
  width: 100%;
}

.calendar-detail-panel {
  background: var(--surface);
  bottom: 0;
  box-shadow: -12px 0 30px rgba(23, 32, 31, 0.15);
  max-width: 390px;
  overflow-y: auto;
  padding: 1.25rem;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(105%);
  transition: transform 180ms ease;
  width: calc(100% - 2rem);
  z-index: 60;
}

.calendar-detail-panel.open {
  transform: translateX(0);
}

.calendar-detail-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
}

.calendar-detail-heading h2 {
  font-size: 1rem;
  margin: 0;
}

.calendar-detail-backdrop {
  background: rgba(19, 44, 41, 0.34);
  border: 0;
  bottom: 0;
  cursor: default;
  display: none;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 50;
}

.calendar-detail-backdrop.open {
  display: block;
}

.validation-summary {
  border: 1px solid #ecc6c0;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-bottom: 0.8rem;
  padding: 0.7rem;
}

.validation-summary:empty {
  display: none;
}

.validation-summary ul {
  margin: 0;
  padding-left: 1.1rem;
}

.narrow-page {
  margin: 0 auto;
  max-width: 660px;
}

.narrow-page .page-title {
  margin: 1rem 0 1.5rem;
}

.back-link {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.empty-page {
  margin: 14vh auto 0;
  max-width: 620px;
  text-align: center;
}

.empty-page h1 {
  font-size: 2rem;
}

.empty-page > p:not(.eyebrow) {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.auth-page {
  background: var(--surface);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(460px, 1.05fr);
  min-height: 100vh;
}

.auth-intro {
  background: var(--sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
}

.auth-intro-login {
  justify-content: center;
  position: relative;
}

.auth-intro-login .auth-footnote {
  bottom: 3rem;
  left: 3rem;
  position: absolute;
  right: 3rem;
}

.auth-intro > div {
  max-width: 520px;
}

.auth-intro h1 {
  font-size: 2.7rem;
  line-height: 1.05;
  margin: 0;
  max-width: 480px;
}

.auth-intro > div > p:last-child {
  color: var(--sidebar-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 1rem 0 0;
  max-width: 480px;
}

.auth-footnote {
  color: var(--sidebar-subtle);
  display: flex;
  font-size: 0.72rem;
  justify-content: space-between;
  margin: 0;
}

.auth-form-wrap {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 3rem;
}

.auth-form {
  max-width: 420px;
  width: 100%;
}

.form-heading {
  margin-bottom: 1.7rem;
}

.form-heading h2 {
  font-size: 1.8rem;
  margin: 0;
}

.form-heading > p:last-child,
.form-note {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 0.45rem 0 0;
}

.auth-form .field {
  margin-bottom: 1rem;
}

.auth-form .button {
  margin-top: 0.5rem;
}

.form-note {
  text-align: center;
}

@media (max-width: 1100px) {
  .content {
    padding: 2rem;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric:nth-child(1),
  .metric:nth-child(2) {
    border-bottom: 0;
  }

  .metric:first-child {
    border-radius: 8px 0 0 0;
  }

  .metric:nth-child(2) {
    border-radius: 0 8px 0 0;
  }

  .metric:nth-child(3) {
    border-left: 1px solid var(--line);
    border-radius: 0 0 0 8px;
  }

  .metric:last-child {
    border-radius: 0 0 8px 0;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .holiday-layout {
    grid-template-columns: 1fr;
  }

  .holiday-preview {
    grid-template-columns: 1fr 1fr;
    position: static;
  }
}

.request-inbox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.request-inbox-item {
  align-items: center;
  color: var(--ink);
  display: grid;
  gap: 1rem;
  grid-template-columns: 38px minmax(105px, 0.8fr) minmax(160px, 1.15fr) minmax(130px, 0.8fr) auto;
  min-height: 78px;
  padding: 0.85rem 1rem;
  transition: background 140ms ease;
}

.request-inbox-item + .request-inbox-item {
  border-top: 1px solid var(--line);
}

.request-inbox-item:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.request-inbox-person,
.request-inbox-dates,
.request-inbox-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.request-inbox-person strong,
.request-inbox-dates strong {
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-inbox-person small,
.request-inbox-dates small,
.request-inbox-meta > small {
  color: var(--muted);
  font-size: 0.68rem;
  margin-top: 0.2rem;
}

.request-inbox-meta > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-inbox-statuses {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.request-inbox-statuses .status {
  font-size: 0.58rem;
  padding: 0.25rem 0.42rem;
}

.request-review {
  padding-top: 0.25rem;
}

.request-empty {
  align-items: center;
  display: flex;
  gap: 1rem;
  min-height: 180px;
}

.request-empty h2,
.request-empty p {
  margin: 0;
}

.request-empty h2 {
  font-size: 1rem;
}

.request-empty p {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.request-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.request-summary {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.2fr 0.7fr 1.2fr;
  margin: 1rem -1.25rem 0;
  padding: 1rem 1.25rem;
}

.request-summary > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.request-summary strong {
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.request-summary small,
.request-window {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.22rem;
}

.detail-label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  margin-bottom: 0.28rem;
  text-transform: uppercase;
}

.request-detail-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr 1fr;
  padding-top: 1.15rem;
}

.request-detail-grid h2 {
  font-size: 0.78rem;
  margin: 0 0 0.65rem;
}

.request-window {
  margin: -0.4rem 0 0.6rem;
}

.request-balance-list,
.request-away-list {
  display: grid;
  gap: 0.4rem;
}

.request-away-groups {
  display: grid;
  gap: 0.9rem;
}

.request-away-group > .holiday-muted {
  font-size: 0.7rem;
  margin: 0.35rem 0 0;
}

.request-away-group .request-away-list {
  margin-top: 0.4rem;
}

.request-balance-list > div {
  align-items: center;
  background: var(--surface-subtle);
  display: grid;
  font-size: 0.72rem;
  gap: 0.5rem;
  grid-template-columns: auto 1fr auto;
  padding: 0.58rem 0.65rem;
}

.request-balance-list > div > span:nth-child(2),
.request-away-list {
  color: var(--muted);
}

.request-away-list span {
  font-size: 0.72rem;
}

.request-away-list strong {
  color: var(--ink);
  margin-right: 0.3rem;
}

.request-notes {
  border-left: 3px solid var(--teal);
  margin-top: 1rem;
  padding: 0.15rem 0 0.15rem 0.75rem;
}

.request-notes p {
  font-size: 0.78rem;
  margin: 0;
  white-space: pre-wrap;
}

.request-decision {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(240px, 1fr) auto;
  margin-top: 1.15rem;
  padding-top: 1rem;
}

.request-decision .field label span {
  color: var(--muted);
  font-weight: 500;
}

.request-actions {
  display: flex;
  gap: 0.55rem;
}

.request-change {
  background: var(--gold-soft);
  border: 1px solid #ead8a7;
  border-radius: 6px;
  margin-top: 1rem;
  padding: 0.85rem;
}

.request-change-heading {
  align-items: center;
  display: flex;
  gap: 0.6rem;
}

.request-change-heading strong {
  font-size: 0.76rem;
}

.request-change-dates {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 0.75rem;
}

.request-change-dates > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.request-change-dates span,
.request-change-dates strong {
  font-size: 0.7rem;
}

.request-change-dates span {
  color: var(--muted);
}

.holiday-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.holiday-tabs a {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 750;
  gap: 0.45rem;
  padding: 0.7rem 0;
}

.holiday-tabs a.active {
  border-color: var(--teal);
  color: var(--primary-ink);
}

.holiday-tabs a span {
  align-items: center;
  background: var(--surface-disabled);
  border-radius: 4px;
  display: inline-flex;
  font-size: 0.64rem;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 0.3rem;
}

.holiday-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  overflow: hidden;
}

.holiday-list-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  gap: 1rem;
  grid-template-columns: 44px minmax(0, 1fr) auto 16px;
  min-height: 78px;
  padding: 0.8rem 1rem;
}

.holiday-list-item:last-child {
  border-bottom: 0;
}

.holiday-list-item:hover {
  background: var(--surface-subtle);
}

.holiday-list-date {
  height: 44px;
  width: 44px;
}

.holiday-list-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.holiday-list-main strong {
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.holiday-list-main small {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.2rem;
}

.holiday-list-arrow {
  color: var(--muted);
  font-size: 1.3rem;
}

.holidays-empty {
  align-items: center;
  display: flex;
  gap: 1rem;
  min-height: 180px;
}

.holidays-empty h2,
.holidays-empty p {
  margin: 0;
}

.holidays-empty h2 {
  font-size: 1rem;
  text-transform: capitalize;
}

.holidays-empty p {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

.holiday-details-header {
  align-items: flex-end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.holiday-details-header .page-title {
  margin-top: 1rem;
}

.holiday-overview {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr 1fr 0.7fr;
}

.profile-overview {
  grid-template-columns: 1fr 1fr;
}

.holiday-overview > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.holiday-overview strong {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.holiday-overview small {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.2rem;
}

.holiday-change-notice {
  align-items: baseline;
}

.holiday-timeline-section {
  margin-top: 1.5rem;
}

.holiday-timeline-section .section-heading h2 {
  font-size: 1rem;
  margin: 0;
}

.holiday-timeline {
  --timeline-gutter: 1.4rem;
  --timeline-line-x: 4px;
  list-style: none;
  margin: 1rem 0 0 0.5rem;
  padding: 0 0 0 var(--timeline-gutter);
  position: relative;
}

.holiday-timeline::before {
  background: var(--line-strong);
  content: "";
  height: calc(100% - 1rem);
  left: var(--timeline-line-x);
  position: absolute;
  top: 0.75rem;
  width: 1px;
}

.holiday-timeline > li {
  margin-bottom: 0.8rem;
  position: relative;
}

.timeline-marker {
  background: var(--teal);
  border: 3px solid var(--surface-subtle);
  border-radius: 50%;
  height: 11px;
  left: calc(var(--timeline-line-x) - var(--timeline-gutter) + 0.5px);
  position: absolute;
  top: 1.1rem;
  transform: translateX(-50%);
  width: 11px;
  z-index: 1;
}

.timeline-event {
  padding: 1rem;
}

.timeline-event header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.timeline-event header > div {
  display: flex;
  flex-direction: column;
}

.timeline-event header strong {
  font-size: 0.8rem;
}

.timeline-event header span,
.timeline-event time,
.timeline-dates {
  color: var(--muted);
  font-size: 0.68rem;
}

.timeline-event time {
  white-space: nowrap;
}

.timeline-dates {
  margin: 0.7rem 0 0;
}

.timeline-date-change {
  align-items: center;
  background: var(--surface-subtle);
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 0.8rem;
  padding: 0.7rem;
}

.timeline-date-change > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.timeline-date-change span {
  color: var(--muted);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.timeline-date-change strong {
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.timeline-note {
  border-left: 3px solid var(--teal);
  margin-top: 0.8rem;
  padding-left: 0.7rem;
}

.timeline-note span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline-note p {
  font-size: 0.76rem;
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .sidebar {
    box-shadow: 12px 0 34px rgba(31, 41, 59, 0.22);
    transform: translateX(-105%);
    transition: transform 160ms ease;
    visibility: hidden;
    width: min(280px, 86vw);
  }

  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }

  .mobile-header {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    height: 62px;
    justify-content: space-between;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .menu-button {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 750;
    min-height: 36px;
    padding: 0 0.7rem;
  }

  .content {
    margin-left: 0;
    padding: 1.5rem 1rem 3rem;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 1.5rem;
  }

  .page-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .page-title h1 {
    font-size: 1.65rem;
  }

  .metric-grid {
    gap: 0.75rem;
    grid-template-columns: 1fr 1fr;
  }

  .metric,
  .metric:first-child,
  .metric:nth-child(2),
  .metric:nth-child(3),
  .metric:last-child {
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 168px;
  }

  .metric-value {
    font-size: 2rem;
  }

  .section-heading {
    align-items: flex-start;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 0.7rem;
  }

  .search-field input {
    min-width: 0;
  }

  .row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .theme-choice-list {
    grid-template-columns: 1fr;
  }

  .allowance-year-row {
    grid-template-columns: 1fr 90px auto;
  }

  .allowance-year-row .button:first-of-type {
    grid-column: 1 / 3;
  }

  .allowance-year-readonly {
    grid-template-columns: 1fr auto;
  }

  .allowance-add-form {
    grid-template-columns: 1fr;
  }

  .holiday-date-grid,
  .holiday-preview {
    grid-template-columns: 1fr;
  }

  .request-summary,
  .request-detail-grid,
  .request-decision,
  .request-change-dates,
  .holiday-overview,
  .timeline-date-change {
    grid-template-columns: 1fr;
  }

  .holiday-details-header {
    align-items: stretch;
    flex-direction: column;
  }

  .holiday-details-header .status {
    align-self: flex-start;
  }

  .holiday-list-item {
    gap: 0.75rem;
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .holiday-list-item .status {
    grid-column: 2;
    justify-self: start;
  }

  .holiday-list-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .request-inbox-item {
    align-items: start;
    gap: 0.45rem 0.75rem;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 0.85rem;
  }

  .request-inbox-person {
    align-self: center;
  }

  .request-inbox-dates,
  .request-inbox-meta {
    grid-column: 2;
  }

  .request-inbox-dates strong {
    white-space: normal;
  }

  .request-inbox-item .holiday-list-arrow {
    grid-column: 3;
    grid-row: 1 / span 3;
  }

  .timeline-event header {
    flex-direction: column;
    gap: 0.35rem;
  }

  .request-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .request-actions .button {
    width: 100%;
  }

  .field-wide {
    grid-column: auto;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: 34vh;
    padding: 1.5rem;
  }

  .auth-intro h1 {
    font-size: 2rem;
    margin-top: 2.5rem;
  }

  .auth-intro-login .auth-footnote {
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
  }

  .auth-footnote {
    font-size: 0.68rem;
  }

  .auth-form-wrap {
    padding: 2rem 1.25rem 3rem;
  }
}

@media (max-width: 470px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 150px;
  }

  .leave-item {
    grid-template-columns: 44px 1fr;
  }

  .leave-dates {
    grid-column: 2;
    text-align: left;
  }

  .approver-list {
    grid-template-columns: 1fr;
  }

  .segmented-control label {
    font-size: 0.62rem;
    padding-inline: 0.15rem;
  }

  .dialog-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .calendar-subscription-link {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .calendar-subscription-link .button {
    width: 100%;
  }

  .admin-subsection {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions .button,
  .form-actions .button {
    width: 100%;
  }

  .holiday-delete {
    margin-right: 0;
  }
}

@media (max-width: 1180px) {
  .calendar-year {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-year-month:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .calendar-year-month:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 820px) {
  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-period-controls h2 {
    margin-left: auto;
    text-align: right;
  }

  .calendar-scope a {
    min-width: 0;
  }

  .calendar-workspace {
    grid-template-columns: 1fr;
  }

  .calendar-filters {
    max-height: none;
    position: static;
  }

  .calendar-team-list {
    display: grid;
    gap: 0 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-surface {
    min-height: 500px;
    overflow-x: auto;
  }

  .calendar-year {
    min-width: 620px;
  }
}

@media (max-width: 600px) {
  .calendar-period-controls {
    display: grid;
    grid-template-columns: 38px auto 38px;
  }

  .calendar-period-controls .button {
    width: 100%;
  }

  .calendar-period-controls h2 {
    grid-column: 1 / -1;
    margin: 0.25rem 0 0;
    text-align: left;
  }

  .calendar-team-list {
    grid-template-columns: 1fr;
  }

  .calendar-day-view {
    grid-template-columns: 1fr;
  }

  .calendar-day-summary {
    align-items: baseline;
    flex-direction: row;
    gap: 0.55rem;
    justify-content: flex-start;
    padding: 1rem;
  }

  .calendar-day-summary > strong {
    font-size: 2rem;
    margin: 0;
    order: -1;
  }

  .calendar-day-summary > small {
    margin-left: auto;
  }

  .calendar-date-cell {
    min-height: 88px;
  }

  .calendar-date-cell > strong {
    font-size: 0.6rem;
  }

  .calendar-detail-panel {
    border-radius: 8px 8px 0 0;
    bottom: 0;
    max-height: 78vh;
    max-width: none;
    top: auto;
    transform: translateY(105%);
    width: 100%;
  }

  .calendar-detail-panel.open {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
