:root {
  color-scheme: dark;
  --bg: #171719;
  --surface: #1b1b1e;
  --surface-2: #202023;
  --surface-3: #29292d;
  --line: #3a3939;
  --text: #f1eee9;
  --muted: #b2aca4;
  --accent: #e8c18e;
  --accent-strong: #d9a96f;
  --accent-soft: rgba(217, 169, 111, 0.16);
  --danger: #e88984;
  --danger-soft: rgba(232, 137, 132, 0.14);
  --success: #83bd9f;
  --success-soft: rgba(131, 189, 159, 0.14);
  --warning: #e5bd7c;
  --warning-soft: rgba(229, 189, 124, 0.15);
  --schedule-day-bg: #b89b80;
  --schedule-day-text: #211b17;
  --schedule-night-bg: #66595d;
  --schedule-night-text: #fff;
  --schedule-double-bg: #8f6268;
  --schedule-double-text: #fff;
  --schedule-porter-bg: #89695e;
  --schedule-porter-text: #fff;
  --schedule-manager-bg: #927873;
  --schedule-manager-text: #fff;
  --schedule-housekeeping-bg: #796889;
  --schedule-housekeeping-text: #fff;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f1ec;
  --surface: #fffdf9;
  --surface-2: #f1ece5;
  --surface-3: #e8e1d8;
  --line: #ded5c9;
  --text: #2d2924;
  --muted: #746c62;
  --accent: #9b7339;
  --accent-strong: #8e6923;
  --accent-soft: rgba(142, 105, 35, 0.13);
  --danger: #af4c47;
  --danger-soft: rgba(175, 76, 71, 0.12);
  --success: #367b55;
  --success-soft: rgba(54, 123, 85, 0.12);
  --warning: #9b6b16;
  --warning-soft: rgba(155, 107, 22, 0.13);
  --schedule-day-bg: #d8bda4;
  --schedule-day-text: #493a30;
  --schedule-night-bg: #837272;
  --schedule-night-text: #fff;
  --schedule-double-bg: #b68185;
  --schedule-double-text: #fff;
  --schedule-porter-bg: #b68f81;
  --schedule-porter-text: #fff;
  --schedule-manager-bg: #c8a9a0;
  --schedule-manager-text: #332723;
  --schedule-housekeeping-bg: #b68f81;
  --schedule-housekeeping-text: #fff;
  --shadow: 0 16px 40px rgba(55, 43, 29, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button, input, select { max-width: 100%; }
.is-hidden { display: none !important; }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 18px; border-radius: 10px; color: #fff; box-shadow: 0 12px 32px rgba(0,0,0,.22); transition: opacity .2s ease, transform .2s ease; }
.toast.is-success { background: #197347; }
.toast.is-error { background: #a33232; }
.toast.is-hidden { opacity: 0; transform: translateY(12px); }

/* Unified card layout for operational lists */
.record-card { display: grid; grid-template-columns: 78px minmax(0, 1fr) minmax(180px, auto); gap: 16px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.field-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .86rem; }
.debt-category-options { display: flex; flex-wrap: wrap; gap: 8px; }
.debt-category-option { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
.debt-category-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.debt-category-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.debt-category-amount-card { align-self: start; }
.debt-category-details.has-minibar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.debt-category-details.has-minibar .debt-category-minibar-card { grid-column: 1; }
.debt-category-side { display: grid; grid-column: 2; gap: 12px; align-content: start; }
.debt-category-side .debt-category-amount-card { align-self: start; }
.debt-total-summary { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); font-weight: 700; }
.debt-total-summary strong { font-size: 1.1rem; }
.bonus-filters { flex-wrap: nowrap; margin: 0 0 18px; }
.bonus-filters select { min-width: 0; flex: 1 1 0; }
.bonus-stats-head { margin-bottom: 16px; }
.debt-category-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.debt-category-card h4 { margin: 0 0 12px; }
.minibar-product-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.minibar-product-row { display: grid; grid-template-columns: auto 36px minmax(0, 1fr) 76px; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.minibar-product-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--surface-3); }
.minibar-product-placeholder { display: grid; place-items: center; font-size: 1.15rem; }
.minibar-stat-product { display: flex; align-items: center; gap: 9px; }
.minibar-product-row span, .minibar-product-row small { display: block; }
.minibar-product-row small { color: var(--muted); margin-top: 3px; }
.minibar-quantity-input { width: 76px; min-width: 0; }
.minibar-total { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.debt-category-option input[type="checkbox"], .minibar-product-row input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; flex: 0 0 16px; accent-color: var(--accent-strong); }
.employee-card.is-inactive { opacity: .68; border-style: dashed; }
.employee-groups { display: grid; gap: 24px; }
.employee-group { display: grid; gap: 12px; }
.employee-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.employee-group-head h3 { margin: 0; }
.employee-group-head span { min-width: 28px; padding: 4px 8px; border-radius: 999px; color: var(--muted); background: var(--surface-3); text-align: center; }
.employee-card-grid { display: grid; grid-template-columns: 1fr; gap: 9px; min-height: 40px; }
.employee-tile { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 48px 13px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.employee-tile:active { cursor: grabbing; }
.employee-tile.is-inactive { opacity: .62; border-style: dashed; }
.employee-tile.is-dragging { opacity: .35; border-color: var(--accent); }
.employee-drag { position: absolute; top: 50%; right: 12px; padding: 8px; color: var(--muted); transform: translateY(-50%); touch-action: none; cursor: grab; font-size: 1.2rem; }
.employee-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 10px; background: var(--accent-soft); font-size: 1.25rem; }
.employee-tile-body { min-width: 0; }
.employee-tile .record-title { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.employee-tile .record-title .record-badge { justify-self: end; margin-right: -5px; }
.employee-meta { display: grid; gap: 5px; margin-top: 10px; color: var(--muted); font-size: .82rem; }
.employee-tile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.employee-dismissed-group { margin-top: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.employee-dismissed-group .employee-tile { cursor: default; }
.home-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, var(--surface-2), var(--accent-soft)); }
.home-hero h2 { margin: 3px 0 5px; }
.home-hero span { color: var(--muted); text-transform: capitalize; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "team templates" "notifications notes" "contacts contacts"; gap: 16px; }
.home-team-panel { grid-area: team; }
.home-templates-panel { grid-area: templates; }
.home-contacts-panel { grid-area: contacts; }
.home-attention-panel { grid-area: attention; }
.home-notifications-panel { grid-area: notifications; }
.home-notes-panel { grid-area: notes; }
.is-manager-home .home-grid { grid-template-areas: "team templates" "attention notes" "notifications contacts"; }
.home-news-panel { grid-column: 1 / -1; }
.home-manager-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.home-manager-summary article { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.home-manager-summary article > span { font-size: 1.5rem; }
.home-manager-summary small, .home-manager-summary strong { display: block; }
.home-manager-summary small { color: var(--muted); }
.home-manager-summary strong { margin-top: 3px; font-size: 1.35rem; }
.home-shift-list, .home-contact-list, .home-attention-list, .home-news-list { display: grid; gap: 9px; }
.home-shift-person { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.home-shift-person small, .home-contact small, .home-news-item small, .home-news-item time { display: block; margin-top: 3px; color: var(--muted); font-size: .77rem; }
.home-person-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 9px; background: var(--accent-soft); }
.home-button-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.home-template-button { display: grid; min-height: 52px; padding: 10px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface-2); font-weight: 800; text-align: center; cursor: pointer; }
.home-template-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.home-template-entry { position: relative; }
.home-template-entry .home-template-button { width: 100%; }
.home-mini-action { min-width: 30px; min-height: 30px; border: 0; border-radius: 7px; color: var(--muted); background: var(--surface-3); cursor: pointer; }
.home-template-actions { position: absolute; top: 9px; right: 7px; display: flex; gap: 3px; }
.home-contact, .home-attention-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px; border-radius: 9px; background: var(--surface-2); }
.home-contact a { color: var(--accent); font-weight: 800; }
.home-attention-item span { color: var(--warning); font-weight: 800; }
.home-news-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border-bottom: 1px solid var(--line); }
.home-news-item > span { font-size: 1.25rem; }
.home-news-actions { display: flex; gap: 5px; }
.home-news-actions button { padding: 4px 7px; border: 0; border-radius: 6px; color: var(--muted); background: var(--surface-3); cursor: pointer; }
.home-team-panel, .home-templates-panel { min-height: 330px; }
.home-shift-comparison { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.home-shift-comparison h4 { min-height: 38px; margin: 0 0 10px; text-align: center; }
.home-shift-arrow { display: grid; min-height: 160px; place-items: center; color: var(--accent); font-size: 1.8rem; }
.home-notifications-panel .home-news-list { max-height: 390px; overflow-y: auto; padding-right: 5px; }
.note-tabs { display: flex; gap: 5px; }
.home-note-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.home-notes-panel { position: relative; padding-top: 20px; }
.home-notes-panel .panel-head { min-height: 48px; padding-right: 285px; }
.home-note-shortcuts { position: absolute; top: 14px; right: 16px; display: flex; gap: 9px; }
.home-note-shortcuts .ghost-button { position: relative; min-height: 44px; padding: 0 16px; border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); border-radius: 11px; background: var(--surface-2); color: var(--text); font-size: .86rem; box-shadow: 0 5px 14px rgba(0, 0, 0, .13); }
.home-note-shortcuts .ghost-button:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.home-note-shortcuts .subtab-badge { position: absolute; top: -7px; right: -5px; }
.home-note-button { position: relative; display: grid; min-height: 150px; padding: 18px; place-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-2); text-align: center; cursor: pointer; }
.home-note-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.home-note-button > span { font-size: 1.8rem; }
.home-note-button small { color: var(--muted); }
.home-note-button .subtab-badge { position: absolute; top: 10px; right: 10px; }
.note-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.note-form textarea { grid-column: 1 / -1; }
.employee-notes-list { display: grid; max-height: 68vh; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; overflow-y: auto; padding: 3px 7px 3px 3px; }
.employee-note { position: relative; display: flex; min-height: 190px; padding: 17px; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, var(--surface-2), var(--surface)); box-shadow: 0 7px 20px rgba(0, 0, 0, .12); }
.employee-note.is-unread { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.employee-note > div { display: flex; justify-content: space-between; gap: 10px; }
.employee-note time { color: var(--muted); font-size: .75rem; }
.employee-note p { margin: 13px 0; flex: 1; white-space: pre-wrap; line-height: 1.5; }
.employee-note button { margin-top: 8px; padding: 6px 0; border: 0; color: var(--danger); background: transparent; cursor: pointer; }
.employee-note-actions, .note-inline-editor > div { display: flex; gap: 10px; }
.employee-note-actions button:first-child, .note-inline-editor button:first-child { color: var(--accent); }
.note-inline-editor { margin-top: 10px; }
.note-inline-editor textarea { min-height: 100px; }
.all-templates-list { display: grid; max-height: 65vh; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow-y: auto; }
.all-template-card { display: grid; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface-2); text-align: left; cursor: pointer; }
.all-template-card span { display: -webkit-box; overflow: hidden; color: var(--muted); -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.modal-card.modal-card-wide { width: min(1040px, calc(100vw - 28px)); max-height: 90vh; }
#notesModal .modal-card { min-height: min(720px, 90vh); }
.template-preview { margin-bottom: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; line-height: 1.6; }
textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface-3); resize: vertical; }
.activity-card .record-details { align-items: flex-start; }
.calendar-connect-panel { margin-top: 18px; }
.calendar-connect-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.calendar-service-card { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; min-height: 190px; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, var(--surface-2), var(--surface)); }
.calendar-service-card::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--calendar-color); }
.google-calendar-card { --calendar-color: #5b91f5; }
.apple-calendar-card { --calendar-color: #cbd3df; }
.calendar-service-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: color-mix(in srgb, var(--calendar-color) 16%, var(--surface-3)); color: var(--calendar-color); font-size: 1.35rem; font-weight: 900; }
.calendar-service-body { display: flex; min-width: 0; flex-direction: column; }
.calendar-service-title { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.calendar-service-title div { display: grid; gap: 3px; }
.calendar-service-title small, .calendar-service-status { color: var(--muted); font-size: .78rem; }
.calendar-service-title strong { font-size: 1.02rem; }
.calendar-service-state { padding: 4px 8px; border-radius: 999px; background: color-mix(in srgb, var(--calendar-color) 13%, transparent); color: var(--calendar-color); font-size: .68rem; font-weight: 800; }
.calendar-service-status { display: grid; gap: 4px; min-height: 45px; margin: 16px 0; line-height: 1.45; }
.calendar-service-status b { color: var(--text); }
.calendar-service-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.month-select { min-width: 170px; font-weight: 650; }
.month-nav {
  display: inline-grid;
  grid-template-columns: 40px minmax(132px, auto) 40px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
}
.month-nav button {
  min-height: 40px;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 1.55rem;
  cursor: pointer;
}
.month-nav button:hover { color: var(--accent); background: var(--accent-soft); }
.month-nav strong { padding: 0 8px; text-align: center; white-space: nowrap; }
.schedule-primary-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; }
.schedule-extra-toggle { min-height: 46px; }
.schedule-table-legend { margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.schedule-common-head { margin-bottom: 14px; }
.schedule-common-head .panel-head { margin-bottom: 0; }
.salary-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.manager-shift-settings { margin-top: 14px; }
.manager-shift-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.manager-shift-title small { color: var(--muted); }
.manager-shift-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.manager-shift-grid label { display: grid; grid-template-columns: minmax(0, 1fr) 90px; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.form-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.bonus-employee-select { position: relative; }
.bonus-employee-toggle { width: 100%; min-height: 44px; padding: 10px 42px 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface-3); text-align: left; cursor: pointer; }
.bonus-employee-toggle::after { content: "⌄"; position: absolute; right: 14px; font-size: 18px; }
.bonus-employee-dropdown { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; max-height: 280px; padding: 10px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 36px rgba(0,0,0,.32); }
.bonus-employee-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bonus-employee-picker label { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.bonus-employee-picker input { width: 18px; height: 18px; margin: 0; }
@media (max-width: 640px) { .bonus-employee-picker { grid-template-columns: 1fr; } .debt-category-details, .minibar-product-list { grid-template-columns: 1fr; } .debt-category-details.has-minibar .debt-category-side { grid-column: 1; } }
@media (max-width: 640px) { .manager-shift-grid { grid-template-columns: 1fr; } }
.schedule-table-wrap { overflow: hidden; width: 100%; max-width: 100%; border: 1px solid var(--line); border-radius: 14px; }
.schedule-matrix { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.schedule-matrix th, .schedule-matrix td { min-width: 0; height: 34px; padding: 2px; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.schedule-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
.schedule-copy-day { display: flex; width: 100%; min-height: 30px; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 1px; border: 0; border-radius: 5px; color: inherit; background: transparent; cursor: pointer; }
.schedule-copy-day:hover, .schedule-copy-day:focus-visible { color: var(--accent); background: var(--surface-3); outline: none; }
.schedule-copy-day strong { font-weight: 500; }
.schedule-copy-day small { display: block; margin-top: 0 !important; }
.schedule-matrix th small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.schedule-matrix .schedule-person { position: sticky; left: 34px; z-index: 3; width: 156px; min-width: 156px; max-width: 156px; text-align: left; padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; background: var(--surface-2); font-weight: 500; text-transform: none; }
.schedule-matrix .schedule-number { position: sticky; left: 0; z-index: 4; width: 34px; min-width: 34px; max-width: 34px; padding: 2px; color: var(--muted); background: var(--surface-2); font-weight: 500; }
.schedule-matrix thead .schedule-person { z-index: 4; }
.schedule-matrix td { cursor: pointer; }
.schedule-matrix td:hover { background: rgba(255,255,255,.05); }
.schedule-matrix td.has-shift { color: #fff; font-weight: 400; background: rgba(100,167,255,.14); }
.schedule-matrix tr:last-child th, .schedule-matrix tr:last-child td { border-bottom: 0; }
.schedule-matrix .schedule-group-row th { position: sticky; left: 0; z-index: 3; height: 28px; padding: 4px 10px; color: var(--accent); background: var(--surface-3); text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.schedule-extra-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.schedule-trainees { display: grid; gap: 10px; padding-top: 4px; }
.schedule-trainees-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.schedule-trainee-list { display: grid; gap: 8px; }
.schedule-trainee-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, .55fr) 42px; gap: 8px; align-items: center; }
.schedule-add-employee { min-width: 42px; padding: 0; font-size: 1.35rem; }
@media (max-width: 760px) { .calendar-connect-grid, .schedule-extra-fields { grid-template-columns: 1fr; } .schedule-trainee-row { grid-template-columns: minmax(0, 1fr) 42px; } .schedule-trainee-row select:nth-child(2) { grid-column: 1; grid-row: 2; } .schedule-trainee-row button { grid-column: 2; grid-row: 1 / span 2; height: 100%; } }
.record-icon { display: grid; place-items: center; width: 78px; height: 70px; overflow: hidden; border-radius: 10px; background: var(--surface-3); font-size: 28px; }
.record-icon img { width: 100%; height: 100%; object-fit: cover; }
.record-content { min-width: 0; }
.record-title { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.record-title strong { overflow-wrap: anywhere; }
.record-badge { flex: none; padding: 4px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .72rem; font-weight: 700; }
.record-badge-success { background: var(--success-soft); color: #98ecc9; }
.record-badge-debt { background: var(--danger-soft); color: #ffaaa6; }
.record-details { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0 6px; color: var(--muted); font-size: .83rem; }
.record-details b { color: var(--text); }
.record-content small { color: var(--muted); }
.record-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 180px; }
.salary-total { display: grid; gap: 4px; min-width: 180px; text-align: right; }
.salary-total small { color: var(--muted); }
.salary-total strong { color: #98ecc9; font-size: 1.1rem; }
.salary-not-eligible { border-color: rgba(244, 184, 76, .42); }
.salary-threshold-warning { margin-top: 11px; padding: 9px 11px; border-radius: 8px; color: #ffdd83; background: var(--warning-soft); font-size: .8rem; }
.salary-settings { margin-bottom: 16px; }
.salary-settings label { display: grid; gap: 5px; color: var(--muted); font-size: .8rem; }
.form-hint { margin: 0; color: var(--muted); font-size: .85rem; }

@media (max-width: 720px) {
  .record-card { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .record-icon { width: 56px; height: 56px; }
  .record-actions { grid-column: 1 / -1; justify-content: flex-start; min-width: 0; }
  .salary-total { grid-column: 1 / -1; text-align: left; min-width: 0; }
  .employee-tile { grid-template-columns: 42px minmax(0, 1fr); }
  .employee-tile-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .home-grid, .home-manager-summary { grid-template-columns: 1fr; }
  .home-grid { grid-template-areas: "team" "templates" "notifications" "notes" "contacts"; }
  .is-manager-home .home-grid { grid-template-areas: "team" "templates" "attention" "notes" "notifications" "contacts"; }
  .home-news-panel { grid-column: auto; }
  .home-hero { align-items: flex-start; flex-direction: column; }
  .home-shift-comparison { grid-template-columns: 1fr; }
  .home-shift-arrow { min-height: 32px; transform: rotate(90deg); }
  .home-team-panel, .home-templates-panel { min-height: 0; }
  .all-templates-list { grid-template-columns: 1fr; }
  .employee-notes-list { grid-template-columns: 1fr; }
  .employee-note { min-height: 160px; }
  .home-note-buttons { grid-template-columns: 1fr; }
  .home-note-button { min-height: 105px; }
  .home-notes-panel .panel-head { min-height: 0; padding-right: 0; }
  .home-note-shortcuts { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 13px; }
  .home-note-shortcuts .ghost-button { width: 100%; padding: 0 10px; }
}

@media (min-width: 721px) and (max-width: 980px) {
  .employee-notes-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.compact-stats { margin-bottom: 18px; }
.compact-stats .metric { min-height: auto; padding: 14px 16px; }
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 18px; overflow-x: auto; padding: 4px 2px 12px; }
.kanban-column { --kanban: #5d7dbd; --kanban-soft: rgba(93, 125, 189, .13); min-width: 230px; min-height: 360px; padding: 14px; border: 1px solid color-mix(in srgb, var(--kanban) 42%, var(--line)); border-radius: 16px; background: linear-gradient(180deg, var(--kanban-soft), var(--surface) 42%); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.kanban-column:nth-child(1) { --kanban: #5e99ff; --kanban-soft: rgba(94, 153, 255, .14); }
.kanban-column:nth-child(2) { --kanban: #f4b84c; --kanban-soft: rgba(244, 184, 76, .14); }
.kanban-column:nth-child(3) { --kanban: #ad83ff; --kanban-soft: rgba(173, 131, 255, .14); }
.kanban-column:nth-child(4) { --kanban: #54d29c; --kanban-soft: rgba(84, 210, 156, .14); }
.kanban-column h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--kanban); color: #fff; font-size: .95rem; letter-spacing: .01em; box-shadow: 0 4px 10px color-mix(in srgb, var(--kanban) 28%, transparent); }
.kanban-column h4::before { content: ""; width: 8px; height: 8px; border: 2px solid rgba(255,255,255,.82); border-radius: 50%; }
.kanban-cards { display: grid; gap: 11px; }
.kanban-card { padding: 14px; border: 1px solid color-mix(in srgb, var(--kanban) 25%, var(--line)); border-left: 4px solid var(--kanban); border-radius: 12px; background: var(--surface-2); box-shadow: 0 5px 14px rgba(0, 0, 0, .18); transition: transform .16s ease, box-shadow .16s ease; }
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0, 0, 0, .28); }
.kanban-label { margin: 0 0 5px; color: var(--kanban); font-size: .65rem; font-weight: 800; letter-spacing: .1em; }
.kanban-card strong { color: var(--text); font-size: .96rem; line-height: 1.35; }
.kanban-detail { display: grid; gap: 2px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.kanban-detail span, .kanban-dates span { color: var(--muted); font-size: .72rem; }
.kanban-detail b, .kanban-dates b { color: var(--text); font-size: .82rem; font-weight: 600; line-height: 1.35; }
.kanban-dates { display: grid; grid-template-columns: 1fr auto 1fr; gap: 7px; align-items: end; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.kanban-dates div { display: grid; gap: 2px; }.kanban-dates i { color: var(--muted); font-style: normal; }
.kanban-card .row-actions { margin-top: 12px; }
.kanban-card .small-button { border-color: var(--kanban); color: var(--kanban); background: transparent; }
.kanban-card .small-button:hover { color: #fff; background: var(--kanban); }
.kanban-card.is-rejected { border-color: rgba(255, 139, 134, .52); border-left-color: #e88984; background: rgba(255, 139, 134, .12); }
.request-rejected-label { display: inline-block; margin: 8px 0 0; padding: 4px 8px; border-radius: 999px; background: rgba(255, 139, 134, .22); color: #ffb0ac; font-size: .72rem; font-weight: 800; }
@media (max-width: 760px) { .kanban-board { grid-template-columns: repeat(4, minmax(260px, 1fr)); } }
.room-chip.is-vip { border-color: var(--warning); background: var(--warning-soft); }
.vip-price { width: 110px; }
.product-photo { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.rooms-panel { margin-bottom: 18px; }.room-add-panel { max-width: 760px; }
.room-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.room-chip { display: grid; gap: 10px; align-content: start; min-height: 150px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.room-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }.vip-badge { padding: 3px 7px; border-radius: 999px; background: var(--warning); color: #2c2109; font-size: .7rem; font-weight: 900; }.room-standard { color: var(--muted); font-size: .8rem; }.vip-price-label { display: grid; gap: 4px; color: var(--muted); font-size: .78rem; }.vip-price { width: 100%; }
.lost-list { display: grid; gap: 14px; }.lost-card { display: grid; grid-template-columns: 78px minmax(0, 1fr) minmax(180px, auto); gap: 16px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }.lost-photo { display: grid; place-items: center; width: 78px; height: 70px; overflow: hidden; border-radius: 10px; background: var(--surface-3); font-size: 28px; }.lost-photo img { width: 100%; height: 100%; object-fit: cover; }.lost-title { display: flex; justify-content: space-between; align-items: start; gap: 10px; }.lost-title strong { overflow-wrap: anywhere; }.lost-status { flex: none; padding: 4px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .72rem; font-weight: 700; }.lost-details { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0 6px; color: var(--muted); font-size: .83rem; }.lost-details b { color: var(--text); }.lost-content small { color: var(--muted); }.lost-actions { display: grid; gap: 10px; min-width: 180px; }.lost-actions label { display: grid; gap: 4px; color: var(--muted); font-size: .75rem; }.lost-actions .row-actions { justify-content: flex-end; }
.lost-photo-open { display: block; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 0; background: transparent; cursor: zoom-in; }
.lost-photo-open img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .18s ease; }
.lost-photo-open:hover img { transform: scale(1.06); }
.lost-photo-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lost-image-modal { place-items: center; }
.lost-image-preview { position: relative; z-index: 1; display: block; width: auto; max-width: 96vw; max-height: 96vh; margin: 0 auto; object-fit: contain; }
.modal.lost-image-modal { align-items: center; padding: 12px; }
.modal.lost-image-modal { place-items: center; }
@media (max-width: 720px) { .lost-card { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }.lost-photo { width: 56px; height: 56px; }.lost-actions { grid-column: 1 / -1; min-width: 0; }.lost-actions .row-actions { justify-content: flex-start; } .room-grid { grid-template-columns: 1fr; } }

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(100, 167, 255, 0.13), transparent 38%),
    var(--bg);
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

@media (min-width: 981px) {
  .app-shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .sidebar {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .sidebar .nav {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .sidebar .shift-card,
  .sidebar-logout {
    flex-shrink: 0;
  }

  .main {
    height: 100vh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.hotel-brand { min-height: 62px; padding: 3px 0 15px; justify-content: space-between; border-bottom: 1px solid var(--line); }
.hotel-brand-name { display: grid; gap: 5px; color: var(--text); font-family: Georgia, "Times New Roman", serif; font-size: .84rem; font-weight: 600; letter-spacing: .11em; text-align: center; }
.hotel-brand-stars { color: var(--accent); font-family: Arial, sans-serif; font-size: .9rem; letter-spacing: .25em; }
.sidebar-collapse { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; padding: 5px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface-2); }
.sidebar-collapse:hover { color: var(--accent); border-color: var(--accent); }
.sidebar-collapse svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent-strong), #1b5fc2);
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: 0; }
h1 { margin-bottom: 0; font-size: 1.35rem; }
h2 { margin-bottom: 4px; font-size: 1.65rem; }
h3 { margin-bottom: 0; font-size: 1.05rem; }

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 700;
}
.nav-badge, .subtab-badge { display: inline-grid; min-width: 18px; height: 18px; place-items: center; margin-left: 6px; padding: 0 4px; border-radius: 999px; color: #fff; background: #d85555; font-size: .67rem; font-weight: 900; line-height: 1; vertical-align: middle; }
.nav-badge { margin: 0 0 0 auto; }

.nav-item:hover, .nav-item.is-active {
  color: var(--accent);
  border-color: rgba(217, 169, 111, 0.34);
  background: linear-gradient(90deg, rgba(217, 169, 111, .20), rgba(217, 169, 111, .08));
}
.nav-item.is-active { box-shadow: inset 3px 0 0 var(--accent-strong); }
.nav-icon { width: 19px; height: 19px; flex: 0 0 19px; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-toggle, .menu-backdrop { display: none; }
.sidebar-logout { margin-top: 0; }
.sidebar-logout .nav-icon { color: currentColor; }
.shift-card .eyebrow { font-size: .62rem; }
.shift-card strong { font-size: .73rem; line-height: 1.35; }
.shift-card span { margin-top: 5px; font-size: .72rem; line-height: 1.35; }

@media (min-width: 901px) {
  .app-shell.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar-collapsed .sidebar { gap: 16px; padding: 20px 9px; }
  .sidebar-collapsed .hotel-brand { justify-content: center; padding-bottom: 12px; }
  .sidebar-collapsed .hotel-brand-name,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .shift-card { display: none; }
  .sidebar-collapsed .sidebar-collapse { position: absolute; top: 12px; right: 8px; }
  .sidebar-collapsed .hotel-brand { position: relative; min-height: 36px; }
  .sidebar-collapsed .nav { gap: 7px; }
  .sidebar-collapsed .nav-item { position: relative; justify-content: center; min-height: 42px; padding: 0; }
  .sidebar-collapsed .nav-item.is-active { box-shadow: inset 0 3px 0 var(--accent-strong); }
  .sidebar-collapsed .nav-icon { width: 20px; height: 20px; }
  .sidebar-collapsed .nav-badge { position: absolute; top: 1px; right: 1px; min-width: 15px; height: 15px; margin: 0; padding: 0 3px; font-size: .58rem; }
  .sidebar-collapsed .sidebar-logout { justify-content: center; min-height: 42px; padding: 0; }
}

.parking-page-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; }
.parking-page-actions { display: flex; align-items: center; gap: 8px; }
.parking-page-head h2 { margin-bottom: 5px; }
.parking-page-head span { color: var(--muted); }
.parking-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.parking-stat { display: flex; min-height: 85px; padding: 18px 20px; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.parking-stat span { font-weight: 800; }
.parking-stat strong { font-size: 2.2rem; }
.parking-stat-free { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.parking-stat-reserved { border-color: var(--warning); color: var(--warning); background: var(--warning-soft); }
.parking-stat-occupied { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.parking-map { width: 100%; }
.parking-map-layout { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.parking-map-caption { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.parking-zoom { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: .75rem; }
.parking-zoom:hover { border-color: var(--accent); }
.parking-map-viewport { overflow-x: auto; }
.parking-map.is-zoomed .parking-plan { width: 150%; min-width: 800px; max-width: none; }
.parking-map-caption span:first-child { color: var(--text); font-weight: 700; letter-spacing: .12em; }
.parking-plan { display: block; width: 100%; max-width: 1120px; height: auto; margin: 0 auto; padding: 0px 0; }
.parking-road { fill: none; stroke: var(--surface-2); stroke-width: 40; stroke-linejoin: round; stroke-linecap: round; opacity: .7; }
.parking-direction { fill: none; stroke: var(--muted); stroke-width: 2; opacity: .45; stroke-linecap: round; stroke-linejoin: round; }
.parking-road-label { fill: var(--muted); opacity: .5; font-size: 12px; letter-spacing: .25em; }
.parking-entry-label { fill: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; }
.parking-zone-label { fill: var(--text); font-size: 20px; font-weight: 700; letter-spacing: .12em; }
.parking-zone-hint { fill: var(--muted); font-size: 13px; }
.parking-underground-guide { fill: none; stroke: var(--line); stroke-width: 2; }
.parking-bay { cursor: pointer; outline: none; }
.parking-bay.is-free { --bay-color: var(--success); }
.parking-bay.is-reserved { --bay-color: var(--warning); }
.parking-bay.is-occupied { --bay-color: var(--danger); }
.parking-bay-hit { fill: transparent; }
.parking-bay-fill { fill: var(--bay-color); opacity: .13; transition: opacity .15s ease; pointer-events: none; }
.parking-bay-lines { fill: none; stroke: var(--muted); stroke-opacity: .65; stroke-width: 1.5; pointer-events: none; }
.parking-bay-number { fill: var(--bay-color); font-size: 21px; font-weight: 650; text-anchor: middle; pointer-events: none; }
.parking-bay-plate { fill: var(--text); font-size: 10px; font-weight: 500; text-anchor: middle; pointer-events: none; }
.parking-bay-badge { fill: var(--text); font-size: 12px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.parking-status-select-hidden { display: none; }
.parking-status-field { margin: 0; padding: 0; border: 0; }
.parking-status-field legend { margin-bottom: 8px; font-weight: 700; }
.parking-status-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.parking-status-option { position: relative; display: grid; min-height: 64px; place-items: center; padding: 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 800; cursor: pointer; text-align: center; transition: .15s ease; }
.parking-status-option input { position: absolute; opacity: 0; pointer-events: none; }
.parking-status-option:has(input:checked) { box-shadow: 0 0 0 3px var(--accent-soft); transform: translateY(-1px); }
.parking-status-option.is-selected { box-shadow: 0 0 0 3px var(--accent-soft); transform: translateY(-1px); }
.parking-category-field { margin: 0; padding: 0; border: 0; }
.parking-category-field legend { margin-bottom: 8px; color: var(--text); font-weight: 700; }
.parking-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.parking-category-option { display: flex; min-width: 0; min-height: 52px; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface-2); cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.parking-category-option:hover, .parking-category-option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.parking-category-option.is-selected { box-shadow: 0 0 0 2px var(--accent-soft); transform: translateY(-1px); }
.parking-category-option span { overflow-wrap: anywhere; font-size: .8rem; line-height: 1.2; }
.parking-category-icon-svg { width: 21px; height: 21px; flex: 0 0 21px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.parking-bay-category-icon { color: var(--bay-color); pointer-events: none; }
.parking-bay-category-icon path, .parking-bay-category-icon rect, .parking-bay-category-icon circle { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.parking-status-free:has(input:checked) { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.parking-status-free.is-selected { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.parking-status-reserved:has(input:checked) { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.parking-status-reserved.is-selected { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.parking-status-occupied:has(input:checked) { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.parking-status-occupied.is-selected { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.parking-help { display: inline-grid; width: 22px; height: 22px; margin-left: 6px; place-items: center; padding: 0; border: 1px solid var(--accent); border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 800; vertical-align: middle; }
.parking-help:hover { background: var(--accent); color: var(--bg); }
.parking-tutorial-card { position: fixed; max-width: min(340px, calc(100vw - 28px)); width: min(340px, calc(100vw - 28px)); max-height: min(210px, calc(100vh - 28px)); overflow-y: auto; padding: 16px; background: var(--surface-2); }
.parking-tutorial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.parking-tutorial-grid article { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.parking-tutorial-grid p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; font-size: .9rem; }
.parking-tutorial-note { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--muted); font-size: .85rem; line-height: 1.45; }
.parking-tour-progress { color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.parking-tour-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.parking-tour-target { position: relative !important; pointer-events: none !important; border-radius: 12px; outline: 4px solid var(--accent); outline-offset: 5px; box-shadow: 0 0 0 9px rgba(100,167,255,.24), 0 0 35px rgba(100,167,255,.8) !important; }
.parking-tour-spotlight { position: fixed; z-index: 2; pointer-events: none; border: 3px solid var(--accent); border-radius: 12px; background: transparent; box-shadow: 0 0 0 100vmax rgba(3, 7, 14, .84), 0 0 28px rgba(100,167,255,.95); transition: left .2s ease, top .2s ease, width .2s ease, height .2s ease; }
.parking-tour-spotlight::after { content: ""; position: absolute; inset: -3px; border: 1px solid rgba(255,255,255,.45); border-radius: inherit; }
.modal#parkingTutorial .modal-backdrop { display: none; }
#parkingTutorial, #parkingHelpBtn { display: none !important; }
.parking-tutorial-card { z-index: 4; }
.parking-tutorial-card h3 { margin: 6px 0 8px; font-size: 1rem; }
.parking-tutorial-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.parking-tutorial-card .parking-tour-actions { margin-top: 14px; }
.parking-tutorial-card .parking-tour-actions button { min-height: 36px; padding: 8px 14px; }
.parking-bay.is-unmarked .parking-bay-lines { stroke-dasharray: 5 5; }
.parking-bay.is-second-row .parking-bay-lines { stroke-dasharray: 2 3; stroke-opacity: .4; }
.parking-bay:hover .parking-bay-fill, .parking-bay:focus .parking-bay-fill { opacity: .29; }
.parking-bay:hover .parking-bay-lines, .parking-bay:focus .parking-bay-lines { stroke: var(--bay-color); stroke-opacity: 1; stroke-width: 2.5; }
.parking-map-footnote { padding: 16px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; text-align: center; }
.app-shell.parking-mode { display: block; height: auto; min-height: 100vh; overflow: visible; }
.app-shell.parking-mode .sidebar, .app-shell.parking-mode .topbar { display: none; }
.app-shell.parking-mode .main { width: 100%; height: auto; min-height: 100vh; padding: 28px; overflow: visible; }
.app-shell.parking-mode #parkingView { display: block; }

.shift-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.shift-card strong,
.shift-card span {
  display: block;
}

.shift-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.team-alert-banner {
  position: fixed;
  z-index: 25;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 11px;
  border: 3px solid #ef4444;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #741b26, #36151b);
  box-shadow: 0 8px 26px rgba(160, 20, 35, .4), inset 0 0 0 1px rgba(255,255,255,.08);
  letter-spacing: .06em;
  animation: team-alert-pulse 1.8s ease-in-out infinite;
}
.team-alert-banner.is-hidden { display: none; }
.team-alert-symbol { color: #ff6969; font-size: 1.85rem; line-height: 1; text-shadow: 0 0 12px rgba(255, 40, 50, .75); }
.team-alert-copy { display: grid; gap: 2px; }
.team-alert-copy strong { font-size: 1rem; }
.team-alert-copy span { font-size: .82rem; letter-spacing: .01em; }
@keyframes team-alert-pulse {
  50% { box-shadow: 0 8px 30px rgba(230, 25, 45, .6), inset 0 0 0 1px rgba(255,255,255,.12); }
}

.topbar-actions, .filters, .row-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.user-line {
  color: var(--muted);
  font-size: 0.9rem;
}

.primary-button, .ghost-button, .danger-button, .small-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: linear-gradient(145deg, var(--accent-strong), #1b5fc2);
}

.ghost-button, .small-button {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
}

.danger-button {
  color: var(--danger);
  border-color: rgba(255, 139, 134, 0.34);
  background: var(--danger-soft);
}

.small-button {
  min-height: 31px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.view, .subview { display: none; }
.view.is-active, .subview.is-active { display: block; }

.subtabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow-x: auto;
}

.subtab {
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.subtab.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.panel, .metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel { padding: 18px; }
.panel + .panel { margin-top: 0px; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.toolbar-head { align-items: center; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric { padding: 17px; }
.metric span, .metric small { color: var(--muted); }
.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.form-grid.compact {
  margin-top: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.wide { grid-column: 1 / -1; }

input, select {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-3);
  outline: none;
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(100, 167, 255, 0.16);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th, td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.amount { color: var(--warning); font-weight: 900; }
.debt-list-toolbar { display: grid; grid-template-columns: 175px minmax(390px, 1fr) 290px; align-items: stretch; gap: 12px; margin: 0 0 14px; }
.debt-list-heading { flex: 0 0 175px; padding-top: 5px; }
.debt-list-heading .eyebrow { margin-bottom: 4px; }
.debt-list-heading h3 { margin: 0; font-size: 1.1rem; }
.debt-list-summary.stats-grid { min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.debt-list-summary .metric { display: flex; min-width: 0; min-height: 136px; padding: 10px 12px; flex-direction: column; align-items: flex-start; justify-content: space-between; text-align: left; }
.debt-list-summary .metric strong { margin: 5px 0 2px; font-size: clamp(1.1rem, 1.55vw, 1.55rem); white-space: nowrap; }
.debt-list-summary .metric span, .debt-list-summary .metric small { font-size: .82rem; }
.debt-list-toolbar .filters { display: grid; width: 290px; align-content: start; justify-items: end; gap: 8px; }
.debt-list-toolbar .filters > * { width: 100%; max-width: 290px; min-width: 0; }
@media (min-width: 721px) and (max-width: 1100px) {
  .debt-list-toolbar { grid-template-columns: minmax(0, 1fr) 290px; }
  .debt-list-heading { grid-column: 1 / -1; }
}
.note { display: block; margin-top: 5px; color: var(--muted); font-size: 0.82rem; }
.empty-state { padding: 28px; color: var(--muted); text-align: center; }

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-open { color: var(--warning); background: var(--warning-soft); }
.status-paid { color: var(--success); background: var(--success-soft); }

.list {
  display: grid;
  gap: 10px;
}

.list-row, .room-chip, .category-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  min-width: 0;
}

.list-row strong { display: block; }
.list-row span, .list-row small { color: var(--muted); }
.list-row > div { min-width: 0; }
.list-row span, .list-row small, .note {
  overflow-wrap: anywhere;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.room-chip {
  min-height: 44px;
  font-weight: 900;
}

.lost-list img {
  width: 76px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-day {
  min-height: 82px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  text-align: left;
  color: var(--text);
  overflow: hidden;
}

.calendar-day strong { display: block; margin-bottom: 8px; }
.calendar-day span { color: var(--muted); font-size: 0.82rem; }
.calendar-day.has-debt { border-color: rgba(100, 167, 255, 0.44); background: var(--accent-soft); }
.schedule-calendar .calendar-day { min-height: 142px; }

.schedule-panel { min-height: calc(100vh - 150px); }
.schedule-head { align-items: center; }
.schedule-header-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.schedule-today-copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.schedule-today-copy-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}
.schedule-rotate-hint { display: none; }
.requests-rotate-hint { display: none; }

.shift-tag, .shift-part {
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 800;
}

.shift-tag { padding: 6px 10px; font-size: 0.78rem; }
.unified-schedule-calendar .calendar-day {
  display: block;
  min-height: 148px;
  cursor: pointer;
}
.unified-schedule-calendar .calendar-day:hover { border-color: var(--accent); }
.unified-schedule-calendar .shift-part { display: block; min-height: 0; margin-top: 5px; padding: 6px 8px; }
.shift-day { color: var(--schedule-day-text); border-color: var(--schedule-day-bg); background: var(--schedule-day-bg); }
.shift-mid { color: #d9b5ff; border-color: rgba(190, 129, 255, 0.5); background: rgba(190, 129, 255, 0.15); }
.shift-night { color: var(--schedule-night-text); border-color: var(--schedule-night-bg); background: var(--schedule-night-bg); }
.shift-manager { color: var(--schedule-manager-text); border-color: var(--schedule-manager-bg); background: var(--schedule-manager-bg); }
.shift-porter { color: var(--schedule-porter-text); border-color: var(--schedule-porter-bg); background: var(--schedule-porter-bg); }
.shift-housekeeping-assistant { color: var(--schedule-housekeeping-text); border-color: var(--schedule-housekeeping-bg); background: var(--schedule-housekeeping-bg); }
.shift-trainee { color: var(--schedule-day-text); border-color: var(--schedule-day-bg); background: var(--schedule-day-bg); }
.tooltip-trigger { position: relative; display: inline-grid; width: 17px; height: 17px; place-items: center; border: 1px solid currentColor; border-radius: 50%; color: var(--accent); font-size: .72rem; font-weight: 800; cursor: help; }
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after { position: absolute; z-index: 110; left: 50%; bottom: calc(100% + 8px); width: max-content; max-width: min(280px, 80vw); padding: 8px 10px; border-radius: 7px; background: #111b29; color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .28); content: attr(data-tooltip); font-size: .75rem; font-weight: 500; line-height: 1.35; opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .15s ease, transform .15s ease; }
[data-tooltip]:hover::after, [data-tooltip]:focus::after { opacity: 1; transform: translate(-50%, 0); }

.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 8, 14, 0.72); backdrop-filter: blur(6px); }
.modal-card {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.schedule-readonly .schedule-calendar { pointer-events: none; }
.calendar-weekday { padding: 0 4px 6px; color: var(--muted); font-size: 0.72rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.unified-schedule-calendar .calendar-day.is-my-shift { border-color: #e6f0ff; box-shadow: inset 0 0 0 1px rgba(100, 167, 255, 0.9), 0 0 18px rgba(100, 167, 255, 0.18); }

.schedule-day strong {
  margin-bottom: 7px;
}

.shift-split {
  display: grid;
  gap: 6px;
}

.shift-part {
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.13);
  color: var(--text);
  overflow-wrap: anywhere;
}

.shift-part b {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.shift-day { border-color: rgba(244, 199, 107, 0.36); }
.shift-night { border-color: rgba(100, 167, 255, 0.36); }
.shift-full { border-color: rgba(115, 223, 179, 0.34); }
.shift-part.shift-day { color: var(--schedule-day-text); border-color: var(--schedule-day-bg); background: var(--schedule-day-bg); }
.shift-part.shift-mid { color: #d9b5ff; border-color: rgba(190, 129, 255, 0.5); background: rgba(190, 129, 255, 0.15); }
.shift-part.shift-night { color: var(--schedule-night-text); border-color: var(--schedule-night-bg); background: var(--schedule-night-bg); }
.shift-part.shift-manager { color: var(--schedule-manager-text); border-color: var(--schedule-manager-bg); background: var(--schedule-manager-bg); }
.shift-part.shift-porter { color: var(--schedule-porter-text); border-color: var(--schedule-porter-bg); background: var(--schedule-porter-bg); }
.shift-part.shift-housekeeping-assistant { color: var(--schedule-housekeeping-text); border-color: var(--schedule-housekeeping-bg); background: var(--schedule-housekeeping-bg); }
.shift-part.shift-trainee { color: var(--schedule-day-text); border-color: var(--schedule-day-bg); background: var(--schedule-day-bg); }
.schedule-calendar .calendar-day.is-my-shift-day, .schedule-calendar .shift-part.shift-day.is-my-schedule { border-color: var(--schedule-day-bg); box-shadow: inset 0 0 0 2px var(--schedule-day-bg), 0 0 20px color-mix(in srgb, var(--schedule-day-bg) 25%, transparent); }
.schedule-calendar .calendar-day.is-my-shift-mid, .schedule-calendar .shift-part.shift-mid.is-my-schedule { border-color: #d9b5ff; box-shadow: inset 0 0 0 2px rgba(190, 129, 255, .9), 0 0 20px rgba(190, 129, 255, .25); }
.schedule-calendar .calendar-day.is-my-shift-night, .schedule-calendar .shift-part.shift-night.is-my-schedule { border-color: var(--schedule-night-bg); box-shadow: inset 0 0 0 2px var(--schedule-night-bg), 0 0 20px color-mix(in srgb, var(--schedule-night-bg) 25%, transparent); }
.schedule-calendar .calendar-day.is-my-shift-manager, .schedule-calendar .shift-part.shift-manager.is-my-schedule { border-color: var(--schedule-manager-bg); box-shadow: inset 0 0 0 2px var(--schedule-manager-bg), 0 0 20px color-mix(in srgb, var(--schedule-manager-bg) 25%, transparent); }
.schedule-calendar .calendar-day.is-my-shift-porter, .schedule-calendar .shift-part.shift-porter.is-my-schedule { border-color: var(--schedule-porter-bg); box-shadow: inset 0 0 0 2px var(--schedule-porter-bg), 0 0 20px color-mix(in srgb, var(--schedule-porter-bg) 25%, transparent); }
.schedule-calendar .calendar-day.is-my-shift-housekeeping, .schedule-calendar .shift-part.shift-housekeeping-assistant.is-my-schedule { border-color: var(--schedule-housekeeping-bg); box-shadow: inset 0 0 0 2px var(--schedule-housekeeping-bg), 0 0 20px color-mix(in srgb, var(--schedule-housekeeping-bg) 25%, transparent); }
.schedule-calendar .calendar-day.is-my-shift-trainee, .schedule-calendar .shift-part.shift-trainee.is-my-schedule { border-color: var(--schedule-day-bg); box-shadow: inset 0 0 0 2px var(--schedule-day-bg), 0 0 20px color-mix(in srgb, var(--schedule-day-bg) 25%, transparent); }

.discount-form {
  display: grid;
  grid-template-columns: minmax(140px, 220px) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.checkline,
.discount-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkline input,
.discount-row input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
}

.discount-row {
  justify-content: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.discount-row span {
  display: grid;
  gap: 4px;
  color: var(--text);
}

.day-details {
  margin-top: 16px;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 14px;
    padding: 14px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }
  .nav-item { flex: 0 0 auto; }
  .shift-card { display: none; }
  .stats-grid, .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .parking-tutorial-grid { grid-template-columns: 1fr; }
  .parking-stats { gap: 6px; }
  .parking-stat { min-height: 82px; padding: 10px 4px; flex-direction: column-reverse; justify-content: center; gap: 5px; border-radius: 10px; }
  .parking-stat span { font-size: .67rem; font-weight: 600; }
  .parking-stat strong { font-size: 1.5rem; }
  .parking-map-caption { padding: 14px 12px; font-size: .65rem; }
  .parking-map-caption span:last-child { display: none; }
  .parking-map-footnote { padding: 12px; font-size: .7rem; }
  .app-shell.parking-mode .main { padding: 16px 12px; }
  body { font-size: 15px; }
  .login-screen { padding: 16px; }
  .login-card { padding: 22px 18px; }
  .sidebar { padding: 10px 12px; }
  .sidebar .brand { display: none; }
  .main { padding: 14px 12px 24px; }
  h2 { font-size: 1.4rem; }
  .topbar, .panel-head, .toolbar-head { flex-direction: column; align-items: stretch; }
  .topbar { gap: 12px; margin-bottom: 16px; }
  .topbar-actions > button { width: 100%; }
  .panel { padding: 14px; }
  .form-grid, .inline-form, .stats-grid, .nav { grid-template-columns: 1fr; }
  .subtabs {
    display: flex;
    margin: 0 -2px 14px;
    padding: 4px;
  }
  .subtab { flex: 0 0 auto; white-space: nowrap; }
  .discount-form { grid-template-columns: 1fr; }
  .filters { align-items: stretch; }
  .filters > * { flex: 1 1 100%; }
  .debt-list-toolbar { grid-template-columns: 1fr; }
  .debt-list-heading { padding-top: 0; }
  .debt-list-summary.stats-grid { width: 100%; grid-template-columns: 1fr; }
  .debt-list-summary .metric { min-height: 84px; }
  .debt-list-toolbar .filters { width: 100%; justify-items: end; }
  .debt-list-toolbar .filters > * { max-width: none; }
  .primary-button, .ghost-button, .danger-button { min-height: 44px; }
  .list-row { align-items: flex-start; flex-direction: column; }
  .row-actions { width: 100%; }
  .row-actions > button { flex: 1 1 auto; }
  .calendar-grid { gap: 6px; }
  .calendar-day {
    min-height: 66px;
    padding: 6px;
    border-radius: 6px;
  }
  .calendar-day strong { margin-bottom: 4px; font-size: 0.82rem; }
  .calendar-day span { font-size: 0.7rem; }
  .schedule-calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .schedule-calendar .calendar-day { min-height: 112px; }
  .unified-schedule-calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .unified-schedule-calendar .calendar-day { min-height: 82px; padding: 5px; }
  .unified-schedule-calendar .calendar-day strong { font-size: 0.76rem; }
  .unified-schedule-calendar .shift-part { margin-top: 3px; padding: 4px; font-size: 0.62rem; overflow-wrap: anywhere; }
  .schedule-panel { min-height: auto; }
  .schedule-legend { gap: 5px; }
  .shift-tag { padding: 5px 7px; font-size: 0.68rem; }
  .modal { padding: 12px; }
  .modal-card { padding: 16px; }
  .shift-part { min-height: 36px; padding: 6px; font-size: 0.78rem; }
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .main { padding-inline: 10px; }
  .panel { padding: 12px; }
  .calendar-grid { gap: 4px; }
  .calendar-day { min-height: 58px; padding: 5px; }
  .schedule-calendar { grid-template-columns: 1fr; }
  .unified-schedule-calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .unified-schedule-calendar .calendar-day { min-height: 72px; }
}

/* Settings and lost-items layouts: final overrides after legacy list styles. */
.room-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.room-chip { display: grid; gap: 10px; align-content: start; min-height: 150px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.lost-list { display: grid; gap: 14px; }
.lost-card { display: grid; grid-template-columns: 78px minmax(0, 1fr) minmax(180px, auto); gap: 16px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
@media (max-width: 720px) { .room-grid { grid-template-columns: 1fr; } .lost-card { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; } .lost-actions { grid-column: 1 / -1; min-width: 0; } }

/* Phone-first controls and readable schedule calendar. */
@media (max-width: 700px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }
  .sidebar { position: sticky; top: 0; gap: 8px; padding: 8px 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
  .nav { gap: 6px; margin: 0 -2px; padding: 1px 2px 7px; scroll-snap-type: x proximity; }
  .nav-item { min-height: 44px; padding: 0 14px; scroll-snap-align: start; }
  .main { padding: 12px 10px calc(24px + env(safe-area-inset-bottom)); }
  .topbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .topbar-actions > button { width: auto; }
  .panel { padding: 13px; border-radius: 12px; }
  .panel-head > input, .toolbar-head > input, .panel-head > select, .toolbar-head > select { width: 100%; }
  .subtabs { position: sticky; top: 59px; z-index: 6; margin-inline: -2px; box-shadow: 0 5px 10px rgba(0, 0, 0, .12); }
  .subtab { min-height: 42px; padding-inline: 14px; }
  input, select { min-height: 44px; font-size: 16px; }
  .small-button { min-height: 38px; font-size: .86rem; }
  .form-grid { gap: 12px; }
  .form-grid .primary-button.wide { min-height: 48px; }
  .inline-form { gap: 10px; }
  .filters { gap: 8px; }
  .filters input, .filters select { min-width: 0; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: 12px; }
  .metric strong { margin: 6px 0 3px; font-size: 1.25rem; }
  .table-wrap { margin-inline: -13px; border-radius: 0; border-inline: 0; -webkit-overflow-scrolling: touch; }
  table { min-width: 760px; }
  th, td { padding: 10px; }
  .record-card, .lost-card { grid-template-columns: 50px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .record-icon, .lost-photo { width: 50px; height: 50px; font-size: 22px; }
  .record-actions, .lost-actions, .salary-total { grid-column: 1 / -1; min-width: 0; text-align: left; justify-content: flex-start; }
  .record-actions > button, .lost-actions .row-actions > button { flex: 1 1 130px; }
  .record-details, .lost-details { gap: 6px 10px; font-size: .78rem; }
  .schedule-panel { padding: 11px; overflow: hidden; }
  .schedule-head { gap: 10px; }
  .schedule-head input { width: 100%; }
  .schedule-legend { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .schedule-legend .shift-tag { flex: 0 0 auto; }
  .unified-schedule-calendar { grid-template-columns: repeat(7, minmax(108px, 1fr)); width: max-content; min-width: 100%; gap: 7px; overflow: visible; }
  .schedule-calendar { display: grid; overflow-x: auto; max-width: 100%; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
  .unified-schedule-calendar .calendar-day { min-height: 124px; padding: 7px; }
  .unified-schedule-calendar .calendar-day strong { font-size: .88rem; }
  .unified-schedule-calendar .shift-part { min-height: 0; margin-top: 5px; padding: 6px; font-size: .72rem; line-height: 1.25; }
  .calendar-weekday { font-size: .7rem; }
  .modal { align-items: end; padding: 0; }
  .modal-card { width: 100%; max-height: 92vh; overflow-y: auto; padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; }
  .toast { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; max-width: none; }
}

@media (max-width: 390px) {
  .topbar-actions { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .main { padding-inline: 8px; }
  .panel { padding: 11px; }
  .unified-schedule-calendar { grid-template-columns: repeat(7, minmax(98px, 1fr)); }
  .unified-schedule-calendar .calendar-day { min-height: 116px; }
}

/* Mobile drawer: the page itself scrolls vertically, with navigation in a burger menu. */
@media (max-width: 900px) {
  html, body { width: 100%; overflow-x: hidden; }
  body.menu-open { overflow: hidden; }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(310px, 86vw);
    max-width: none;
    gap: 18px;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 16px 0 38px rgba(0, 0, 0, .35);
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  body.menu-open .sidebar { transform: translateX(0); }
  .sidebar .brand { display: flex; }
  .sidebar-collapse { display: none; }
  .sidebar .shift-card { display: block; margin-top: 0; }
  .nav { display: grid; gap: 6px; overflow: visible; margin: 0; padding: 0; }
  .nav-item { width: 100%; min-height: 46px; text-align: left; }
  .nav-badge { float: none; }
  .sidebar-logout { width: 100%; min-height: 46px; margin-top: auto; }
  .menu-backdrop { display: block; position: fixed; z-index: 40; inset: 0; border: 0; background: rgba(3, 7, 13, .58); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  body.menu-open .menu-backdrop { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-content: center; gap: 5px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
  .menu-toggle span { display: block; width: 20px; height: 2px; border-radius: 9px; background: var(--text); transition: transform .2s ease, opacity .2s ease; }
  body.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  body.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .topbar { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
  .topbar > div { min-width: 0; }
  .topbar h2 { margin: 0; }
  .subtabs { position: static; overflow: visible; display: grid; grid-template-columns: 1fr; padding: 5px; }
  .subtab { width: 100%; text-align: left; white-space: normal; }
  .unified-schedule-calendar { grid-template-columns: 1fr; width: 100%; min-width: 0; gap: 8px; }
  .schedule-calendar { display: grid; overflow: visible; padding-bottom: 0; }
  .schedule-calendar .calendar-weekday { display: none; }
  .unified-schedule-calendar .calendar-day { min-height: 0; padding: 10px; }
  .unified-schedule-calendar .calendar-day strong { font-size: .95rem; }
  .unified-schedule-calendar .shift-part { padding: 8px; font-size: .82rem; }
  .schedule-rotate-hint { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; padding: 10px; border: 1px solid rgba(100, 167, 255, .32); border-radius: 10px; background: var(--accent-soft); color: var(--text); }
  .schedule-rotate-hint > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; color: #9ec9ff; background: rgba(100, 167, 255, .17); font-size: 1.45rem; }
  .schedule-rotate-hint strong, .schedule-rotate-hint small { display: block; }
  .schedule-rotate-hint small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .main { padding: 8px 10px 20px; }
  .topbar { margin-bottom: 8px; }
  .topbar h2 { font-size: 1.2rem; }
  .schedule-rotate-hint { display: none; }
  .schedule-panel { display: block; min-height: 0; height: auto; padding: 12px; overflow: visible; }
  .schedule-head { margin-bottom: 10px; }
  .schedule-head input { min-height: 40px; }
  .schedule-calendar { display: grid; overflow: visible; width: 100%; max-width: 100%; padding: 0; }
  .schedule-calendar .calendar-weekday { display: none; }
  .unified-schedule-calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; min-width: 0; gap: 7px; }
  .unified-schedule-calendar .calendar-day { min-height: 145px; padding: 8px; }
  .unified-schedule-calendar .calendar-day strong { margin-bottom: 6px; font-size: .9rem; }
  .unified-schedule-calendar .shift-part { min-height: 0; margin-top: 5px; padding: 7px; font-size: .78rem; line-height: 1.25; }
  .schedule-legend { gap: 6px; margin: 0 0 10px; }
  .shift-tag { padding: 5px 8px; font-size: .7rem; }
}

@media (max-width: 900px) and (orientation: portrait) {
  .schedule-panel { display: grid; min-height: 58vh; place-content: center; }
  .schedule-panel .schedule-head, .schedule-panel .schedule-legend, .schedule-panel .schedule-calendar { display: none; }
  .schedule-rotate-hint { display: grid; justify-items: center; gap: 14px; max-width: 300px; margin: 0; padding: 24px 20px; text-align: center; border-color: rgba(100, 167, 255, .46); }
  .schedule-rotate-hint > span { width: 74px; height: 74px; border-radius: 18px; font-size: 3rem; animation: rotate-phone 1.9s ease-in-out infinite; }
  .schedule-rotate-hint strong { font-size: 1.05rem; }
  .schedule-rotate-hint small { max-width: 230px; font-size: .85rem; line-height: 1.45; }
  #requestsBoardTab.is-active { display: grid; min-height: 58vh; place-content: center; }
  #requestsBoardTab.is-active > .panel { display: none; }
  .requests-rotate-hint { display: grid; justify-items: center; gap: 14px; max-width: 300px; padding: 24px 20px; text-align: center; border: 1px solid rgba(100, 167, 255, .46); border-radius: 10px; background: var(--accent-soft); }
  .requests-rotate-hint > span { display: grid; width: 74px; height: 74px; place-items: center; border-radius: 18px; color: #9ec9ff; background: rgba(100, 167, 255, .17); font-size: 3rem; animation: rotate-phone 1.9s ease-in-out infinite; }
  .requests-rotate-hint strong, .requests-rotate-hint small { display: block; }
  .requests-rotate-hint strong { font-size: 1.05rem; }
  .requests-rotate-hint small { max-width: 230px; margin-top: 2px; color: var(--muted); font-size: .85rem; line-height: 1.45; }
}

@keyframes rotate-phone {
  0%, 18% { transform: rotate(0deg); }
  48%, 70% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

/* Lost-item cards follow the reference layout without changing the theme palette. */
.lost-card { grid-template-columns: 132px minmax(0, 1fr) 188px; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.lost-photo { width: auto; height: auto; min-height: 180px; align-self: stretch; border-radius: 0; }
.lost-content { display: flex; min-width: 0; flex-direction: column; padding: 14px 16px; }
.lost-title { align-items: center; }
.lost-title strong { display: flex; min-width: 0; align-items: flex-start; gap: 8px; }
.lost-title strong > span { overflow-wrap: anywhere; }
.lost-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 14px 0; }
.lost-details > span { display: flex; min-width: 0; align-items: center; gap: 7px; }
.lost-details b { min-width: 0; overflow-wrap: anywhere; }
.lost-inline-icon { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lost-added { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.lost-added > span { width: 16px; height: 16px; flex: 0 0 16px; }
.lost-added small { color: var(--muted); }
.lost-actions { align-content: center; min-width: 0; padding: 14px; border-left: 1px solid var(--line); }
.lost-action-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.lost-action-button .lost-inline-icon { width: 15px; height: 15px; flex-basis: 15px; }
@media (max-width: 720px) {
  .lost-card { grid-template-columns: 92px minmax(0, 1fr); }
  .lost-photo { grid-row: 1 / 3; width: auto; min-height: 100%; }
  .lost-content { padding: 12px 12px 8px; }
  .lost-details { grid-template-columns: 1fr; gap: 8px; margin: 11px 0; }
  .lost-actions { grid-column: 2; min-width: 0; padding: 0 12px 12px; border-left: 0; }
}

.schedule-table-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 12px; }
.schedule-legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; }
.schedule-legend-item b { color: var(--text); font-size: .82rem; }
.schedule-legend-dot { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 50%; }
.schedule-tone-day { background: var(--schedule-day-bg); }
.schedule-tone-night { background: var(--schedule-night-bg); }
.schedule-tone-double { background: var(--schedule-double-bg); }
.schedule-tone-porter { background: var(--schedule-porter-bg); }
.schedule-tone-manager { background: var(--schedule-manager-bg); }
.schedule-matrix td.has-shift.schedule-tone-day { color: var(--schedule-day-text); background: var(--schedule-day-bg); }
.schedule-matrix td.has-shift.schedule-tone-night { color: var(--schedule-night-text); background: var(--schedule-night-bg); }
.schedule-matrix td.has-shift.schedule-tone-double { color: var(--schedule-double-text); background: var(--schedule-double-bg); }
.schedule-matrix td.has-shift.schedule-tone-porter { color: var(--schedule-porter-text); background: var(--schedule-porter-bg); }
.schedule-matrix td.has-shift.schedule-tone-manager { color: var(--schedule-manager-text); background: var(--schedule-manager-bg); }
.schedule-matrix thead th.schedule-weekend { background: #e2d8ce; }
:root:not([data-theme="light"]) .schedule-matrix thead th.schedule-weekend { color: #f0e9df; background: #29272a; }

/* Standalone browser-based document workspace and the manager's file-only accounts. */
.app-shell.files-mode { display: block; min-height: 100vh; height: auto; overflow: visible; }
.app-shell.files-mode .sidebar, .app-shell.files-mode .topbar, .app-shell.files-mode .team-alert-banner { display: none; }
.app-shell.files-mode .main { width: 100%; height: auto; min-height: 100vh; padding: clamp(18px, 4vw, 48px); overflow: visible; }
.files-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.files-page-head h2 { margin-bottom: 6px; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.files-page-head p:last-child { margin-bottom: 0; color: var(--muted); }
.files-privacy-note { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface); line-height: 1.5; }
.files-privacy-note > span:first-child { font-size: 1.2rem; }
.files-privacy-note strong { color: var(--text); }
.files-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.file-tool-card { display: grid; gap: 13px; min-width: 0; padding: 20px; }
.file-tool-heading { display: flex; align-items: center; gap: 12px; }
.file-tool-heading .eyebrow { margin-bottom: 3px; }
.file-tool-icon { display: grid; min-width: 44px; height: 44px; place-items: center; padding: 0 5px; border: 1px solid var(--line); border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-size: 1.35rem; font-weight: 750; }
.file-tool-description, .file-hint { margin: 0; color: var(--muted); line-height: 1.5; }
.file-hint { font-size: .83rem; }
.file-picker { position: relative; display: flex; min-height: 44px; align-items: center; justify-content: center; padding: 8px 12px; border: 1px dashed var(--accent); border-radius: 9px; color: var(--text); background: var(--accent-soft); cursor: pointer; text-align: center; }
.file-picker:hover { border-style: solid; }
.file-picker input { width: 1px; height: 1px; position: absolute; overflow: hidden; clip-path: inset(50%); }
.file-selected-file { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.file-selected-file:empty { display: none; }
.selected-file-icon { display: grid; width: 30px; height: 34px; flex: 0 0 30px; place-items: center; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 1.2rem; }
.selected-file-name { display: grid; min-width: 0; flex: 1; gap: 2px; }
.selected-file-name strong { overflow: hidden; font-size: .84rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.selected-file-name small { color: var(--muted); font-size: .75rem; }
.selected-file-clear { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface-3); font-size: 1.1rem; }
.selected-file-clear:hover { color: var(--danger); border-color: var(--danger); }
.file-tool-card > label:not(.file-picker) { display: grid; gap: 7px; color: var(--muted); font-size: .88rem; }
.file-operation-list { display: grid; gap: 7px; max-height: 220px; overflow: auto; }
.file-operation-row, .file-account-row { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.file-row-index { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; border-radius: 50%; color: var(--muted); background: var(--surface-3); font-size: .75rem; }
.file-row-name { display: grid; min-width: 0; flex: 1; overflow: hidden; font-size: .86rem; text-overflow: ellipsis; }
.file-row-name small, .file-account-row small { color: var(--muted); font-size: .75rem; }
.file-row-actions { display: flex; gap: 4px; }
.file-row-actions .small-button { min-width: 30px; padding: 0 7px; }
.file-action-button { width: 100%; }
.file-operation-status { min-height: 1.3em; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.file-operation-status.is-error { color: var(--danger); }
.file-progress { display: grid; gap: 6px; }
.file-progress-track { position: relative; height: 8px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.file-progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); transition: width .25s ease; }
.file-progress.is-indeterminate .file-progress-track > span { width: 34%; animation: file-progress-slide 1.25s ease-in-out infinite alternate; }
.file-progress.is-complete .file-progress-track > span { background: var(--success); }
.file-progress > small { color: var(--muted); font-size: .76rem; }
.file-progress-only > small { display: none; }
@keyframes file-progress-slide { from { transform: translateX(0); } to { transform: translateX(195%); } }
.file-account-row { justify-content: space-between; margin-top: 8px; }
.file-account-row > div { display: grid; gap: 3px; }
.docx-render-stage { position: fixed; z-index: -1; top: 0; left: -10000px; width: 780px; padding: 32px; color: #111; background: #fff; font-family: Arial, sans-serif; font-size: 12pt; line-height: 1.45; }
.docx-render-stage table { width: 100%; border-collapse: collapse; }
.docx-render-stage td, .docx-render-stage th { padding: 5px; border: 1px solid #999; }
.docx-render-stage img { max-width: 100%; }
@media (max-width: 760px) {
  .app-shell.files-mode .main { padding: 18px 12px; }
  .files-tools-grid { grid-template-columns: 1fr; }
  .files-page-head { align-items: flex-start; }
  .file-tool-card { padding: 16px; }
  .parking-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parking-category-option { min-height: 46px; padding: 7px; gap: 6px; }
  .parking-category-option span { font-size: .75rem; }
}
