:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-blue: #eef7ff;
  --text: #172033;
  --text-soft: #58657a;
  --text-faint: #667386;
  --line: #dce4ee;
  --line-strong: #c7d2df;
  --accent: #0875b5;
  --accent-strong: #005f91;
  --accent-soft: #dff2ff;
  --success: #157347;
  --success-soft: #e8f7ef;
  --danger: #b42332;
  --danger-soft: #fff0f1;
  --warning: #8a5b08;
  --warning-soft: #fff7df;
  --shadow-card: 0 1px 2px rgb(20 38 63 / 6%), 0 12px 30px rgb(31 55 84 / 7%);
  --shadow-dialog: 0 24px 80px rgb(9 30 54 / 24%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --nav-height: 72px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  overflow-x: clip;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--tg-theme-text-color, var(--text));
  background:
    radial-gradient(circle at 8% -8%, rgb(101 190 240 / 16%), transparent 30rem),
    var(--bg);
  overflow-x: clip;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--accent-strong);
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 28px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
  background: rgb(255 255 255 / 84%);
  border-bottom: 1px solid rgb(220 228 238 / 78%);
  backdrop-filter: blur(18px);
}

.brand,
.account {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand {
  gap: 10px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(145deg, #39a9e8, #0878bc);
  border: 1px solid rgb(0 90 148 / 18%);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgb(19 139 205 / 22%);
}

.brand-mark svg,
.button-icon svg,
.nav-icon svg,
.state-icon svg,
.meta-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.brand-copy,
.account-copy {
  min-width: 0;
}

.brand-name,
.account-name {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-context,
.account-role {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.2;
}

.account {
  gap: 9px;
  margin-left: 14px;
}

.account-copy {
  text-align: right;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #24506a;
  background: #dceffa;
  border: 1px solid #c2e2f4;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.page {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 34px 0 20px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.01em;
}

.eyebrow::before {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 4px var(--accent-soft);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 8px;
  font-size: clamp(27px, 4.5vw, 42px);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.hero-description {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 20px;
  padding: 14px;
  background: rgb(255 255 255 / 76%);
  border: 1px solid rgb(220 228 238 / 90%);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgb(28 52 80 / 5%);
  backdrop-filter: blur(12px);
}

.field {
  min-width: 0;
}

.field-label {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field-label-required::after {
  content: " *";
  color: var(--danger);
}

.input-shell {
  position: relative;
}

.input-shell .meta-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--text-faint);
  pointer-events: none;
  transform: translateY(-50%);
}

.control {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  transition-property: border-color, box-shadow, background-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.input-shell .control {
  padding-left: 44px;
}

.control::placeholder {
  color: #8a95a7;
  opacity: 1;
}

.control:hover:not(:disabled):not([readonly]) {
  border-color: #aebccc;
}

.control:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(22 138 205 / 20%);
}

.control[readonly] {
  color: var(--text-soft);
  background: var(--surface-soft);
}

.control[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgb(180 35 50 / 12%);
}

textarea.control {
  min-height: 92px;
  resize: vertical;
}

.button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: none;
  transition-property: transform, background-color, border-color, box-shadow, color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.64;
  transform: none;
}

.button:active {
  transform: scale(0.97);
}

.button:focus-visible,
.nav-link:focus-visible,
.tab:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid rgb(22 138 205 / 30%);
  outline-offset: 2px;
}

.button-primary {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 7px 16px rgb(22 138 205 / 20%);
}

.button-primary:hover {
  background: #00527d;
  box-shadow: 0 9px 20px rgb(22 138 205 / 25%);
}

.button-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-secondary:hover {
  background: var(--surface-soft);
  border-color: #aebccc;
}

.button-quiet {
  min-height: 44px;
  color: var(--accent-strong);
  background: transparent;
}

.button-small {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 13px;
}

.button-danger {
  color: #ffffff;
  background: var(--danger);
  box-shadow: 0 7px 16px rgb(180 35 50 / 16%);
}

.button-danger:hover {
  background: #941d29;
}

.button-danger-quiet {
  color: var(--danger);
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 26%, transparent);
}

.button-danger-quiet:hover {
  background: var(--danger-soft);
}

.button-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
}

.results-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  margin-bottom: 10px;
}

.results-title {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.results-count {
  color: var(--text-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.filter-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  color: #22516c;
  background: var(--accent-soft);
  border: 1px solid #bfe4f8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.absence-card {
  position: relative;
  min-width: 0;
  padding: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  animation: card-enter 240ms ease-out both;
}

.absence-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--type-color, var(--accent));
  content: "";
}

.card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.employee {
  display: flex;
  gap: 11px;
  min-width: 0;
  align-items: center;
}

.employee-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #28516a;
  background: var(--surface-blue);
  border: 1px solid #cbe8f7;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 780;
}

.employee-copy {
  min-width: 0;
}

.employee-name {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.01em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.employee-department {
  margin: 0;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.type-pill {
  flex: 0 0 auto;
  max-width: 46%;
  padding: 6px 9px;
  color: var(--type-text, #23516b);
  background: var(--type-soft, var(--accent-soft));
  border: 1px solid var(--type-line, #c3e5f7);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 740;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.type-trip {
  --type-color: #8d63d2;
  --type-soft: #f2edff;
  --type-line: #ded2fb;
  --type-text: #6440a4;
}

.type-day-off {
  --type-color: #d18316;
  --type-soft: #fff6df;
  --type-line: #f3ddb1;
  --type-text: #805009;
}

.type-sick {
  --type-color: #d05262;
  --type-soft: #fff0f2;
  --type-line: #f4ccd1;
  --type-text: #943746;
}

.card-meta {
  display: grid;
  gap: 9px;
  margin: 0;
}

.meta-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.35;
}

.meta-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--text-faint);
}

.dates {
  font-variant-numeric: tabular-nums;
}

.substitute strong {
  color: var(--text);
  font-weight: 700;
}

.card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.state-card {
  display: grid;
  justify-items: center;
  min-height: 260px;
  padding: 46px 24px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.state-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 17px;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 17px;
}

.state-icon svg {
  width: 25px;
  height: 25px;
}

.state-card h2 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 19px;
  text-wrap: balance;
}

.state-card p {
  max-width: 440px;
  margin-bottom: 18px;
  line-height: 1.55;
  text-wrap: pretty;
}

.error-state .state-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.loading-state {
  align-content: center;
}

.loader {
  position: relative;
  width: 36px;
  height: 36px;
  margin-bottom: 17px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: var(--nav-height);
  padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: rgb(255 255 255 / 94%);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgb(28 52 80 / 8%);
  backdrop-filter: blur(18px);
}

.bottom-nav.with-admin {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.nav-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 58px;
  padding: 5px 4px;
  color: var(--text-faint);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 670;
  line-height: 1.1;
  text-decoration: none;
  transition-property: color, background-color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-link:active {
  transform: scale(0.96);
}

.nav-link[aria-current="page"] {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
}

.nav-icon svg {
  width: 21px;
  height: 21px;
}

.dialog {
  width: min(100% - 28px, 620px);
  max-height: min(88dvh, 760px);
  margin: auto;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
}

.dialog-compact {
  width: min(100% - 28px, 500px);
}

.dialog-wide {
  width: min(100% - 28px, 760px);
}

.dialog::backdrop {
  background: rgb(14 30 49 / 48%);
  backdrop-filter: blur(3px);
}

.dialog[open] {
  animation: dialog-enter 180ms ease-out both;
}

.dialog-shell {
  display: grid;
  max-height: min(88dvh, 760px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.dialog-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.dialog-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.4;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  transition-property: background-color, color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.icon-button:hover {
  color: var(--text);
  background: #eef2f6;
}

.icon-button:active {
  transform: scale(0.96);
}

.dialog-body {
  padding: 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.confirm-copy {
  margin-bottom: 0;
  color: var(--text-soft);
  line-height: 1.55;
  text-wrap: pretty;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.field-full {
  grid-column: 1 / -1;
}

.field-hint {
  margin: 7px 2px 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.4;
}

.field-error {
  margin: 7px 2px 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.field-error[hidden] {
  display: none;
}

.form-error {
  margin: 0 0 14px;
  padding: 11px 12px;
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: var(--radius-sm);
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  z-index: 40;
  right: 16px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 14px);
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: min(380px, calc(100% - 32px));
  min-height: 48px;
  padding: 11px 14px;
  color: #0e5c3a;
  background: var(--success-soft);
  border: 1px solid #bde5ce;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-size: 14px;
  font-weight: 680;
  animation: toast-enter 180ms ease-out both;
}

.toast-mark {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #ffffff;
  background: var(--success);
  border-radius: 50%;
  font-size: 14px;
}

.admin-heading {
  margin-bottom: 22px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 18px;
}

.toggle-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-control {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  min-height: 58px;
  padding: 11px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.check-control:has(input:focus-visible) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(22 138 205 / 20%);
}

.check-control input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.check-control span {
  display: grid;
  gap: 2px;
}

.check-control strong {
  font-size: 13px;
  line-height: 1.35;
}

.check-control small {
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.35;
}

.tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  background: #e8edf3;
  border-radius: 12px;
}

.tab {
  min-height: 44px;
  padding: 9px 14px;
  color: var(--text-soft);
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition-property: color, background-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.tab[aria-selected="true"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 4px rgb(27 47 70 / 11%);
}

.table-shell {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table caption {
  padding: 16px 18px 8px;
  color: var(--text);
  font-size: 17px;
  font-weight: 750;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.status-badge {
  display: inline-flex;
  padding: 4px 8px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid #c6e8d4;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 720;
}

.access-shell {
  display: grid;
  width: min(100% - 32px, 540px);
  min-height: 100dvh;
  margin: 0 auto;
  place-content: center;
  text-align: center;
}

.access-card {
  padding: 38px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}

.access-card .state-icon {
  margin-right: auto;
  margin-left: auto;
  color: var(--warning);
  background: var(--warning-soft);
}

.access-card h1 {
  margin-bottom: 10px;
  font-size: 28px;
}

.access-card p {
  margin-bottom: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.access-action {
  margin-top: 20px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 760px) {
  .topbar {
    padding-right: max(28px, env(safe-area-inset-right));
    padding-left: max(28px, env(safe-area-inset-left));
  }

  .bottom-nav {
    right: auto;
    left: 50%;
    width: min(720px, calc(100% - 40px));
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    transform: translateX(-50%);
  }
}

@media (max-width: 759px) {
  .topbar {
    min-height: 58px;
  }

  .brand-context,
  .account-copy {
    display: none;
  }

  .page {
    width: min(100% - 24px, 580px);
    padding-top: 24px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-bottom: 17px;
  }

  .hero .button-primary {
    width: 100%;
  }

  h1 {
    font-size: 28px;
  }

  .hero-description {
    font-size: 14px;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr);
    padding: 11px;
  }

  .toolbar-search {
    grid-column: auto;
  }

  .toolbar .button-secondary {
    min-width: 0;
    width: 100%;
  }

  .toolbar .button-primary {
    display: none;
  }

  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .absence-card {
    padding: 16px;
  }

  .card-head {
    gap: 8px;
  }

  .type-pill {
    max-width: 42%;
  }

  .dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 18px);
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .dialog-shell {
    max-height: calc(100dvh - 18px);
  }

  .dialog-head {
    padding: 16px 14px 12px;
  }

  .dialog-body {
    padding: 15px 14px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-full {
    grid-column: auto;
  }

  .dialog-actions {
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  }

  .dialog-actions .button {
    flex: 1;
  }

  .toast {
    right: 12px;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 10px);
    left: 12px;
    max-width: none;
  }

  .tabs {
    display: grid;
    width: 100%;
  }

  .admin-toolbar,
  .toggle-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-toolbar {
    display: grid;
  }

  .admin-toolbar .button {
    width: 100%;
  }

  .table-shell {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .data-table {
    min-width: 720px;
  }
}

@media (max-width: 370px) {
  .brand-name {
    max-width: 138px;
  }

  .button-label-optional {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .card-head {
    display: grid;
  }

  .type-pill {
    max-width: 100%;
    justify-self: start;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111722;
    --surface: #1b2431;
    --surface-soft: #222d3b;
    --surface-blue: #173449;
    --text: #edf3f8;
    --text-soft: #b3c0cf;
    --text-faint: #91a0b2;
    --line: #303d4d;
    --line-strong: #415064;
    --accent: #38a9e9;
    --accent-strong: #69c4f5;
    --accent-soft: #15394e;
    --success: #5fd69a;
    --success-soft: #153c2d;
    --danger: #ff8591;
    --danger-soft: #492129;
    --warning: #f2bd5a;
    --warning-soft: #47371a;
    --shadow-card: 0 1px 2px rgb(0 0 0 / 16%), 0 12px 30px rgb(0 0 0 / 18%);
    --shadow-dialog: 0 24px 80px rgb(0 0 0 / 48%);
  }

  body {
    background:
      radial-gradient(circle at 8% -8%, rgb(30 132 190 / 16%), transparent 30rem),
      var(--bg);
  }

  .topbar,
  .bottom-nav {
    background: rgb(27 36 49 / 90%);
  }

  .toolbar {
    background: rgb(27 36 49 / 78%);
  }

  .avatar,
  .employee-avatar {
    color: #a8d9f3;
    background: #173449;
    border-color: #28516b;
  }

  .filter-chip {
    color: #a9daf5;
    border-color: #275b77;
  }

  .type-trip {
    --type-soft: #33284c;
    --type-line: #574575;
    --type-text: #d1bcfa;
  }

  .type-day-off {
    --type-soft: #47371c;
    --type-line: #6c5428;
    --type-text: #f1c56f;
  }

  .type-sick {
    --type-soft: #48262d;
    --type-line: #72404a;
    --type-text: #f3a4ad;
  }

  .button-primary {
    color: #08131b;
  }

  .button-secondary:hover,
  .icon-button:hover {
    background: #293647;
  }

  .tabs {
    background: #111923;
  }

  .toast {
    color: #a8edca;
    border-color: #2a694a;
  }

  .toast-mark {
    color: #0d2519;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .loader {
    border-color: var(--accent);
    border-top-color: transparent;
  }
}
