:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --panel-soft: #f8fafb;
  --text: #17212b;
  --muted: #647382;
  --border: #dce3e8;
  --brand: #163f63;
  --brand-hover: #0f334f;
  --brand-soft: #eaf1f6;
  --brand-contrast: #ffffff;
  --success: #24734a;
  --success-bg: #e8f5ed;
  --warning: #966012;
  --warning-bg: #fff4db;
  --danger: #a23d3d;
  --danger-bg: #fdecec;
  --vacation: #5368a9;
  --vacation-bg: #edf0fb;
  --purple: #72549a;
  --purple-bg: #f2ecf8;
  --shadow: 0 10px 30px rgba(30, 50, 70, .07);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.45; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(1.65rem, 3vw, 2.1rem); line-height: 1.18; font-weight: 600; letter-spacing: -.025em; }
h2 { margin-bottom: 4px; font-size: 1.07rem; font-weight: 600; }
h3 { margin: 4px 0 0; font-size: .93rem; font-weight: 600; }
p { margin-bottom: 0; }
.muted { color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { position: sticky; top: 0; z-index: 30; height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -.01em; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; color: var(--brand-contrast); background: var(--brand); font-weight: 700; }
.account { display: flex; align-items: center; gap: 10px; color: var(--text); }
.account-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border: 1px solid transparent; border-radius: 50%; }
.account-icon:hover { background: var(--panel-soft); border-color: var(--brand); }
.account-icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.account-copy { display: grid; text-align: right; }
.account-copy strong { font-size: .86rem; font-weight: 600; }
.account-copy small { color: var(--muted); }
.avatar, .mini-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--brand); background: var(--brand-soft); font-weight: 650; }
.avatar { width: 36px; height: 36px; font-size: .78rem; }
.mini-avatar { width: 34px; height: 34px; font-size: .74rem; }
.mobile-menu-button { display: none; min-height: 42px; align-items: center; gap: 7px; padding: 7px 10px; color: var(--text); background: transparent; border: 1px solid var(--border); border-radius: 8px; }

.app-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 66px); }
.sidebar { position: sticky; top: 66px; height: calc(100vh - 66px); display: flex; flex-direction: column; justify-content: space-between; padding: 22px 14px; background: var(--panel); border-right: 1px solid var(--border); overflow-y: auto; }
.nav-label { padding: 0 11px; margin: 17px 0 7px; color: var(--muted); font-size: .7rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; text-align: left; text-decoration: none; cursor: pointer; }
.nav-item > span { width: 19px; color: inherit; text-align: center; font-size: 1rem; }
.nav-item:hover { color: var(--brand); background: var(--panel-soft); }
.nav-item.is-active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.logout-form { margin-top: 30px; }
.nav-button { font: inherit; }
.backdrop { display: none; }

.content { min-width: 0; }
.page { width: min(1240px, 100%); margin: 0 auto; padding: 30px; }
.narrow-page { width: min(900px, 100%); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading p:not(.eyebrow), .panel-heading p, .calendar-panel p { color: var(--muted); }
.eyebrow { margin-bottom: 5px; color: var(--brand); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 19px; border-bottom: 1px solid var(--border); }
.panel-heading p { font-size: .86rem; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; cursor: pointer; transition: border-color .15s, background-color .15s, transform .15s; }
.button:hover { border-color: var(--brand); }
.button:active { transform: translateY(1px); }
.button.is-loading, button.is-loading { pointer-events: none; opacity: .72; }
.button.is-loading::before, button.is-loading::before { width: 14px; height: 14px; content: ""; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }
.button-primary { color: var(--brand-contrast); background: var(--brand); border-color: var(--brand); }
.button-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.button-secondary { background: var(--panel); }
.button-small { min-height: 34px; padding: 6px 10px; font-size: .82rem; }
.button-large { min-height: 50px; padding: 12px 20px; }
.button-full { width: 100%; }

.month-workspace { display: grid; gap: 18px; }
.month-panel { box-shadow: none; }
.month-toolbar { min-height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.month-toolbar h2 { margin: 0; font-size: 1.12rem; text-transform: capitalize; }
.month-navigation { display: flex; align-items: center; gap: 7px; }
.month-navigation a { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px; color: var(--text); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; font-size: 1.25rem; }
.month-navigation a:hover { color: var(--brand); border-color: var(--brand); }
.month-navigation .today-button { font-size: .82rem; }
.month-weekdays, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-weekdays span { padding: 10px 12px; color: var(--muted); background: var(--panel-soft); border-right: 1px solid var(--border); text-align: left; font-size: .72rem; font-weight: 650; }
.month-weekdays span:last-child { border-right: 0; }
.month-day { position: relative; min-width: 0; min-height: 112px; display: block; padding: 9px; color: var(--text); background: var(--panel); border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0; text-align: left; cursor: pointer; overflow: hidden; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day:nth-last-child(-n + 7) { border-bottom: 0; }
.month-day:hover { background: var(--panel-soft); }
.month-day.outside { color: #a6b0b8; background: var(--panel-soft); }
.month-day.weekend { background: var(--panel-soft); }
.month-day.selected { box-shadow: inset 0 0 0 2px var(--brand); z-index: 1; }
.month-day.today .month-day-number { color: var(--brand-contrast); background: var(--brand); }
.month-day-number { width: 27px; height: 27px; display: grid; place-items: center; margin-bottom: 6px; border-radius: 50%; font-size: .8rem; font-weight: 600; }
.month-events { display: grid; gap: 4px; }
.month-event { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 3px 5px; border-radius: 4px; font-size: .67rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-event i { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.event-confirmed { color: var(--success); background: var(--success-bg); }
.event-warning { color: var(--warning); background: var(--warning-bg); }
.event-vacation { color: var(--vacation); background: var(--vacation-bg); }
.event-muted { color: var(--muted); background: transparent; }
.month-mobile-dots { display: none; }
.calendar-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: currentColor; }
.dot-confirmed { color: var(--success); }
.dot-warning { color: var(--warning); }
.dot-vacation { color: var(--vacation); }
.calendar-legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: .7rem; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }

.day-results { min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { min-width: 0; padding: 14px 15px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.stat span { display: block; color: var(--muted); font-size: .77rem; }
.stat strong { display: block; margin: 3px 0; font-size: 1.55rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat small { display: block; overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.team-panel { box-shadow: none; }
.team-heading { align-items: flex-end; }
.compact-field { display: grid; gap: 5px; color: var(--muted); font-size: .74rem; }
input, select, textarea { min-height: 42px; width: 100%; padding: 9px 11px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[readonly] { color: var(--muted); background: var(--panel-soft); }
.compact-field select { min-width: 155px; }
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 17px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: var(--panel-soft); font-size: .73rem; font-weight: 650; letter-spacing: .02em; }
tbody tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.person strong, .person small { display: block; }
.person strong { font-size: .88rem; font-weight: 600; }
.person small { color: var(--muted); font-size: .72rem; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-confirmed { color: var(--success); background: var(--success-bg); }
.status-pending { color: var(--warning); background: var(--warning-bg); }
.status-expired { color: var(--danger); background: var(--danger-bg); }
.status-vacation { color: var(--vacation); background: var(--vacation-bg); }
.status-reopened { color: var(--purple); background: var(--purple-bg); }
.status-future, .status-non-working { color: var(--muted); background: var(--panel-soft); }
.empty-state { padding: 45px 20px; text-align: center; }
.empty-state p { margin-top: 4px; color: var(--muted); }
.inline-success { padding: 11px 13px; margin-bottom: 12px; color: var(--success); background: var(--success-bg); border-radius: 8px; font-size: .85rem; }
.htmx-request:not(.global-loading) { opacity: .65; pointer-events: none; }
.global-loading { position: fixed; z-index: 200; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; opacity: 0; pointer-events: none; }
.global-loading span { display: block; width: 38%; height: 100%; background: var(--brand); transform: translateX(-110%); }
.global-loading.htmx-request { opacity: 1; }
.global-loading.htmx-request span { animation: loading-bar 1s ease-in-out infinite; }

.search-field { width: min(310px, 100%); }
.two-column { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr); align-items: start; gap: 18px; }
.form-panel { overflow: visible; }
.stacked-form { display: grid; gap: 16px; padding: 19px; }
.stacked-form label, .login-form label { display: grid; gap: 6px; color: var(--text); font-size: .82rem; font-weight: 600; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-error { padding: 10px 12px; color: var(--danger); background: var(--danger-bg); border-radius: 8px; }
.page-message { margin-bottom: 16px; }
.form-message { margin: 18px 19px 0; }
.form-help { display: grid; gap: 3px; padding: 13px; color: var(--muted); background: var(--panel-soft); border-radius: 8px; font-size: .8rem; }
.form-help strong { color: var(--text); }
.form-footer { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.checkbox-field { display: flex !important; align-items: flex-start; gap: 10px !important; padding: 12px; background: var(--panel-soft); border-radius: 8px; cursor: pointer; }
.checkbox-field input { width: 18px; height: 18px; min-height: 0; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--brand); }
.checkbox-field span, .checkbox-field strong, .checkbox-field small { display: block; }
.checkbox-field small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--brand); }
.vacation-list article, .holiday-list article, .audit-list article { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.vacation-list article:last-child, .holiday-list article:last-child, .audit-list article:last-child { border-bottom: 0; }
.vacation-list article > div, .holiday-list article > div:nth-child(2), .audit-list article > div { min-width: 0; flex: 1; }
.vacation-list strong, .vacation-list span, .vacation-list small, .holiday-list strong, .holiday-list span, .audit-list strong, .audit-list span, .audit-list small { display: block; }
.vacation-list span, .holiday-list span, .audit-list span { color: var(--muted); font-size: .82rem; }
.vacation-list small, .audit-list small { margin-top: 2px; color: var(--muted); font-size: .74rem; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 auto !important; gap: 7px; }
.row-actions form { margin: 0; }
.my-vacation-list article { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto; align-items: center; gap: 18px; padding: 17px 19px; border-bottom: 1px solid var(--border); }
.my-vacation-list article:last-child { border-bottom: 0; }
.my-vacation-list article > div:nth-child(2) strong, .my-vacation-list article > div:nth-child(2) span { display: block; }
.my-vacation-list article > div:nth-child(2) span { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.vacation-range { display: grid; grid-template-columns: auto auto 20px auto auto; align-items: baseline; gap: 4px; color: var(--brand); }
.vacation-range strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.vacation-range span { color: var(--muted); font-size: .7rem; }
.vacation-range i { color: var(--muted); text-align: center; font-style: normal; }
.holiday-date { width: 48px; padding: 6px; flex: 0 0 auto; color: var(--brand); background: var(--brand-soft); border-radius: 8px; text-align: center; }
.holiday-date strong { font-size: 1.08rem; }
.holiday-date span { color: inherit; font-size: .67rem; font-weight: 650; }
.audit-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; color: var(--brand); background: var(--brand-soft); border-radius: 50%; }
.reopen-summary { display: flex; align-items: center; gap: 12px; padding: 19px; border-bottom: 1px solid var(--border); }
.reopen-summary > div { min-width: 0; flex: 1; }
.reopen-summary strong, .reopen-summary span { display: block; }
.reopen-summary > div span { color: var(--muted); font-size: .8rem; }
.security-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; color: var(--brand); background: var(--brand-soft); border-radius: 50%; }
.security-setting { display: flex; align-items: center; gap: 13px; padding: 19px; }
.security-setting > div:nth-child(2) { min-width: 0; flex: 1; }
.security-setting strong, .security-setting span { display: block; }
.security-setting span { margin-top: 2px; color: var(--muted); font-size: .8rem; }
.settings-form { display: grid; gap: 16px; }
.form-actions { display: flex; align-items: center; gap: 14px; }
.form-actions .inline-success { margin: 0; }

.day-confirm-card { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 24px; padding: 25px; margin-bottom: 18px; background: var(--panel); border: 2px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.day-confirm-card.day-card-confirmed { border-color: var(--success); }
.day-confirm-card.day-card-action { border-color: var(--warning); }
.day-confirm-card.day-card-expired { border-color: var(--danger); }
.day-confirm-card.day-card-reopened { border-color: var(--purple); }
.day-confirm-card.day-card-vacation { border-color: var(--vacation); }
.day-confirm-card.day-card-future, .day-confirm-card.day-card-non-working { border-color: var(--border); }
.day-date { width: 74px; height: 74px; display: grid; place-items: center; align-content: center; color: var(--brand); background: var(--brand-soft); border-radius: 12px; }
.day-date span { font-size: 1.8rem; font-weight: 650; line-height: 1; }
.day-date small { margin-top: 3px; font-size: .65rem; font-weight: 700; letter-spacing: .08em; }
.day-details { display: grid; }
.day-details p, .day-details span { color: var(--muted); }
.day-details strong { margin: 3px 0; font-size: 1.35rem; font-weight: 600; }
.confirmation-complete { display: flex; align-items: center; gap: 10px; color: var(--success); }
.confirmation-complete strong, .confirmation-complete span { display: block; }
.confirmation-complete span:not(.large-check) { color: var(--muted); font-size: .78rem; }
.large-check { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; color: var(--success); background: var(--success-bg); border-radius: 50%; }
.large-check svg { width: 20px; height: 20px; display: block; overflow: visible; }
.large-check path { fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.day-confirm-form { justify-self: end; margin: 0; }
.day-confirm-form input { display: none; }
.day-unavailable { display: grid; justify-items: end; gap: 5px; }
.day-unavailable small { color: var(--muted); font-size: .72rem; }
.personal-calendar { box-shadow: none; }
.personal-calendar .month-day { text-decoration: none; }
.personal-calendar .month-event { min-height: 22px; }
.personal-calendar .event-action { color: var(--brand); background: var(--brand-soft); }
.month-navigation .month-nav-disabled { min-width: 38px; height: 38px; display: grid; place-items: center; color: #b8c0c7; background: var(--panel-soft); border: 1px solid var(--border); border-radius: 8px; font-size: 1.25rem; }
.personal-calendar-note { padding: 11px 15px; color: var(--muted); background: var(--panel-soft); border-top: 1px solid var(--border); font-size: .76rem; }
.recent-days { box-shadow: none; }
.simple-list > div { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.simple-list > div:last-child { border-bottom: 0; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #e8eef3, #f6f8fa 48%, #edf2f6); }
.login-shell { width: min(920px, 100%); min-height: 560px; display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 70px rgba(22, 63, 99, .14); overflow: hidden; }
.login-brand-panel { display: flex; flex-direction: column; justify-content: space-between; padding: 42px; color: var(--brand-contrast); background: var(--brand); }
.login-brand-panel .login-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.login-brand-panel .brand-mark { color: var(--brand); background: var(--brand-contrast); }
.login-brand-panel .eyebrow, .login-brand-panel p, .login-brand-panel small { color: #dce8f2; }
.login-brand-panel h1 { max-width: 370px; font-size: clamp(2rem, 4vw, 2.8rem); }
.login-brand-panel p:not(.eyebrow) { max-width: 340px; }
.login-form-panel { display: grid; place-items: center; padding: 42px; }
.login-form { width: min(340px, 100%); display: grid; gap: 18px; }
.login-form h2 { font-size: 1.5rem; }
.forgot-link { justify-self: end; margin-top: -9px; font-size: .78rem; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.demo-credentials { display: grid; gap: 2px; padding: 12px; color: var(--muted); background: var(--panel-soft); border-radius: 8px; font-size: .76rem; }
.demo-credentials strong { color: var(--text); }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #e8eef3, #f7f9fa 50%, #edf2f6); }
.auth-shell { width: min(470px, 100%); }
.auth-brand { width: max-content; margin: 0 auto 20px; }
.auth-card { display: grid; gap: 19px; padding: 30px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 60px rgba(22, 63, 99, .12); }
.auth-card h1 { font-size: 1.65rem; }
.auth-card > .security-icon { width: 48px; height: 48px; font-weight: 700; letter-spacing: 2px; }
.otp-form, .stacked-auth-form { display: grid; gap: 14px; }
.otp-form label, .stacked-auth-form label { display: grid; gap: 6px; color: var(--text); font-size: .82rem; font-weight: 600; }
.otp-input { min-height: 58px; text-align: center; font-size: 1.55rem; font-weight: 650; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.demo-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; color: var(--muted); background: var(--warning-bg); border-radius: 8px; font-size: .78rem; }
.demo-code strong { color: var(--warning); font-size: 1rem; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.auth-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 4px; border-top: 1px solid var(--border); font-size: .78rem; }
.auth-actions a, .auth-actions button, .auth-back { color: var(--brand); background: transparent; border: 0; text-decoration: none; cursor: pointer; }
.auth-actions button { padding: 8px 0; }
.auth-actions a:hover, .auth-actions button:hover, .auth-back:hover { text-decoration: underline; }
.auth-back { justify-self: start; }

body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(17, 31, 43, .52); animation: modal-fade .16s ease-out; }
.modal-dialog { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 26px 80px rgba(15, 32, 48, .28); animation: modal-rise .18s ease-out; }
.modal-dialog-wide { width: min(760px, 100%); }
.modal-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 19px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.16rem; }
.modal-header p:not(.eyebrow) { color: var(--muted); font-size: .82rem; }
.modal-close { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: 8px; font-size: 1.35rem; cursor: pointer; }
.modal-close:hover { color: var(--text); border-color: var(--brand); }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding-top: 3px; }
.employee-activity { display: grid; gap: 12px; padding-top: 3px; border-top: 1px solid var(--border); }
.employee-activity-heading, .employee-card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.employee-activity-heading { padding-top: 14px; }
.employee-activity-heading h3 { font-size: .98rem; }
.employee-activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.employee-activity-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; }
.employee-card-title { padding: 10px 12px; background: var(--panel-soft); font-size: .8rem; }
.activity-count { min-width: 23px; padding: 2px 7px; color: var(--muted); background: var(--panel); border-radius: 999px; text-align: center; font-size: .72rem; }
.activity-count.has-issues { color: var(--danger); background: var(--danger-bg); }
.employee-mini-list { list-style: none; }
.employee-mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 9px 11px; border-top: 1px solid var(--border); }
.employee-mini-list li:first-child { border-top: 0; }
.employee-mini-list li > div { min-width: 0; }
.employee-mini-list strong, .employee-mini-list small { display: block; }
.employee-mini-list strong { font-size: .76rem; }
.employee-mini-list small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.employee-mini-list .status { flex: 0 0 auto; font-size: .68rem; }
.activity-empty { padding: 18px 12px; color: var(--muted); font-size: .76rem; text-align: center; }
.confirm-dialog { width: min(420px, calc(100% - 32px)); padding: 0; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 26px 80px rgba(15, 32, 48, .3); }
.confirm-dialog::backdrop { background: rgba(17, 31, 43, .52); }
.confirm-dialog form { display: grid; grid-template-columns: auto 1fr; gap: 15px; padding: 23px; }
.confirm-dialog h2 { margin: 0 0 5px; font-size: 1.15rem; }
.confirm-dialog p { color: var(--muted); }
.confirm-dialog footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; padding-top: 8px; }
.confirm-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--warning); background: var(--warning-bg); border-radius: 50%; font-weight: 700; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loading-bar { 0% { transform: translateX(-110%); } 55% { transform: translateX(130%); } 100% { transform: translateX(280%); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1020px) {
  .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar { height: 60px; padding: 0 14px; }
  .brand-mark { width: 32px; height: 32px; }
  .account-copy { display: none; }
  .mobile-menu-button { display: inline-flex; order: 2; margin-left: auto; }
  .account { order: 3; }
  .app-layout { display: block; min-height: calc(100vh - 60px); }
  .sidebar { position: fixed; z-index: 50; top: 60px; bottom: 0; left: 0; width: min(290px, 86vw); height: auto; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 12px 0 35px rgba(20, 35, 50, .18); }
  .sidebar.is-open { transform: translateX(0); }
  .backdrop { position: fixed; z-index: 40; inset: 60px 0 0; display: block; visibility: hidden; opacity: 0; background: rgba(20, 30, 40, .42); transition: opacity .2s ease, visibility .2s; }
  .backdrop.is-visible { visibility: visible; opacity: 1; }
  .page { padding: 22px 14px 36px; }
  .page-heading { display: block; }
  .page-heading > .button { width: 100%; margin-top: 15px; }
  .month-toolbar { grid-template-columns: 1fr auto; }
  .month-toolbar h2 { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .month-navigation { grid-column: 1; grid-row: 2; }
  .calendar-legend { grid-column: 2; grid-row: 2; }
  .calendar-legend span { font-size: 0; gap: 3px; }
  .calendar-legend .calendar-dot { width: 8px; height: 8px; }
  .month-weekdays span { padding: 8px 0; text-align: center; font-size: 0; }
  .month-weekdays span::after { content: attr(data-short); font-size: .72rem; }
  .month-day { min-height: 52px; padding: 5px 2px; text-align: center; }
  .month-day-number { width: 25px; height: 25px; margin: 0 auto 3px; font-size: .75rem; }
  .month-events { display: none; }
  .month-mobile-dots { height: 7px; display: flex; justify-content: center; gap: 2px; }
  .month-mobile-dots .calendar-dot { width: 5px; height: 5px; }
  .stat-grid { gap: 7px; }
  .stat { padding: 11px 9px; }
  .stat strong { font-size: 1.3rem; }
  .stat small { display: none; }
  .team-heading { display: block; }
  .compact-field { margin-top: 12px; }
  .compact-field select { min-width: 0; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .responsive-table { overflow: visible; }
  .responsive-table table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tbody tr { padding: 14px 15px; border-bottom: 1px solid var(--border); }
  .responsive-table tbody tr:last-child { border-bottom: 0; }
  .responsive-table td { display: grid; grid-template-columns: 105px minmax(0, 1fr); align-items: center; gap: 10px; padding: 5px 0; border: 0; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: .73rem; }
  .responsive-table td:first-child { display: block; margin-bottom: 6px; }
  .responsive-table td:first-child::before { display: none; }
  .day-confirm-card { grid-template-columns: auto 1fr; gap: 15px; padding: 18px; }
  .day-confirm-card > .button, .confirmation-complete { grid-column: 1 / -1; width: 100%; }
  .day-confirm-form { grid-column: 1 / -1; width: auto; justify-self: end; }
  .day-unavailable { grid-column: 1 / -1; width: 100%; }
  .day-confirm-form .button { width: auto; }
  .day-unavailable { justify-items: start; padding-top: 13px; border-top: 1px solid var(--border); }
  .confirmation-complete { padding-top: 13px; border-top: 1px solid var(--border); }
  .form-row { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .button { width: 100%; }
  .vacation-list article, .holiday-list article { align-items: flex-start; flex-wrap: wrap; }
  .vacation-list article > .button, .holiday-list article > .button { margin-left: 46px; }
  .vacation-list .row-actions, .holiday-list .row-actions { width: 100%; justify-content: stretch; margin-left: 46px; }
  .vacation-list .row-actions .button, .holiday-list .row-actions .button { width: 100%; }
  .my-vacation-list article { grid-template-columns: 1fr auto; gap: 12px; }
  .my-vacation-list .vacation-range { grid-column: 1 / -1; }
  .security-setting { align-items: flex-start; flex-wrap: wrap; }
  .security-setting form { width: 100%; margin-left: 48px; }
  .security-setting form .button { width: 100%; }
  .form-footer { align-items: stretch; flex-direction: column-reverse; }
  .form-footer .button { width: 100%; }
  .login-body { display: block; padding: 0; background: var(--panel); }
  .login-shell { min-height: 100vh; display: block; border: 0; border-radius: 0; box-shadow: none; }
  .login-brand-panel { min-height: 235px; padding: 25px 22px; }
  .login-brand-panel > small { display: none; }
  .login-brand-panel h1 { font-size: 2rem; }
  .login-brand-panel p:not(.eyebrow) { display: none; }
  .login-form-panel { padding: 32px 22px; }
  .auth-body { display: block; padding: 0; background: var(--panel); }
  .auth-shell { width: 100%; min-height: 100vh; padding: 24px 18px; }
  .auth-card { padding: 23px 19px; border: 0; box-shadow: none; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal-dialog { width: 100%; max-height: calc(100vh - 24px); border-width: 1px 0 0; border-radius: 16px 16px 0 0; }
  .employee-activity-heading { align-items: stretch; flex-direction: column; }
  .employee-activity-heading .button { width: 100%; }
  .employee-activity-grid { grid-template-columns: 1fr; }
  .modal-footer { position: sticky; bottom: -19px; padding: 12px 0 0; background: var(--panel); }
  .modal-footer .button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
