:root {
    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --color-bg: #f3f4f6;
    --color-surface: #fff;
    --color-surface-muted: #f9fafb;
    --color-border: #e5e7eb;
    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-text-subtle: #9ca3af;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-accent: #f97316;
    --color-danger: #dc2626;
    --color-success-bg: #dcfce7;
    --color-error-bg: #fee2e2;
    --color-info-bg: #dbeafe;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --page-padding-x: 1.5rem;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-width: 0;
    overflow-x: clip;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html {
    overflow-x: clip;
}

a {
    color: var(--color-primary);
}

a:hover {
    color: var(--color-primary-hover);
}

/* ——— Navbar ——— */

@font-face {
    font-family: "Bitcount Single Cursive";
    src: url("/static/oncall/fonts/BitcountSingle_Cursive-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem var(--page-padding-x);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.navbar .brand,
.nav-drawer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--color-text);
    text-decoration: none;
    flex-shrink: 0;
}

.brand-text {
    font-family: "Bitcount Single Cursive", var(--font);
    font-weight: 400;
    font-size: 1.55rem;
    line-height: 1;
    letter-spacing: 0.02em;
}

.brand-icon {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
}

.nav-user-name--mobile,
.nav-burger,
.nav-backdrop,
.nav-drawer-brand {
    display: none;
}

.nav-menu {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    min-width: 0;
}

.nav-burger {
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}

.nav-burger-lines,
.nav-burger-lines::before,
.nav-burger-lines::after {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    position: relative;
}

.nav-burger-lines::before,
.nav-burger-lines::after {
    content: "";
    position: absolute;
    left: 0;
}

.nav-burger-lines::before {
    top: -6px;
}

.nav-burger-lines::after {
    top: 6px;
}

.navbar.is-open .nav-burger-lines {
    background: transparent;
}

.navbar.is-open .nav-burger-lines::before {
    top: 0;
    transform: rotate(45deg);
}

.navbar.is-open .nav-burger-lines::after {
    top: 0;
    transform: rotate(-45deg);
}

.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-width: 0;
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
}

.nav-link.is-active {
    background: #eff6ff;
    color: var(--color-primary);
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--color-border);
}

.nav-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.nav-logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.nav-logout-form button {
    padding: 0.4rem 0.75rem;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.nav-logout-form button:hover {
    background: var(--color-surface-muted);
}

/* ——— Layout ——— */

.site-footer {
    margin-top: auto;
    padding: 0.85rem var(--page-padding-x);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.01em;
}

.container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 1.5rem var(--page-padding-x);
    overflow-x: clip;
    flex: 1;
}

@media (min-width: 1400px) {
    :root {
        --page-padding-x: 2rem;
    }
}

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

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-grid {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
    max-width: 100%;
}

.page-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.dashboard-split {
    display: grid;
    grid-template-columns: 3fr 3fr;
    gap: 1.25rem;
    grid-column: 1 / -1;
    min-width: 0;
    max-width: 100%;
}

.dashboard-aside {
    display: grid;
    grid-template-columns: 3fr 3fr;
    gap: 0.75rem;
    min-width: 0;
    max-width: 100%;
}

.dashboard-stats--compact {
    padding: 1rem;
}

.dashboard-stats--compact h2 {
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

.dashboard-stats-month {
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.stats-card--compact {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem 0.5rem;
    padding: 0.45rem 0.55rem;
    text-align: left;
}

.stats-card-metric {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.stats-card--compact strong {
    font-size: 1.25rem;
    line-height: 1;
}

.stats-card--compact span {
    margin-top: 0;
    font-size: 0.65rem;
    line-height: 1.25;
    text-transform: lowercase;
    color: var(--color-text-muted);
}

.dashboard-team {
    min-width: 0;
    padding: 0.75rem;
}

.dashboard-team h2 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.team-roster-groups {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.team-roster-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.2rem;
}

.team-roster-team-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--team-color, var(--color-text));
    line-height: 1.2;
}

.duty-badge--sm {
    min-width: 1.5rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.62rem;
    border-radius: 4px;
}

.team-roster {
    list-style: none;
    margin: 0;
    padding: 0;
}

.team-roster-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.15rem 0;
    font-size: 0.78rem;
    line-height: 1.25;
}

.team-roster-item + .team-roster-item {
    border-top: 1px solid var(--color-border);
}

.team-roster-item.is-me .team-roster-name {
    font-weight: 700;
    color: #1d4ed8;
}

.badge-lead {
    flex-shrink: 0;
    background: #dcfce7;
    color: #166534;
    font-size: 0.6rem;
    padding: 0.05rem 0.3rem;
    line-height: 1.3;
}

.dashboard-incoming {
    grid-column: 1 / -1;
}

.dashboard-outgoing .swap-list {
    margin: 0;
}

.dashboard-outgoing .swap-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}

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

.stats-cards.stats-cards--vertical {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    gap: 0.4rem;
}

.stats-card {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    text-align: center;
}

.stats-card strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
}

.stats-card span {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: lowercase;
}

.dashboard-stats .stats-card.stats-card--compact .stats-card-metric > strong {
    color: var(--color-text, #111827);
}

.dashboard-stats .stats-card.stats-card--compact .stats-card-metric--workdays > strong {
    color: #7c7c7c;
}

.dashboard-stats .stats-card.stats-card--compact .stats-card-metric--off-days > strong {
    color: #dc2626;
}

.data-table tbody tr.is-mine {
    background: #eff6ff;
}

.data-table tbody tr.is-mine:hover {
    background: #dbeafe;
}

.badge-mine {
    background: #dbeafe;
    color: #1d4ed8;
}

@media (max-width: 768px) {
    :root {
        --page-padding-x: 1rem;
    }

    body.nav-open {
        overflow: hidden;
    }

    .navbar {
        gap: 0.65rem;
        align-items: center;
    }

    .navbar .brand {
        display: none;
    }

    .nav-drawer-brand {
        display: inline-flex;
        align-items: center;
        align-self: center;
        margin-bottom: 0;
        padding: 0;
        min-height: 42px;
    }

    .nav-user-name--mobile {
        display: flex;
        align-items: center;
        align-self: center;
        flex: 0 1 auto;
        min-width: 0;
        max-width: 42vw;
        min-height: 42px;
        margin-left: auto;
        margin-right: 0.35rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.875rem;
        font-weight: 600;
        line-height: 1;
        color: var(--color-text);
    }

    .nav-burger {
        display: inline-flex;
        align-self: center;
        width: 42px;
        height: 42px;
    }

    .nav-backdrop {
        display: block;
    }

    .navbar.is-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 950;
        flex: none;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: min(18rem, 86vw);
        margin: 0;
        padding: 1rem 0.85rem 1.25rem;
        background: var(--color-surface);
        border-left: 1px solid var(--color-border);
        box-shadow: -4px 0 24px rgba(15, 23, 42, 0.12);
        transform: translateX(100%);
        transition: transform 0.22s ease;
        overflow-y: auto;
    }

    .navbar.is-open .nav-menu {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
    }

    .nav-link {
        padding: 0.65rem 0.75rem;
    }

    .nav-user {
        margin-left: 0;
        margin-top: auto;
        padding-top: 1rem;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--color-border);
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .nav-user .nav-user-name {
        display: none;
    }

    .nav-logout-form button {
        width: 100%;
    }
}

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

    .dashboard-split {
        grid-template-columns: 1fr;
    }

    .dashboard-aside {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 640px) {
    .container:has(.dashboard-page) {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .dashboard-page {
        gap: 0.85rem;
    }

    .dashboard-page .page-header {
        margin-bottom: 0.75rem;
    }

    .dashboard-page .page-header h1 {
        font-size: 1.25rem;
    }

    .dashboard-page .card {
        padding: 0.85rem 0.9rem;
    }

    .dashboard-page .card h2 {
        font-size: 0.95rem;
        margin-bottom: 0.65rem;
    }

    .dashboard-page .duty-item {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 0.35rem 0.65rem;
        padding: 0.65rem 0.75rem;
    }

    .dashboard-page .duty-time {
        grid-column: 1 / -1;
        white-space: normal;
        font-size: 0.78rem;
        padding-top: 0.15rem;
        border-top: 1px solid var(--color-border);
    }

    .dashboard-page .team-cell {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .dashboard-page .team-cell .team-name {
        font-size: 0.82rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .dashboard-page .table-wrap {
        border-radius: var(--radius-sm);
    }

    .dashboard-page .data-table:not(.team-shifts-table) {
        font-size: 0.82rem;
        min-width: 520px;
    }

    .dashboard-page .data-table th {
        padding: 0.5rem 0.6rem;
        font-size: 0.68rem;
    }

    .dashboard-page .data-table td {
        padding: 0.55rem 0.6rem;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .dashboard-page .table-actions {
        flex-direction: column;
        align-items: stretch;
        min-width: 6.5rem;
    }

    .dashboard-page .table-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .dashboard-page .dashboard-stats--compact {
        padding: 0.75rem 0.85rem;
    }

    .dashboard-page .dashboard-stats--compact h2 {
        font-size: 0.9rem;
        line-height: 1.35;
    }

    .dashboard-page .stats-card--compact {
        gap: 0.25rem 0.35rem;
        padding: 0.4rem 0.45rem;
    }

    .dashboard-page .stats-card--compact strong {
        font-size: 1.1rem;
    }

    .dashboard-page .stats-card--compact span {
        font-size: 0.58rem;
        line-height: 1.2;
        hyphens: auto;
    }

    .dashboard-page .dashboard-outgoing .swap-item {
        gap: 0.5rem;
    }

    .dashboard-page .dashboard-outgoing .swap-item .btn {
        align-self: stretch;
        justify-content: center;
    }

    .dashboard-page .dashboard-team {
        padding: 0.65rem 0.75rem;
    }

    .dashboard-page .team-shifts-desktop,
    .dashboard-page .upcoming-shifts-desktop {
        display: none;
    }

    .dashboard-page .team-shifts-mobile,
    .dashboard-page .upcoming-shifts-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .dashboard-page .team-shifts-day-card {
        padding: 0.55rem 0.65rem 0.45rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-sm);
        background: var(--color-surface);
    }

    .dashboard-page .team-shifts-day-card.is-weekend {
        background: #fff7ed;
    }

    .dashboard-page .team-shifts-day-title {
        margin: 0 0 0.4rem;
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--color-text);
    }

    .dashboard-page .team-shifts-day-items {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    .dashboard-page .team-shift-item {
        padding: 0.1rem 0;
    }

    .dashboard-page .team-shift-item--plain {
        padding-right: 0;
    }

    .dashboard-page .team-shift-item-main {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        min-width: 0;
    }

    .dashboard-page .team-shift-item.is-mine .team-shift-chip {
        box-shadow: inset 0 0 0 1px #93c5fd;
    }

    .dashboard-page .team-shift-take,
    .dashboard-page .team-shift-badge {
        flex-shrink: 0;
    }

    .dashboard-page .team-shift-take {
        padding: 0.18rem 0.45rem;
        font-size: 0.68rem;
        line-height: 1.2;
        border-radius: 6px;
    }

    .dashboard-page .team-shift-badge {
        padding: 0.12rem 0.4rem;
        font-size: 0.62rem;
        line-height: 1.2;
    }

    .dashboard-page .team-shift-chip {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        flex: 1;
        min-width: 0;
        padding: 0.28rem 0.45rem;
        border-radius: 7px;
        background: #f3f4f6;
        border-left: 4px solid var(--team-color, var(--color-primary));
    }

    .dashboard-page .team-shift-chip-dept {
        min-width: 1.65rem;
        padding: 0.1rem 0.35rem;
        border-radius: 5px;
        color: #fff;
        font-size: 0.62rem;
        font-weight: 800;
        text-align: center;
        flex-shrink: 0;
    }

    .dashboard-page .team-shift-chip-person {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.78rem;
        font-weight: 700;
        color: var(--color-text);
    }

    .dashboard-page .team-shift-range {
        margin-top: 0.15rem;
        padding-left: 0.45rem;
        font-size: 0.68rem;
        font-weight: 600;
        color: var(--color-text-muted);
        line-height: 1.25;
    }
}

/* ——— Cards ——— */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.125rem 1.25rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    max-width: 100%;
}

.card h2,
.card h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
}

.card > p:last-child,
.card > ul:last-child {
    margin-bottom: 0;
}

.card-empty {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.925rem;
}

.auth-card {
    max-width: 420px;
    margin: 3rem auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.auth-card h1 {
    margin: 0 0 1.5rem;
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
}

/* ——— Buttons ——— */

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

button:hover,
.btn:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.825rem;
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-danger {
    background: var(--color-surface);
    color: var(--color-danger);
    border-color: #fecaca;
}

.btn-danger:hover {
    background: #fef2f2;
    color: var(--color-danger);
    border-color: #fecaca;
}

.btn-success {
    background: #16a34a;
    border-color: #16a34a;
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

.link-muted {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
}

.link-muted:hover {
    color: var(--color-text);
}

/* ——— Forms ——— */

label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    margin-top: 0.35rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 400;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

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

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.form-meta {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    font-size: 0.925rem;
}

.form-meta strong {
    color: var(--color-text-muted);
    font-weight: 600;
}

/* ——— Tables ——— */

.table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    padding: 0.65rem 0.85rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
    border-bottom: 1px solid var(--color-border);
}

.data-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--color-surface-muted);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* legacy table selector */
table:not(.data-table) {
    width: 100%;
    border-collapse: collapse;
}

table:not(.data-table) th,
table:not(.data-table) td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

/* ——— Lists & duty rows ——— */

.duty-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.duty-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    border-left: 4px solid var(--team-color, var(--color-primary));
}

.duty-item.is-override {
    background: #fff7ed;
}

.duty-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: var(--team-color, var(--color-primary));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.team-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.team-cell .team-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.team-shifts-mobile,
.upcoming-shifts-mobile {
    display: none;
}

.duty-info {
    min-width: 0;
}

.duty-info strong {
    display: block;
    font-size: 0.925rem;
}

.duty-info span {
    font-size: 0.825rem;
    color: var(--color-text-muted);
}

.duty-time {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
    min-width: 0;
}

.swap-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.swap-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    font-size: 0.9rem;
}

.swap-item-text {
    flex: 1;
    min-width: 0;
}

.swap-item-text strong {
    color: var(--color-text);
}

.swap-item-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.825rem;
    color: var(--color-text-muted);
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-override {
    background: #ffedd5;
    color: #c2410c;
}

.badge-pending {
    background: #dbeafe;
    color: #1d4ed8;
}

/* ——— Messages ——— */

.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.message.success {
    background: var(--color-success-bg);
    border-color: #bbf7d0;
    color: #166534;
}

.message.error {
    background: var(--color-error-bg);
    border-color: #fecaca;
    color: #991b1b;
}

.message.info,
.message.warning {
    background: var(--color-info-bg);
    border-color: #bfdbfe;
    color: #1e40af;
}

.error {
    color: var(--color-danger);
    font-size: 0.875rem;
}

/* ——— Filters / toolbar (shared with calendar) ——— */

.filters {
    margin-bottom: 1.25rem;
}

.filters.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.filters.calendar-toolbar label {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.875rem;
}

.filters.calendar-toolbar select {
    width: auto;
    min-width: 180px;
    margin-top: 0;
}

.calendar-toolbar .toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-toolbar button {
    padding: 0.45rem 0.85rem;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.calendar-toolbar button:hover {
    background: var(--color-surface-muted);
}

.calendar-toolbar button.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.calendar-toolbar button.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.calendar-toolbar .toolbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 8px;
    min-width: 140px;
}

.hint {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.hint pre {
    background: var(--color-surface-muted);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    overflow-x: auto;
}
