:root {
    --bg: #f0f3f8;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --danger: #dc2626;
    --sidebar: #0b1220;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --ok: #059669;
    --ok-bg: #ecfdf5;
    --warn-bg: #fff7ed;
    /* Calendar legend + day header — single source of truth (solid, no tint) */
    --cal-shift-regular: #2563eb;
    --cal-shift-oncall: #ea580c;
    --cal-day-empty: #64748b;
    --cal-day-open: #9333ea;
    --cal-day-wanted: #db2777;
    --cal-day-full: #059669;
    --cal-day-partly: #0891b2;
    --cal-day-closed: #57534e;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

a { color: var(--brand); text-decoration: none; }

.shell { display: flex; min-height: 100vh; align-items: flex-start; }

.sidebar {
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    align-self: flex-start;
    scrollbar-width: thin;
}

/* Central / super admin — full text sidebar */
.sidebar--wide {
    width: 260px;
    padding: 1.25rem 1rem;
    gap: 1.5rem;
}

.sidebar--wide .sidebar-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}

.sidebar--wide .sidebar-top .brand {
    flex: 1;
    min-width: 0;
}

.sidebar--wide .brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .35rem .5rem;
    color: #fff;
}

.sidebar--wide .side-nav {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.sidebar--wide .side-nav a,
.sidebar--wide .side-nav button.nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem .85rem;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: .92rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
    white-space: nowrap;
}

.sidebar--wide .side-nav a:hover,
.sidebar--wide .side-nav button.nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.sidebar--wide .side-nav a.active {
    background: rgba(37, 99, 235, .22);
    color: var(--sidebar-active);
    box-shadow: none;
}

/* Tenant — slim icon rail */
.sidebar--rail {
    width: 76px;
    padding: 1rem .7rem 1.25rem;
    gap: 1.15rem;
    align-items: center;
    z-index: 110;
    overflow: visible;
}

.sidebar--rail .sidebar-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
}

.sidebar--rail .sidebar-top .brand {
    flex: 0 0 auto;
    min-width: 0;
}

.sidebar--rail .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: .2rem;
    color: #fff;
    width: 100%;
}

.sidebar--rail .brand-text {
    display: none;
    min-width: 0;
}

.sidebar--rail .side-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    min-height: 0;
    padding-bottom: 10rem;
}

.sidebar--rail .side-nav a:not(.nav-group-link),
.sidebar--rail .side-nav button.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 12px;
    color: #94a3b8;
    font-weight: 500;
    font-size: .92rem;
    border: 0;
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.sidebar--rail .side-nav a:not(.nav-group-link):hover,
.sidebar--rail .side-nav button.nav-link:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.sidebar--rail .side-nav a:not(.nav-group-link).active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
}

.sidebar--rail .nav-section {
    width: 1.6rem;
    height: 1px;
    margin: .45rem 0;
    padding: 0;
    border: 0;
    background: rgba(148, 163, 184, .28);
    font-size: 0;
    overflow: hidden;
    color: transparent;
}

.nav-group {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar--rail .nav-group-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 12px;
    color: #94a3b8;
    font-weight: 500;
    font-size: .92rem;
    border: 0;
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.sidebar--rail .nav-group-toggle:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.sidebar--rail .nav-group-toggle.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
}

.sidebar--rail .nav-group-caret {
    display: none;
}

@media (min-width: 901px) {
    .nav-group-panel {
        position: fixed;
        left: 5.15rem;
        top: 0;
        z-index: 1000;
        min-width: 13rem;
        padding: .4rem;
        border-radius: 12px;
        background: #1e293b;
        border: 1px solid rgba(148, 163, 184, .18);
        box-shadow: 0 14px 34px rgba(15, 23, 42, .42);
        pointer-events: auto;
    }

    .nav-group-panel[hidden] {
        display: none !important;
        pointer-events: none !important;
    }
}

.sidebar--rail .nav-group-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    height: auto;
    padding: .62rem .75rem;
    border-radius: 9px;
    color: #cbd5e1;
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    box-shadow: none;
    justify-content: flex-start;
    transition: background .15s ease, color .15s ease;
}

.sidebar--rail .nav-group-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.sidebar--rail .nav-group-link.active {
    background: rgba(37, 99, 235, .22);
    color: #fff;
    box-shadow: none;
}

.sidebar--rail .nav-group-link .nav-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, #3b82f6, #1e40af);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    font-size: .95rem;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .35);
}

.brand strong { display: block; font-size: .95rem; line-height: 1.2; }
.brand span { font-size: .75rem; color: var(--sidebar-text); font-weight: 500; }

.nav-ico {
    display: grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.nav-ico svg {
    width: 1.2rem;
    height: 1.2rem;
    display: block;
}

.nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
}

.topbar-left > div {
    min-width: 0;
}

.topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.topbar-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.topbar-heading .badge {
    font-size: .72rem;
    font-weight: 700;
    vertical-align: middle;
}
.topbar-left p {
    margin: .2rem 0 0;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.35;
    max-width: 52rem;
}
.topbar p { margin: .15rem 0 0; color: var(--muted); font-size: .88rem; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-shrink: 0;
}

.sidebar-top .brand {
    min-width: 0;
}

.nav-toggle,
.nav-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.nav-toggle span,
.nav-close span {
    display: block;
    position: relative;
    width: 1.05rem;
    height: 1.5px;
    background: var(--ink);
    border-radius: 2px;
}

.nav-toggle span + span {
    margin-top: .28rem;
}

.nav-toggle {
    flex-direction: column;
}

.nav-close {
    border-color: rgba(148, 163, 184, .25);
    background: rgba(255, 255, 255, .06);
}

.nav-close span {
    background: transparent;
    width: 1rem;
    height: 1rem;
}

.nav-close span::before,
.nav-close span::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1.5px;
    background: #e2e8f0;
    border-radius: 2px;
}

.nav-close span::before { transform: rotate(45deg); }
.nav-close span::after { transform: rotate(-45deg); }

.nav-scrim {
    display: none;
}

.user-menu { position: relative; }

.user-chip {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .35rem .75rem .35rem .4rem;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.user-chip:hover { background: #f1f5f9; }

.user-menu-dd {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    z-index: 30;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: .35rem;
}

.user-menu-dd a,
.user-menu-dd button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: .65rem .75rem;
    border-radius: 8px;
    font: inherit;
    color: var(--ink);
    text-decoration: none;
}

.user-menu-dd a:hover,
.user-menu-dd button:hover { background: #f8fafc; }

.user-menu-dd button.danger { color: var(--danger); }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .8rem;
}

.content { padding: 1.5rem; max-width: none; width: 100%; margin: 0 auto; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.card--form {
    max-width: 640px;
}

.card--form-lg {
    max-width: 760px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.card-head h2 { margin: 0; font-size: 1.05rem; }
.muted { color: var(--muted); font-size: .92rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow);
}

.stat label { display: block; color: var(--muted); font-size: .82rem; font-weight: 600; margin-bottom: .35rem; }
.stat strong { font-size: 1.6rem; letter-spacing: -.02em; }

.badge {
    display: inline-flex;
    align-items: center;
    background: #eff6ff;
    color: #1d4ed8;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    margin: .1rem;
}

.badge-muted { background: #f1f5f9; color: #475569; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: #c2410c; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: .65rem 1rem;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    font-family: inherit;
}

.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: #f8fafc; color: var(--ink); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: .4rem .7rem; font-size: .8rem; }

.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

table { width: 100%; border-collapse: collapse; }
th, td {
    text-align: left;
    padding: .85rem .6rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    font-size: .92rem;
}
th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
}
tr:last-child td { border-bottom: 0; }

.flash {
    background: var(--ok-bg);
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: .85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.wip-banner {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 48%, #fff7ed 100%);
    border: 1px solid #fbbf24;
    box-shadow: 0 10px 30px rgba(245, 158, 11, .12);
    color: #78350f;
    padding: 1.75rem 1.85rem;
    border-radius: 18px;
    margin-bottom: 1.35rem;
    position: relative;
    overflow: hidden;
}

.wip-banner::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.wip-banner-icon {
    flex: 0 0 auto;
    width: 3.5rem;
    height: 3.5rem;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(251, 191, 36, .45);
    color: #d97706;
}

.wip-banner-icon svg {
    width: 1.65rem;
    height: 1.65rem;
}

.wip-banner-copy {
    min-width: 0;
    flex: 1;
}

.wip-banner-badge {
    display: inline-flex;
    align-items: center;
    padding: .28rem .65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(251, 191, 36, .55);
    color: #b45309;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.wip-banner-title {
    margin: .65rem 0 .45rem;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    line-height: 1.2;
    color: #92400e;
    font-weight: 800;
}

.wip-banner-text {
    margin: 0;
    max-width: 52rem;
    font-size: .98rem;
    line-height: 1.55;
    color: #b45309;
}

.wip-banner-text strong {
    color: #92400e;
    font-weight: 700;
}

@media (max-width: 640px) {
    .wip-banner {
        flex-direction: column;
        padding: 1.35rem 1.25rem 1.35rem 1.45rem;
    }

    .wip-banner-icon {
        width: 3rem;
        height: 3rem;
    }
}

.cred-box {
    background: var(--ok-bg);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.cred-box h2 { margin: 0 0 .35rem; font-size: 1rem; }

.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: .85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.error-list {
    margin: 0;
    padding-left: 1.2rem;
}

.publish-gaps {
    list-style: none;
    margin: .7rem 0 0;
    padding: 0;
    display: grid;
    gap: .4rem;
}

.publish-gaps li {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.publish-gap-btn {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .35rem .55rem;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: .55rem .75rem;
    font-size: .9rem;
    text-align: left;
    cursor: pointer;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.publish-gap-btn:hover,
.publish-gap-btn:focus-visible {
    border-color: #f87171;
    background: #fff7f7;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, .15);
    outline: none;
}

.publish-gap-btn-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .55rem;
}

.publish-gaps strong {
    color: #7f1d1d;
}

.publish-gaps span {
    color: #991b1b;
}

.publish-gaps em {
    font-style: normal;
    color: #b91c1c;
    opacity: .9;
    font-size: .82rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.publish-gap-view {
    color: #be123c;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.error-hint {
    margin: .65rem 0 0;
    font-size: .84rem;
    color: #9f1239;
}

.app-modal-card--gaps {
    width: min(520px, 100%);
    max-height: min(80vh, 640px);
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.2rem 1.15rem;
}

.app-modal--soft .app-modal-backdrop {
    background: rgba(15, 23, 42, .28);
    backdrop-filter: blur(3px);
}

.publish-gap-modal-meta {
    display: block;
    margin-top: .2rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
}

.publish-gap-modal-body {
    overflow: auto;
    margin-top: .35rem;
    padding-right: .15rem;
    max-height: min(52vh, 420px);
}

.publish-gap-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .35rem;
}

.publish-gap-items li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .55rem;
    align-items: center;
    padding: .5rem .65rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    font-size: .88rem;
}

.publish-gap-when {
    font-weight: 600;
    color: var(--ink);
    min-width: 0;
}

.publish-gap-staffed {
    color: var(--muted);
    font-size: .8rem;
    white-space: nowrap;
}

.publish-gap-open {
    color: #be123c;
    font-weight: 700;
    font-size: .8rem;
    white-space: nowrap;
}

label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9rem; }

input, select, textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 1rem;
    background: #fff;
    font: inherit;
    color: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(37,99,235,.25);
    border-color: var(--brand);
}

.field-error { color: var(--danger); margin-top: -.7rem; margin-bottom: 1rem; font-size: .85rem; }
.hint { margin-top: -.55rem; margin-bottom: 1rem; color: var(--muted); font-size: .85rem; }

.checkbox-row { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-weight: 500; }
.checkbox-row input { width: auto; margin: 0; }

.dept-dd { position: relative; margin-bottom: 1rem; }

.dept-dd-toggle {
    width: 100%;
    text-align: left;
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.dept-dd-toggle:focus {
    outline: 2px solid rgba(37,99,235,.25);
    border-color: var(--brand);
}

.dept-dd-menu {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow: auto;
    padding: .35rem;
}

.dept-dd-option {
    display: flex;
    width: 100%;
    align-items: center;
    gap: .55rem;
    border: 0;
    background: transparent;
    text-align: left;
    padding: .55rem .65rem;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
}

.dept-dd-option:hover { background: #f8fafc; }
.dept-dd-option.is-selected { background: #eff6ff; color: #1d4ed8; font-weight: 600; }

.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .25rem; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
code { background: #f1f5f9; padding: .1rem .35rem; border-radius: 6px; font-size: .85em; }

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.app-modal[hidden] { display: none !important; }

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
}

.app-modal-card {
    position: relative;
    width: min(440px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
    padding: 1.35rem 1.4rem;
}

.app-modal-title { margin: 0 0 .75rem; font-size: 1.1rem; }
.app-modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; flex-wrap: wrap; }

@media (max-width: 900px) {
    .shell {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-toggle,
    .nav-close {
        display: inline-flex;
    }

    .nav-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 80;
        background: rgba(15, 23, 42, .48);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    .nav-scrim:not([hidden]) {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar--rail {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 90;
        width: min(288px, 86vw);
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: none;
        align-items: stretch;
        padding: 1.1rem 1rem 1.25rem;
        gap: 1.35rem;
    }

    .sidebar--wide {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 90;
        width: min(288px, 86vw);
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: none;
        padding: 1.1rem 1rem 1.25rem;
        gap: 1.35rem;
    }

    .sidebar--rail .sidebar-top {
        justify-content: space-between;
        align-items: flex-start;
    }

    .sidebar--rail .brand {
        justify-content: flex-start;
        padding: .35rem .5rem;
    }

    .sidebar--rail .brand-text {
        display: block;
    }

    .sidebar--rail .side-nav {
        flex: 0 0 auto;
        align-items: stretch;
        justify-content: flex-start;
        gap: .25rem;
        padding-bottom: 0;
    }

    .sidebar--rail .side-nav a:not(.nav-group-link),
    .sidebar--rail .side-nav button.nav-link {
        width: 100%;
        height: auto;
        justify-content: flex-start;
        gap: .7rem;
        padding: .72rem .85rem;
        border-radius: 10px;
        background: transparent;
    }

    .sidebar--rail .side-nav a:not(.nav-group-link).active {
        background: rgba(37, 99, 235, .22);
        box-shadow: none;
        color: #fff;
    }

    .sidebar--rail .nav-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        opacity: 1;
        pointer-events: auto;
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0;
        color: inherit;
        font-size: .92rem;
        font-weight: 500;
    }

    .sidebar--rail .nav-section {
        width: auto;
        height: auto;
        margin: .85rem .85rem .35rem;
        padding-top: .55rem;
        border-top: 1px solid rgba(255, 255, 255, .08);
        background: transparent;
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: rgba(148, 163, 184, .9);
        overflow: visible;
    }

    .sidebar--rail .nav-group {
        align-items: stretch;
    }

    .sidebar--rail .nav-group-toggle {
        width: 100%;
        height: auto;
        justify-content: flex-start;
        gap: .7rem;
        padding: .72rem .85rem;
        border-radius: 10px;
        background: transparent;
    }

    .sidebar--rail .nav-group-toggle.active {
        background: rgba(37, 99, 235, .22);
        box-shadow: none;
        color: #fff;
    }

    .sidebar--rail .nav-group-toggle .nav-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        opacity: 1;
        pointer-events: auto;
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0;
        color: inherit;
        font-size: .92rem;
        font-weight: 500;
    }

    .sidebar--rail .nav-group-caret {
        display: block;
        width: .45rem;
        height: .45rem;
        margin-left: auto;
        border-right: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor;
        transform: rotate(45deg);
        opacity: .55;
        transition: transform .15s ease;
    }

    .sidebar--rail .nav-group.is-open .nav-group-caret {
        transform: rotate(-135deg);
        margin-top: .2rem;
    }

    .sidebar--rail .nav-group-panel {
        position: static;
        min-width: 0;
        padding: 0 0 .15rem .35rem;
        margin: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .sidebar--rail .nav-group-panel[hidden] {
        display: none !important;
    }

    .sidebar--rail .nav-group.has-active .nav-group-panel,
    .sidebar--rail .nav-group.is-open .nav-group-panel {
        display: flex !important;
        flex-direction: column;
        gap: .1rem;
    }

    .sidebar--rail .nav-group-link {
        padding: .58rem .85rem .58rem 2.35rem;
        border-radius: 10px;
        color: #94a3b8;
        font-size: .88rem;
    }

    .sidebar--rail .nav-group-link:hover {
        background: rgba(255, 255, 255, .06);
        color: #fff;
    }

    .sidebar--rail .nav-group-link.active {
        background: rgba(37, 99, 235, .18);
        color: #fff;
    }

    .sidebar--rail .nav-group-link .nav-ico {
        display: none;
    }

    .sidebar--rail .nav-group-link .nav-label {
        font-size: .88rem;
    }

    body.nav-open .sidebar--rail,
    body.nav-open .sidebar--wide {
        transform: translateX(0);
        box-shadow: 12px 0 40px rgba(15, 23, 42, .28);
    }

    body.nav-open {
        overflow: hidden;
    }

    .topbar {
        padding: .85rem 1rem;
    }

    .topbar h1 {
        font-size: 1.02rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar p {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-chip-text {
        display: none;
    }

    .user-chip {
        padding: .3rem;
        border-radius: 999px;
    }

    .content {
        padding: 1rem;
    }

    .stats { grid-template-columns: 1fr !important; }
}

body.guest-layout {
    margin: 0;
    min-height: 100vh;
    color: var(--ink, #0f172a);
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse 80% 60% at 10% 10%, rgba(37,99,235,.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 90%, rgba(14,165,233,.12), transparent 50%),
        #0b1220;
}

.guest-layout .panel {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 2rem 1.75rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

.guest-layout .mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, #3b82f6, #1e40af);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    margin-bottom: 1rem;
}

.guest-layout h1 { margin: 0 0 .35rem; font-size: 1.35rem; }
.guest-layout .sub { margin: 0 0 1.5rem; color: var(--muted, #64748b); font-size: .92rem; }

.guest-layout label {
    display: block;
    font-weight: 600;
    margin-bottom: .4rem;
    font-size: .9rem;
}

.guest-layout input {
    width: 100%;
    padding: .75rem .85rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 1rem;
    font: inherit;
}

.guest-layout input:focus {
    outline: 2px solid rgba(37,99,235,.25);
    border-color: var(--brand, #2563eb);
}

.guest-layout .field-error {
    color: #dc2626;
    margin-top: -.7rem;
    margin-bottom: 1rem;
    font-size: .85rem;
}

.guest-layout .checkbox-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.1rem;
    font-weight: 500;
}

.guest-layout .checkbox-row input { width: auto; margin: 0; }

.guest-layout .btn {
    width: 100%;
    background: var(--brand, #2563eb);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: .8rem 1rem;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    font-family: inherit;
}

.guest-layout .btn:hover { background: #1d4ed8; }

.guest-layout .error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: .75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* Staff weekly calendar (My schedule) */
.cal-card { overflow: visible; }

.cal-card > .card-head {
    position: relative;
    margin-bottom: 0;
    padding-bottom: 1rem;
}

.cal-card > .card-head::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cbd5e1 6%, #cbd5e1 94%, transparent);
}

.cal-card > .cal-month-head {
    padding-top: .9rem;
    margin-bottom: .5rem;
}

.cal-card > .month-cal-head {
    padding-top: 1rem;
    margin-top: .15rem;
    margin-bottom: .85rem;
}

.cal-card > .month-cal-head > div {
    padding: .2rem 0 .35rem;
}

.cal-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem 1.25rem;
    margin-bottom: 1rem;
    font-size: .82rem;
    color: var(--muted);
    font-weight: 600;
}
.cal-card-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem 1.35rem;
    min-width: 0;
}

.cal-card-title h2 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .48rem 1.1rem .48rem .85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .14);
}

.cal-card-title h2::before {
    content: "";
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 5px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .92) 0 28%, transparent 28%),
        linear-gradient(145deg, #3b82f6, #2563eb);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
    flex-shrink: 0;
}

.cal-legend--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    gap: .85rem 1.15rem;
    font-size: .78rem;
}

.cal-legend--inline span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: #475569;
    font-weight: 600;
    line-height: 1.2;
}
.cal-card-top .cal-legend {
    margin-bottom: 0;
}
.month-nav {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 5;
}
.month-nav-btn {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 1.25rem;
    line-height: 1;
    font-weight: 600;
    text-decoration: none;
}
.month-nav-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--ink);
}
.month-nav-picker {
    position: relative;
}
.month-nav-label {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-width: 8.25rem;
    border: 1px solid transparent;
    background: transparent;
    text-align: center;
    font: inherit;
    font-size: .92rem;
    font-weight: 700;
    color: var(--ink);
    padding: .35rem .55rem;
    border-radius: 8px;
    cursor: pointer;
}
.month-nav-label:hover,
.month-nav-label[aria-expanded="true"] {
    background: #f8fafc;
    border-color: var(--line);
    color: var(--brand);
}
.month-nav-caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: .55;
    margin-top: 1px;
}
.month-picker {
    position: fixed;
    width: 248px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .16);
    padding: .75rem;
    z-index: 85;
    display: none;
}
.month-picker.is-open {
    display: block;
}
.month-picker[hidden] {
    display: none !important;
}
.month-picker-year {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .65rem;
}
.month-picker-year strong {
    font-size: .95rem;
    letter-spacing: .02em;
}
.month-picker-year-btn {
    appearance: none;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.month-picker-year-btn:hover {
    background: #f8fafc;
}
.month-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .35rem;
}
.month-picker-month {
    appearance: none;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: .55rem .25rem;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}
.month-picker-month:hover {
    background: #f1f5f9;
}
.month-picker-month.is-selected {
    background: rgba(37, 99, 235, .12);
    color: var(--brand);
}
.month-picker-month.is-current:not(.is-selected) {
    box-shadow: inset 0 0 0 1px #93c5fd;
}
.month-picker-month.is-disabled,
.month-picker-month:disabled {
    opacity: .35;
    cursor: not-allowed;
    background: transparent;
    color: #94a3b8;
}
.month-picker-month.is-disabled:hover,
.month-picker-month:disabled:hover {
    background: transparent;
    color: #94a3b8;
}
.month-nav--picker-only {
    margin-left: 0;
}
.ms-week-toolbar-meta .month-nav {
    margin-left: 0;
}
.ms-week-toolbar-meta .month-nav-label {
    min-width: 0;
    padding: .38rem .65rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 750;
    color: #1d4ed8;
}
.ms-week-toolbar-meta .month-nav-label:hover,
.ms-week-toolbar-meta .month-nav-label[aria-expanded="true"] {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.cal-dot {
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
    border-radius: 999px;
    margin-right: 0;
    vertical-align: middle;
    flex-shrink: 0;
}
/* Shift type (legend pills) */
.cal-dot--regular { background: var(--cal-shift-regular); }
.cal-dot--oncall { background: var(--cal-shift-oncall); }

/* Day status (legend pills + calendar headers — same variables) */
.cal-dot--empty { background: var(--cal-day-empty); }
.cal-dot--open { background: var(--cal-day-open); }
.cal-dot--wanted { background: var(--cal-day-wanted); }
.cal-dot--filled-you { background: var(--cal-day-full); }
.cal-dot--filled-other { background: var(--cal-day-partly); }
.cal-dot--closed { background: var(--cal-day-closed); }

.cal-legend-sep {
    display: inline-block;
    width: 1px;
    height: .85rem;
    background: var(--line);
    vertical-align: middle;
    margin: 0 .15rem;
}

.cal-await-legend {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
    color: #9f1239;
}

.cal-await-rail {
    display: inline-block;
    width: 3px;
    height: .72rem;
    border-radius: 2px;
    background: #e11d48;
    vertical-align: middle;
}

.cal-await-count {
    min-width: 1.15rem;
    height: 1.15rem;
    display: inline-grid;
    place-items: center;
    font-size: .65rem;
    font-weight: 700;
    color: #fff;
    background: #e11d48;
    border-radius: 999px;
    padding: 0 .28rem;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(225, 29, 72, .12);
}

.cal-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .65rem;
}

.cal-day {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cal-day.is-today {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .15);
}

.cal-day[class*="cal-day--status-"].is-today {
    box-shadow: none;
}

.cal-day--status-wanted {
    border-color: var(--cal-day-wanted) !important;
    background: #fff;
}

.cal-day--status-filled-you {
    border-color: var(--cal-day-full) !important;
    background: #fff;
}

.cal-day--status-filled-other {
    border-color: var(--cal-day-partly) !important;
    background: #fff;
}

.cal-day--status-open {
    border-color: var(--cal-day-open) !important;
    background: #fff;
}

.cal-day--status-free {
    border-color: var(--cal-day-empty) !important;
    background: #fff;
}

.cal-day--status-closed {
    border-color: var(--cal-day-closed) !important;
    background: #fff;
}

.cal-day--status-wanted .cal-day-head {
    background: var(--cal-day-wanted);
    color: #fff;
    border-bottom: 1px solid var(--cal-day-wanted);
}

.cal-day--status-filled-you .cal-day-head {
    background: var(--cal-day-full);
    color: #fff;
    border-bottom: 1px solid var(--cal-day-full);
}

.cal-day--status-filled-other .cal-day-head {
    background: var(--cal-day-partly);
    color: #fff;
    border-bottom: 1px solid var(--cal-day-partly);
}

.cal-day--status-open .cal-day-head {
    background: var(--cal-day-open);
    color: #fff;
    border-bottom: 1px solid var(--cal-day-open);
}

.cal-day--status-free .cal-day-head {
    background: var(--cal-day-empty);
    color: #fff;
    border-bottom: 1px solid var(--cal-day-empty);
}

.cal-day--status-closed .cal-day-head {
    background: var(--cal-day-closed);
    color: #fff;
    border-bottom: 1px solid var(--cal-day-closed);
}

.cal-day--status-wanted .cal-day-num,
.cal-day--status-filled-you .cal-day-num,
.cal-day--status-filled-other .cal-day-num,
.cal-day--status-open .cal-day-num,
.cal-day--status-free .cal-day-num,
.cal-day--status-closed .cal-day-num,
.cal-day--status-wanted .cal-day-count,
.cal-day--status-filled-you .cal-day-count,
.cal-day--status-filled-other .cal-day-count,
.cal-day--status-open .cal-day-count,
.cal-day--status-free .cal-day-count,
.cal-day--status-closed .cal-day-count {
    color: #fff;
}

.cal-day--status-wanted .cal-day-count,
.cal-day--status-filled-you .cal-day-count,
.cal-day--status-filled-other .cal-day-count,
.cal-day--status-open .cal-day-count,
.cal-day--status-free .cal-day-count,
.cal-day--status-closed .cal-day-count {
    background: transparent;
    border: 1.5px solid #fff;
    color: #fff;
}

.cal-day-head {
    padding: .65rem .7rem .45rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: .1rem;
    text-decoration: none;
    color: inherit;
    border-radius: 0;
    transition: background .15s ease;
}

a.cal-day-head:hover {
    background: #eff6ff;
}

.cal-day--status-wanted a.cal-day-head:hover { background: var(--cal-day-wanted); }
.cal-day--status-filled-you a.cal-day-head:hover { background: var(--cal-day-full); }
.cal-day--status-filled-other a.cal-day-head:hover { background: var(--cal-day-partly); }
.cal-day--status-open a.cal-day-head:hover { background: var(--cal-day-open); }
.cal-day--status-free a.cal-day-head:hover { background: var(--cal-day-empty); }
.cal-day--status-closed a.cal-day-head:hover { background: var(--cal-day-closed); }

a.cal-day-head:hover .cal-day-num {
    color: var(--brand);
}

.cal-day--status-wanted a.cal-day-head:hover .cal-day-num,
.cal-day--status-filled-you a.cal-day-head:hover .cal-day-num,
.cal-day--status-filled-other a.cal-day-head:hover .cal-day-num,
.cal-day--status-open a.cal-day-head:hover .cal-day-num,
.cal-day--status-free a.cal-day-head:hover .cal-day-num,
.cal-day--status-closed a.cal-day-head:hover .cal-day-num {
    color: #fff;
}

.cal-day-name { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.cal-day-num { font-size: 1.15rem; line-height: 1.1; color: var(--ink); }
.cal-day-month { font-size: .72rem; color: var(--muted); }

.cal-day-body {
    padding: .55rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    flex: 1;
}

.cal-block {
    border-radius: 10px;
    padding: .5rem .55rem;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    font-size: .78rem;
    line-height: 1.25;
    border: 1px solid transparent;
}

.cal-block strong { font-size: .82rem; }
.cal-block-meta { color: rgba(15, 23, 42, .65); font-size: .72rem; }

.cal-block--regular { background: #dbeafe; border-color: #93c5fd; color: #1e3a8a; }
.cal-block--oncall { background: #ffedd5; border-color: #fdba74; color: #9a3412; }

.cal-empty {
    color: var(--muted);
    font-size: .78rem;
    text-align: center;
    padding: 1.25rem .5rem;
}

a.cal-empty--link {
    display: block;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}

a.cal-empty--link:hover {
    background: #eff6ff;
    color: var(--brand);
}

@media (max-width: 1100px) {
    .cal-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .cal-week { grid-template-columns: 1fr; }
}

.cal-month-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .45rem;
    margin-bottom: .45rem;
}
.cal-month-dow {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    text-align: center;
    padding: .25rem;
}
.cal-month {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: 142px;
    gap: .5rem;
}
.cal-day--pad {
    height: 142px;
    min-height: 0;
    border: 0;
    background: transparent;
}

.cal-month .cal-day--fixed {
    height: 142px;
    min-height: 142px;
    max-height: 142px;
    overflow: hidden;
}
.cal-month .cal-day.is-clickable {
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cal-month .cal-day.is-clickable:hover,
.cal-month .cal-day.is-clickable:focus-visible {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
    outline: none;
}
.cal-month .cal-day-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .35rem;
    padding: .5rem .6rem .35rem;
}
.cal-month .cal-day-num { font-size: 1.02rem; }

.cal-month .cal-day-date {
    display: flex;
    align-items: baseline;
    gap: .35rem;
}

.cal-month .cal-day-month {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.cal-day--status-wanted .cal-day-month,
.cal-day--status-filled-you .cal-day-month,
.cal-day--status-filled-other .cal-day-month,
.cal-day--status-open .cal-day-month,
.cal-day--status-free .cal-day-month,
.cal-day--status-closed .cal-day-month {
    color: rgba(255, 255, 255, .92);
}

.cal-day-badges {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cal-day-count {
    font-size: .68rem;
    font-weight: 700;
    color: var(--muted);
    background: #e2e8f0;
    border-radius: 999px;
    padding: .1rem .4rem;
    line-height: 1.2;
}


.cal-month .cal-day--has-requests {
    box-shadow: inset 3px 0 0 #e11d48;
}

.cal-month .cal-day--has-requests.is-today {
    box-shadow: inset 3px 0 0 #e11d48, inset 0 0 0 1px rgba(37, 99, 235, .15);
}

.cal-month .cal-day--has-requests.is-clickable:hover,
.cal-month .cal-day--has-requests.is-clickable:focus-visible {
    border-color: #fda4af;
    box-shadow: inset 3px 0 0 #e11d48, 0 0 0 2px rgba(225, 29, 72, .1);
}

.cal-chip--await {
    box-shadow: inset 2px 0 0 #e11d48;
    background: rgba(225, 29, 72, .08) !important;
    border-color: rgba(225, 29, 72, .35) !important;
}

.cal-chip--filled-you {
    background: rgba(22, 163, 74, .12) !important;
    border-color: rgba(22, 163, 74, .42) !important;
    box-shadow: inset 2px 0 0 #16a34a;
}

.cal-chip--filled-other {
    background: rgba(37, 99, 235, .10) !important;
    border-color: rgba(37, 99, 235, .40) !important;
    box-shadow: inset 2px 0 0 #2563eb;
}

.cal-chip--closed {
    background: #fff7ed !important;
    border-color: #fdba74 !important;
    box-shadow: inset 2px 0 0 #d97706;
}

.cal-chip--open {
    background: rgba(6, 182, 212, .12) !important;
    border-color: rgba(6, 182, 212, .45) !important;
    box-shadow: inset 2px 0 0 #06b6d4;
}
.cal-month .cal-day-body {
    padding: .22rem .4rem .35rem;
    gap: .22rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.cal-month .cal-chip:has(.cal-chip-people) {
    flex-wrap: nowrap;
    padding: .2rem .32rem;
}

.cal-month .cal-chip .cal-chip-people {
    flex: 0 1 auto;
    min-width: 0;
    font-size: .62rem;
    line-height: 1.2;
}
.cal-chip {
    display: flex;
    align-items: center;
    gap: .28rem;
    border-radius: 7px;
    padding: .24rem .38rem;
    font-size: .72rem;
    line-height: 1.25;
    border: 1px solid transparent;
    min-width: 0;
    flex-wrap: nowrap;
}
.cal-chip-time {
    font-weight: 700;
    flex-shrink: 0;
}
.cal-chip-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}

.cal-chip-people {
    font-size: .66rem;
    font-weight: 600;
    color: rgba(15, 23, 42, .55);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}

.cal-more {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: auto;
    flex-shrink: 0;
    padding: .22rem .58rem;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.2;
    color: #1d4ed8;
    background: linear-gradient(180deg, #f8fbff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .08);
}

.cal-day--status-filled-you .cal-more {
    color: #047857;
    background: linear-gradient(180deg, #f0fdf4 0%, #d1fae5 100%);
    border-color: #6ee7b7;
    box-shadow: 0 1px 2px rgba(5, 150, 105, .1);
}

.cal-day--status-filled-other .cal-more {
    color: #0e7490;
    background: linear-gradient(180deg, #ecfeff 0%, #cffafe 100%);
    border-color: #67e8f9;
    box-shadow: 0 1px 2px rgba(8, 145, 178, .1);
}

.cal-day--status-wanted .cal-more {
    color: #be185d;
    background: linear-gradient(180deg, #fdf2f8 0%, #fce7f3 100%);
    border-color: #f9a8d4;
}

.cal-more--ok {
    color: #047857;
    background: linear-gradient(180deg, #f0fdf4 0%, #d1fae5 100%);
    border-color: #6ee7b7;
}
.ms-day-panels { display: none; }
.ms-day-panel { display: block; }
.ms-day-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.ms-day-item {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding: .8rem .85rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.ms-day-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.ms-day-item-main {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.ms-day-requests {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: .15rem;
    padding-top: .85rem;
    border-top: 1px solid #e2e8f0;
}

.ms-day-requests-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ms-day-request {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem .75rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.ms-day-request-main {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
    flex: 1 1 auto;
}

.ms-day-request-name {
    font-size: .88rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.ms-day-request-meta,
.ms-day-request-note {
    font-size: .76rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.35;
}

.ms-day-request-note {
    font-style: italic;
}

.ms-request-pref {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: .12rem .45rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.2;
}

.ms-request-pref--want {
    background: rgba(22, 163, 74, .12);
    color: #166534;
}

.ms-request-pref--decline {
    background: rgba(234, 88, 12, .12);
    color: #c2410c;
}

.ms-review-actions {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex-shrink: 0;
}

.ms-review-actions form {
    margin: 0;
}

.ms-review-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-width: 6.5rem;
    min-height: 2rem;
    padding: .4rem .7rem;
    border-radius: 9px;
    border: 1px solid transparent;
    font: inherit;
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ms-review-btn svg {
    flex-shrink: 0;
}

.ms-review-btn--accept {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .22);
}

.ms-review-btn--accept:hover {
    background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
    color: #fff;
}

.ms-review-btn--reject {
    background: #fff;
    color: #dc2626;
    border-color: #fecaca;
}

.ms-review-btn--reject:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.ms-admin-day-item {
    gap: 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    overflow: hidden;
}

.ms-admin-day-item.has-pending {
    border-left: 3px solid #2563eb;
}

.ms-admin-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    flex-shrink: 0;
    padding: .35rem .55rem;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    color: #475569;
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.2;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ms-admin-edit-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

@media (max-width: 520px) {
    .ms-day-request {
        flex-direction: column;
    }

    .ms-review-actions {
        flex-direction: row;
        width: 100%;
    }

    .ms-review-actions form {
        flex: 1 1 0;
        min-width: 0;
    }

    .ms-review-btn {
        width: 100%;
        min-width: 0;
    }
}

.ms-day-request-main .badge {
    width: fit-content;
}
.ms-day-type {
    display: inline-flex;
    width: fit-content;
    font-size: .68rem;
    font-weight: 700;
    border-radius: 6px;
    padding: .12rem .4rem;
    border: 1px solid transparent;
}
.app-modal--day .app-modal-backdrop {
    background: rgba(15, 23, 42, .32);
    backdrop-filter: blur(3px);
}
.app-modal--day .app-modal-card--day {
    max-width: 520px;
    width: calc(100% - 2rem);
    padding: 0;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .2);
}

.app-modal--day .app-modal-body {
    max-height: min(72vh, 520px);
    overflow-y: auto;
    padding: .85rem 1.15rem 1.15rem;
}
.app-modal-day-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: 1.1rem 1.15rem .85rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.app-modal-day-head-text {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}
.app-modal-day-kicker {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #94a3b8;
    line-height: 1;
}
.app-modal-day-head .app-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: #0f172a;
}
.app-modal-x {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 1.25rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    border-radius: 10px;
}
.app-modal-x:hover { background: #f1f5f9; color: var(--ink); border-color: #cbd5e1; }

.ms-req-shift-card {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding: 1rem 1.05rem;
}

.ms-req-shift-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.ms-req-shift-head-main {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
}

.ms-req-shift-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
    letter-spacing: -.01em;
}

.ms-req-shift-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .75rem;
}

.ms-req-shift-meta-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    font-weight: 600;
    color: #475569;
    line-height: 1.3;
}

.ms-req-shift-meta-item svg {
    flex-shrink: 0;
    color: #94a3b8;
}

.ms-req-shift-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .35rem;
    font-size: .78rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.35;
}

.ms-req-shift-tags-sep {
    color: #cbd5e1;
}

.ms-req-shift-footer {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-top: .15rem;
    padding-top: .85rem;
    border-top: 1px solid #e2e8f0;
}

.ms-req-shift-note {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .15rem;
    padding: .55rem .7rem;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.3;
}

.ms-req-shift-note--assigned {
    background: rgba(22, 163, 74, .1);
    color: #166534;
}

.ms-req-shift-note--locked {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.ms-shift-actions--prefs {
    display: flex;
    gap: .5rem;
    width: 100%;
    margin-top: 0;
}

.ms-shift-actions--prefs form {
    flex: 1 1 0;
    margin: 0;
    min-width: 0;
}

.ms-pref-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    min-height: 2.35rem;
    padding: .5rem .75rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.ms-pref-btn svg {
    flex-shrink: 0;
}

.ms-pref-btn--want {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
}

.ms-pref-btn--want:hover:not(:disabled) {
    background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
    color: #fff;
}

.ms-pref-btn--want:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

.ms-pref-btn--decline {
    background: #fff;
    color: #475569;
    border-color: #e2e8f0;
}

.ms-pref-btn--decline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.ms-pref-btn--withdraw {
    width: auto;
    min-height: 0;
    padding: .35rem .15rem;
    background: transparent;
    border: 0;
    color: #dc2626;
    font-size: .76rem;
    font-weight: 650;
    align-self: flex-start;
}

.ms-pref-btn--withdraw:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.ms-req-withdraw-form {
    margin: 0;
}

.ms-bulk {
    margin: 0 0 1rem;
    padding: 1rem 1.25rem 1.15rem;
    border-bottom: 1px solid var(--line);
    background: #fff7ed;
}
.ms-bulk-head {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    margin-bottom: .75rem;
}
.ms-bulk-head strong { font-size: .92rem; }
.ms-bulk-groups {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .85rem;
}
.ms-bulk-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid #fed7aa;
    background: #fff;
    border-radius: 999px;
    padding: .35rem .7rem;
    font: inherit;
    font-size: .8rem;
    cursor: pointer;
    color: var(--ink);
}
.ms-bulk-chip:hover {
    border-color: #fb923c;
    background: #ffedd5;
}
.ms-bulk-chip em {
    font-style: normal;
    color: var(--muted);
    font-size: .72rem;
}
.ms-bulk-chip strong {
    font-size: .72rem;
    background: #ffedd5;
    color: #c2410c;
    border-radius: 999px;
    padding: .05rem .4rem;
}
.ms-bulk-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .65rem;
}
.ms-bulk-field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 160px;
}
.ms-bulk-field span {
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ms-bulk-field select {
    margin: 0;
    min-width: 160px;
}

.ms-balance {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
.ms-balance-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: .95rem 1.05rem;
    box-shadow: var(--shadow);
}
.ms-balance-card.is-full {
    border-color: #fecaca;
    background: #fff7f7;
}
.ms-balance-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .55rem;
}
.ms-balance-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
}
.ms-balance-range {
    display: block;
    margin-top: .2rem;
    font-size: .8rem;
    color: #64748b;
}
.ms-balance-top strong {
    font-size: 1.2rem;
    font-weight: 750;
    white-space: nowrap;
    letter-spacing: -.02em;
    color: var(--ink);
}
.ms-balance-den {
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    margin-left: .05rem;
}
.ms-balance-meter {
    position: relative;
    height: .5rem;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
    margin-bottom: .55rem;
}
.ms-balance-meter i {
    position: absolute;
    top: 0;
    bottom: 0;
    display: block;
}
.ms-balance-meter .is-assigned {
    left: 0;
    background: #2563eb;
}
.ms-balance-meter .is-pending {
    background: #93c5fd;
}
.ms-balance-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .85rem;
    font-size: .75rem;
    color: #64748b;
}
.ms-balance-left {
    margin-left: auto;
    font-weight: 600;
    color: #334155;
}
.ms-balance-legend .dot-assigned,
.ms-balance-legend .dot-pending {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    border-radius: 999px;
    margin-right: .28rem;
    vertical-align: middle;
}
.ms-balance-legend .dot-assigned { background: #2563eb; }
.ms-balance-legend .dot-pending { background: #93c5fd; }
@media (max-width: 900px) {
    .ms-balance { grid-template-columns: 1fr; }
    .ms-balance-left { margin-left: 0; }
}

.ms-week-toolbar {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding: 1.05rem 1.35rem .85rem;
    border-bottom: 1px solid var(--line);
}

.ms-week-toolbar-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .85rem;
    flex-wrap: wrap;
}

.ms-week-toolbar-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    min-width: 0;
}

.ms-week-toolbar-title h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.25;
}

.ms-week-toolbar-title span {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.3;
}

.ms-week-toolbar-meta {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.ms-pending-pill {
    display: inline-flex;
    align-items: center;
    padding: .22rem .55rem;
    border-radius: 999px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c;
    font-size: .72rem;
    font-weight: 700;
}

.ms-week-seg {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    padding: .2rem;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
}

.ms-week-seg-item {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .42rem .7rem;
    border-radius: 9px;
    text-decoration: none;
    color: #64748b;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.ms-week-seg-item i {
    font-style: normal;
    min-width: .95rem;
    height: .95rem;
    padding: 0 .22rem;
    border-radius: 999px;
    background: #ffe4e6;
    color: #be123c;
    font-size: .62rem;
    font-weight: 700;
    display: inline-grid;
    place-items: center;
}

.ms-week-seg-item:hover {
    color: #1e40af;
    background: rgba(255, 255, 255, .7);
}

.ms-week-seg-item.is-active {
    background: #fff;
    color: #1d4ed8;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.ms-week-card .ms-req-hint {
    margin: 0;
    padding: .7rem 1.35rem;
    color: #64748b;
    font-size: .82rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.ms-week-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .6rem;
    padding: 1rem 1.35rem 1.2rem;
}
.ms-week-day {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    min-height: 148px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ms-week-day.is-clickable {
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.ms-week-day.is-clickable:hover,
.ms-week-day.is-clickable:focus-visible {
    border-color: #93c5fd;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .1);
    transform: translateY(-1px);
    outline: none;
}
.ms-week-day.has-pending {
    box-shadow: inset 3px 0 0 #e11d48;
}
.ms-week-day.has-pending.is-clickable:hover,
.ms-week-day.has-pending.is-clickable:focus-visible {
    border-color: #fda4af;
    box-shadow: inset 3px 0 0 #e11d48, 0 8px 20px rgba(225, 29, 72, .08);
}
.ms-week-day.is-today {
    border-color: #93c5fd;
    background: #f8fbff;
}
.ms-week-day.has-pending.is-today {
    box-shadow: inset 3px 0 0 #e11d48;
}
.ms-week-day.is-outside {
    opacity: .5;
    background: #f8fafc;
}
.ms-week-day.is-empty:not(.is-clickable) {
    background: #f8fafc;
}
.ms-week-day-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .4rem;
    padding: .65rem .7rem .45rem;
    border-bottom: 1px solid var(--line);
}
.ms-week-day-head > div:first-child {
    min-width: 0;
}
.ms-week-day-badges {
    display: flex;
    align-items: center;
    gap: .25rem;
}
.ms-week-dow {
    display: block;
    font-size: .66rem;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.ms-week-day-head strong {
    font-size: 1.15rem;
    line-height: 1.1;
    letter-spacing: -.02em;
}
.ms-week-day-count {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-size: .68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ms-week-day-body {
    padding: .45rem .5rem .55rem;
    display: flex;
    flex-direction: column;
    gap: .28rem;
    flex: 1;
}
.ms-week-day-body .cal-chip {
    pointer-events: none;
}
.ms-week-day-cta {
    margin-top: auto;
    padding-top: .25rem;
    font-size: .68rem;
    font-weight: 700;
    color: #2563eb;
    opacity: 0;
    transition: opacity .15s ease;
}
.ms-week-day.is-clickable:hover .ms-week-day-cta,
.ms-week-day.is-clickable:focus-visible .ms-week-day-cta {
    opacity: 1;
}
.ms-week-outside,
.ms-week-none {
    margin: auto 0;
    text-align: center;
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 500;
    padding: .85rem .35rem;
}

.ms-req-day-item {
    gap: 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    overflow: hidden;
}

.app-modal--day .ms-day-list {
    gap: .75rem;
}

.ms-req-day-item .ms-shift-people {
    margin-top: 0;
}
.ms-req-day-item .ms-shift-actions {
    margin-top: 0;
}
.ms-req-day-item.is-wanted {
    border-left: 3px solid #2563eb;
}
.ms-req-day-item.is-filled {
    border-left: 3px solid #16a34a;
}
.ms-req-day-item.is-blocked {
    background: #fffbeb;
    border-color: #fde68a;
}

.ms-req-day-item.is-filled-you {
    border-left: 3px solid #16a34a;
}

.ms-req-day-item.is-filled-other {
    border-left: 3px solid #2563eb;
    background: rgba(37, 99, 235, .03);
    border-color: rgba(37, 99, 235, .18);
}

.ms-req-day-item.is-closed {
    background: #fff7ed;
    border-color: #fdba74;
}

.ms-shift-card {
    border-radius: 10px;
    padding: .55rem .55rem .6rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    border: 1px solid transparent;
}
.ms-shift-card.is-blocked {
    background: #fffbeb !important;
    border-color: #fde68a !important;
}
.ms-shift-card.is-wanted {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .35);
}
.ms-shift-card.is-filled {
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, .35);
}
.ms-shift-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .35rem;
}
.ms-shift-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    justify-content: flex-end;
}
.ms-shift-type {
    font-size: .65rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, .65);
}
.ms-shift-title {
    font-size: .82rem;
    line-height: 1.25;
    color: #0f172a;
}
.ms-shift-time {
    font-size: .72rem;
    color: rgba(15, 23, 42, .65);
}
.ms-shift-people {
    margin-top: .3rem;
    padding: .35rem .4rem;
    border-radius: 8px;
    font-size: .72rem;
    line-height: 1.35;
}
.ms-shift-people-label {
    display: block;
    font-size: .62rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: .1rem;
}
.ms-shift-people--assigned {
    background: rgba(22, 163, 74, .12);
    color: #166534;
}
.ms-shift-people--peers {
    background: rgba(37, 99, 235, .08);
    color: #1e3a8a;
}
.ms-shift-people--peers ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .15rem .45rem;
}
.ms-shift-assigned-you {
    margin-top: .35rem;
    font-size: .75rem;
    font-weight: 650;
    color: #166534;
}
.ms-shift-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-top: .35rem;
}
.ms-shift-actions .btn-sm {
    padding: .28rem .5rem;
    font-size: .72rem;
}

@media (max-width: 1100px) {
    .ms-week-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .ms-week-board { grid-template-columns: 1fr; }
    .ms-week-day-cta { opacity: 1; }
}

.ms-req-switch {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.ms-req-switch-item {
    display: inline-flex;
    flex-direction: column;
    gap: .1rem;
    padding: .55rem .85rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    font-size: .88rem;
}
.ms-req-switch-item span {
    font-weight: 500;
    font-size: .75rem;
    color: var(--muted);
}
.ms-req-switch-item.is-active {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}
.ms-req-hint {
    margin: 0 0 1rem;
    padding: 0 1.25rem;
    color: var(--muted);
    font-size: .85rem;
}
.ms-req-recent-card {
    margin-top: 1rem;
}

.cal-card.ms-week-card {
    padding: 0;
    overflow: hidden;
}
.cal-chip.has-request {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .35);
}

.ms-req-list .ms-req-item {
    flex-wrap: wrap;
}
.ms-req-item.is-blocked {
    background: #fffbeb;
    border-color: #fde68a;
}
.ms-req-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    flex-shrink: 0;
}
.ms-req-recent {
    display: flex;
    flex-direction: column;
}
.ms-req-recent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--line);
}
.ms-req-recent-row:first-child { border-top: 0; }
.ms-req-recent-row > div {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}
.ms-req-recent-row .muted { font-size: .8rem; }

.ms-limits {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 0 1.25rem 1.25rem;
}
.ms-limit-chip {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .75rem 1rem;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.ms-limit-chip strong { font-size: .95rem; }
.ms-limit-chip em { font-style: normal; color: var(--muted); font-weight: 500; font-size: .85rem; }
.ms-block-reason {
    margin-top: 0;
    padding: .55rem .7rem;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
    font-size: .76rem;
    font-weight: 600;
    line-height: 1.4;
}
.ms-row-blocked td { background: #fffbeb; }
button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

@media (max-width: 1100px) {
    .cal-month,
    .cal-month-head { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .cal-month,
    .cal-month-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cal-month-dow:nth-child(n+3) { display: none; }
}

.topbar-right { display: flex; align-items: center; gap: .75rem; }

.notif-menu { position: relative; }
.notif-btn {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: .55rem .8rem;
    font: inherit;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    position: relative;
}
.notif-count {
    position: absolute;
    top: -.35rem;
    right: -.35rem;
    background: #dc2626;
    color: #fff;
    border-radius: 999px;
    font-size: .65rem;
    min-width: 1.1rem;
    height: 1.1rem;
    display: grid;
    place-items: center;
    padding: 0 .25rem;
}
.notif-dd {
    position: absolute;
    right: 0;
    top: calc(100% + .4rem);
    width: min(340px, 85vw);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
    z-index: 40;
    overflow: hidden;
}
.notif-dd-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem .9rem;
    border-bottom: 1px solid var(--line);
    font-size: .85rem;
}
.notif-dd-head a { color: var(--brand); font-weight: 600; text-decoration: none; }
.notif-item {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    padding: .75rem .9rem;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    font: inherit;
}
.notif-item:hover { background: #f8fafc; }
.notif-item strong { font-size: .85rem; }
.notif-item span { font-size: .78rem; color: var(--muted); }
.notif-empty { padding: 1rem .9rem; color: var(--muted); font-size: .85rem; }
.notif-unread td { background: #eff6ff; }

/* Full month calendar (dashboard) */
.month-cal-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .5rem;
    margin-bottom: .85rem;
    padding: 0 .15rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    text-align: center;
}

.month-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .5rem;
}

.month-day {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    min-height: 110px;
    padding: .55rem .5rem .45rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    position: relative;
}

.month-day.is-outside {
    background: #f8fafc;
    opacity: .55;
}

.month-day.is-today {
    border-color: #93c5fd;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .18);
}

.month-day.is-popover-open {
    z-index: 25;
    opacity: 1;
}

.month-day.has-shifts {
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.month-day.has-shifts:hover {
    border-color: #bfdbfe;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, .12);
}

.month-day.has-shifts:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.workload-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.15rem 1.15rem;
    margin-bottom: 1rem;
}

.workload-card.is-warn {
    border-color: #fdba74;
    background: linear-gradient(180deg, #fffaf5 0%, #fff 60%);
}

.workload-card.is-over {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff7f7 0%, #fff 60%);
}

.workload-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .95rem;
}

.workload-card-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.workload-card-period {
    margin-top: .2rem;
    font-size: .82rem;
    color: var(--ink);
    font-weight: 600;
}

.workload-status {
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    padding: .28rem .55rem;
    border-radius: 999px;
    line-height: 1;
}

.workload-status--ok {
    color: var(--ok);
    background: var(--ok-bg);
}

.workload-status--warn {
    color: #c2410c;
    background: #ffedd5;
}

.workload-status--over {
    color: #b91c1c;
    background: #fee2e2;
}

.workload-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}

.workload-stat {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    padding: .85rem .9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    min-width: 0;
}

.workload-stat-top {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.workload-stat label {
    font-size: .72rem;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.workload-stat strong {
    font-size: 1.35rem;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.workload-stat strong small {
    font-size: .78rem;
    font-weight: 650;
    color: var(--muted);
    margin-left: .1rem;
}

.workload-stat > span {
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.35;
}

.workload-stat.is-over {
    border-color: #fecaca;
    background: #fff5f5;
}

.workload-stat.is-over strong,
.workload-stat.is-over > span {
    color: #b91c1c;
}

.workload-meter {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.workload-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
    max-width: 100%;
}

.workload-meter i.is-warn {
    background: #ea580c;
}

.workload-meter i.is-over {
    background: #dc2626;
}

.workload-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.workload-chip {
    display: inline-flex;
    align-items: center;
    font-size: .72rem;
    font-weight: 650;
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: .2rem .5rem;
}

@media (max-width: 900px) {
    .workload-card-grid {
        grid-template-columns: 1fr;
    }
}

.month-day-num {
    font-size: .82rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
    padding: .1rem .15rem 0;
}

.month-day-shifts {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.month-pill {
    border-radius: 6px;
    padding: .2rem .35rem;
    font-size: .68rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-pill-link {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    text-decoration: none;
    color: inherit;
    white-space: normal;
}

.month-pill-link:hover {
    filter: brightness(.97);
    outline: 1px solid rgba(37, 99, 235, .35);
}

.month-pill-main {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-pill-meta {
    font-size: .62rem;
    font-weight: 600;
    opacity: .75;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-legend-sep {
    width: 1px;
    height: .9rem;
    background: var(--line);
    margin: 0 .15rem;
}

.month-status-dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    margin-right: .25rem;
    vertical-align: middle;
    border: 1px solid transparent;
}

.month-status--draft {
    border-left: 3px solid #94a3b8;
}
.month-status-dot.month-status--draft { background: #94a3b8; border-left: 0; }

.month-status--open {
    border-left: 3px solid #f59e0b;
}
.month-status-dot.month-status--open { background: #f59e0b; border-left: 0; }

.month-status--review {
    border-left: 3px solid #8b5cf6;
}
.month-status-dot.month-status--review { background: #8b5cf6; border-left: 0; }

.month-status--published {
    border-left: 3px solid #16a34a;
}
.month-status-dot.month-status--published { background: #16a34a; border-left: 0; }

.month-more {
    appearance: none;
    border: 0;
    background: transparent;
    padding: .15rem 0;
    margin: 0;
    font: inherit;
    font-size: .72rem;
    color: var(--brand);
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    width: fit-content;
}

.month-more:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.day-popover {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 72vw);
    max-height: min(320px, calc(100vh - 24px));
    display: none;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
    z-index: 70;
    overflow: hidden;
    opacity: 0;
    transform: translateY(6px) scale(.98);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.day-popover[hidden] {
    display: none !important;
}

.day-popover.is-open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.day-popover-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    padding: .75rem .85rem;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.day-popover-head strong {
    display: block;
    font-size: .88rem;
}

.day-popover-head span {
    display: block;
    margin-top: .15rem;
    font-size: .75rem;
    color: var(--muted);
    font-weight: 600;
}

.day-popover-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: .1rem .25rem;
    border-radius: 6px;
}

.day-popover-close:hover {
    background: #e2e8f0;
    color: var(--ink);
}

.day-popover-list {
    overflow-y: auto;
    padding: .4rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.day-popover-item {
    display: flex;
    gap: .55rem;
    align-items: stretch;
    padding: .55rem .5rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background .12s ease;
}

.day-popover-item:hover {
    background: #f8fafc;
}

.day-popover-accent {
    width: 4px;
    border-radius: 999px;
    flex-shrink: 0;
    border: 0 !important;
}

.day-popover-item-body {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.day-popover-item-body strong {
    font-size: .84rem;
}

.day-popover-item-body > span {
    font-size: .75rem;
    color: var(--muted);
    font-weight: 500;
}

.day-popover-item-meta {
    font-size: .7rem !important;
    font-weight: 600 !important;
}

@media (max-width: 900px) {
    .month-cal-head,
    .month-cal { grid-template-columns: repeat(7, minmax(4.5rem, 1fr)); overflow-x: auto; }
    .month-day { min-height: 88px; }
}

/* Day repeat — segmented control */
.repeat-field {
    margin: 0 0 1rem;
}

.repeat-field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .45rem;
}

.repeat-field-head label {
    margin: 0;
}

.repeat-field-head .muted {
    font-size: .78rem;
    font-weight: 500;
}

.repeat-field .hint {
    margin: .55rem 0 0;
}

.day-seg {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
}

.day-seg-item {
    position: relative;
    margin: 0;
    cursor: pointer;
    user-select: none;
    border-right: 1px solid var(--line);
}

.day-seg-item:last-child {
    border-right: 0;
}

.day-seg-item input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.day-seg-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6rem;
    padding: .55rem .25rem;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--muted);
    background: transparent;
    transition: background .12s ease, color .12s ease;
}

.day-seg-item:hover span {
    background: #fff;
    color: var(--ink);
}

.day-seg-item input:focus-visible + span {
    outline: 2px solid rgba(37, 99, 235, .4);
    outline-offset: -2px;
    z-index: 1;
    position: relative;
}

.day-seg-item input:checked + span {
    background: #eff6ff;
    color: var(--brand-dark);
    box-shadow: inset 0 -2px 0 var(--brand);
}

@media (max-width: 560px) {
    .day-seg {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .day-seg-item:nth-child(4n) {
        border-right: 0;
    }

    .day-seg-item:nth-child(n+5) {
        border-top: 1px solid var(--line);
    }
}

/* Multi-select chips for variable-length labels (classifications) */
.chip-seg {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: 0 0 1rem;
}

.chip-seg-item {
    position: relative;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.chip-seg-item input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.chip-seg-item span {
    display: inline-flex;
    align-items: center;
    padding: .5rem .85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--muted);
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.chip-seg-item:hover span {
    background: #fff;
    color: var(--ink);
}

.chip-seg-item input:focus-visible + span {
    outline: 2px solid rgba(37, 99, 235, .4);
    outline-offset: 2px;
}

.chip-seg-item input:checked + span {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--brand-dark);
}

/* Schedule shift board */
.shift-board {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.shift-day-group {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.shift-day-label {
    display: flex;
    align-items: baseline;
    gap: .55rem;
    padding: .7rem .95rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.shift-day-label strong {
    font-size: .92rem;
    letter-spacing: .02em;
}

.shift-day-label span {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 500;
}

.shift-day-label em {
    margin-left: auto;
    font-style: normal;
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
}

.shift-rows {
    display: flex;
    flex-direction: column;
}

.shift-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) auto;
    gap: 1rem;
    align-items: center;
    padding: .85rem .95rem;
    border-top: 1px solid var(--line);
}

.shift-row:first-child {
    border-top: 0;
}

.shift-row-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: .2rem;
}

.shift-row-title strong {
    font-size: .95rem;
}

.shift-type {
    display: inline-flex;
    align-items: center;
    padding: .15rem .45rem;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 700;
    border: 1px solid transparent;
    line-height: 1.2;
}

.shift-row-when {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.shift-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
}

.staff-meter {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .28rem .55rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    white-space: nowrap;
}

.staff-meter-count {
    font-size: .82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.staff-meter-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.staff-meter.is-empty {
    background: #fff7ed;
    border-color: #fed7aa;
}

.staff-meter.is-empty .staff-meter-count { color: #c2410c; }

.staff-meter.is-partial {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.staff-meter.is-partial .staff-meter-count { color: #1d4ed8; }

.staff-meter.is-full {
    background: var(--ok-bg);
    border-color: #a7f3d0;
}

.staff-meter.is-full .staff-meter-count { color: var(--ok); }

.shift-assignees {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}

.assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .5rem .2rem .2rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--ink);
    font-size: .75rem;
    font-weight: 600;
}

.assignee-chip i {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #e2e8f0;
    font-style: normal;
    font-size: .65rem;
    font-weight: 700;
    color: #334155;
}

.assignee-empty {
    font-size: .8rem;
    color: var(--muted);
    font-weight: 500;
}

.shift-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .15rem;
}

.shift-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    padding: .35rem .55rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

.shift-link:hover {
    background: #f1f5f9;
    color: var(--ink);
}

.shift-link.is-danger:hover {
    background: #fef2f2;
    color: var(--danger);
}

@media (max-width: 900px) {
    .shift-row {
        grid-template-columns: 1fr;
        gap: .65rem;
    }

    .shift-row-actions {
        justify-content: flex-start;
        padding-top: .15rem;
        border-top: 1px dashed var(--line);
    }
}

/* Staff dashboard — next shift */
.next-shift {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--brand);
}

.next-shift.is-live {
    border-left-color: var(--ok);
    background: linear-gradient(180deg, #f0fdf4 0%, #fff 55%);
}

.next-shift.is-empty {
    border-left-color: #cbd5e1;
}

.next-shift-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .55rem;
}

.next-shift-body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.next-shift-main h2 {
    margin: .15rem 0 .35rem;
    font-size: 1.25rem;
    letter-spacing: -.02em;
}

.next-shift-main p {
    margin: 0 0 .65rem;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 500;
}

.next-shift-countdown {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-dark);
}

.next-shift.is-live .next-shift-countdown {
    color: var(--ok);
}

.next-shift-countdown.is-muted {
    color: var(--ink);
    font-size: 1.05rem;
}

.next-shift-actions {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .next-shift-body {
        align-items: stretch;
    }

    .next-shift-actions .btn {
        width: 100%;
    }
}
/* Content is full-width by default; calendar / board pages use the full shell. */

.user-schedule {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-schedule-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.user-schedule-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
    gap: 1rem;
    align-items: start;
}

.user-schedule-main {
    min-width: 0;
}

.user-schedule-profile {
    margin: 0;
    padding: .95rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.user-schedule-profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.user-schedule-profile-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .2rem;
}

.user-schedule-name {
    display: block;
    font-size: 1.15rem;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.user-schedule-code {
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 700;
    color: var(--brand);
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: .28rem .55rem;
    line-height: 1;
}

.user-schedule-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: .45rem;
    margin: 0;
    padding-top: .75rem;
    border-top: 1px solid var(--line);
}

.user-schedule-meta > div {
    min-width: 0;
    padding: .5rem .65rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.user-schedule-meta span {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .15rem;
}

.user-schedule-meta strong {
    display: block;
    font-size: .86rem;
    font-weight: 650;
    color: var(--ink);
    line-height: 1.3;
    word-break: break-word;
}

.user-schedule-aside {
    position: sticky;
    top: 5.5rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.user-schedule-aside .workload-card,
.user-schedule-aside-empty {
    margin-bottom: 0;
}

.user-schedule-aside-empty {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.1rem 1.2rem;
}

.workload-card--compact {
    padding: .9rem 1rem 1rem;
}

.workload-card--compact .workload-card-head {
    margin-bottom: .7rem;
}

.workload-card--compact .workload-card-grid {
    grid-template-columns: 1fr;
    gap: .55rem;
}

.workload-card--compact .workload-stat {
    padding: .6rem .7rem;
    gap: .35rem;
}

.workload-card--compact .workload-stat strong {
    font-size: 1.1rem;
}

.workload-card--compact .workload-summary-chips {
    gap: .3rem;
}

.workload-card--compact .workload-chip {
    font-size: .68rem;
    padding: .15rem .4rem;
}

.user-schedule .cal-card {
    margin: 0;
}

@media (max-width: 980px) {
    .user-schedule-body {
        grid-template-columns: 1fr;
    }

    .user-schedule-aside {
        position: static;
        order: -1;
    }

    .user-schedule-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .user-schedule-meta {
        grid-template-columns: 1fr;
    }
}

.scheduler {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.scheduler-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .65rem .9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .75rem .9rem;
    box-shadow: var(--shadow);
}

.scheduler-toolbar-left,
.scheduler-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .5rem .65rem;
}

.scheduler-toolbar-right {
    margin-left: auto;
}

.scheduler-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .65rem;
    align-items: flex-end;
    margin: 0;
}

.scheduler-nav,
.scheduler-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}

.scheduler-period {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
}

.period-nav {
    margin-left: 0;
}

.period-nav .month-nav-label {
    min-width: 10.5rem;
    white-space: nowrap;
}

.period-nav-picker {
    position: relative;
}

.period-nav-date {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
}

.scheduler-field {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    margin: 0;
    font-size: .68rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.scheduler-field select {
    margin: 0;
    min-width: 8.5rem;
    padding: .45rem .65rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    font-size: .84rem;
    color: var(--ink);
}

.scheduler-view-tabs {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.scheduler-view-tabs a {
    padding: .45rem .75rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
}

.scheduler-view-tabs a.is-active {
    background: var(--brand);
    color: #fff;
}

.scheduler-cal-shell {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.scheduler-week-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    gap: .75rem;
    align-items: start;
}

.scheduler-balance-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .75rem .8rem;
    position: sticky;
    top: 5.25rem;
    max-height: calc(100vh - 6.5rem);
    overflow: auto;
}

.scheduler-balance-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .65rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--line);
}

.scheduler-balance-head strong {
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
}

.scheduler-balance-head span {
    font-size: .75rem;
    color: var(--muted);
    font-weight: 700;
    background: #f1f5f9;
    border-radius: 999px;
    padding: .15rem .45rem;
}

.scheduler-balance-tools {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-bottom: .65rem;
}

.scheduler-balance-search {
    margin: 0 !important;
    padding: .45rem .65rem !important;
    font-size: .82rem !important;
    background: #fff;
}

.scheduler-balance-toggle {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    font-size: .75rem;
    font-weight: 650;
    color: var(--muted);
    cursor: pointer;
}

.scheduler-balance-toggle input {
    width: .9rem;
    height: .9rem;
    margin: 0;
    accent-color: var(--brand);
}

.scheduler-balance-empty {
    margin: .35rem 0 0;
    font-size: .78rem;
}

.scheduler-balance-list {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.scheduler-balance-card {
    padding: .55rem .6rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.scheduler-balance-card.is-over {
    border-color: #fecaca;
    background: #fff7f7;
}

.scheduler-balance-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.scheduler-balance-card-top strong {
    font-size: .84rem;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduler-balance-card-top span {
    flex-shrink: 0;
    font-size: .75rem;
    font-weight: 700;
    color: var(--brand);
}

.scheduler-balance-card.is-over .scheduler-balance-card-top span {
    color: #b91c1c;
}

.scheduler-balance-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
    font-size: .72rem;
    color: var(--muted);
    font-weight: 600;
}

.scheduler-balance-warn {
    color: #b91c1c;
    font-weight: 750;
}

.scheduler-cal-card {
    margin: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: .75rem;
}

.scheduler-week-layout .cal-day {
    background: #fff;
    min-height: 200px;
}

.scheduler-week-layout .cal-block {
    text-decoration: none;
    color: inherit;
}

.scheduler-cal-card .cal-legend {
    display: none;
}

.scheduler-month-cal {
    gap: .3rem;
}

.scheduler-month-cal .month-day {
    min-height: 118px;
    padding: .4rem .45rem;
    border-radius: 8px;
}

.scheduler-month-cal .month-day-num {
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
}

.scheduler-month-cal .month-pill {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem .3rem;
    font-size: .64rem;
    line-height: 1.2;
    overflow: hidden;
}

.scheduler-month-cal .month-pill-time {
    flex-shrink: 0;
    font-weight: 700;
    opacity: .85;
}

.scheduler-month-cal .month-pill-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduler-month-cal .month-more {
    font-size: .62rem;
    font-weight: 700;
    color: var(--muted);
    padding: .1rem .2rem;
}

.scheduler-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1.1rem;
    padding: .55rem .9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
}

.board-shell .scheduler-legend {
    border-top: 1px solid var(--line);
    border-radius: 0 0 14px 14px;
}

@media (max-width: 1100px) {
    .scheduler-week-layout {
        grid-template-columns: 1fr;
    }

    .scheduler-balance-panel {
        position: static;
        max-height: none;
    }

    .scheduler-balance-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: .45rem;
    }
}

@media (max-width: 900px) {
    .scheduler-toolbar-left,
    .scheduler-toolbar-right {
        width: 100%;
    }

    .scheduler-toolbar-right {
        margin-left: 0;
        padding-top: .55rem;
        border-top: 1px solid var(--line);
    }

    .scheduler-month-cal .month-day {
        min-height: 96px;
    }
}

.board-shell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.board-scroll {
    overflow-x: auto;
}

.board {
    min-width: 1180px;
}

.board-head,
.board-row,
.board-staffing,
.board-chart {
    display: grid;
    grid-template-columns: 200px minmax(860px, 1fr) 72px;
    align-items: stretch;
}

.board-head {
    background: #eff6ff;
    border-bottom: 1px solid #dbeafe;
    position: sticky;
    top: 0;
    z-index: 3;
}

.board-corner,
.board-total-head,
.board-total,
.board-employee {
    padding: .65rem .75rem;
    border-right: 1px solid var(--line);
}

.board-total-head,
.board-total {
    border-right: 0;
    text-align: center;
    font-weight: 800;
}

.board-corner,
.board-total-head {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #1d4ed8;
    font-weight: 800;
    display: flex;
    align-items: center;
}

.board-hours {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    border-right: 1px solid var(--line);
}

.board-hours > div {
    padding: .55rem 0;
    text-align: center;
    font-size: .68rem;
    font-weight: 700;
    color: #334155;
    border-left: 1px solid #e2e8f0;
}

.board-hours > div:first-child {
    border-left: 0;
}

.board-row {
    border-bottom: 1px solid var(--line);
    min-height: calc(var(--lanes, 1) * 40px + 24px);
}

.board-row:hover {
    background: #f8fafc;
}

.board-row.is-unassigned {
    background: #fff7ed;
}

.board-employee {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .15rem;
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 2;
}

.board-row.is-unassigned .board-employee {
    background: #fff7ed;
}

.board-employee strong {
    font-size: .9rem;
}

.board-employee span,
.board-employee em {
    font-size: .72rem;
    color: var(--muted);
    font-style: normal;
    font-weight: 600;
}

.board-employee em.is-over {
    color: #b91c1c;
}

.board-track {
    position: relative;
    min-height: calc(var(--lanes, 1) * 40px + 24px);
    border-right: 1px solid var(--line);
}

.board-gridlines {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    pointer-events: none;
}

.board-gridlines > div {
    border-left: 1px solid #f1f5f9;
}

.board-gridlines > div:first-child {
    border-left: 0;
}

.board-bar {
    position: absolute;
    top: calc(12px + (var(--lane, 0) * 40px));
    height: 32px;
    border-radius: 8px;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    padding: 0 .55rem;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .16);
    z-index: calc(1 + var(--lane, 0));
}

.board-bar span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-bar--regular { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.board-bar--oncall { background: linear-gradient(90deg, #c2410c, #f59e0b); }

.board-bar:hover {
    filter: brightness(1.05);
    outline: 2px solid rgba(255,255,255,.35);
}

.board-total {
    display: grid;
    place-items: center;
    font-size: .95rem;
    background: #fff;
}

.board-empty {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
}

.board-staffing {
    background: #f8fafc;
    border-top: 1px solid var(--line);
}

.board-staffing-counts > div {
    font-size: .78rem;
    font-weight: 800;
    color: #0f172a;
}

.board-chart {
    background: #fff;
    border-top: 1px solid var(--line);
    min-height: 84px;
}

.board-chart-bars {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    align-items: end;
    gap: 2px;
    padding: .55rem .35rem .45rem;
    border-right: 1px solid var(--line);
    min-height: 84px;
}

.board-chart-col {
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.board-chart-col span {
    width: 70%;
    max-width: 18px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    display: block;
}

/* Roster shift create / edit */
.shift-form-page {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.shift-form-form {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.shift-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, .95fr);
    gap: .85rem;
    align-items: stretch;
}

.shift-form-primary {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    min-width: 0;
    min-height: 100%;
}

.shift-form-side {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    min-height: 100%;
}

.shift-form-side .ms-create-guide {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.shift-form-side:has(.shift-form-panel--side) {
    position: sticky;
    top: 5.25rem;
}

.shift-form-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.1rem;
}

.shift-form-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--line);
}

.shift-form-panel-head > div {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.shift-form-panel-head strong {
    display: block;
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}

.shift-form-panel-head span {
    display: block;
    font-size: .78rem;
    color: var(--muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.shift-form-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem .9rem;
}

.shift-form-fields--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shift-form-fields--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.shift-form-fields--1 {
    grid-template-columns: minmax(0, 1fr);
}

.shift-form-field {
    min-width: 0;
}

.shift-form-field--full {
    grid-column: 1 / -1;
}

.shift-form-field label {
    margin-bottom: .3rem;
}

.shift-form-field input,
.shift-form-field select,
.shift-form-field textarea {
    margin-bottom: 0;
}

.multi-dd {
    position: relative;
    margin-bottom: 0;
}

.multi-dd-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    width: 100%;
    text-align: left;
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    color: inherit;
    cursor: pointer;
    margin-bottom: 0;
}

.multi-dd-toggle:disabled {
    cursor: not-allowed;
    background: #f8fafc;
    color: var(--muted);
}

.multi-dd-toggle:focus {
    outline: 2px solid rgba(37, 99, 235, .25);
    border-color: var(--brand);
}

.multi-dd-toggle.is-placeholder .multi-dd-label {
    color: var(--muted);
}

.multi-dd-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-dd-chevron {
    flex-shrink: 0;
    width: .45rem;
    height: .45rem;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg) translateY(-1px);
    margin-top: -.15rem;
}

.multi-dd-menu {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow: auto;
    padding: .35rem;
}

.multi-dd-option {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .65rem;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    margin: 0;
}

.multi-dd-option:hover {
    background: #f8fafc;
}

.multi-dd-option input {
    width: auto;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--brand);
}

.multi-dd-option span {
    flex: 1;
    min-width: 0;
}

.shift-audience-fields {
    margin-top: 1rem;
}

.shift-form-field .dept-dd,
.shift-form-field .chip-seg,
.shift-form-field .multi-dd {
    margin-bottom: 0;
}

.shift-form-field .dept-dd-toggle {
    margin-bottom: 0;
}

.shift-form-field .checkbox-row {
    margin: 0;
}

.shift-form-panel .hint {
    margin: .55rem 0 0;
}

.shift-form-panel--side {
    padding: 1rem 1.05rem;
}

.shift-form-panel--side .staff-picker {
    margin: 0;
    border: 0;
    background: transparent;
    padding: 0;
}

.shift-form-panel--side .staff-picker-list {
    max-height: min(34vh, 260px);
}

.shift-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .85rem 1.1rem;
}

.ms-form-hint {
    margin: .35rem 0 0;
    font-size: .78rem;
}

.ms-create-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ms-create-form-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-height: 0;
}

.ms-create-form-body .shift-form-field--full {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 0;
}

.ms-create-form-body .shift-form-field--full textarea {
    flex: 1;
    min-height: 5.5rem;
    resize: vertical;
}

.shift-form-field input.is-readonly,
.shift-form-field input:disabled {
    background: #f8fafc;
    color: #475569;
    cursor: not-allowed;
}

.ms-create-guide {
    padding-bottom: 1rem;
}

.ms-create-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .45rem;
    margin-bottom: .85rem;
    padding: .65rem .75rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.ms-create-status p {
    margin: 0;
    font-size: .82rem;
    color: #475569;
    line-height: 1.4;
}

.ms-create-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.ms-create-step {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .55rem .65rem;
    border-radius: 10px;
    border: 1px solid transparent;
    color: #64748b;
    font-size: .82rem;
    line-height: 1.35;
}

.ms-create-step-copy {
    flex: 1;
    min-width: 0;
}

.ms-create-step strong {
    display: block;
    color: #334155;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.3;
}

.ms-create-step-copy span {
    display: block;
    font-size: .76rem;
    line-height: 1.35;
}

.ms-create-step-num {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: .05rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.ms-create-step.is-current {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.ms-create-step.is-current .ms-create-step-num {
    background: #fff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.ms-create-step.is-current strong {
    color: #1e3a8a;
}

.ms-create-step.is-done {
    color: #047857;
}

.ms-create-step.is-done .ms-create-step-num {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #047857;
}

.ms-create-step.is-done strong {
    color: #065f46;
}

.ms-create-guide-foot {
    margin: auto 0 0;
    padding-top: .75rem;
    border-top: 1px solid var(--line);
    font-size: .78rem;
    color: #64748b;
    line-height: 1.45;
}

.shift-form-danger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #fff7f7;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: .85rem 1.1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 980px) {
    .shift-form-grid {
        grid-template-columns: 1fr;
    }

    .shift-form-side {
        position: static;
        order: 2;
    }

    .shift-form-fields,
    .shift-form-fields--2,
    .shift-form-fields--4 {
        grid-template-columns: 1fr;
    }

    .shift-form-panel--side .staff-picker-list {
        max-height: 240px;
    }
}

/* Staff picker */
.staff-picker {
    margin: .85rem 0 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    padding: .85rem;
}

.staff-picker-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.staff-picker-head strong {
    display: block;
    font-size: .92rem;
}

.staff-picker-head .muted {
    display: block;
    font-size: .78rem;
    margin-top: .15rem;
}

.staff-picker-count {
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 700;
    color: var(--brand);
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: .28rem .55rem;
    line-height: 1;
}

.staff-picker-search {
    margin: 0 0 .65rem !important;
    background: #fff;
}

.staff-picker-list {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    max-height: 280px;
    overflow: auto;
    padding-right: .15rem;
}

.staff-pick {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    margin: 0;
    padding: .65rem .75rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.staff-pick:hover {
    border-color: #bfdbfe;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .08);
}

.staff-pick:has(input:checked),
.staff-pick.is-selected {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #bfdbfe;
}

.staff-pick input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--brand);
}

.staff-pick-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: .8rem;
    font-weight: 750;
    color: #1d4ed8;
    background: #dbeafe;
}

.staff-pick:has(input:checked) .staff-pick-avatar {
    background: var(--brand);
    color: #fff;
}

.staff-pick-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.staff-pick-body strong {
    font-size: .92rem;
    line-height: 1.2;
}

.staff-pick-body span {
    font-size: .75rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-pick-limits {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .3rem;
}

.staff-chip {
    display: inline-flex;
    align-items: center;
    font-size: .68rem;
    font-weight: 700;
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: .18rem .45rem;
    white-space: nowrap;
}

.staff-chip--oc {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.staff-chip--muted {
    color: var(--muted);
    background: #f1f5f9;
    border-color: var(--line);
}

.staff-picker-empty-search {
    margin: .5rem 0 0;
}

.staff-pick[hidden] {
    display: none;
}

@media (max-width: 560px) {
    .staff-pick {
        grid-template-columns: auto auto minmax(0, 1fr);
        grid-template-rows: auto auto;
    }

    .staff-pick-limits {
        grid-column: 2 / -1;
        justify-content: flex-start;
        padding-left: 0;
    }
}

/* Staff home / my-schedule / team-schedule */
.staff-home {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: .85rem;
    align-items: start;
}

.staff-home-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.staff-home-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .65rem;
}

.staff-home-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .55rem .75rem;
    margin: 0;
    width: 100%;
}

.staff-home-cal {
    margin: 0;
}

.staff-home-cal .ms-week-toolbar {
    border-bottom: 1px solid var(--line);
}

.staff-home-cal .ms-req-hint {
    margin: 0;
    padding: .7rem 1.35rem;
    color: #64748b;
    font-size: .82rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.team-dept-form {
    margin: 0;
}

.team-dept-field {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    margin: 0;
    font-weight: 600;
}

.team-dept-field span {
    font-size: .68rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}

.team-dept-field select {
    margin: 0;
    min-width: 10rem;
    padding: .42rem .65rem;
    border-radius: 10px;
}

.team-dept-field--inline {
    flex-direction: row;
    align-items: center;
}

.team-dept-field--inline select {
    min-width: 8.5rem;
    padding: .38rem .6rem;
}


.team-dept-chip {
    display: inline-flex;
    align-items: center;
    padding: .4rem .7rem;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 700;
}

.schedule-card-head {
    align-items: stretch;
    flex-direction: column;
    gap: .65rem;
}

.schedule-card-head-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    width: 100%;
}

.schedule-card-head .cal-card-title {
    flex: 1 1 auto;
    min-width: 0;
}

.schedule-card-head .cal-card-title:has(h2) {
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
}

.dashboard-cal-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
}

.dashboard-cal-head .schedule-card-head-main {
    width: auto;
    flex: 1 1 auto;
}

.dashboard-cal-tools {
    width: auto;
    flex-shrink: 0;
}

.dashboard-cal-head--filters-only {
    justify-content: flex-end;
}

.dashboard-cal-toolbar {
    display: inline-flex;
    align-items: stretch;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .55rem;
    margin-left: auto;
}

.dashboard-cal-control {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 2.35rem;
    padding: .35rem .65rem .35rem .75rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.dashboard-cal-control-label {
    flex-shrink: 0;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #94a3b8;
    line-height: 1;
}

.dashboard-dept-form {
    margin: 0;
}

.dashboard-dept-field {
    margin: 0;
    min-width: 0;
}

.dept-picker {
    position: relative;
    min-width: 0;
}

.dept-picker-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
    min-width: 8.5rem;
    max-width: 14rem;
    margin: 0;
    padding: .15rem 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: .84rem;
    font-weight: 650;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
}

.dept-picker-toggle:hover,
.dept-picker-toggle[aria-expanded="true"] {
    color: #1d4ed8;
}

.dept-picker-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dept-picker-caret {
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: .55;
    margin-top: 1px;
}

.dept-picker-menu {
    position: fixed;
    min-width: 220px;
    max-width: min(320px, calc(100vw - 24px));
    max-height: min(320px, calc(100vh - 24px));
    overflow: auto;
    margin: 0;
    padding: .35rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .16);
    z-index: 85;
    display: none;
}

.dept-picker-menu.is-open {
    display: block;
}

.dept-picker-menu[hidden] {
    display: none !important;
}

.dept-picker-option {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .1rem;
    width: 100%;
    margin: 0;
    padding: .55rem .65rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    color: #0f172a;
}

.dept-picker-option-name {
    font-size: .84rem;
    font-weight: 650;
    line-height: 1.25;
}

.dept-picker-option-meta {
    font-size: .72rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.2;
}

.dept-picker-option:hover {
    background: #f1f5f9;
}

.dept-picker-option.is-selected {
    background: rgba(37, 99, 235, .1);
    color: #1d4ed8;
}

.dept-picker-option.is-selected .dept-picker-option-meta {
    color: #3b82f6;
}

.dept-picker-option.is-selected .dept-picker-option-name::after {
    content: ' ✓';
    font-size: .78rem;
    font-weight: 700;
}

.dashboard-dept-value {
    font-size: .84rem;
    font-weight: 650;
    color: #0f172a;
    white-space: nowrap;
}

.dashboard-cal-control--month {
    padding-right: .45rem;
}

.dashboard-month-nav {
    margin-left: 0;
    gap: .15rem;
}

.dashboard-month-nav .month-nav-btn {
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 1rem;
}

.dashboard-month-nav .month-nav-btn:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}

.dashboard-month-nav .month-nav-label {
    min-width: 0;
    padding: .2rem .45rem;
    border: 0;
    background: transparent;
    border-radius: 8px;
    font-size: .84rem;
    font-weight: 700;
    color: #0f172a;
}

.dashboard-month-nav .month-nav-label:hover,
.dashboard-month-nav .month-nav-label[aria-expanded="true"] {
    background: #f1f5f9;
    color: #1d4ed8;
}

@media (max-width: 900px) {
    .dashboard-cal-head {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-cal-head--filters-only {
        align-items: stretch;
    }

    .dashboard-cal-toolbar {
        width: 100%;
        margin-left: 0;
        justify-content: stretch;
    }

    .dashboard-cal-control {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .dept-picker-toggle {
        max-width: 100%;
    }
}

.schedule-card-head .cal-legend--inline {
    flex-wrap: wrap;
    row-gap: .45rem;
}

.schedule-scope-form {
    margin: 0;
    flex-shrink: 0;
}

.scope-seg {
    display: inline-flex;
    align-items: center;
    gap: .18rem;
    padding: .22rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.scope-seg-item {
    position: relative;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.scope-seg-item input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.scope-seg-item span {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .48rem .9rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    color: #64748b;
    background: transparent;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease;
    white-space: nowrap;
}

.scope-seg-icon {
    flex-shrink: 0;
    opacity: .78;
}

.scope-seg-item:hover span {
    color: #334155;
}

.scope-seg-item input:checked + span {
    background: #fff;
    color: #0f172a;
    border-color: #dbeafe;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 0 0 1px rgba(37, 99, 235, .06);
}

.scope-seg-item input:checked + span .scope-seg-icon {
    opacity: 1;
    color: var(--brand);
}

.scope-seg-item input:focus-visible + span {
    outline: 2px solid rgba(37, 99, 235, .35);
    outline-offset: 1px;
}

.schedule-cal-tools {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .55rem .75rem;
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
}

.schedule-cal-tools .ms-week-toolbar-meta {
    flex-wrap: nowrap;
}

.schedule-balance-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.schedule-info-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem .65rem;
    width: 100%;
    padding: .55rem .8rem;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: .82rem;
    line-height: 1.35;
}

.schedule-info-bar-icon {
    flex-shrink: 0;
    color: var(--brand);
    opacity: .9;
}

.schedule-info-bar-text {
    flex: 1 1 auto;
    min-width: 0;
}

.schedule-info-bar-text strong {
    color: #0f172a;
    font-weight: 700;
}

.schedule-info-bar-tag {
    display: inline-flex;
    align-items: center;
    padding: .18rem .55rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .schedule-card-head .cal-legend--inline {
        max-width: 100%;
    }
}

@media (max-width: 720px) {
    .schedule-card-head {
        gap: .55rem;
    }

    .schedule-card-head-main {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-cal-tools {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .schedule-scope-form,
    .scope-seg {
        width: 100%;
    }

    .scope-seg {
        display: flex;
    }

    .scope-seg-item {
        flex: 1;
    }

    .scope-seg-item span {
        justify-content: center;
        width: 100%;
    }

    .schedule-cal-tools .ms-week-toolbar-meta {
        justify-content: space-between;
        flex-wrap: wrap;
        width: 100%;
    }

    .schedule-balance-btn {
        width: 100%;
    }
}

.cal-chip.is-you {
    outline: 1.5px solid rgba(5, 150, 105, .45);
    outline-offset: 0;
}

.team-week-board {
    padding: 1rem 1.35rem 1.2rem;
}

.team-chip-people {
    display: block;
    margin: -.05rem 0 .15rem .1rem;
    font-size: .66rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-chip-people.is-open {
    color: #b45309;
}

.team-balance-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.team-balance-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .95rem 1.05rem;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.team-balance-head strong {
    display: block;
    font-size: .92rem;
}

.team-balance-head span {
    display: block;
    margin-top: .15rem;
    font-size: .78rem;
    color: var(--muted);
}

.team-balance-head em {
    font-style: normal;
    min-width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: .72rem;
    font-weight: 700;
    display: inline-grid;
    place-items: center;
}

.team-balance-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding: .75rem;
    max-height: min(70vh, 560px);
    overflow: auto;
}

.team-balance-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: .7rem .75rem;
}

.team-balance-card.is-over {
    border-color: #fecaca;
    background: #fff7f7;
}

.team-balance-card-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    margin-bottom: .4rem;
}

.team-balance-card-top strong {
    font-size: .85rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-balance-card-top span {
    font-size: .78rem;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.team-balance-card.is-over .team-balance-card-top span {
    color: #be123c;
}

.team-balance-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .55rem;
    margin-top: .4rem;
    font-size: .7rem;
    color: #64748b;
}

.team-balance-warn {
    color: #be123c;
    font-weight: 700;
}

.staff-home-aside {
    position: sticky;
    top: 5.25rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.staff-home-aside .workload-card {
    margin-bottom: 0;
}

.next-shift--aside {
    margin: 0;
}

.next-shift--aside .next-shift-body {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
}

.next-shift--aside h2 {
    font-size: 1.05rem;
}

.next-shift--aside .next-shift-actions {
    width: 100%;
}

.next-shift--aside .next-shift-actions .btn {
    width: 100%;
}

@media (max-width: 980px) {
    .staff-home {
        grid-template-columns: 1fr;
    }

    .staff-home-aside {
        position: static;
        order: -1;
    }
}

/* Duration presets */
.duration-presets {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: .35rem;
}

.duration-chip {
    cursor: pointer;
}

.duration-chip input { display: none; }

.duration-chip span {
    display: inline-block;
    padding: .3rem .7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 500;
    background: #fff;
    transition: all .15s;
}

.duration-chip input:checked + span {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.duration-chip span:hover {
    border-color: #2563eb;
}

/* Time picker dropdowns */
.time-picker-row {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.time-select {
    flex: 1;
    padding: .45rem .5rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: .88rem;
    background: #fff;
    appearance: auto;
    cursor: pointer;
}

.time-select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .15);
}

.time-colon {
    font-size: 1.1rem;
    font-weight: 700;
    color: #64748b;
}

/* Schedule stepper + toolbar */
.ms-schedule-toolbar {
    margin-bottom: 1rem;
    padding: .95rem 1.15rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.ms-schedule-toolbar--minimal {
    padding: .7rem 1.15rem;
}

.ms-schedule-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
}

.ms-schedule-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    margin-left: auto;
}

.ms-schedule-actions form {
    margin: 0;
}

.ms-schedule-actions .btn-sm {
    padding: .48rem .85rem;
    font-size: .84rem;
}

.ms-schedule-hint {
    margin: .65rem 0 0;
    padding: .55rem 0 0;
    border-top: 1px solid #eef2f7;
    color: #64748b;
    font-size: .84rem;
    line-height: 1.45;
}

.ms-schedule-status-note {
    font-size: .82rem;
    font-weight: 600;
}

.ms-stepper {
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: .85rem 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.ms-stepper--compact {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.ms-stepper-item {
    display: flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.ms-stepper-item.upcoming {
    opacity: .45;
}

.ms-stepper-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: .78rem;
    font-weight: 700;
    border: 2px solid #cbd5e1;
    color: #64748b;
    background: #fff;
    flex-shrink: 0;
}

.ms-stepper--compact .ms-stepper-circle {
    width: 28px;
    height: 28px;
    font-size: .78rem;
    border-width: 2px;
}

.ms-stepper-item.active .ms-stepper-circle {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.ms-stepper-item.done .ms-stepper-circle {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
}

.ms-stepper-label {
    font-size: .82rem;
    font-weight: 600;
    color: #334155;
}

.ms-stepper--compact .ms-stepper-label {
    font-size: .82rem;
}

.ms-stepper-item.active .ms-stepper-label {
    color: #2563eb;
}

.ms-stepper-item.done .ms-stepper-label {
    color: #16a34a;
}

.ms-stepper-line {
    flex: 1 1 0;
    min-width: 20px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 .6rem;
}

.ms-stepper--compact .ms-stepper-line {
    min-width: 16px;
    margin: 0 .5rem;
}

.ms-stepper-line.done {
    background: #16a34a;
}

.ms-stepper-hint {
    margin: -.55rem 0 1.15rem;
    padding: .65rem .95rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: .84rem;
    line-height: 1.45;
}

.ms-review-lock-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .65rem;
    margin: 0 0 .85rem;
    padding: .75rem .95rem;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-size: .86rem;
    line-height: 1.45;
}

.ms-review-lock-banner strong {
    font-weight: 800;
}

.ms-shift-locked {
    display: inline-block;
    margin-top: .35rem;
    font-size: .8rem;
    font-weight: 600;
    color: #c2410c;
}

.swap-list {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding: .25rem 0 .5rem;
}

.swap-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.swap-row-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .45rem;
    min-width: 0;
    flex: 1;
    font-size: .9rem;
    line-height: 1.4;
}

.swap-form {
    padding: .25rem 0 .5rem;
}

.swap-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: 1rem;
    align-items: start;
}

.swap-board-main {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.swap-card-head {
    padding: 1rem 1.1rem .85rem;
    margin-bottom: 0;
}

.swap-card-head::after {
    display: none;
}

.swap-board-tools {
    flex-wrap: nowrap;
}

.swap-dept-form {
    margin: 0;
}

.swap-dept-select {
    margin: 0;
    min-width: 9rem;
    padding: .48rem .75rem;
    font-size: .82rem;
}

.swap-how-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
    width: 100%;
    padding: .6rem .75rem;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}

.swap-how-step {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .78rem;
    line-height: 1.35;
    color: #475569;
}

.swap-how-step strong {
    color: #0f172a;
}

.swap-how-num {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-size: .72rem;
    font-weight: 800;
}

.swap-board-main .swap-cal-wrap {
    margin: 0 1.1rem 1.15rem;
}

.swap-board-toolbar {
    display: none;
}

.swap-board-toolbar h2 {
    margin: 0;
    font-size: 1.05rem;
}

.swap-board-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    align-items: center;
}

.swap-dept-form select {
    margin: 0;
    min-width: 9rem;
}

.swap-week-nav {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

.swap-week-nav strong {
    font-size: .82rem;
    min-width: 9.5rem;
    text-align: center;
}

.swap-week-btn {
    width: 1.7rem;
    height: 1.7rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #334155;
    text-decoration: none;
    font-weight: 700;
}

.swap-week-btn:hover {
    background: #f1f5f9;
}

.swap-board-legend {
    margin-bottom: .75rem;
}

.swap-you-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: .12rem .45rem;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #047857;
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.2;
}

.swap-cal-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
}

.swap-cal {
    min-width: 760px;
}

.swap-cal-head,
.swap-cal-row {
    display: grid;
    grid-template-columns: 140px repeat(7, minmax(90px, 1fr));
}

.swap-cal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.swap-cal-staff-col,
.swap-cal-day-col {
    padding: .55rem .45rem;
    border-right: 1px solid #eef2f7;
}

.swap-cal-head .swap-cal-day-col {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    align-items: center;
    font-size: .72rem;
    color: #64748b;
}

.swap-cal-head .swap-cal-day-col strong {
    color: #0f172a;
    font-size: .9rem;
}

.swap-cal-row {
    border-bottom: 1px solid #eef2f7;
    background: #fff;
}

.swap-cal-row.is-you {
    background: #f0fdf4;
    box-shadow: inset 3px 0 0 #059669;
}

.swap-cal-row.is-you .swap-cal-staff-col {
    background: #f0fdf4;
}

.swap-cal-staff-col {
    position: sticky;
    left: 0;
    z-index: 1;
    background: inherit;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    justify-content: center;
    font-size: .84rem;
}

.swap-cal-day-col {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-height: 4.2rem;
}

.swap-cal-day-col.is-today {
    background: rgba(37, 99, 235, .04);
}

.swap-chip {
    display: flex;
    flex-direction: column;
    gap: .08rem;
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: .38rem .42rem .32rem;
    font: inherit;
    line-height: 1.2;
    cursor: default;
    position: relative;
}

.swap-chip-time {
    font-size: .68rem;
    font-weight: 700;
    opacity: .85;
}

.swap-chip strong {
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swap-chip-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: .08rem;
    padding: .08rem .34rem;
    border-radius: 999px;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.2;
}

.swap-chip-tag.is-yours {
    background: rgba(255, 255, 255, .72);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, .28);
}

.swap-chip-tag.is-action {
    background: rgba(255, 255, 255, .78);
    color: #6d28d9;
    border: 1px solid rgba(147, 51, 234, .22);
}

.swap-chip-tag.is-locked {
    background: rgba(255, 255, 255, .72);
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.swap-chip.is-peer-locked {
    opacity: .72;
    cursor: not-allowed;
}

.swap-chip span:not(.swap-chip-time):not(.swap-chip-tag) {
    font-size: .68rem;
    font-weight: 700;
    opacity: .85;
}

.swap-chip.is-regular {
    background: #dbeafe;
    color: #1e3a8a;
}

.swap-chip.is-oncall {
    background: #ffedd5;
    color: #9a3412;
}

.swap-chip.is-mine {
    box-shadow: inset 0 0 0 1.5px #059669;
}

.swap-chip.is-peer {
    cursor: pointer;
    border-style: dashed;
    border-color: rgba(147, 51, 234, .28);
}

.swap-chip.is-peer:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
    border-color: rgba(147, 51, 234, .45);
}

.swap-chip:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.swap-chip-empty {
    display: grid;
    place-items: center;
    min-height: 2.8rem;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 600;
}

.swap-board-aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.swap-aside-card {
    padding: 1.15rem 1.15rem 1.25rem;
    border-radius: 16px;
}

.swap-aside-card .card-head {
    margin-bottom: 1rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid #eef2f7;
}

.swap-aside-head {
    align-items: center;
}

.swap-aside-sub {
    margin: .2rem 0 0;
    color: #64748b;
    font-size: .82rem;
    line-height: 1.35;
}

.swap-aside-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 .45rem;
    border-radius: 999px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c;
    font-size: .82rem;
    font-weight: 800;
}

.swap-aside-empty {
    padding: .35rem .15rem .15rem;
    color: #64748b;
    font-size: .84rem;
    line-height: 1.45;
}

.swap-aside-empty p {
    margin: 0;
}

.swap-aside-card .card-head h2 {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #0f172a;
}

.swap-request-stack,
.swap-activity-list {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.swap-request-stack--wide {
    max-width: 720px;
}

.swap-request-card {
    border: 1px solid #e5ebf3;
    border-radius: 14px;
    padding: 1.1rem 1.15rem 1.05rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.swap-request-card:hover {
    border-color: #d5e0ef;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}

.swap-request-card-head {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: baseline;
    margin-bottom: .95rem;
}

.swap-request-lead {
    margin: 0;
    font-size: .88rem;
    color: #64748b;
    line-height: 1.35;
    min-width: 0;
}

.swap-request-lead strong {
    color: #0f172a;
    font-weight: 700;
}

.swap-request-lead-muted {
    color: #94a3b8;
    font-weight: 500;
}

.swap-request-time {
    font-size: .75rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.swap-from-to {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .55rem;
    align-items: stretch;
    position: relative;
}

.swap-leg {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .85rem .8rem .9rem;
    border-radius: 12px;
    background: #f4f6f9;
    border: 1px solid transparent;
    min-width: 0;
}

.swap-leg.is-yours {
    background: #eef4ff;
}

.swap-leg-label {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .62rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: .15rem;
}

.swap-leg-title {
    color: #0f172a;
    font-size: .98rem;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.swap-leg-meta {
    font-size: .78rem;
    color: #64748b;
    line-height: 1.35;
}

.swap-leg-dept {
    margin-top: .2rem;
    font-size: .76rem;
    font-weight: 600;
    color: #475569;
}

.swap-exchange {
    align-self: center;
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #fff;
    color: var(--brand);
    border: 1.5px solid #bfdbfe;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .12);
    z-index: 1;
}

.swap-note {
    margin: .85rem 0 0;
    padding: .7rem .8rem;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    font-size: .8rem;
    color: #92400e;
    line-height: 1.4;
}

.swap-request-actions {
    display: flex;
    justify-content: flex-end;
    gap: .55rem;
    margin-top: 1rem;
}

.swap-request-actions .btn {
    min-width: 5.75rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: .82rem;
}

.swap-request-actions .btn-sm {
    padding: .5rem 1rem;
}

.swap-request-actions .btn-secondary {
    background: #fff;
    border: 1px solid #dce3ee;
    color: #0f172a;
    box-shadow: none;
}

.swap-request-actions .btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.swap-activity-row {
    display: flex;
    justify-content: space-between;
    gap: .65rem;
    align-items: flex-start;
    padding: .85rem .95rem;
    border: 1px solid #e8eef6;
    border-radius: 12px;
    background: #fff;
}

.swap-activity-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .35rem;
}

@media (max-width: 520px) {
    .swap-from-to {
        grid-template-columns: 1fr;
        gap: .65rem;
    }

    .swap-exchange {
        justify-self: center;
        transform: rotate(90deg);
    }

    .swap-request-card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: .25rem;
    }
}

.swap-modal-card {
    width: min(720px, 100%);
    max-height: min(94vh, 920px);
    overflow: auto;
}

.swap-modal-intro {
    margin: 0 0 1rem;
    padding: .65rem .75rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: .84rem;
    line-height: 1.45;
}

.swap-modal-footnote {
    margin: .35rem 0 0;
    color: #64748b;
    font-size: .8rem;
    line-height: 1.4;
}

.swap-modal-form label {
    margin-top: .85rem;
}

.swap-modal-form label:first-of-type {
    margin-top: 0;
}

.fancy-dd {
    position: relative;
    margin-bottom: .35rem;
}

.fancy-dd-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    text-align: left;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    color: inherit;
    cursor: pointer;
    min-height: 3.5rem;
}

.fancy-dd.is-open .fancy-dd-toggle,
.fancy-dd-toggle:focus {
    outline: 2px solid rgba(37, 99, 235, .22);
    border-color: #2563eb;
}

.fancy-dd-value {
    display: flex;
    flex-direction: column;
    gap: .14rem;
    min-width: 0;
    flex: 1;
}

.fancy-dd-value strong {
    font-size: .98rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fancy-dd-value span {
    font-size: .82rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fancy-dd-placeholder {
    color: #94a3b8 !important;
    font-size: .98rem !important;
}

.fancy-dd-caret {
    width: .55rem;
    height: .55rem;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    margin-top: -.25rem;
    flex-shrink: 0;
    transition: transform .15s ease;
}

.fancy-dd.is-open .fancy-dd-caret {
    transform: rotate(225deg);
    margin-top: .2rem;
}

.fancy-dd-panel {
    position: static;
    margin-top: .55rem;
    z-index: 1;
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
    padding: .45rem;
}

.fancy-dd-panel[hidden] {
    display: none !important;
}

.fancy-dd-list {
    overflow: auto;
    max-height: min(340px, 42vh);
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding-right: .1rem;
}

.fancy-dd-option {
    display: flex;
    flex-direction: column;
    gap: .16rem;
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: .8rem .85rem;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.fancy-dd-option strong {
    font-size: .94rem;
    color: #0f172a;
}

.fancy-dd-option span {
    font-size: .8rem;
    color: #64748b;
    line-height: 1.35;
}

.fancy-dd-option:hover {
    border-color: #dbe3ef;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.fancy-dd-option.is-selected {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.fancy-dd-option.is-selected strong {
    color: #1d4ed8;
}


@media (max-width: 1100px) {
    .swap-board {
        grid-template-columns: 1fr;
    }

    .swap-how-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .swap-board-tools {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-end;
    }

    .swap-card-head-main {
        flex-direction: column;
        align-items: stretch;
    }
}



@media (max-width: 900px) {
    .ms-schedule-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ms-schedule-actions {
        margin-left: 0;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .ms-stepper,
    .ms-stepper--compact {
        flex-wrap: wrap;
        gap: .35rem;
    }
    .ms-stepper-label {
        font-size: .72rem;
    }
    .ms-stepper-line {
        min-width: 10px;
    }
}

.is-hidden { display: none !important; }
