:root {
    --ink: #15211d;
    --muted: #69736f;
    --canvas: #f3f5f2;
    --surface: #ffffff;
    --line: #e2e7e3;
    --brand: #1d6b4f;
    --brand-dark: #102b22;
    --brand-soft: #dcece5;
    --duty: #d8eadf;
    --off: #f6e5b8;
    --leave: #dfe5f8;
    --danger: #a63c3c;
    --shadow: 0 14px 35px rgba(24, 49, 39, .08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input { font: inherit; }
a { color: inherit; }

.app-frame { width: min(100%, 1440px); min-height: 100vh; margin: 0 auto; padding-top: 92px; padding-bottom: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 24px 20px 12px; }
.topbar h1 { margin: 2px 0 0; font-size: clamp(1.45rem, 5vw, 2.1rem); letter-spacing: -.035em; }
.eyebrow { margin: 0; color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.avatar, .staff-row__avatar { display: grid; flex: 0 0 auto; overflow: hidden; place-items: center; border-radius: 50%; background: var(--brand-dark); color: white; font-weight: 800; text-decoration: none; }
.avatar { width: 46px; height: 46px; box-shadow: 0 0 0 5px rgba(29, 107, 79, .1); }
.avatar img, .staff-row__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-dropdown { position: relative; z-index: 30; flex: 0 0 auto; }
.avatar--button { padding: 0; border: 0; cursor: pointer; }
.avatar-dropdown.is-open .avatar { box-shadow: 0 0 0 5px rgba(29, 107, 79, .18), 0 12px 28px rgba(12,35,27,.18); }
.avatar-menu { top: calc(100% + 14px); min-width: 180px; font-size: .82rem; }
.main-content { display: grid; gap: 16px; padding: 12px 16px 24px; }

.notice { padding: 14px 16px; border: 1px solid; border-radius: 14px; font-weight: 700; }
.notice--success { color: #225e46; border-color: #bcdcca; background: #e8f5ed; }
.notice--error { color: #8d3333; border-color: #e8bcbc; background: #fbecec; }
.impersonation-bar { position: sticky; z-index: 60; top: 0; left: 0; display: flex; width: 100%; max-width: none; align-items: center; justify-content: center; gap: 12px; padding: 10px 16px; border: 0; border-bottom: 1px solid rgba(246, 229, 184, .95); border-radius: 0; background: #fff7dc; color: #6b4f10; box-shadow: 0 8px 24px rgba(24,49,39,.08); font-size: .72rem; font-weight: 800; }
.impersonation-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.impersonation-bar button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--brand-dark); color: white; font: inherit; cursor: pointer; }

#toast-container > .toast {
    width: min(420px, calc(100vw - 32px));
    padding: 15px 44px 15px 52px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 16px;
    background-position: 16px center;
    box-shadow: 0 18px 45px rgba(11, 35, 26, .18);
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.4;
    opacity: .98;
}

#toast-container.toast-top-right {
    top: calc(18px + env(safe-area-inset-top));
    right: calc(18px + env(safe-area-inset-right));
}

#toast-container.toast-bottom-full-width {
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(104px + env(safe-area-inset-bottom));
    left: calc(12px + env(safe-area-inset-left));
    width: auto;
}

#toast-container.toast-bottom-full-width > .toast {
    width: 100%;
    margin: 0 0 10px;
}

#toast-container > .toast-success {
    background-color: var(--brand);
}

#toast-container > .toast-error {
    background-color: var(--danger);
}

#toast-container > .toast-success,
#toast-container > .toast-error {
    color: white;
}

#toast-container > .toast .toast-close-button {
    top: -.2em;
    right: -.3em;
    color: white;
    opacity: .85;
    text-shadow: none;
}

#toast-container > .toast .toast-progress {
    height: 3px;
    background-color: rgba(255,255,255,.75);
    opacity: 1;
}

.duty-hero { position: relative; display: flex; min-height: 190px; overflow: hidden; padding: 24px; border-radius: 26px; background: linear-gradient(140deg, #102b22, #184c3a 70%, #287158); color: white; box-shadow: var(--shadow); }
.duty-hero::after { position: absolute; right: -50px; bottom: -85px; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; content: ""; }
.duty-hero__copy { z-index: 1; align-self: center; }
.duty-hero h2 { margin: 18px 0 4px; font-size: 2.25rem; letter-spacing: -.05em; }
.duty-hero p { max-width: 28rem; margin: 0; color: rgba(255,255,255,.72); line-height: 1.55; }
.duty-hero .duty-hero__time { margin-top: 9px; color: rgba(255,255,255,.92); font-size: .76rem; font-weight: 800; letter-spacing: .03em; }
.duty-hero__mark { position: absolute; right: 24px; top: 50%; display: grid; width: 68px; height: 68px; place-items: center; transform: translateY(-50%); border: 1px solid rgba(255,255,255,.28); border-radius: 22px; background: rgba(255,255,255,.1); font-size: 1.8rem; font-weight: 900; backdrop-filter: blur(8px); }
.status-pill { display: inline-flex; padding: 7px 10px; border-radius: 999px; background: #dbf4e7; color: #144c37; font-size: .72rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.status-pill--quiet { background: rgba(255,255,255,.12); color: white; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat-card { min-height: 108px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.stat-card span { display: block; min-height: 34px; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.stat-card strong { display: block; margin-top: 8px; color: var(--brand-dark); font-size: 1.75rem; letter-spacing: -.04em; }
.stat-card small { color: var(--muted); font-size: .85rem; }

.panel { overflow: hidden; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 8px 24px rgba(29, 58, 47, .04); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2, .profile-summary h2 { margin: 4px 0 0; font-size: 1.25rem; letter-spacing: -.025em; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 15px; border: 0; border-radius: 12px; font-weight: 800; text-decoration: none; cursor: pointer; }
.button--secondary { border: 1px solid var(--line); background: #f7f9f7; color: var(--ink); }

.schedule-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.schedule-tab { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: #f7f9f7; color: var(--muted); font: inherit; font-size: .78rem; font-weight: 900; cursor: pointer; }
.schedule-tab.is-active { border-color: rgba(29, 107, 79, .22); background: var(--brand-dark); color: white; box-shadow: 0 10px 22px rgba(12,35,27,.12); }
.schedule-tab-panel.is-hidden { display: none; }

.day-list, .staff-list { display: grid; gap: 4px; }
.day-row { display: grid; grid-template-columns: 52px 1fr 14px; align-items: center; gap: 12px; min-height: 68px; padding: 8px 10px; border-radius: 14px; }
.day-row + .day-row { border-top: 1px solid #edf0ed; }
.day-row--today { border: 0 !important; background: #f0f7f3; }
.day-row time { display: grid; grid-template-columns: 1fr 1fr; align-items: baseline; gap: 4px; }
.day-row time span { color: var(--muted); font-size: .7rem; font-weight: 700; }
.day-row time strong { font-size: 1.2rem; }
.day-row__people { display: grid; gap: 4px; font-size: .84rem; font-weight: 700; }
.day-row__callsign { color: var(--brand); font-style: normal; font-weight: 800; }
.muted { color: var(--muted); font-weight: 500; }
.duty-dot { width: 9px; height: 9px; border-radius: 50%; background: #d8ddd9; }
.duty-dot--ready { background: var(--brand); box-shadow: 0 0 0 4px rgba(29,107,79,.1); }

.count-badge { min-width: 34px; padding: 7px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); text-align: center; font-weight: 900; }
.staff-heading-actions { display: flex; align-items: center; gap: 8px; }
.staff-heading-actions .button { min-height: 36px; padding: 0 11px; font-size: .7rem; }
.staff-add-button { background: var(--brand-dark); color: white; }
.staff-row__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.staff-row__actions .tag { flex: 0 0 100%; width: max-content; margin-left: auto; }
.staff-row__actions form { display: inline-flex; margin: 0; }
.staff-action { min-height: 32px; padding: 0 9px; font-size: .66rem; }
.main-content > .staff-page__list { grid-column: 1 / -1 !important; }
.staff-group-title { margin: 14px 0 2px; padding: 9px 10px; border-radius: 10px; background: #f0f5f2; color: var(--brand); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.staff-group-title:first-child { margin-top: 0; }
.staff-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 0; }
.staff-row + .staff-row { border-top: 1px solid #edf0ed; }
.staff-row__avatar { display: grid !important; width: 40px; height: 40px; align-items: center; justify-items: center; place-items: center; background: #dfe9e4; color: var(--brand-dark); line-height: 1; text-align: center; }
.staff-row div { min-width: 0; }
.staff-row strong, .staff-row span { display: block; }
.staff-row strong { overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.staff-row__profile-link { text-decoration: none; }
.staff-row__profile-link:hover, .staff-row__profile-link:focus-visible { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.staff-row__callsign { color: var(--brand); font-style: normal; font-weight: 800; }
.staff-row div > span { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.staff-row__status { text-align: right; }

.reports-upload-form { display: grid; gap: 12px; }
.reports-upload-form .schedule-dialog__field { margin: 0; }
.reports-primary-button { gap: 8px; background: var(--brand-dark); color: white; }
.reports-inline-form { margin: 0; }
.reports-hint { margin: 14px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.reports-template-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 20px 16px 0; }
.reports-add-box { margin: 0; }
.reports-add-box summary { width: fit-content; list-style: none; cursor: pointer; }
.reports-add-box summary::-webkit-details-marker, .reports-row-editor summary::-webkit-details-marker { display: none; }
.reports-add-box[open] { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: #f4faf6; }
.reports-add-box[open] summary { margin-bottom: 14px; }
.reports-variables-download { gap: 8px; min-height: 46px; white-space: nowrap; }
.reports-instruction { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 14px; border: 1px solid #d9e5df; border-radius: 16px; background: #f4faf6; color: #40524a; }
.reports-instruction .material-icons { color: var(--brand); font-size: 1.2rem; }
.reports-instruction p { margin: 0; font-size: .78rem; font-weight: 700; line-height: 1.55; }
.reports-variable-groups { display: grid; gap: 16px; }
.reports-variable-group { display: grid; gap: 9px; }
.reports-variable-group h3 { margin: 0; color: var(--brand); font-size: .78rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.reports-variable-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.reports-variable-token { display: grid; gap: 3px; min-height: 58px; padding: 10px 12px; border: 1px solid #d9e5df; border-radius: 14px; background: #f8fbf9; color: var(--brand); font: inherit; text-align: left; cursor: pointer; transition: background .18s ease, color .18s ease, transform .18s ease; }
.reports-variable-token strong { color: inherit; font-size: .74rem; font-weight: 900; line-height: 1.25; }
.reports-variable-token small { color: var(--muted); font-size: .64rem; font-weight: 700; line-height: 1.3; }
.reports-variable-token:hover, .reports-variable-token:focus-visible, .reports-variable-token.is-copied { outline: 0; background: var(--brand-dark); color: white; transform: translateY(-1px); }
.reports-variable-token:hover small, .reports-variable-token:focus-visible small, .reports-variable-token.is-copied small { color: rgba(255,255,255,.7); }
.reports-date-form { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.reports-date-form input { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9f7; color: var(--ink); }
.reports-bulk-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.reports-bulk-actions .button { min-height: 44px; gap: 8px; white-space: nowrap; }
.reports-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.reports-summary-grid article { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #f7f9f7; }
.reports-summary-grid span { display: block; color: var(--muted); font-size: .72rem; }
.reports-summary-grid strong { display: block; margin-top: 6px; color: var(--brand-dark); font-size: 1.65rem; }
.reports-template-list { display: grid; gap: 10px; padding-right: 20px; }
.reports-template-card { display: grid; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: #fbfcfb; }
.reports-template-card__main { display: flex; min-width: 0; gap: 12px; }
.reports-template-card__icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }
.reports-template-card h3 { margin: 0 0 4px; font-size: 1rem; }
.reports-template-card p { margin: 0 0 10px; color: var(--muted); font-size: .76rem; }
.reports-variables { display: flex; flex-wrap: wrap; gap: 6px; }
.reports-variables span { padding: 5px 8px; border-radius: 999px; background: #edf4f0; color: var(--brand); font-size: .68rem; font-weight: 800; }
.reports-template-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.reports-template-card__actions form { margin: 0; }
.reports-template-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.reports-icon-button { display: inline-flex; width: 36px; min-width: 36px; height: 36px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #87918d; box-shadow: none; }
.reports-icon-button:hover, .reports-icon-button:focus-visible { background: #edf4f0; color: var(--brand); }
.reports-icon-button .material-icons { font-size: 1.35rem; line-height: 1; }
.reports-delete-form { display: flex; align-items: center; margin: 0; }
.reports-delete-button { width: 36px; padding: 0; color: #87918d; }
.reports-delete-button:hover, .reports-delete-button:focus-visible { background: #fdeaea; color: var(--danger); }
.reports-empty { display: grid; justify-items: center; gap: 8px; padding: 28px 16px; color: var(--muted); text-align: center; }
.reports-empty .material-icons { color: var(--brand); font-size: 2rem; }
.reports-table-wrap { overflow-x: auto; padding-right: 20px; }
.reports-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; }
.reports-table th, .reports-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink); text-align: left; vertical-align: middle; }
.reports-table th:last-child, .reports-table td:last-child { text-align: right; }
.reports-table th:last-child { width: 180px; }
.reports-table th { background: #f4faf6; color: var(--brand); font-size: .76rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.reports-table tr:last-child td { border-bottom: 0; }
.reports-table td strong { font-size: .92rem; }
.reports-row-editor { position: relative; }
.reports-row-editor summary { width: fit-content; list-style: none; cursor: pointer; }
.reports-row-editor__body { position: absolute; z-index: 5; right: 0; display: grid; gap: 10px; min-width: min(760px, calc(100vw - 80px)); margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #f4faf6; box-shadow: 0 18px 42px rgba(12,35,27,.16); text-align: left; }
.reports-edit-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 10px; align-items: end; margin: 0; }
.reports-edit-form .schedule-dialog__field { margin: 0; }
.tag { display: inline-block !important; padding: 6px 8px; border-radius: 8px; background: #eaf0ed; color: #4f5b56 !important; font-size: .65rem !important; font-weight: 800; }
.tag--ready { background: #e5f4eb; color: #236046 !important; }
.tag--quiet { background: #f2f2f2; }
.tag--service { background: #e5f4eb; color: #236046 !important; }
.tag--day-off { background: #fff1c9; color: #715510 !important; }
.tag--leave { background: #e7ebfa; color: #33497a !important; }
.tag--trip { background: #eee7f7; color: #60417f !important; }
.tag--vlk { background: #f9e5e2; color: #873e35 !important; }
.tag--inspection { background: #e8f0f8; color: #31536d !important; }
.tag--camp { background: #e6f2dc; color: #526d31 !important; }
.tag--szch { background: #fde2e2; color: #9a1c1c !important; }
.tag--reserve { background: #ecefed; color: #58625d !important; }

.panel--wide { padding-right: 0; }
.panel--wide .section-heading { padding-right: 20px; }
.legend { display: none; gap: 12px; color: var(--muted); font-size: .7rem; font-weight: 700; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.matrix-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.legend__duty { background: var(--duty); }
.legend__off { background: var(--off); }
.legend__leave { background: var(--leave); }
.legend__trip { background: #eee7f7; }
.legend__vlk { background: #f9e5e2; }
.legend__inspection { background: #e8f0f8; }
.legend__camp { background: #e6f2dc; }
.matrix-scroll { overflow-x: auto; padding-bottom: 8px; scrollbar-color: #b7c3bd transparent; }
.schedule-matrix { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: .72rem; }
.schedule-matrix th, .schedule-matrix td { min-width: 40px; height: 42px; border-right: 1px solid #e8ece9; border-bottom: 1px solid #e8ece9; text-align: center; }
.schedule-matrix thead th { position: sticky; top: 32px; background: #f8faf8; font-weight: 900; }
.schedule-matrix__months th { height: 32px; color: var(--brand); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.schedule-matrix__months th { top: 0; }
.schedule-matrix__months th:not(:first-child) { background: #eef5f1; text-align: center; }
.schedule-matrix thead th span { display: block; margin-bottom: 2px; color: var(--muted); font-size: .56rem; }
.schedule-matrix th:first-child { position: sticky; left: 0; z-index: 2; min-width: 210px; padding: 0 10px; border-left: 1px solid #e8ece9; background: #fff; text-align: left; white-space: nowrap; }
.schedule-matrix thead th:first-child { z-index: 3; background: #f8faf8; }
.schedule-matrix .is-today { box-shadow: inset 2px 0 var(--brand), inset -2px 0 var(--brand); }
.schedule-date-button { display: grid; width: 100%; height: 100%; min-height: 42px; padding: 0; place-items: center; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 900; cursor: pointer; }
.schedule-date-button span { display: block; margin-bottom: 2px; color: var(--muted); font-size: .56rem; }
.schedule-date-button:hover, .schedule-date-button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; background: rgba(29, 107, 79, .08); }
.schedule-date-button:disabled, .schedule-date-button--locked { outline: 0; cursor: default; opacity: .72; }
.schedule-matrix .cell-duty { background: var(--duty); color: #14523a; font-weight: 900; }
.schedule-matrix .cell-off { background: var(--off); color: #765b17; font-weight: 900; }
.schedule-matrix .cell-leave { background: var(--leave); color: #324778; font-weight: 900; }
.schedule-matrix .cell-trip { background: #eee7f7; color: #60417f; font-weight: 900; }
.schedule-matrix .cell-vlk { background: #f9e5e2; color: #873e35; font-weight: 900; }
.schedule-matrix .cell-inspection { background: #e8f0f8; color: #31536d; font-weight: 900; }
.schedule-matrix .cell-camp { background: #e6f2dc; color: #526d31; font-weight: 900; }
.schedule-matrix .schedule-matrix__empty { height: 72px; padding: 16px; background: #f8faf8; color: var(--muted); text-align: center; }
.schedule-cell-button { display: grid; width: 100%; height: 100%; min-height: 42px; padding: 0; place-items: center; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 900; cursor: pointer; }
.schedule-cell-readonly { display: grid; width: 100%; height: 100%; min-height: 42px; place-items: center; font-weight: 900; }
.schedule-cell-button:hover, .schedule-cell-button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; background: rgba(29, 107, 79, .1); }
.schedule-cell-button:focus-visible { position: relative; z-index: 1; }
.schedule-cell-button:disabled, .schedule-cell-button--locked { outline: 0; background: rgba(21, 33, 29, .035); cursor: not-allowed; opacity: .62; }

.schedule-dialog { width: min(calc(100% - 28px), 430px); padding: 0; border: 0; border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 28px 80px rgba(8, 27, 20, .3); }
.schedule-dialog::backdrop { background: rgba(8, 27, 20, .6); backdrop-filter: blur(3px); }
.schedule-dialog form { padding: 24px; }
.schedule-dialog__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.schedule-dialog__heading h2 { margin: 5px 0 2px; font-size: 1.25rem; }
.schedule-dialog__heading p:last-child { margin: 0; color: var(--muted); font-size: .8rem; }
.schedule-dialog__close { display: flex; width: 38px; height: 38px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: #f7f9f7; color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.schedule-dialog__close .material-icons { display: block; font-size: 1.15rem; line-height: 1; }
.schedule-dialog__field { display: grid; gap: 8px; margin: 24px 0 18px; }
.schedule-dialog__field span { font-size: .75rem; font-weight: 800; }
.schedule-dialog__field select, .schedule-dialog__field input[type="date"], .schedule-dialog__field input[type="text"], .schedule-dialog__field input[type="file"] { width: 100%; height: 52px; padding: 0 14px; border: 1px solid #d9e0dc; border-radius: 13px; outline: none; background: white; color: var(--ink); font: inherit; }
.schedule-dialog__field input[type="file"] { height: auto; padding: 13px 14px; }
.schedule-dialog__field select { padding-right: 42px; }
.schedule-dialog__field select:focus, .schedule-dialog__field input[type="date"]:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(29, 107, 79, .1); }
.schedule-dialog__range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.schedule-dialog__range[hidden] { display: none; }
.schedule-dialog__range .schedule-dialog__field { min-width: 0; margin: 0 0 18px; }
.schedule-dialog__check { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; margin: -4px 0 16px; padding: 12px 14px; border-radius: 14px; background: #f0f7f3; color: var(--brand); font-size: .82rem; font-weight: 800; cursor: pointer; }
.schedule-dialog__check[hidden] { display: none; }
.schedule-dialog__check input { width: 18px; height: 18px; accent-color: var(--brand); }
.schedule-dialog__replacement[hidden] { display: none; }
.schedule-dialog__replacement { margin-bottom: 18px; padding: 14px; border: 1px solid #e8dcc2; border-radius: 14px; background: #fff9ec; }
.schedule-dialog__replacement .schedule-dialog__field { margin: 0; }
.schedule-dialog__replacement p { margin: 9px 0 0; color: #76623c; font-size: .72rem; line-height: 1.45; }
.schedule-dialog__duty-list { display: grid; gap: 8px; margin: 18px 0 4px; }
.schedule-dialog__duty-member { padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: #f7f9f7; font-weight: 900; }
.schedule-dialog__submit { width: 100%; min-height: 52px; background: var(--brand-dark); color: white; }

.profile-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.profile-summary p:last-child { margin: 7px 0 0; color: var(--muted); font-size: .82rem; }

.staff-page__list, .staff-page__calendar { grid-column: 1 / -1; }
.absence-heading { padding-right: 20px; }
.month-switcher { display: flex; gap: 7px; }
.month-switcher .button { width: 42px; padding: 0; font-size: 1.05rem; }
.absence-legend { display: flex; gap: 16px; margin: -4px 20px 14px 0; color: var(--muted); font-size: .72rem; font-weight: 800; }
.absence-legend span { display: inline-flex; align-items: center; gap: 6px; }
.absence-legend i { width: 11px; height: 11px; border-radius: 3px; }
.absence-view-tabs { margin: 0 0 14px; }
.absence-view-panel.is-hidden { display: none; }
.absence-matrix td { font-weight: 900; text-transform: uppercase; }
.absence-period-matrix th:not(:first-child), .absence-period-matrix td { min-width: 122px; }
.absence-months-panel { overflow-x: visible; }
.absence-months-panel .absence-period-matrix { width: 100%; min-width: 100%; table-layout: fixed; }
.absence-months-panel .absence-period-matrix th:first-child { min-width: 160px; }
.absence-months-panel .absence-period-matrix th:not(:first-child), .absence-months-panel .absence-period-matrix td { min-width: 0; width: calc((100% - 160px) / 12); }
.schedule-cell-button--period { align-content: center; gap: 5px; padding: 6px; line-height: 1.15; text-transform: none; }
.period-summary { display: block; width: 100%; padding: 4px 6px; border-radius: 8px; font-size: .62rem; white-space: nowrap; }
.absence-months-panel .period-summary { overflow: hidden; padding: 3px 4px; font-size: .56rem; text-overflow: ellipsis; }
.period-summary--empty { color: var(--muted); font-size: .78rem; }

.duty-partners-panel {
    padding-right: 26px;
}

.duty-partner-grid {
    display: grid;
    gap: 14px;
}

.duty-partner-card {
    display: grid;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfcfb;
}

.duty-partner-card__head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.duty-partner-card__head strong,
.duty-partner-card__head span,
.duty-partner-card__partners span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duty-partner-card__head strong {
    font-size: .9rem;
}

.duty-partner-card__head span {
    margin-top: 3px;
    color: var(--brand);
    font-size: .74rem;
    font-weight: 800;
}

.duty-partner-card__partners {
    display: grid;
    gap: 5px;
    min-height: 96px;
    padding: 12px;
    border-radius: 14px;
    background: #f1f6f3;
}

.duty-partner-card__partners .eyebrow {
    margin-bottom: 2px;
}

.duty-partner-card__partners span {
    font-size: .78rem;
    font-weight: 800;
}

.duty-partner-edit {
    width: 100%;
}

.partner-dialog {
    width: min(calc(100% - 28px), 860px);
}

.partner-picker {
    display: grid;
    gap: 14px;
    margin: 22px 0;
}

.partner-picker h3 {
    margin: 0 0 10px;
    font-size: .9rem;
}

.partner-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 260px;
    max-height: 48vh;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8faf8;
}

.partner-option,
.partner-selected-row {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #e0e7e3;
    border-radius: 12px;
    background: white;
    color: var(--ink);
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
    text-align: left;
}

.partner-option {
    cursor: pointer;
}

.partner-option:hover,
.partner-option:focus-visible {
    border-color: rgba(29, 107, 79, .35);
    outline: 0;
    background: #f0f7f3;
}

.partner-option small {
    display: block;
    margin-top: 2px;
    color: var(--brand);
    font-size: .66rem;
}

.partner-selected-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.partner-selected-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.partner-selected-row div {
    display: flex;
    gap: 4px;
}

.partner-selected-row button {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: #edf3ef;
    color: var(--brand-dark);
    font-weight: 900;
    cursor: pointer;
}

.partner-selected-row [data-remove] {
    background: #f6e7e7;
    color: var(--danger);
}

.partner-hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .72rem;
}

.directories-page .main-content {
    grid-template-columns: 1fr;
}

.directories-page {
    width: min(calc(100% - 32px), 1480px);
    margin: 0 auto;
    padding-top: 28px;
}

.directory-page-head {
    display: grid;
    width: calc(100% - 32px);
    margin: 0 auto 24px;
    gap: 16px;
}

.directories-page .editor-header {
    margin-bottom: 0;
}

.directories-page .main-content {
    padding-top: 0;
}

.directory-panel {
    overflow: visible;
}

.directory-sortable {
    display: grid;
    gap: 12px;
}

.directory-add-form,
.directory-edit-form {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) minmax(92px, .35fr) auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid rgba(16, 37, 31, .08);
    border-radius: 18px;
    background: #eef7f2;
}

.directory-add-form[hidden],
.directory-edit-form[hidden],
.directory-menu__dropdown[hidden] {
    display: none;
}

.directory-add-form--position,
.directory-edit-form--position {
    grid-template-columns: minmax(220px, 1.4fr) minmax(170px, .85fr) minmax(180px, .95fr) minmax(170px, .85fr) minmax(82px, .35fr) auto auto;
}

.directory-add-form .button,
.directory-edit-form .button {
    min-height: 42px;
    padding: 0 13px;
    border-radius: 11px;
    font-size: .72rem;
    line-height: 1.15;
    white-space: nowrap;
}

.directory-add-toggle {
    gap: 6px;
}

.directory-add-toggle .material-icons {
    font-size: 1rem;
}

.directory-card {
    position: relative;
    border: 1px solid rgba(16, 37, 31, .11);
    border-radius: 14px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.directory-card:hover {
    border-color: rgba(29, 107, 79, .22);
    box-shadow: 0 10px 24px rgba(24, 49, 39, .07);
}

.directory-card.is-dragging {
    opacity: .58;
    transform: scale(.995);
}

.directory-card--nest-target {
    border-color: rgba(29, 107, 79, .38);
    box-shadow: 0 0 0 3px rgba(29, 107, 79, .08);
}

.directory-card__summary {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto 36px;
    gap: 12px;
    align-items: center;
    min-height: 70px;
    padding: 13px 14px;
}

.directory-card--position > .directory-card__summary {
    grid-template-columns: 34px 28px minmax(0, 1fr) auto 36px;
}

.directory-tree,
.directory-children {
    display: grid;
    gap: 12px;
}

.directory-children {
    min-height: 8px;
    margin: 0 0 12px 45px;
    padding-left: 15px;
    border-left: 1px dashed rgba(29, 107, 79, .22);
}

.directory-handle,
.directory-disclose,
.directory-menu__toggle {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #8b9591;
    cursor: grab;
}

.directory-menu__toggle {
    cursor: pointer;
}

.directory-disclose {
    width: 28px;
    height: 28px;
    color: #6f7d78;
    cursor: pointer;
}

.directory-disclose--empty {
    pointer-events: none;
}

.directory-handle .material-icons,
.directory-disclose .material-icons,
.directory-menu__toggle .material-icons {
    font-size: 1.35rem;
    line-height: 1;
}

.directory-handle:hover,
.directory-disclose:hover,
.directory-menu__toggle:hover,
.directory-handle:focus-visible,
.directory-disclose:focus-visible,
.directory-menu__toggle:focus-visible {
    background: #f0f5f2;
    color: var(--brand-dark);
    outline: 0;
}

.directory-card__title {
    min-width: 0;
}

.directory-card__title strong,
.directory-card__title span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.directory-card__title strong {
    font-size: .9rem;
}

.directory-card__title span {
    margin-top: 4px;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 700;
}

.directory-status {
    color: #8b9591;
    line-height: 1;
}

.directory-status.is-active {
    color: var(--brand);
}

.directory-status .material-icons {
    font-size: 1.18rem;
    line-height: 1;
}

.directory-menu {
    position: relative;
}

.directory-menu__dropdown {
    position: absolute;
    z-index: 5;
    top: calc(100% + 7px);
    right: 0;
    min-width: 145px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(24, 49, 39, .15);
}

.directory-menu__dropdown button {
    display: flex;
    width: 100%;
    min-height: 34px;
    align-items: center;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
    gap: 8px;
}

.directory-menu__dropdown button .material-icons {
    font-size: 1rem;
    line-height: 1;
}

.directory-menu__dropdown button:hover,
.directory-menu__dropdown button:focus-visible {
    background: #f0f5f2;
    outline: 0;
}

.directory-menu__dropdown .danger {
    color: var(--danger);
}

.directory-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    color: var(--brand);
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.directory-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--brand);
}

.directory-row__sort input {
    text-align: center;
}

/* Staff profile editor */
.profile-editor { width: min(100%, 1180px); min-height: 100vh; margin: 0 auto; padding: 20px 14px 110px; }
.editor-header { display: grid; gap: 18px; margin-bottom: 22px; }
.editor-header h1 { margin: 5px 0 3px; font-size: clamp(1.55rem, 7vw, 2.4rem); letter-spacing: -.04em; }
.editor-header p:last-child { margin: 0; color: var(--muted); }
.editor-back { width: max-content; color: var(--brand); font-size: .82rem; font-weight: 800; text-decoration: none; }
.editor-back:hover, .editor-back:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.profile-editor > .notice { display: grid; gap: 3px; margin-bottom: 16px; }
.profile-editor > .notice span { font-size: .8rem; font-weight: 600; }
.editor-form { display: grid; gap: 14px; }
.editor-card { padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 8px 24px rgba(29, 58, 47, .04); }
.editor-card--identity { display: grid; gap: 24px; }
.editor-card__content { min-width: 0; }
.editor-section-heading { margin-bottom: 18px; }
.editor-section-heading h2 { margin: 4px 0 0; font-size: 1.16rem; letter-spacing: -.025em; }
.editor-section-heading--action { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.editor-section-heading--action .button { flex: 0 0 auto; min-height: 38px; padding: 0 11px; font-size: .75rem; }
.avatar-upload { display: grid; justify-items: center; align-content: start; gap: 10px; }
.avatar-upload__preview { display: grid; width: 112px; height: 112px; overflow: hidden; place-items: center; border: 6px solid #edf3ef; border-radius: 32px; background: var(--brand-soft) center / cover no-repeat; color: var(--brand-dark); font-size: 2.3rem; font-weight: 900; }
.avatar-upload__preview--button { padding: 0; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.avatar-upload__preview--button:hover, .avatar-upload__preview--button:focus-visible { outline: 0; transform: translateY(-1px); box-shadow: 0 12px 28px rgba(29, 58, 47, .12); }
.avatar-upload small { color: var(--muted); font-size: .68rem; text-align: center; }
.avatar-crop-dialog { width: min(calc(100% - 28px), 460px); }
.avatar-crop { display: grid; gap: 18px; padding: 24px; }
.avatar-crop__frame { position: relative; width: min(100%, 340px); height: min(74vw, 340px); overflow: hidden; justify-self: center; border: 6px solid #edf3ef; background: #dbe9e2; }
.avatar-crop__frame img { display: block; max-width: 100%; }
.avatar-crop__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid { display: grid; gap: 15px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field > span { color: #34443d; font-size: .72rem; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #d9e0dc; border-radius: 12px; outline: 0; background: #fbfcfb; color: var(--ink); font: inherit; }
.field textarea { min-height: 74px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: white; box-shadow: 0 0 0 4px rgba(29, 107, 79, .1); }
.duty-toggle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 18px; }
.duty-toggle { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: #f0f7f3; cursor: pointer; }
.duty-toggle--danger { background: #fdecec; }
.duty-toggle input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--brand); }
.duty-toggle--danger input { accent-color: #a83232; }
.duty-toggle span { display: grid; gap: 4px; }
.duty-toggle strong { font-size: .82rem; }
.duty-toggle small { color: var(--muted); font-size: .7rem; line-height: 1.45; }
.repeater { display: grid; gap: 12px; }
.repeater-row { position: relative; padding: 16px 48px 16px 16px; border: 1px solid var(--line); border-radius: 16px; background: #f9fbf9; }
.repeater-row--weapon { display: grid; gap: 12px; }
.repeater-remove { position: absolute; top: 12px; right: 12px; display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 0; border-radius: 9px; background: #f6e7e7; color: var(--danger); font-size: 1.25rem; cursor: pointer; }
.repeater-remove:hover, .repeater-remove:focus-visible { background: #edd1d1; }
.repeater-empty { margin: 0; padding: 18px; border: 1px dashed #ccd6d0; border-radius: 14px; color: var(--muted); font-size: .8rem; text-align: center; }
.editor-actions { position: sticky; z-index: 10; bottom: 10px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; padding: 10px; border: 1px solid rgba(255,255,255,.65); border-radius: 18px; background: rgba(255,255,255,.92); box-shadow: 0 14px 35px rgba(24,49,39,.14); backdrop-filter: blur(12px); }
.editor-save { background: var(--brand-dark); color: white; }
.profile-view__actions { display: flex; justify-content: flex-end; gap: 9px; margin: -5px 0 14px; }
.detail-grid { display: grid; gap: 10px; margin: 0; }
.detail-grid > div { min-width: 0; padding: 13px; border-radius: 12px; background: #f7f9f7; }
.detail-grid dt { margin-bottom: 5px; color: var(--muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; font-size: .86rem; font-weight: 700; line-height: 1.4; }
.detail-list { display: grid; gap: 9px; }
.detail-list > div { display: grid; gap: 4px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.detail-list span, .detail-list small { color: var(--muted); font-size: .75rem; }

@media (min-width: 620px) {
    .profile-editor { padding: 30px 24px 120px; }
    .editor-header { grid-template-columns: auto 1fr; align-items: start; }
    .editor-back { margin-top: 0; transform: translateY(-3px); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .repeater-row--weapon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field--wide { grid-column: 1 / -1; }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-wide { grid-column: 1 / -1; }
    .editor-actions { display: flex; justify-content: flex-end; }
    .editor-actions .button { min-width: 150px; }
    .duty-partner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .partner-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 619px) {
    .staff-page .staff-row { grid-template-columns: 40px minmax(0, 1fr); }
    .staff-page .staff-row__actions { grid-column: 1 / -1; justify-content: flex-start; padding-left: 51px; }
    .staff-page .staff-row__actions .tag { flex: 0 0 auto; width: auto; margin: 0 auto 0 0; }
    .staff-heading-actions { align-items: flex-end; flex-direction: column; }
    .directory-add-form,
    .directory-edit-form,
    .directory-add-form--position,
    .directory-edit-form--position {
        grid-template-columns: 1fr;
    }
    .directories-page {
        width: min(calc(100% - 20px), 1480px);
        padding-top: 18px;
    }
    .directory-card__summary { grid-template-columns: 32px minmax(0, 1fr) auto 34px; gap: 8px; }
    .directory-card--position > .directory-card__summary { grid-template-columns: 32px 26px minmax(0, 1fr) auto 34px; }
    .directory-children { margin-left: 24px; padding-left: 10px; }
    .directory-check { min-height: 0; }
}

.bottom-nav { position: fixed; z-index: 20; top: max(10px, env(safe-area-inset-top)); right: 10px; bottom: auto; left: 10px; display: flex; max-width: 580px; min-height: 66px; align-items: center; justify-content: space-around; margin: auto; padding: 8px; border: 1px solid rgba(255,255,255,.3); border-radius: 22px; background: rgba(16, 43, 34, .96); box-shadow: 0 12px 34px rgba(12,35,27,.24); backdrop-filter: blur(12px); }
.bottom-nav a, .bottom-nav__trigger { display: grid; min-width: 60px; gap: 3px; padding: 0; border: 0; background: transparent; color: rgba(255,255,255,.58); font: inherit; font-size: .62rem; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; }
.bottom-nav a .material-icons, .bottom-nav__trigger .material-icons { font-size: 1.32rem; line-height: 1; }
.bottom-nav a.is-active { color: white; }
.bottom-nav__dropdown { position: relative; display: grid; }
.bottom-nav__dropdown.is-open .bottom-nav__trigger { color: white; }
.bottom-nav__menu { position: absolute; right: 0; top: calc(100% + 12px); display: grid; min-width: 165px; gap: 4px; padding: 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: rgba(16, 43, 34, .98); box-shadow: 0 16px 35px rgba(12,35,27,.28); }
.bottom-nav__menu[hidden] { display: none; }
.bottom-nav__menu a { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 11px; color: rgba(255,255,255,.82); text-align: left; text-decoration: none; white-space: nowrap; }
.bottom-nav__menu a:hover, .bottom-nav__menu a:focus-visible { background: rgba(255,255,255,.08); color: white; }

@media (max-width: 759px) {
    .duty-toggle-grid { grid-template-columns: 1fr; }
    .reports-template-toolbar { flex-direction: column; margin-right: 0; }
    .reports-variables-download { width: 100%; justify-content: center; white-space: normal; }
    .reports-bulk-actions { width: 100%; justify-content: flex-start; }
    .reports-bulk-actions .button { width: 100%; justify-content: center; white-space: normal; }
    .reports-row-editor__body,
    .reports-edit-form { grid-template-columns: 1fr; }
    .reports-row-editor__body { min-width: 0; }
    .reports-table { min-width: 680px; }
}

@media (min-width: 760px) {
    .app-frame { padding-top: 0; padding-bottom: 40px; }
    .topbar { padding: 34px 36px 16px; }
    .main-content { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; padding: 16px 36px 40px; }
    .notice, .duty-hero, .stats-grid, .panel--wide, .profile-summary { grid-column: 1 / -1; }
    .duty-hero { min-height: 230px; padding: 36px; }
    .duty-hero__mark { right: 50px; width: 88px; height: 88px; }
    .stats-grid { gap: 16px; }
    .stat-card { min-height: 124px; padding: 22px; }
    .stat-card span { min-height: auto; font-size: .78rem; }
    .panel { padding: 26px; border-radius: 26px; }
    .main-content > .panel:not(.panel--wide):not(.profile-summary) { grid-column: span 6; }
    .panel--wide { padding-right: 0; }
    .panel--wide .section-heading { padding-right: 26px; }
    .legend { display: flex; }
    .editor-card { padding: 28px; }
    .editor-card--identity { grid-template-columns: 150px minmax(0, 1fr); }
}

@media (min-width: 980px) {
    .form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .field--wide { grid-column: span 2; }
    .repeater-row--relative .field--wide { grid-column: span 3; }
    .detail-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .duty-partner-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1120px) {
    .main-content { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .duty-hero { grid-column: span 8; }
    .stats-grid { grid-column: span 4; grid-template-columns: 1fr; }
    .stat-card { display: flex; min-height: 0; align-items: center; justify-content: space-between; padding: 14px 18px; }
    .stat-card span { max-width: 110px; }
    .stat-card strong { margin: 0; }
    .bottom-nav { top: 25px; right: 36px; bottom: auto; left: auto; min-width: 360px; }
    .topbar { padding-right: 430px; }
    .topbar--simple { padding-right: 36px; }
}

.app-shell--impersonating .bottom-nav { top: 58px; }

@media (max-width: 759px) {
    .app-shell--impersonating .bottom-nav { top: 54px; }
    .impersonation-bar { justify-content: space-between; font-size: .66rem; }
}
