* {
    box-sizing: border-box;
}

:root {
    --brand-800: #195541;
    --brand-700: #226b52;
    --brand-200: #c7ddd3;
    --brand-100: #e5f0ea;
    --brand-50: #f1f7f4;
    --brand-rgb: 34, 107, 82;

    --page-background: #f4f6f3;
    --primary-text: #24302b;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--page-background);
    color: var(--primary-text);
}
/* Application shell */

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

.app-shell.sidebar-is-collapsed {
    grid-template-columns: 72px minmax(0, 1fr);
}

.app-main {
    min-width: 0;
}

.app-content {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 36px;
}

/* Standalone pages */

.page {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 36px;
}

/* Sidebar */

.sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 18px 12px;
    overflow: visible;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    color: #1f2937;
}

.sidebar__header {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: start;
    gap: 8px;
    min-height: 94px;
    margin-bottom: 24px;
}

.sidebar__brand {
    display: flex;
    grid-column: 2;
    flex-direction: column;
    align-items: center;
    justify-self: center;
    gap: 4px;
    min-width: 0;
    padding-left: 0;
    color: var(--brand-700);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.sidebar__brand-mark {
    display: block;
    width: auto;
    height: auto;
    background: transparent;
    color: var(--brand-700);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 72px;
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: -0.06em;
}

.mobile-header__brand-mark {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-700);
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
}

.sidebar__brand-name {
    overflow: hidden;
    color: var(--brand-700);
    font-size: 20px;
    line-height: 1;
    text-overflow: ellipsis;
}

.sidebar__collapse-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    margin-top: 2px;
    grid-column: 3;
    justify-self: end;
}

.sidebar__collapse-button:hover {
    background: #f3f4f6;
    color: #111827;
}

.sidebar__collapse-button:focus-visible,
.sidebar__link:focus-visible,
.sidebar__account-link:focus-visible,
.mobile-header__brand:focus-visible,
.mobile-header__menu-button:focus-visible {
    outline: 3px solid rgba(var(--brand-rgb), 0.25);
    outline-offset: 2px;
}

.sidebar__icon {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
}

.sidebar__navigation {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
}

.sidebar__group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar__group-label {
    display: block;
    margin: 0 10px 6px;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 42px;
    padding: 10px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #4b5563;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.sidebar__link-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__link:hover {
    background: #f3f4f6;
    color: #111827;
}

.sidebar__link.is-active,
.sidebar__link[aria-current="page"] {
    background: var(--brand-100);
    color: var(--brand-700);
}



.sidebar__footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.sidebar__account {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px 10px;
}

.sidebar__avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.sidebar__account-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sidebar__username {
    overflow: hidden;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar__account-link {
    color: #6b7280;
    font-size: 12px;
    text-decoration: none;
}

.sidebar__account-link:hover {
    color: var(--brand-700);
    text-decoration: underline;
}

.sidebar__logout {
    width: 100%;
    margin: 0;
}

.sidebar__logout-button {
    width: 100%;
}

/* Collapsed desktop sidebar */

@media (min-width: 1025px) {
    .sidebar-is-collapsed .sidebar {
        padding-right: 10px;
        padding-left: 10px;
    }

    .app-shell:not(.sidebar-is-collapsed) .sidebar__navigation {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .sidebar__footer {
        flex: 0 0 auto;
    }

    .sidebar-is-collapsed .sidebar__header {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 9px;
        margin-bottom: 18px;
    }

    .sidebar-is-collapsed .sidebar__brand-mark {
    font-size: 40px;
    line-height: 1;
    letter-spacing: -0.06em;
    }

    .sidebar-is-collapsed .sidebar__brand {
        padding-left: 0;
    }

    .sidebar-is-collapsed .sidebar__brand-name,
    .sidebar-is-collapsed .sidebar__group-label,
    .sidebar-is-collapsed .sidebar__link-label,
    .sidebar-is-collapsed .sidebar__account-details {
        display: none;
    }

    .sidebar-is-collapsed .sidebar__collapse-button {
        transform: rotate(180deg);
    }

    .sidebar-is-collapsed .sidebar__navigation {
        align-items: center;
    }

    .sidebar-is-collapsed .sidebar__group {
        align-items: center;
        width: 100%;
    }

    .sidebar-is-collapsed .sidebar__link {
        justify-content: center;
        width: 44px;
        padding-right: 0;
        padding-left: 0;
    }

    .sidebar-is-collapsed .sidebar__footer {
        align-items: center;
    }

    .sidebar-is-collapsed .sidebar__account {
        justify-content: center;
        padding-right: 0;
        padding-left: 0;
    }

    .sidebar-is-collapsed
        .sidebar__link[data-sidebar-tooltip]::after {
        position: absolute;
        top: 50%;
        left: calc(100% + 12px);
        z-index: 50;
        padding: 7px 9px;
        border-radius: 6px;
        background: #111827;
        color: #ffffff;
        content: attr(data-sidebar-tooltip);
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-50%);
        transition: opacity 120ms ease;
    }

    .sidebar-is-collapsed
        .sidebar__link[data-sidebar-tooltip]:hover::after,
    .sidebar-is-collapsed
        .sidebar__link[data-sidebar-tooltip]:focus-visible::after {
        opacity: 1;
    }
}

/* Mobile header */

.mobile-header {
    display: none;
}

.mobile-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #111827;
    font-weight: 700;
    text-decoration: none;
}

.mobile-header__menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.mobile-header__menu-button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}
.button:hover {
    
    background: var(--brand-800);
}

/* Mobile backdrop */

.sidebar-backdrop {
    display: none;
}

.sidebar-backdrop[hidden] {
    display: none;
}

/* Mobile drawer */

@media (max-width: 1024px) {
    .app-shell,
    .app-shell.sidebar-is-collapsed {
        display: block;
    }

    .app-content {
        padding: 24px;
    }

    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 15;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 64px;
        padding: 10px 24px;
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        width: min(280px, calc(100vw - 48px));
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        box-shadow: 10px 0 30px rgba(17, 24, 39, 0.16);
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }

    .app-shell.sidebar-is-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 25;
        display: block;
        background: rgba(17, 24, 39, 0.45);
    }

    body.sidebar-drawer-open {
        overflow: hidden;
    }

    .sidebar__collapse-button {
        transform: none;
    }
}

@media (max-width: 600px) {
    .app-content {
        padding: 18px;
    }

    .mobile-header {
        padding-right: 18px;
        padding-left: 18px;
    }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
    .app-shell,
    .sidebar,
    .sidebar__collapse-button {
        transition: none;
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
}

.header h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -0.03em;
}

.header > div {
    min-width: 0;
}

.header > .button {
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
}


.header p {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 15px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.button {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--brand-700);
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.button.secondary {
    background: white;
    color: var(--brand-700);
    border: 1px solid #d1d5db;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 34px;
}

.card {
    background: white;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    display: block;
    color: inherit;
    text-decoration: none;
}

.card-link:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.card h3 {
    margin: 0 0 10px;
    color: #6b7280;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card strong {
    display: block;
    font-size: 34px;
    line-height: 1;
}

.section {
    background: white;
    padding: 26px;
    border-radius: 14px;
    margin-bottom: 32px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.section h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.section-subtitle {
    margin: -8px 0 18px;
    color: #6b7280;
    font-size: 14px;
}

.dashboard-followups-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 32px;
    align-items: stretch;
}

.dashboard-followups-grid > .section {
    min-width: 0;
    height: 100%;
    margin-bottom: 0;
}

@media (min-width: 1200px) {
    .dashboard-followups-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.dashboard-page .app-content {
    max-width: 1600px;
}


.recurrence-days-remaining {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.recurrence-review-link {
    white-space: nowrap;
}

.dashboard-assignments-table {
    min-width: 900px;
}

.conflicts-panel {
    align-self: stretch;
}

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

.conflicts-panel-header .section-subtitle {
    margin: 4px 0 0;
}

.conflicts-list {
    border-top: 1px solid #e5e7eb;
}

.conflict-item {
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.conflict-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.conflict-item-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.conflict-item-heading span {
    flex: 0 0 auto;
    color: #6b7280;
    font-size: 13px;
}

.conflict-customer {
    margin: 6px 0 0;
    font-weight: bold;
}

.conflict-description {
    margin: 6px 0 12px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

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

.shift-instruction-group {
    min-width: 0;
    padding: 18px 22px;
}

.shift-instruction-group + .shift-instruction-group {
    border-left: 1px solid #e5e7eb;
}

.shift-instruction-group__heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.shift-instruction-group__heading h4 {
    margin: 0;
    font-size: 14px;
}

.shift-instruction-source {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.shift-instruction-source--persistent {
    background: #eef2ff;
    color: #4338ca;
}

.shift-note-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding-left: 20px;
    line-height: 1.45;
}

.shift-note-list li {
    padding-left: 3px;
    overflow-wrap: anywhere;
}

.shift-note-list li::marker {
    color: var(--brand-700);
    font-size: 1.15em;
}

.shift-disclosure-list,
.past-shift-list {
    display: grid;
    gap: 12px;
}

.shift-disclosure {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: white;
}

.shift-disclosure--cancelled {
    opacity: 0.72;
}

.shift-disclosure__summary {
    position: relative;
    display: block;
    padding: 16px 18px 16px 48px;
    cursor: pointer;
    list-style: none;
}

.shift-disclosure__summary::-webkit-details-marker {
    display: none;
}

.shift-disclosure__summary::marker {
    content: "";
}

.shift-disclosure__summary::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 21px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--brand-700);
    border-bottom: 2px solid var(--brand-700);
    transform: translateY(-65%) rotate(-45deg);
    transition: transform 150ms ease;
}

.shift-disclosure[open] > .shift-disclosure__summary::before {
    transform: translateY(-65%) rotate(45deg);
}

.shift-disclosure__summary-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
}

.shift-disclosure__summary h3,
.past-shift h3 {
    margin: 0;
    font-size: 17px;
}

.shift-disclosure__date,
.past-shift__date {
    margin: 0 0 5px;
    color: var(--brand-700);
    font-size: 13px;
    font-weight: 700;
}

.shift-disclosure__body {
    border-top: 1px solid #e5e7eb;
}

.shift-disclosure__address {
    margin: 0;
    padding: 15px 18px 0;
    color: #6b7280;
    font-size: 14px;
}

.shift-disclosure__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 15px 18px;
}

.shift-disclosure__details dt {
    margin-bottom: 4px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.shift-disclosure__details dd {
    margin: 0;
}

.shift-disclosure__instructions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid #e5e7eb;
}

.shift-instruction-group {
    min-width: 0;
    padding: 16px 18px;
}

.shift-instruction-group + .shift-instruction-group {
    border-left: 1px solid #e5e7eb;
}

.shift-instruction-group__heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.shift-instruction-group__heading h4 {
    margin: 0;
    font-size: 14px;
}

.shift-instruction-source {
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.shift-instruction-source--persistent {
    background: #eef2ff;
    color: #4338ca;
}

.shift-note-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 20px;
    line-height: 1.45;
}

.shift-note-list li {
    padding-left: 2px;
    overflow-wrap: anywhere;
}

.shift-note-list li::marker {
    color: var(--brand-700);
}

.shift-disclosure__footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 18px;
    border-top: 1px solid #e5e7eb;
}

/* Minimal past shifts */

.past-shift {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.past-shift:last-child {
    border-bottom: 0;
}

.past-shift__main {
    min-width: 0;
}

.past-shift__report {
    white-space: nowrap;
}

@media (max-width: 700px) {
    .shift-disclosure__summary-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .shift-disclosure__details,
    .shift-disclosure__instructions {
        grid-template-columns: 1fr;
    }

    .shift-instruction-group + .shift-instruction-group {
        border-top: 1px solid #e5e7eb;
        border-left: 0;
    }

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

    .past-shift__report {
        grid-column: 1 / -1;
    }
}

th {
    background: #f9fafb;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

th,
td {
    text-align: center;
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}



tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f9fafb;
}

.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}


.empty {
    color: #6b7280;
    font-style: italic;
}

.upcoming-list {
    padding-left: 0;
    list-style: none;
}

.upcoming-list li {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

    .section {
        padding: 20px;
    }

    .page {
        padding: 20px;
    }

    table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

.assignment-link {
    color: var(--brand-700);
    font-weight: bold;
    text-decoration: none;
}

.assignment-link:hover {
    text-decoration: underline;
}

.small-button {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--brand-50);
    color: var(--brand-700);
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    border: 1px solid var(--brand-200);
}

.small-button:hover {
    background: var(--brand-100);
    text-decoration: underline;
}

.small-button.danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.small-button.danger:hover {
    background: #fee2e2;
}


@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .header > .button {
        width: 100%;
        margin-top: 0;
        text-align: center;
    }

    .actions,
    .filters {
        align-items: stretch;
    }

    .button,
    .filters select {
        width: 100%;
    }
    .conflicts-panel-header {
    flex-direction: column;
    align-items: stretch;
    }

    .conflict-item-heading {
    flex-direction: column;
    gap: 4px;
    }
}

.filters {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters label {
    font-weight: bold;
    color: #374151;
}

.filters select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    min-width: 180px;
}

.clear-filter {
    color: var(--brand-700);
    font-weight: bold;
    text-decoration: none;
}

.clear-filter:hover {
    text-decoration: underline;
}

.status-form {
    margin: 0;
}

.inline-form {
    display: inline-block;
    margin: 0;
}

.conflict-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.conflict-alert {
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #7f1d1d;
    padding: 12px 14px;
}

.conflict-alert strong {
    display: block;
    margin-bottom: 4px;
}

.conflict-alert p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.recurrence-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--brand-200);
    border-radius: 8px;
    background: var(--brand-50);
    color: var(--brand-800);
    padding: 12px 14px;
}

.recurrence-summary p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.edit-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: min(780px, calc(100vh - 32px));
    border: 0;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}



.edit-dialog::backdrop {
    background: rgba(15, 23, 42, 0.42);
}

#edit-dialog-body,
#unsaved-navigation-dialog-body {
    max-height: min(780px, calc(100vh - 32px));
    overflow: auto;
    padding: 24px;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
}

.modal-header p {
    margin: 6px 0 0;
    color: #64748b;
}

.dialog-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.edit-form {
    display: grid;
    gap: 18px;
}

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

.form-field {
    display: grid;
    gap: 6px;
}

.form-field label {
    font-weight: 700;
    color: #334155;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 9px 10px;
    font: inherit;
}

.form-field textarea,
.form-field:has(textarea),
.form-field:has(#id_employees),
.form-field:has(#id_notes) {
    grid-column: 1 / -1;
}

.help-text {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
}

.customer-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.service-address {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
}

.service-address__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 10px;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    background: #f8fafc;
}

.service-address__summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.service-address__label {
    color: #334155;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

#stored-address-preview {
    overflow: hidden;
    color: #64748b;
    font-size: 0.85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-address__toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.service-address__toggle input[type="checkbox"] {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    flex-shrink: 0;
}

.service-address__fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
    padding-top: 4px;
}

@media (max-width: 720px) {
    .service-address__row {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .service-address__summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .service-address__fields {
        grid-template-columns: 1fr;
    }

    #stored-address-preview {
        white-space: normal;
    }
}

.customer-detail-actions__right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.customer-combobox {
    position: relative;
}

.customer-combobox-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 20;
}

.customer-combobox.open .customer-combobox-list {
    display: block;
}

.customer-combobox-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

.customer-combobox-option.active,
.customer-combobox-option:hover {
    background: var(--brand-100);
}

.customer-combobox-empty {
    padding: 8px 12px;
    color: #6b7280;
    font-size: 13px;
}


#id_employees {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px;
}

#id_employees label {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 400;
    font-size: 0.85rem;
    line-height: 1.2;
    cursor: pointer;
}

#id_employees label:has(input:checked) {
    border-color: var(--brand-700);
    background: var(--brand-100);
}

#id_employees input[type="checkbox"] {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    flex-shrink: 0;
}

.errorlist,
.form-errors {
    margin: 0;
    padding-left: 18px;
    color: #b91c1c;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

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

    #id_employees {
        grid-template-columns: 1fr;
    }

    #edit-dialog-body,
    #unsaved-navigation-dialog-body {
        padding: 18px;
    }
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-width: 280px;
    font-size: 14px;
}

.billing-date-input {
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 14px;
}

@media (max-width: 600px) {
    .customer-detail-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-detail-actions__right {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .billing-date-input {
        width: 100%;
        min-width: 0;
    }

    .search-input {
        width: 100%;
        min-width: 0;
    }
}

.mini-line {
    margin-bottom: 4px;
    font-size: 13px;
}

.muted {
    color: #6b7280;
}

.service-address:has(
    #id_use_custom_address:not(:checked)
) .service-address__fields {
    display: none;
}

.recurrence-control__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.recurrence-control__summary {
    display: grid;
    gap: 2px;
}

.recurrence-control__title {
    color: #334155;
    font-weight: 700;
}

.recurrence-control__status {
    color: #64748b;
    font-size: 0.88rem;
}

#recurrence-dialog {
    width: min(420px, calc(100vw - 32px));
    border: 0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

#recurrence-dialog::backdrop {
    background: rgba(15, 23, 42, 0.42);
}

#recurrence-dialog .form-grid {
    grid-template-columns: 1fr;
}

[data-weekly-reveal],
[data-monthly-reveal],
[data-end-date-reveal],
[data-end-count-reveal] {
    display: none;
}

#recurrence-dialog:has(#id_recurrence_type option[value="weekly"]:checked) [data-weekly-reveal] {
    display: grid;
}

#recurrence-dialog:has(#id_recurrence_type option[value="monthly"]:checked) [data-monthly-reveal] {
    display: grid;
}

.series-recurrence-form:has(#id_recurrence_type option[value="weekly"]:checked) [data-weekly-reveal] {
    display: grid;
}

.series-recurrence-form:has(#id_recurrence_type option[value="monthly"]:checked) [data-monthly-reveal] {
    display: grid;
}

.recurrence-review-fields {
    border: 0;
    margin: 0;
    min-inline-size: 0;
    padding: 0;
}

#recurrence-dialog:has(input[name="end_condition"][value="date"]:checked) [data-end-date-reveal] {
    display: grid;
}

#recurrence-dialog:has(input[name="end_condition"][value="count"]:checked) [data-end-count-reveal] {
    display: grid;
}

#id_end_condition {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

#id_end_condition label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    cursor: pointer;
}

#id_end_condition input[type="radio"] {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.inline-field {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.inline-field input {
    width: 64px;
}

#id_weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

#id_weekdays > div {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 4px;
    text-align: center;
}

#id_weekdays > div:has(input:checked) {
    border-color: var(--brand-700);
    background: var(--brand-100);
}

#id_weekdays label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-weight: 400;
    cursor: pointer;
    font-size: 0.82rem;
}

#id_weekdays input[type="checkbox"] {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.week-form-table {
    max-width: 560px;
    margin-bottom: 18px;
}

.week-form-table input[type="text"] {
    width: 90px;
    padding: 7px 9px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.week-form-actions {
    justify-content: space-between;
    max-width: 560px;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.badge-avail {
    background: #dcfce7;
    color: #166534;
}

.badge-unavail {
    background: #fef3c7;
    color: #92400e;
}

.toggle-label {
    display: inline-block;
    cursor: pointer;
    margin-right: 6px;
    padding: 2px 4px;
}

.chevron {
    display: inline-block;
    transition: transform 0.1s ease-in-out;
}

tr.override-summary:has(.row-toggle:checked) .chevron {
    transform: rotate(90deg);
}

tr.override-detail {
    display: none;
}

tr.override-summary:has(.row-toggle:checked) + tr.override-detail {
    display: table-row;
}

.override-detail-table {
    width: 100%;
    margin: 0;
    box-shadow: none;
}

.override-detail-table td {
    background: #f9fafb;
}

[data-override-full] {
    grid-column: 1 / -1;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.pagination-status {
    font-size: 13px;
    color: #6b7280;
}

.login-container {
    display: flex;
    justify-content: center;
    padding-top: 64px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
    margin-top: 0;
}

.login-card form {
    display: grid;
    gap: 20px;
}

.login-card .form-group {
    display: grid;
    gap: 8px;
}

.login-card input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
}

.login-card input:focus {
    border-color: var(--brand-700);
    outline: 2px solid rgba(var(--brand-rgb), 0.15);
}

.form-errors,
.field-error {
    color: #991b1b;
}

.form-errors {
    padding: 12px;
    background: #fee2e2;
    border-radius: 8px;
}

.form-errors p,
.field-error {
    margin: 0;
}

.message-list {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.message {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
}

.message.success {
    color: #166534;
    background: #dcfce7;
    border-color: #86efac;
}

.message.warning {
    color: #92400e;
    background: #fef3c7;
    border-color: #fcd34d;
}

.message.error {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}

.account-email {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.account-status-no_account,
.account-status-inactive {
    color: #374151;
    background: #f3f4f6;
}

.account-status-active {
    color: #166534;
    background: #dcfce7;
}

.account-status-pending {
    color: #653a73;
    background: #f1e8f4;
}
.account-status-expired {
    color: #92400e;
    background: #fef3c7;
}

.account-status-revoked,
.account-status-unavailable {
    color: #991b1b;
    background: #fee2e2;
}
.forgot-password {
    margin: 0;
    text-align: right;
    font-size: 14px;
}
.auth-footer-link {
    margin: 16px 0 0;
    text-align: center;
    font-size: 14px;
}

.account-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 16px 36px;
}

.account-bar form {
    margin: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.availability-pattern {
    overflow: hidden;
    margin-bottom: 32px;
    border-radius: 14px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.availability-pattern__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px;
    cursor: pointer;
    list-style: none;
}

.availability-pattern__summary::-webkit-details-marker {
    display: none;
}

.availability-pattern__summary > div > strong {
    display: block;
    font-size: 20px;
}

.availability-days span {
    min-width: 34px;
    padding: 5px 7px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
}

.availability-days span.is-active {
    border-color: var(--brand-200);
    background: var(--brand-100);
    color: var(--brand-700);
    font-weight: 700;
}

.availability-pattern__form {
    padding: 22px 26px;
    border-top: 1px solid #e5e7eb;
}

.availability-field-label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 700;
}

.availability-workday-options {
    display: grid;
    grid-template-columns: repeat(7, minmax(60px, 1fr));
    gap: 8px;
    max-width: 560px;
}

.availability-workday {
    cursor: pointer;
}

.availability-workday input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.availability-workday span {
    display: block;
    padding: 10px 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f8faf9;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.availability-workday:has(input:checked) span {
    border-color: var(--brand-700);
    background: var(--brand-100);
    color: var(--brand-700);
}

.availability-workday input:focus-visible + span {
    outline: 3px solid rgba(var(--brand-rgb), 0.25);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .availability-pattern__summary,
    .availability-pattern__form {
        padding: 18px;
    }

    .availability-workday-options {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }

    .availability-workday span {
        padding-right: 4px;
        padding-left: 4px;
    }
}

.availability-overrides {
    display: grid;
}

.availability-override {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid #e5e7eb;
}

.availability-override:first-child {
    padding-top: 0;
    border-top: 0;
}

.availability-override:last-child {
    padding-bottom: 0;
}

.availability-override__date {
    flex: 0 0 54px;
    padding: 7px 5px;
    border-radius: 9px;
    background: var(--brand-50);
    text-align: center;
}

.availability-override__date span {
    display: block;
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
}

.availability-override__date strong {
    display: block;
    font-size: 18px;
}

.availability-override__content {
    flex: 1;
    min-width: 0;
}

.availability-override__content > strong {
    display: block;
    margin-bottom: 4px;
}

.availability-override__details {
    color: #6b7280;
    font-size: 13px;
}

.availability-override__actions {
    display: flex;
    gap: 6px;
}

@media (max-width: 600px) {
    .availability-override {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .availability-override__actions {
        width: 100%;
        margin-left: 68px;
    }
}

.billing-customer-groups {
    display: grid;
    gap: 18px;
}

.billing-customer-group {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.billing-customer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px;
    background: #f9fafb;
}

.billing-customer-header h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.billing-customer-summary {
    display: flex;
    gap: 24px;
    color: #6b7280;
    font-size: 13px;
}

.billing-customer-summary strong {
    display: block;
    color: #111827;
    font-size: 15px;
}

.billing-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.billing-status.ready {
    color: #166534;
    background: #dcfce7;
}

.billing-status.warning {
    color: #92400e;
    background: #fef3c7;
}

@media (max-width: 700px) {
    .billing-customer-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .billing-customer-summary {
        width: 100%;
        justify-content: space-between;
    }
}

.billing-selection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.billing-selection-toolbar label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.billing-customer-identity {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.billing-customer-checkbox {
    display: flex;
    padding-top: 3px;
}

.billing-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--brand-50);
}

.billing-selection-detail {
    display: block;
    margin-top: 3px;
    color: #6b7280;
    font-size: 13px;
}

.billing-selection-bar button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 600px) {
    .billing-selection-toolbar,
    .billing-selection-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .billing-selection-bar .small-button {
        width: 100%;
    }
}
