@font-face {
  font-family: Manrope;
  src: url('/manrope-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #111c30;
  --navy-active: #223552;
  --background: #f5f7fb;
  --paper: #fff;
  --ink: #17243a;
  --muted: #58677c;
  --quiet: #6a7890;
  --line: #e4eaf2;
  --blue: #2857d5;
  --blue-hover: #1d45bd;
  --radius: 14px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #547bf2;
  outline-offset: 3px;
}
button svg { flex: 0 0 auto; }
h1, h2, .brand, .metric strong { font-family: Manrope, 'Segoe UI', sans-serif; }
h1, h2, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: 234px;
  min-height: 100dvh;
  padding: 28px 16px 17px;
  background: var(--navy);
  color: #eef3ff;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 12px;
  background: #3866ee;
  box-shadow: 0 5px 13px #050e2940, inset 0 1px #ffffff30;
}
.brand strong { display: block; font-size: 1.44rem; font-weight: 800; line-height: 1.1; letter-spacing: -.04em; }
.brand small { display: block; color: #acbbd3; font-size: .75rem; font-weight: 650; margin-top: 4px; }
.nav-label {
  padding: 0 11px;
  margin: 45px 0 13px;
  color: #94a6c2;
  font-size: .75rem;
  letter-spacing: .09em;
  font-weight: 700;
  text-transform: uppercase;
}
.sidebar nav { display: grid; gap: 5px; }
.nav-item {
  display: flex;
  align-items: center;
  position: relative;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: #b2c0d6;
  background: transparent;
  font-size: .91rem;
  font-weight: 560;
  text-align: left;
}
.nav-item:hover { color: white; background: #1a2942; }
.nav-item.active { background: var(--navy-active); border-color: #32486a; color: #f5f8ff; font-weight: 680; }
.nav-item.active > svg { color: #aec6ff; }
.nav-count {
  margin-left: auto;
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 22px;
  border-radius: 6px;
  padding: 0 4px;
  background: #2a3a53;
  color: #e3ebfa;
  font-weight: 700;
  font-size: .76rem;
}
.sidebar-foot { position: relative; margin-top: auto; border-top: 1px solid #2b3950; padding-top: 15px; }
.profile {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #acbbd3;
  padding: 7px 6px;
  text-align: left;
}
.profile:hover { background: #1a2942; }
.profile > span:nth-child(2) { flex: 1; min-width: 0; }
.profile strong, .profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile strong { color: #f1f5ff; font-size: .9rem; font-weight: 650; }
.profile small { font-size: .77rem; margin-top: 2px; }
.profile-menu { position: absolute; bottom: 70px; width: 100%; background: #1c2a43; border: 1px solid #354760; border-radius: 9px; padding: 5px; }
.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 35px; height: 35px; border-radius: 50%; font-size: .75rem; font-weight: 750; }
.tone-0 { color: #2856ad; background: #e3edff; }
.tone-1 { color: #7142a8; background: #f0e7ff; }
.tone-2 { color: #236e62; background: #dff4ed; }
.tone-3 { color: #99542d; background: #faebdf; }
.tone-4 { color: #a0446e; background: #f9e6ef; }
.avatar.profile-avatar { width: 38px; height: 38px; color: #e5edff; background: #304e8a; border: 1px solid #4465aa; }
.menu-button, .scrim { display: none !important; }
.mobile-nav { display: none; }

.main { margin-left: 234px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 66px;
  padding: 0 34px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.breadcrumb { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--quiet); font-size: .9rem; }
.breadcrumb svg { color: #8998ad; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.mobile-company { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.notification-button { position: relative; width: 42px; height: 42px; }
@media (prefers-reduced-motion: no-preference) {
  .refresh-button[aria-busy=true] svg { animation: refresh-turn .8s linear infinite; }
  @keyframes refresh-turn { to { transform: rotate(1turn); } }
}
.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  padding: 1px 4px;
  border: 2px solid white;
  border-radius: 12px;
  background: var(--blue);
  color: white;
  font-size: .68rem;
  font-weight: 750;
  line-height: 1.35;
}
.demo-badge { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 5px 9px; border-radius: 20px; border: 1px solid #e1e8f7; background: #f4f7fd; color: #435b87; font-size: .78rem; font-weight: 650; }
.demo-badge i { width: 6px; height: 6px; border-radius: 50%; background: #587de3; }
.content { max-width: 1600px; margin: 0 auto; padding: 31px 34px 34px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 25px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
h1 { font-size: clamp(1.8rem, 3.1vw, 2.25rem); line-height: 1.15; font-weight: 800; letter-spacing: -.045em; }
h1:focus { outline: none; }
.page-heading p { color: var(--muted); margin-top: 8px; line-height: 1.5; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 680;
  white-space: nowrap;
  line-height: 1.3;
}
.primary { color: white; background: var(--blue); box-shadow: 0 2px 3px #172f7226; }
.primary:hover:enabled { background: var(--blue-hover); }
.neutral { color: #34455c; background: #fff; border-color: #dce4ef; }
.neutral:hover:enabled { background: #f3f6fc; border-color: #c8d5eb; }
.danger { color: #a2273d; background: #fff2f3; border-color: #f1cdd2; }
.danger:hover:enabled { background: #ffe2e7; }
.button.small { min-height: 33px; padding: 5px 11px; font-size: .875rem; }
.button.full { width: 100%; }
.text-button { color: #2454c9; border: 0; padding: 5px 3px; background: transparent; font-weight: 650; font-size: .875rem; }
.text-button:hover { text-decoration: underline; }
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 33px;
  height: 33px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid #dce4ef;
  color: #465976;
  background: white;
}
.icon-button:hover:enabled { background: #eef3fc; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric, .card { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); box-shadow: 0 2px 5px #1e386107; }
.metric { display: flex; align-items: center; min-width: 0; gap: 14px; padding: 15px 18px; min-height: 87px; }
.metric-icon, .activity-icon, .empty-icon { display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; }
.metric-icon { width: 44px; height: 44px; }
.metric-icon.blue { color: #315edb; background: #eaf0ff; }
.metric-icon.amber { color: #96611a; background: #fff1d8; }
.metric-icon.mint { color: #13705a; background: #dff6ee; }
.metric-label { display: block; color: var(--muted); font-size: .875rem; font-weight: 630; line-height: 1.25; }
.metric strong { display: block; margin-top: 4px; font-size: 1.58rem; font-weight: 800; line-height: 1; letter-spacing: -.035em; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 18px; align-items: start; }
.calendar-card { min-width: 0; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 17px 16px 13px; }
.month-controls { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.month-controls h2 { font-size: 1.22rem; letter-spacing: -.034em; font-weight: 800; }
.month-controls h2::first-letter { text-transform: uppercase; }
.period-controls { display: flex; gap: 8px; }
.pager { display: flex; }
.pager .icon-button:first-child { border-radius: 7px 0 0 7px; }
.pager .icon-button:last-child { border-radius: 0 7px 7px 0; margin-left: -1px; }
.pager .icon-button:focus-visible { z-index: 1; }
.segmented {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  gap: 2px;
  border-radius: 8px;
  border: 1px solid #e4eaf4;
  background: #f1f4f9;
}
.segmented button { display: inline-flex; align-items: center; gap: 5px; min-height: 27px; border: 1px solid transparent; border-radius: 5px; padding: 3px 8px; color: var(--muted); background: transparent; font-size: .875rem; font-weight: 630; }
.segmented button:hover { color: var(--blue); }
.segmented button[aria-pressed=true] { background: white; color: #2551bf; border-color: #e1e7f0; box-shadow: 0 1px 2px #152c6415; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 16px 14px; }
.filter-icon { display: inline-flex; color: #63758e; padding: 0 2px; }
.select-wrap { position: relative; min-width: 0; max-width: 210px; }
.select-wrap select { display: block; background: white; border: 1px solid #dce4ef; border-radius: 7px; padding: 6px 30px 7px 10px; font-size: .875rem; font-weight: 550; min-height: 34px; width: 100%; max-width: 100%; color: #3b4e67; appearance: none; text-overflow: ellipsis; }
.select-wrap > svg { position: absolute; pointer-events: none; right: 8px; top: 50%; transform: translateY(-50%); color: #63758e; }
.reset-filters { padding-left: 4px; }
.calendar-scroll { overflow-x: auto; }
.calendar-grid { min-width: 550px; }
.weekdays, .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays { background: #f4f7fb; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.weekdays span { padding: 9px 0; font-size: .875rem; font-weight: 680; text-align: center; color: #52647d; }
.week {
  grid-template-rows: 28px var(--event-rows) 5px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.day {
  grid-column: var(--column);
  grid-row: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 4px 5px 0;
  background: white;
  color: #2c3d56;
  text-align: left;
  min-width: 0;
}
.day:nth-child(7) { border-right: 0; }
.day.weekend { background: #f9fbfe; }
.day.outside { background: #f6f8fb; color: #78869a; }
.day.today { background: #f1f5ff; }
.day:hover { background: #edf3fe; }
.day:focus-visible { outline-offset: -2px; }
.day > span { display: grid; place-items: center; width: 24px; height: 24px; font-size: .88rem; font-weight: 620; }
.day.today > span { border-radius: 50%; background: var(--blue); color: white; font-weight: 730; }
.event {
  z-index: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  margin: 0 4px 3px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  text-align: left;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1;
}
.event:hover { filter: brightness(.95); }
.event span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-label > span, .event-time { display: block; }
.event-time { font-size: .69rem; line-height: 1; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.event-time-mobile { display: none; }
.event.permit { align-self: stretch; }
.event.vacation { align-self: start; height: 20px; }
.event i, .legend-dot, .status-pill i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; background: currentColor; }
.event.approved, .status-pill.approved { background: #ddf5ec; border-color: #cbece0; color: #0c624f; }
.event.pending, .status-pill.pending, .status-pill.withdrawal { background: #fff0d1; border-color: #f8dfaf; color: #865115; }
.status-pill.declined { color: #a12641; background: #fce8ed; border-color: #f6d4dd; }
.status-pill.cancelled { color: #506078; background: #eef2f8; border-color: #e3e9f2; }
.calendar-legend { display: flex; gap: 19px; align-items: center; padding: 12px 17px; color: #4c5f78; }
.calendar-legend span { display: flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 580; }
.legend-dot { width: 8px; height: 8px; }
.legend-dot.approved { background: #289476; }
.legend-dot.pending { background: #c58c33; }
.calendar-list { border-block: 1px solid var(--line); }
.calendar-list li + li { border-top: 1px solid var(--line); }
.absence-row { padding: 12px 16px; width: 100%; display: grid; grid-template-columns: auto minmax(80px, 1fr) max-content max-content auto; gap: 11px; align-items: center; text-align: left; background: transparent; border: 0; color: var(--ink); }
.absence-row:hover, .activity-row:hover { background: #f4f7fc; }
.row-date { color: var(--muted); font-size: .875rem; font-weight: 560; }
.absence-row > svg:last-child, .activity-row > svg:last-child { color: #8998ae; }

.activity-card header { display: flex; gap: 10px; align-items: center; padding: 15px 14px 13px; border-bottom: 1px solid var(--line); }
.activity-icon { width: 33px; height: 33px; border-radius: 8px; background: #ebf0ff; color: #345bc9; }
.activity-card h2 { font-size: 1rem; letter-spacing: -.025em; font-weight: 800; }
.activity-count { display: grid; place-items: center; min-width: 23px; padding: 0 5px; height: 22px; border-radius: 6px; font-size: .76rem; font-weight: 700; color: #865115; background: #fff0d1; margin-left: auto; }
.activity-list { padding: 0 12px; }
.activity-list li + li { border-top: 1px solid #ebeff5; }
.activity-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 3px;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  text-align: left;
  border: 0;
  background: transparent;
}
.row-identity { display: block; min-width: 0; flex: 1; }
.row-identity strong, .row-identity small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-identity strong { font-size: .9rem; font-weight: 700; }
.row-identity small { margin-top: 2px; color: var(--muted); font-size: .8rem; font-weight: 490; }
.activity-card footer { border-top: 1px solid var(--line); padding: 12px 14px; }
.activity-card footer .button { min-height: 36px; }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 44px 16px 48px; }
.empty-icon { margin-bottom: 5px; background: #edf2fd; color: #3b61bd; width: 45px; height: 45px; }
.empty p { color: var(--muted); line-height: 1.45; font-size: .9rem; }
.activity-card .empty { padding: 25px 12px; }
.activity-card .empty strong { font-size: .9rem; }

.table-scroll { overflow: auto; border-radius: inherit; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 14px 18px; }
th { background: #f2f5fa; font-size: .875rem; color: #50627a; font-weight: 700; white-space: nowrap; }
td { border-top: 1px solid var(--line); font-size: .94rem; }
.table-time { display: block; color: var(--muted); margin-top: 3px; }
.person-cell { display: flex; gap: 9px; align-items: center; }
.table-actions { text-align: right; }
.status-pill { display: inline-flex; gap: 6px; align-items: center; border: 1px solid transparent; border-radius: 20px; padding: 3px 8px; font-size: .8rem; font-weight: 660; white-space: nowrap; }

dialog {
  width: min(470px, calc(100% - 28px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  box-shadow: 0 20px 75px #12284938;
}
dialog::backdrop { background: #14223b77; }
.modal-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 1.33rem; font-weight: 800; letter-spacing: -.035em; }
.modal-header p { color: var(--muted); margin-top: 5px; font-size: .94rem; line-height: 1.45; }
.close-button { border-color: transparent; }
.modal-body { padding: 20px; }
form, .credential-body { display: grid; gap: 14px; }
form label, .credential-body label { min-width: 0; }
form label, .credential-body label { display: block; font-size: .9rem; font-weight: 690; color: #34465f; }
input, textarea, form select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cfd9e8;
  border-radius: 8px;
  margin-top: 5px;
  min-height: 41px;
  color: var(--ink);
  background: white;
  font-weight: 500;
}
textarea { display: block; resize: vertical; }
.fields-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
form .account-manager-option { display: flex; align-items: flex-start; gap: 8px; }
.account-manager-option input { width: 17px; height: 17px; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: var(--blue); }
.account-manager-option small { display: block; }
.export-period { min-width: 0; padding: 0; margin: 0; border: 0; }
.type-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.type-field legend { color: #34465f; margin-bottom: 6px; font-size: .9rem; font-weight: 690; }
.type-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.type-options label { position: relative; cursor: pointer; }
.type-options input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; opacity: 0; }
.type-options label span { display: flex; gap: 6px; align-items: center; border: 1px solid #cfd9e8; border-radius: 8px; padding: 9px; min-height: 39px; }
.type-options input:checked + span { background: #edf3ff; border-color: #8faaf5; color: #244db4; }
.type-options input:focus-visible + span { outline: 2px solid #547bf2; outline-offset: 2px; }
.form-hint, .optional { color: var(--muted); font-size: .85rem; line-height: 1.45; font-weight: 500; }
.notification-settings { display: grid; gap: 9px; }
.notification-preference { grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.notification-preference .button { min-height: 41px; }
.notification-preference .form-error { grid-column: 1 / -1; }
.notification-toolbar { display: flex; justify-content: flex-end; margin-top: 10px; }
.notification-list { margin-top: 9px; border: 1px solid var(--line); border-radius: 10px; }
.notification-list li + li { border-top: 1px solid var(--line); }
.notification-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 11px 13px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.notification-row.unread { background: #eef4ff; }
.notification-row:hover { background: #e8efff; }
.notification-text { display: grid; gap: 3px; overflow-wrap: anywhere; }
.notification-text span { font-size: .9rem; }
.notification-text small { color: var(--muted); font-size: .82rem; }
.notification-empty { padding-top: 14px; }
.form-error { background: #fff2f3; color: #9b203b; padding: 9px 10px; border-radius: 7px; font-size: .9rem; line-height: 1.4; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.account-actions { justify-content: flex-start; }
.detail-heading { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.request-details { display: grid; gap: 10px; margin: 17px 0; }
.request-details div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.request-details dt { color: var(--muted); font-size: .875rem; }
.request-details dd { font-size: .94rem; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-list { padding: 0; margin-bottom: 14px; }
.code-input { font: 500 .85rem Consolas, monospace; }
.toast {
  position: fixed;
  z-index: 10;
  right: 18px;
  bottom: 18px;
  max-width: calc(100% - 36px);
  padding: 12px 16px;
  border-radius: 9px;
  color: white;
  background: #184b42;
  box-shadow: 0 6px 20px #102a4730;
  font-weight: 620;
  line-height: 1.4;
}
.toast.error { background: #8a263e; }
.loading-screen, .auth-screen { display: grid; place-content: center; gap: 14px; min-height: 100dvh; padding: 24px; }
.loading-screen { text-align: center; color: var(--muted); }
.auth-screen { background: radial-gradient(ellipse at 58% 14%, #e6eeff 0%, #f5f7fb 63%); }
.auth-card { width: min(100%, 420px); background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 16px 40px #1e386118; }
.auth-brand { background: var(--navy); color: #fff; padding: 22px; }
.auth-brand .brand { padding: 0; }
.auth-body { padding: 25px; }
.auth-body h1 { font-size: 1.76rem; }
.auth-body > p { margin: 8px 0 20px; color: var(--muted); line-height: 1.45; }

@media (min-width: 1450px) {
  .dashboard { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
}
@media (max-width: 1240px) {
  .sidebar { width: 206px; }
  .main { margin-left: 206px; }
  .content { padding-inline: 24px; }
  .topbar { padding-inline: 24px; }
  .dashboard { grid-template-columns: minmax(0, 1fr) 233px; gap: 14px; }
}
@media (max-width: 1080px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .activity-card { width: min(100%, 480px); }
}
@media (max-width: 800px), (pointer: coarse) and (max-width: 950px) and (max-height: 600px) {
  .sidebar { width: min(270px, 85vw); transform: translateX(-100%); visibility: hidden; overflow: auto; }
  .sidebar.open { transform: none; visibility: visible; }
  .main { margin-left: 0; }
  .menu-button { display: inline-grid !important; margin-right: 3px; }
  .scrim.visible { display: block !important; position: fixed; z-index: 4; inset: 0; border: 0; background: #12234570; }
  .topbar { height: 59px; }
}
@media (max-width: 600px), (pointer: coarse) and (max-width: 950px) and (max-height: 600px) {
  .topbar, .content { padding-left: max(13px, env(safe-area-inset-left)); padding-right: max(13px, env(safe-area-inset-right)); }
  .topbar { position: relative; min-height: calc(59px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .pull-indicator {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 2;
    transform: translateX(-50%);
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 0 2px 5px #1e386119;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 650;
    white-space: nowrap;
    pointer-events: none;
  }
  .content { padding-top: 20px; padding-bottom: calc(83px + env(safe-area-inset-bottom)); }
  .sidebar { padding-top: max(28px, env(safe-area-inset-top)); padding-bottom: max(17px, env(safe-area-inset-bottom)); }
  .mobile-nav {
    position: fixed;
    z-index: 3;
    inset: auto 0 0;
    display: flex;
    min-height: 58px;
    padding: 5px max(8px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: var(--paper);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 14px #18294c0d;
  }
  .mobile-nav button {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    padding: 4px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: .71rem;
    font-weight: 650;
    line-height: 1.15;
  }
  .mobile-nav button[aria-current] { background: #eaf0ff; color: #244ebd; }
  .mobile-nav-icon { display: flex; position: relative; }
  .mobile-nav-count {
    position: absolute;
    top: -3px;
    left: calc(100% - 2px);
    min-width: 15px;
    padding: 1px 3px;
    border-radius: 8px;
    background: #fff0d1;
    color: #865115;
    font-size: .67rem;
    font-weight: 750;
  }
  .breadcrumb { gap: 5px; }
  .breadcrumb > .desktop-company, .breadcrumb > svg, .breadcrumb > strong { display: none; }
  .mobile-company { display: inline; color: var(--ink); font-weight: 750; }
  .topbar-actions .demo-badge { display: none; }
  .export-button { min-height: 44px; min-width: 44px; padding: 0; }
  .export-button span { display: none; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 11px; margin-bottom: 17px; }
  .page-heading p { display: none; }
  .heading-actions { width: 100%; }
  .heading-actions > .button { flex: 1 1 auto; min-height: 44px; padding-inline: 10px; }
  .calendar-header { flex-wrap: wrap; gap: 8px; padding: 11px 10px; }
  .month-controls { gap: 8px; justify-content: space-between; width: 100%; }
  .month-controls h2 { font-size: 1.09rem; }
  .icon-button, .calendar-header .button, .segmented button { min-height: 44px; }
  .icon-button { min-width: 44px; }
  .calendar-grid { min-width: 0; }
  .weekdays span { font-size: .78rem; }
  .day { justify-content: center; padding-inline: 0; }
  .event { margin-inline: 1px; padding-inline: 2px; gap: 2px; font-size: .69rem; }
  .event > i, .event > svg, .event-time { display: none; }
  .event-time-mobile { display: block; font-size: .64rem; margin-top: 3px; }
  .calendar-legend { flex-wrap: wrap; gap: 7px 13px; padding-inline: 10px; }
  .absence-row { grid-template-columns: auto minmax(0, 1fr) max-content; padding: 10px; gap: 7px; min-height: 60px; }
  .absence-row .row-date { grid-column: 2; grid-row: 2; }
  .absence-row .status-pill { grid-column: 3; grid-row: 1; }
  .absence-row > svg:last-child { display: none; }
  .calendar-card .calendar-list { border-bottom: 0; }
  .compact-history { border-radius: inherit; overflow: hidden; }
  .compact-history li + li { border-top: 1px solid var(--line); }
  .compact-absence {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 60px;
    padding: 10px 13px;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
  }
  .compact-absence:hover { background: #f4f7fc; }
  .compact-absence:focus-visible { outline-offset: -3px; }
  .compact-absence strong { display: block; overflow-wrap: anywhere; font-size: .95rem; }
  .compact-absence .row-date { display: block; margin-top: 3px; color: var(--muted); font-size: .85rem; }
  .table-scroll table, .table-scroll tbody { display: block; }
  .table-scroll thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .table-scroll tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 10px 12px; padding: 14px; }
  .table-scroll tbody tr + tr { border-top: 1px solid var(--line); }
  .table-scroll td { min-width: 0; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .table-scroll td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: .76rem; font-weight: 650; color: var(--muted); }
  .table-scroll td.cell-person { grid-column: 1 / -1; }
  .table-scroll .table-actions .button { min-height: 44px; }
  dialog {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: 90dvh;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    overscroll-behavior-y: contain;
  }
  .modal-header, .modal-body { padding: 14px; }
  form input, form textarea, form select, .credential-body input { font-size: 1rem; min-height: 44px; }
  .modal-actions .button, .type-options label span, .notification-settings .button { min-height: 44px; }
  .toast { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .auth-screen { padding-top: max(14px, env(safe-area-inset-top)); }
}

@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) and (max-width: 600px),
    (display-mode: standalone) and (pointer: coarse) and (max-width: 950px) and (max-height: 600px) {
    .topbar {
      /* Keep the solid header at the viewport edge and controls clear of the status bar. */
      --top-clearance: calc(env(safe-area-inset-top) + 16px);
      position: sticky;
      top: 0;
      z-index: 2;
      min-height: calc(59px + var(--top-clearance));
      padding-top: var(--top-clearance);
    }
  }
}
