:root {
    --bg: #f3f6ff;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-solid: #ffffff;
    --surface-muted: #f8faff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --line: #e5e7eb;
    --brand: #4f46e5;
    --brand-2: #7c3aed;
    --shadow: 0 18px 44px rgba(79, 70, 229, .12);
}

html, body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: radial-gradient(1200px 700px at -20% -20%, #dbeafe 0%, transparent 50%),
                radial-gradient(1200px 700px at 120% 0%, #ede9fe 0%, transparent 50%),
                var(--bg);
    color: var(--text);
}

a {
    color: var(--brand);
}

.invalid {
    color: #dc2626;
}

body > div:first-child {
    display: contents;
}

.page {
    min-height: 100vh;
}

.main {
    display: flex;
    flex-direction: column;
}

.top-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    margin: .75rem;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 14px;
    background: var(--surface);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.content {
    flex: 1;
}

.glass-card {
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 16px;
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.schedule-page {
    padding: .75rem;
}

.schedule-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: .9rem;
}

.hero-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hamburger-icon {
    width: 18px;
    height: 14px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background-color: currentColor;
    transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle.is-open .hamburger-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.is-open .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open .hamburger-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.loading-state {
    min-height: 260px;
    display: grid;
    place-items: center;
}

.admin-shell {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 1rem;
}

.admin-shell.sidebar-collapsed {
    grid-template-columns: 64px 1fr;
}

.admin-sidebar {
    padding: .6rem;
    height: fit-content;
    position: sticky;
    top: .75rem;
    display: flex;
    flex-direction: column;
}

.admin-shell.sidebar-collapsed .admin-sidebar {
    padding: .5rem;
}

.admin-shell.sidebar-collapsed .sidebar-body {
    display: none;
}

.sidebar-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .5rem;
}

.sidebar-body {
    display: block;
}

.sidebar-logo-wrap {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.sidebar-logo-image {
    max-width: 100%;
    height: auto;
    width: auto;
    max-height: 220px;
    object-fit: contain;
}

.sidebar-block + .sidebar-block {
    margin-top: 1rem;
}

.sidebar-block h6 {
    margin: 0 0 .5rem;
    color: color-mix(in oklab, var(--brand) 72%, var(--text));
    font-weight: 700;
    font-size: .88rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sidebar-link {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: .5rem .6rem;
    border-radius: 10px;
    color: var(--text);
}

.sidebar-link:hover,
.sidebar-link.active {
    background: color-mix(in oklab, var(--brand) 14%, var(--surface-solid));
    color: color-mix(in oklab, var(--brand) 72%, var(--text));
}

.sidebar-tools .sidebar-action {
    margin-top: .3rem;
    width: 100%;
}

.planner-content,
.user-shell {
    padding: .75rem;
}

.planner-toolbar,
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.schedule-view-select {
    min-width: 180px;
}

.planner-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface-solid);
    padding: .25rem 0 .75rem;
}

.planner-toolbar h2,
.user-header h2 {
    margin: 0;
}

.planner-subtitle {
    color: var(--text-muted);
    font-size: .9rem;
}

.toolbar-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.admin-toolbar-controls {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: .5rem;
}

.admin-quick-filter {
    margin-top: .5rem;
    max-width: 320px;
}

.admin-toolbar-controls .admin-quick-filter {
    margin-top: 0;
}

.admin-action-button,
.admin-row-action {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.admin-user-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.admin-inline-actions {
    display: inline-flex;
    gap: .35rem;
}

.admin-dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: grid;
    place-items: center;
    padding: 1rem;
    z-index: 1100;
}

.admin-dialog {
    width: min(100%, 520px);
    padding: 1rem;
}

.admin-dialog-header h3 {
    margin: 0 0 .5rem;
}

.admin-dialog-body {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.admin-dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.admin-dialog-grid label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    color: var(--text);
}

.admin-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: 1rem;
}

.admin-dialog-message {
    margin: 0;
}

.planner-board {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: visible;
    background: var(--surface-solid);
}

.planner-table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
}

.planner-table th,
.planner-table td {
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    padding: .5rem;
    vertical-align: top;
    color: var(--text);
}

.planner-table th {
    background: var(--surface-muted);
    font-weight: 700;
}

.planner-table thead th {
    position: sticky;
    top: 4.25rem;
    z-index: 15;
}

.planner-table th.is-today-col,
.planner-table td.is-today-col {
    background-color: color-mix(in oklab, var(--brand) 5%, var(--surface-solid));
    border-left: 1px solid color-mix(in oklab, var(--brand) 45%, white);
    border-right: 1px solid color-mix(in oklab, var(--brand) 45%, white);
}

.planner-table thead th.is-today-col {
    border-top: 1px solid color-mix(in oklab, var(--brand) 45%, white);
}

.planner-table tbody tr:last-child td.is-today-col {
    border-bottom: 1px solid color-mix(in oklab, var(--brand) 45%, white);
}

.user-cell {
    font-weight: 700;
    white-space: nowrap;
}

.empty-day {
    color: #9ca3af;
    text-align: center;
}

.free-day {
    display: inline-block;
    padding: .15rem .45rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: .75rem;
    font-weight: 700;
}

.planner-item {
    border-radius: 10px;
    padding: .4rem 0;
}

.planner-item-title {
    display: inline-block;
    padding: .22rem .5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .82rem;
    line-height: 1.2;
    margin-bottom: .3rem;
}

.planner-item-time {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: .25rem;
}

.planner-item-activity {
    font-size: .8rem;
    color: var(--text-muted);
}

.month-summary-item {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-top: .2rem;
    min-width: 0;
}

.month-summary-prefix {
    font-size: .74rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-summary-badge {
    display: inline-block;
    max-width: 100%;
    padding: .12rem .42rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-summary-count {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}

.dienst-assignment + .dienst-assignment {
    margin-top: .55rem;
    padding-top: .55rem;
    border-top: 1px dashed var(--line);
}

.dienst-assignment-user {
    font-size: .8rem;
    font-weight: 700;
}

.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-solid);
}

.weekday-header {
    background: var(--surface-muted);
    border-bottom: 1px solid var(--line);
    padding: .55rem;
    text-align: center;
    font-weight: 700;
    font-size: .85rem;
    color: var(--text);
}

.calendar-day {
    min-height: 128px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: .45rem;
    color: var(--text);
}

.calendar-day:nth-child(7n) {
    border-right: 0;
}

.calendar-day-number {
    font-weight: 700;
    margin-bottom: .35rem;
    color: var(--text);
}

.calendar-day.is-outside {
    background: color-mix(in oklab, var(--surface-solid) 92%, var(--text) 8%);
    color: var(--text-muted);
}

.calendar-day.is-outside .calendar-day-number {
    color: var(--text-muted);
}

.calendar-day.is-today {
    box-shadow: inset 0 0 0 2px var(--brand);
}

.day-service {
    display: inline-block;
    padding: .2rem .45rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: .2rem;
}

.day-activity {
    margin-top: .25rem;
    padding: .2rem .35rem;
    border-radius: 6px;
    background: color-mix(in oklab, var(--brand) 10%, var(--surface-solid));
    color: var(--text);
    font-size: .75rem;
    line-height: 1.2;
}

.day-more {
    margin-top: .25rem;
    font-size: .72rem;
    color: var(--text-muted);
}

.user-day-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-day-list .holiday-card {
    border: 1px solid var(--line);
    background: var(--surface-solid);
}

.user-day-schedule-item {
    padding: 0;
}

.user-day-list .holiday-card-user {
    display: inline-block;
    padding: .22rem .5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .9rem;
    color: var(--text);
    background: color-mix(in oklab, var(--brand) 12%, var(--surface-solid));
}

.user-day-list .holiday-card-range {
    margin-top: .5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.user-day-list .holiday-card-notes {
    margin-top: .4rem;
    color: var(--text-muted);
}

@media (max-width: 1100px) {
    .planner-board {
        overflow-x: auto;
        overflow-y: visible;
    }

    .planner-table {
        min-width: 0;
    }

    .planner-table thead,
    .planner-table tbody,
    .planner-table tr,
    .planner-table th,
    .planner-table td {
        display: block;
    }

    .planner-table thead {
        display: none;
    }

    .planner-table tr {
        border-bottom: 1px solid var(--line);
    }

    .planner-table td {
        border-right: 0;
    }

    .planner-table td.is-today-col {
        border-left: 0;
    }

    .planner-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: .35rem;
        font-size: .75rem;
        font-weight: 700;
        color: var(--text-muted);
    }

    .month-calendar {
        grid-template-columns: 1fr;
    }

    .weekday-header {
        display: none;
    }

    .calendar-day {
        min-height: 0;
        border-right: 0;
    }
}

@media (max-width: 1100px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-shell.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .admin-shell.sidebar-collapsed .admin-sidebar {
        width: fit-content;
    }

    .nav-toggle {
        display: inline-flex;
    }
}

@media (max-width: 900px) {
    .month-calendar {
        grid-template-columns: 1fr;
    }

    .weekday-header {
        display: none;
    }

    .calendar-day {
        min-height: 0;
        border-right: 0;
    }
}

@media (max-width: 768px) {
    .top-row {
        flex-wrap: wrap;
        margin: .5rem;
    }

    .schedule-page {
        padding: .5rem;
    }

    .planner-toolbar,
    .user-header,
    .schedule-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-actions,
    .hero-actions {
        width: 100%;
    }

    .admin-quick-filter {
        max-width: none;
    }

    .toolbar-actions .btn,
    .hero-actions .btn {
        flex: 1 1 auto;
    }

    .hero-actions .nav-toggle {
        flex: 0 0 auto;
        width: 42px;
    }
}


.holiday-overview-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.holiday-overview-header {
    margin-bottom: 0;
}

.holiday-filter-bar {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(120px, 140px) minmax(220px, 1fr) auto;
    gap: .75rem;
    align-items: end;
}

.holiday-filter-group {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.holiday-filter-group label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text, #374151);
}

.holiday-filter-actions {
    display: flex;
    justify-content: flex-start;
}

.holiday-day-group {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.holiday-day-heading {
    font-weight: 700;
    color: var(--brand, #1d4ed8);
    padding: .55rem .75rem;
    border: 1px solid var(--line, #dbeafe);
    border-radius: 10px;
    background: var(--surface-muted, #f8fafc);
}

.holiday-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 12px;
    background: var(--surface-solid, #fff);
}

.holiday-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.holiday-col-user {
    width: 18%;
}

.holiday-col-from,
.holiday-col-to {
    width: 19%;
}

.holiday-col-days {
    width: 10%;
}

.holiday-col-notes {
    width: 34%;
}

.holiday-table th,
.holiday-table td {
    padding: .8rem .9rem;
    border-bottom: 1px solid var(--line, #e5e7eb);
    text-align: left;
    vertical-align: top;
}

.holiday-table th {
    background: var(--surface-muted, #f8fafc);
    color: var(--text, #111827);
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap;
}

.holiday-table td {
    color: var(--text, #374151);
    font-size: .92rem;
    overflow-wrap: anywhere;
}

.holiday-table tbody tr:last-child td {
    border-bottom: 0;
}

.holiday-table td:first-child {
    font-weight: 700;
    white-space: nowrap;
}

.holiday-mobile-list {
    display: none;
    gap: .75rem;
}

.holiday-card {
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 12px;
    padding: .9rem 1rem;
    background: var(--surface-solid, #fff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.holiday-card-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem 1rem;
}

.holiday-card-user {
    font-weight: 700;
    color: var(--text, #111827);
    font-size: 1rem;
}

.holiday-card-range {
    color: var(--text-muted, #4b5563);
    font-size: .92rem;
}

.holiday-card-meta {
    margin-top: .55rem;
}

.holiday-days-badge {
    display: inline-block;
    padding: .24rem .6rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 700;
}

.holiday-card-notes {
    margin-top: .6rem;
    color: var(--text, #374151);
    font-size: .92rem;
    white-space: pre-wrap;
}

@media (max-width: 900px) {
    .holiday-filter-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .holiday-filter-bar {
        grid-template-columns: 1fr;
    }

    .holiday-filter-actions .btn {
        width: 100%;
    }

    .holiday-table-wrap {
        display: none;
    }

    .holiday-mobile-list {
        display: grid;
    }

    .holiday-card-main {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-color-scheme: dark) {
    .schedule-page.theme-auto,
    .schedule-page.theme-dark {
        --bg: #0b1220;
        --surface: rgba(17, 25, 40, 0.72);
        --surface-solid: #101a2e;
        --surface-muted: #17233c;
        --text: #e5e7eb;
        --text-muted: #9ca3af;
        --line: #24314b;
        --shadow: 0 24px 48px rgba(0, 0, 0, .45);
    }

    .schedule-page.theme-auto .planner-table th.is-today-col,
    .schedule-page.theme-auto .planner-table td.is-today-col,
    .schedule-page.theme-dark .planner-table th.is-today-col,
    .schedule-page.theme-dark .planner-table td.is-today-col {
        background-color: color-mix(in oklab, #60a5fa 12%, var(--surface-solid));
        border-left-color: color-mix(in oklab, #93c5fd 55%, #0f172a);
        border-right-color: color-mix(in oklab, #93c5fd 55%, #0f172a);
    }

    .schedule-page.theme-auto .planner-table thead th.is-today-col,
    .schedule-page.theme-dark .planner-table thead th.is-today-col {
        border-top-color: color-mix(in oklab, #93c5fd 55%, #0f172a);
    }

    .schedule-page.theme-auto .planner-table tbody tr:last-child td.is-today-col,
    .schedule-page.theme-dark .planner-table tbody tr:last-child td.is-today-col {
        border-bottom-color: color-mix(in oklab, #93c5fd 55%, #0f172a);
    }
}

.schedule-page.theme-dark {
    --bg: #0b1220;
    --surface: rgba(17, 25, 40, 0.72);
    --surface-solid: #101a2e;
    --surface-muted: #17233c;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --line: #24314b;
    --shadow: 0 24px 48px rgba(0, 0, 0, .45);
}

.schedule-page.theme-light {
    --bg: #f3f6ff;
}

.print-only {
    display: none;
}

.print-schedule-list {
    display: none;
}

@page {
    size: A4 portrait;
    margin: 10mm;
}

@media print {
    html,
    body {
        background: #fff !important;
        color: #000 !important;
    }

    body {
        margin: 0;
    }

    .top-row,
    .admin-sidebar,
    .admin-dialog-backdrop,
    .print-hidden {
        display: none !important;
    }

    .page,
    .main,
    .content,
    .schedule-page,
    .admin-shell,
    .planner-content,
    .print-schedule-scope {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: auto !important;
        height: auto !important;
        background: #fff !important;
        box-shadow: none !important;
        border: 0 !important;
        backdrop-filter: none !important;
    }

    .glass-card,
    .holiday-card,
    .user-day-list .holiday-card {
        background: #fff !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }

    .print-only {
        display: block !important;
    }

    .print-header {
        margin: 0 0 6mm !important;
        padding: 0 !important;
        break-after: avoid;
        page-break-after: avoid;
    }

    .print-header h2 {
        margin: 0 0 2mm;
        font-size: 16pt;
    }

    .planner-subtitle {
        color: #444 !important;
    }

    .print-schedule-list {
        display: grid !important;
        gap: 4mm;
    }

    .admin-print-list {
        display: grid !important;
        gap: 5mm;
    }

    .print-schedule-card {
        border: 1px solid #d1d5db;
        border-radius: 10px;
        padding: 3mm;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .print-schedule-date {
        margin-bottom: 2mm;
        font-size: 10pt;
        font-weight: 700;
        color: #111;
    }

    .print-schedule-main {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 4mm;
        flex-wrap: wrap;
    }

    .print-schedule-time,
    .print-schedule-activity,
    .print-schedule-notes,
    .holiday-card-range,
    .holiday-card-notes {
        color: #374151 !important;
    }

    .print-schedule-time {
        font-size: 9pt;
        font-weight: 600;
    }

    .print-schedule-activity,
    .print-schedule-notes {
        margin-top: 1.5mm;
        font-size: 9pt;
    }

    .admin-print-card {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .admin-print-entry + .admin-print-entry {
        margin-top: 3mm;
        padding-top: 3mm;
        border-top: 1px dashed #d1d5db;
    }

    .admin-print-entry-date {
        margin-bottom: 1.5mm;
        font-size: 9pt;
        font-weight: 700;
        color: #111;
    }

    .admin-dienst-print-layout {
        color: #111 !important;
    }

    .admin-dienst-print-title {
        margin-bottom: 3mm;
        font-size: 16pt;
        font-weight: 700;
        text-align: center;
    }

    .admin-dienst-print-meta {
        margin-bottom: 1.5mm;
        font-size: 10pt;
    }

    .admin-dienst-print-table {
        width: 100%;
        margin-top: 4mm;
        border-collapse: collapse;
        font-size: 9pt;
        color: #111 !important;
    }

    .admin-dienst-print-table th,
    .admin-dienst-print-table td {
        padding: 1.5mm 2mm;
        vertical-align: top;
        text-align: left;
    }

    .admin-dienst-print-table thead th {
        border-bottom: 1px solid #9ca3af;
        font-weight: 700;
    }

    .admin-dienst-print-table tbody tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .admin-dienst-print-table tbody td:nth-child(1),
    .admin-dienst-print-table tbody td:nth-child(2) {
        font-weight: 700;
    }

    .day-service,
    .planner-item-title,
    .free-day {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .user-day-list {
        gap: 4mm;
    }

    .holiday-card {
        border: 1px solid #d1d5db !important;
        page-break-inside: avoid;
    }

    .holiday-card-main {
        align-items: center;
    }
}

@media (max-width: 768px) {
    .admin-user-cell {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-inline-actions,
    .admin-dialog-grid,
    .admin-dialog-actions {
        width: 100%;
    }

    .admin-dialog-grid {
        grid-template-columns: 1fr;
    }

    .admin-dialog-actions .btn {
        flex: 1 1 auto;
    }
}

/* ── Swap Wizard ─────────────────────────────────────────── */

.swap-wizard-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.swap-wizard-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.swap-back-btn {
    text-decoration: none;
    font-size: 0.95rem;
    padding-left: 0;
}

.swap-wizard-steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.swap-step-indicator {
    font-size: 0.9rem;
    color: #999;
    font-weight: 500;
}

.swap-step-indicator.active {
    color: #0d6efd;
    font-weight: 700;
}

.swap-step-indicator.done {
    color: #198754;
}

.swap-step-separator {
    color: #bbb;
    font-size: 1rem;
}

.swap-step {
    padding: 1.25rem 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.swap-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.swap-view-select {
    max-width: 200px;
}

.swap-nav-buttons {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.swap-period-label {
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
}

/* Selectable & selected cells */
.swap-selectable {
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.swap-selectable:hover {
    background: rgba(13, 110, 253, 0.07) !important;
    box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.35);
}

.swap-selected {
    background: rgba(13, 110, 253, 0.12) !important;
    box-shadow: inset 0 0 0 2px #0d6efd !important;
}

/* Colleague chips inside calendar cells */
.swap-colleague-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.swap-colleague-chip {
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
    font-size: 0.72rem;
    line-height: 1.3;
    border: 1px solid transparent;
}

.swap-chip-name {
    font-weight: 600;
    display: block;
}

/* Card grid for day view */
.swap-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.swap-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.swap-card.swap-selectable:hover {
    border-color: #0d6efd;
}

.swap-card.swap-selected {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.07) !important;
}

.swap-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.swap-card-pick-btn {
    min-width: 70px;
}

.swap-card-employee {
    color: #666;
}

/* Day view single panel */
.swap-day-view {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    min-height: 80px;
}

/* Colleagues table */
.swap-colleagues-table td {
    vertical-align: top;
    min-width: 110px;
}

/* Per-Dienst week/day table */
.swap-perdienst-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.swap-perdienst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 700px;
}

.swap-perdienst-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 0.45rem 0.6rem;
    text-align: left;
    white-space: nowrap;
}

.swap-perdienst-table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.swap-perdienst-table tbody tr:last-child {
    border-bottom: none;
}

.swap-perdienst-dienst-col {
    width: 120px;
    min-width: 100px;
    padding: 0.5rem 0.6rem;
    vertical-align: top;
    border-right: 1px solid #dee2e6;
}

.swap-perdienst-cell {
    vertical-align: top;
    padding: 0.35rem 0.5rem;
    min-width: 120px;
    border-right: 1px solid #f0f0f0;
}

.swap-perdienst-cell:last-child {
    border-right: none;
}

.swap-perdienst-entry {
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    margin-bottom: 0.3rem;
    line-height: 1.35;
}

.swap-perdienst-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.swap-perdienst-entry .planner-item-time {
    font-size: 0.78rem;
    color: #555;
}

.swap-perdienst-entry .planner-item-activity {
    font-size: 0.75rem;
    color: #777;
    font-style: italic;
}

/* Selection hint strip */
.swap-selection-hint {
    background: rgba(25, 135, 84, 0.1);
    border: 1px solid #198754;
    border-radius: 6px;
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
}

/* Summary step */
.swap-summary {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.swap-summary-block {
    flex: 1 1 220px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.swap-summary-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.swap-summary-value {
    font-weight: 600;
}

.swap-summary-arrow {
    align-self: center;
    font-size: 2rem;
    color: #0d6efd;
}

.swap-info-text {
    font-size: 0.9rem;
    color: #555;
}

.swap-empty {
    color: #999;
    padding: 1rem;
    text-align: center;
}

/* Footer with prev/next buttons */
.swap-wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
    margin-top: 0.5rem;
}

@media (max-width: 576px) {
    .swap-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .swap-view-select {
        max-width: 100%;
    }

    .swap-nav-buttons {
        margin-left: 0;
        justify-content: flex-end;
    }

    .swap-summary {
        flex-direction: column;
    }

    .swap-summary-arrow {
        align-self: center;
        transform: rotate(90deg);
    }

    .swap-card-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Shift Swap Requests page ────────────────────────────── */

.swap-requests-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.swap-requests-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.swap-requests-header h3 {
    margin: 0;
}

.swap-requests-empty {
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.swap-requests-section {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.swap-section-title {
    margin: 0 0 0.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #444;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.4rem;
}

.swap-request-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    flex-wrap: wrap;
}

.swap-request-card.swap-status-pending {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.06);
}

.swap-request-card.swap-status-waiting {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}

.swap-request-card.swap-status-approved {
    border-color: #198754;
    background: rgba(25, 135, 84, 0.05);
}

.swap-request-card.swap-status-rejected {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.04);
    opacity: 0.8;
}

.swap-request-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1 1 auto;
    min-width: 0;
}

.swap-request-parties {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.swap-request-name {
    font-weight: 600;
}

.swap-request-you {
    color: #0d6efd;
}

.swap-request-arrow {
    color: #999;
    font-size: 1.1rem;
}

.swap-request-shifts {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

.swap-request-shift {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.swap-request-dienst {
    color: #555;
    font-size: 0.8rem;
}

.swap-request-arrow-small {
    color: #aaa;
}

.swap-request-meta {
    font-size: 0.78rem;
    color: #888;
}

.swap-request-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.swap-status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
}

.swap-status-badge.swap-status-pending {
    background: #fff3cd;
    color: #856404;
}

.swap-status-badge.swap-status-waiting {
    background: #cfe2ff;
    color: #084298;
}

.swap-status-badge.swap-status-approved {
    background: #d1e7dd;
    color: #0a3622;
}

.swap-status-badge.swap-status-rejected {
    background: #f8d7da;
    color: #842029;
}

@media (max-width: 576px) {
    .swap-request-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .swap-request-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
