@import url("./modules/work-cars.css");
@import url("./modules/staff.css");
@import url("./modules/ai-assistant.css");
@import url("./modules/rotas.css");
@import url("./modules/rotas-smooth-toggle.css");
@import url("./modules/documents.css");
@import url("./modules/settings.css");
@import url("./modules/shopping.css");

:root {
    --accent: #059080;
    --accent-dark: #0E7F75;
    --accent-soft: rgba(22, 184, 166, .18);

    --surface-dark: rgba(6, 18, 22, .92);
    --surface-dark-strong: rgba(4, 13, 16, .97);
    --surface-border: rgba(122, 198, 190, .14);
    --surface-text: #F4F8F8;
    --surface-muted: rgba(218, 231, 230, .66);

    --topography-image: url("/images/backgrounds/card-topography-gold.webp");
    --glass-overlay: rgba(5, 17, 20, .78);
    --glass-overlay-strong: rgba(4, 13, 16, .90);
    --glass-border: rgba(126, 210, 201, .14);

    --sidebar: #051115;
    --sidebar-hover: rgba(22, 184, 166, .12);

    --workspace: #07161A;
    --card: #0A1B20;
    --surface: #0C2025;

    --text: var(--surface-text);
    --text-primary: var(--surface-text);
    --text-secondary: var(--surface-muted);
    --border: var(--surface-border);

    --success: #42D6A4;
    --success-soft: rgba(66, 214, 164, .15);

    --warning: #F2B94B;
    --warning-soft: rgba(242, 185, 75, .15);

    --info: #4EA7FF;
    --info-soft: rgba(78, 167, 255, .15);

    --error: #FF6B6B;
    --error-soft: rgba(255, 107, 107, .16);

    --radius: 14px;
    --shadow: 0 8px 30px rgba(0, 0, 0, .28);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    background-color: #0f0f10;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background-color: #0f0f10;
    background: var(--workspace);
    color: var(--text);
}

button,
input {
    font: inherit;
}

a,
button,
input,
select,
textarea {
    font-family: inherit;
}

i[data-lucide] {
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.lucide-static {
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* Keep each slot reserved until Lucide replaces the empty element with SVG. */
html:not(.lucide-ready) [data-lucide] {
    visibility: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    color: #D4D4D8;
    padding: 18px 14px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    z-index: 50;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 6px;
}

.sidebar__logo,
.login-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: white;
    font-weight: 800;
}

.sidebar__brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar__brand-text strong {
    color: white;
}

.sidebar__brand-text span {
    font-size: .78rem;
    color: #A1A1AA;
    margin-top: 2px;
}

.sidebar__collapse {
    margin-left: auto;
    color: #A1A1AA;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-section {
    margin: 18px 10px 6px;
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #71717A;
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .92rem;
}

.nav-link {
    min-height: 42px;
}

.nav-link svg {
    width: 19px;
    height: 19px;
}

.nav-link [data-lucide],
.nav-link .lucide-static {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-link.active {
    background: var(--accent);
    color: white;
}

.nav-link>span {
    display: block;
    line-height: 1.2;
}

.sidebar__footer {
    margin-top: auto;
    padding-top: 18px;
}

.sidebar__profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid #2F2F34;
}

.sidebar__profile div:last-child {
    display: flex;
    flex-direction: column;
}

.sidebar__profile span {
    font-size: .78rem;
    color: #A1A1AA;
    margin-top: 2px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 800;
}

.avatar--small {
    width: 34px;
    height: 34px;
    font-size: .78rem;
}

.app-main {
    min-width: 0;
    min-height: 100vh;
    margin-left: 260px;
}

.sidebar__brand-text,
.nav-link>span,
.nav-section,
.sidebar__profile>div {
    visibility: visible;
    opacity: 1;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.mobile-menu {
    display: none;
}

.global-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 760px;
    padding: 8px 10px 8px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: transparent;
}

.global-search svg {
    width: 18px;
    color: var(--text-secondary);
}

.global-search [data-lucide],
.global-search .lucide-static {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.global-search input {
    flex: 1;
    border: 0;
    outline: 0;
    min-width: 120px;
    background: transparent;
}

.search-action {
    border: 0;
    background: #F4F4F5;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 700;
}

.search-action--ai {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.topbar__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 0;
    display: inline-grid;
    place-items: center;
    background: transparent;
    cursor: pointer;
}

.icon-button [data-lucide],
.icon-button .lucide-static {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.icon-button:hover {
    background: #F4F4F5;
}

.notification-button {
    position: relative;
}

.notification-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    right: 8px;
    top: 7px;
    border-radius: 50%;
    background: var(--error);
    border: 2px solid white;
}

.page {
    padding: 30px;
    max-width: 1560px;
    margin: 0 auto;
}

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

.page-header h1 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.15rem);
}

.page-header p {
    margin: 7px 0 0;
    color: var(--text-secondary);
}

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 10px 14px;
    font-weight: 750;
    cursor: pointer;
}

.button svg {
    width: 17px;
    height: 17px;
}

.button [data-lucide] {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}

.button--primary {
    background: var(--accent);
    color: white;
}

.button--primary:hover {
    background: var(--accent-dark);
}

.button--secondary {
    background: white;
    border-color: var(--border);
    color: var(--text);
}

.button--secondary:hover {
    background: #FAFAFA;
}

.button--full {
    width: 100%;
}

.button:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    min-width: 0;
}

.card--full {
    width: 100%;
}

.card-header,
.ai-briefing__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.card-header h2,
.ai-briefing h2 {
    margin: 0;
    font-size: 1.05rem;
}

.card-header p,
.ai-briefing p {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: .87rem;
}

.card-header>svg {
    color: var(--text-secondary);
}

.ai-briefing {
    background: linear-gradient(135deg, rgba(198, 40, 40, .09), rgba(198, 40, 40, .015));
    border-color: rgba(198, 40, 40, .22);
    margin-bottom: 22px;
}

.card-title-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.icon-chip {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: white;
}

.briefing-list {
    margin: 20px 0 0;
    padding-left: 22px;
    display: grid;
    gap: 10px;
    line-height: 1.55;
}

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

.empty-state {
    text-align: center;
    padding: 30px 16px 10px;
}

.empty-state__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.empty-state h2,
.empty-state h3 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0 auto 18px;
    color: var(--text-secondary);
    max-width: 420px;
    line-height: 1.5;
}

.empty-page-card {
    min-height: 460px;
    display: grid;
    place-items: center;
}

.tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 16px 0 14px;
}

.tab {
    border: 0;
    background: #F4F4F5;
    padding: 8px 11px;
    border-radius: 9px;
    white-space: nowrap;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: .78rem;
}

.tab.active {
    background: var(--accent);
    color: white;
}

.rota-table-wrap {
    overflow: auto;
    max-height: 350px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.rota-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 620px;
}

.rota-table th,
.rota-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.rota-table thead th {
    position: sticky;
    top: 0;
    background: #FAFAFA;
    z-index: 2;
    font-size: .76rem;
    color: var(--text-secondary);
}

.rota-table tbody th {
    text-align: left;
    font-size: .84rem;
    background: white;
}

.rota-table .is-today {
    background: #FFF8F8;
}

.rota-cell {
    width: 30px;
    height: 30px;
    margin: auto;
    border-radius: 8px;
    display: grid;
    place-items: center;
}

.rota-cell svg {
    width: 15px;
    height: 15px;
}

.rota-cell.is-working {
    background: var(--sidebar);
    color: white;
    border-left: 4px solid var(--accent);
}

.rota-cell.is-off {
    background: #F1F1F3;
    border: 1px solid #E4E4E7;
}

/* Keep every dashboard rota tab aligned and the same size */
.rota-card .rota-table-wrap {
    height: 310px;
    overflow: auto;
}

.rota-card .rota-table {
    width: 100%;
    table-layout: fixed;
}

.rota-card .rota-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: white;
}

.rota-card .rota-table th,
.rota-card .rota-table td {
    height: 52px;
    box-sizing: border-box;
}

.rota-card .rota-table thead th {
    height: 44px;
}

.rota-card .rota-table th:first-child {
    width: 160px;
}

.rota-card [data-rota-panel] {
    width: 100%;
}

.dashboard-rota-empty {
    height: 260px !important;
    color: var(--text-secondary);
    text-align: center;
    vertical-align: middle;
}

.rota-card tbody[hidden] {
    display: none;
}

.text-link {
    color: var(--accent-dark);
    font-size: .84rem;
    font-weight: 800;
}

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

.item-list {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.list-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 11px;
}

.list-item:hover {
    background: #FAFAFA;
}

.list-item span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-item small {
    color: var(--text-secondary);
}

.list-item>svg {
    width: 17px;
    color: var(--text-secondary);
}

.status-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.status-icon svg {
    width: 18px;
    height: 18px;
}

.status-icon--warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.status-icon--info {
    color: var(--info);
    background: var(--info-soft);
}

.social-list {
    display: grid;
    gap: 10px;
    margin-top: 17px;
}

.social-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
}

.social-platform {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
}

.social-platform svg {
    width: 18px;
    height: 18px;
}

.growth {
    color: var(--success);
    font-size: .78rem;
    font-weight: 800;
}

.toast-container {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1000;
    display: grid;
    gap: 10px;
}

.toast {
    min-width: 240px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    border-radius: 11px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
    transform: translateY(12px);
    opacity: 0;
    transition: .2s ease;
}

.toast--visible {
    transform: translateY(0);
    opacity: 1;
}

.toast--success {
    background: var(--success);
    color: white;
}

.toast__icon {
    font-weight: 900;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, .48);
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal {
    max-width: 440px;
    width: 100%;
    background: white;
    border-radius: 18px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, .24);
}

.modal__icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: grid;
    place-items: center;
}

.modal__icon--error {
    color: var(--error);
    background: var(--error-soft);
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(198, 40, 40, .18), transparent 34%),
        var(--sidebar);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(430px, 100%);
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.login-brand h1 {
    margin: 0;
}

.login-brand p {
    margin: 4px 0 0;
    color: var(--text-secondary);
}

.form-stack {
    display: grid;
    gap: 15px;
}

.form-stack label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    font-size: .88rem;
}

.form-stack input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    outline: 0;
}

.form-stack input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, .13);
}

.login-hint {
    margin-top: 18px;
    background: #F4F4F5;
    padding: 12px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    font-size: .82rem;
}

.inline-alert {
    padding: 11px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: .85rem;
}

.inline-alert--error {
    background: var(--error-soft);
    color: var(--error);
}

.inline-alert--success {
    background: var(--success-soft);
    color: var(--success);
}

.spin {
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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


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

    .app-main {
        margin-left: 0;
        width: 100%;
        min-width: 0;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;

        width: min(320px, 86vw);
        height: 100dvh;

        transform: translateX(-105%);
        transition: transform .25s ease;

        overflow-y: auto;
        overflow-x: hidden;

        padding-bottom: calc(24px + env(safe-area-inset-bottom));

        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;

        z-index: 1001;
    }

    .mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;

        background: rgba(0, 0, 0, .55);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            opacity .25s ease,
            visibility .25s ease;

        z-index: 1000;
    }

    .mobile-sidebar-open .mobile-sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-sidebar-open {
        overflow: hidden;
    }

    .mobile-menu {
        display: inline-grid;
    }

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

    .global-search .search-action {
        display: none;
    }
}

@media (max-width: 980px) {
    .page-header {
        position: relative;
        min-height: 0;
        height: auto;
        margin-bottom: 20px;
        padding-bottom: 0;
        padding-right: 58px;
        display: block;
    }

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

    .page-header>.button {
        position: absolute;
        top: 2px;
        right: 0;

        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 0;

        display: flex;
        align-items: center;
        justify-content: center;

        background: var(--accent, #d62828);
        border: none;
        border-radius: 12px;

        color: #ffffff !important;
        font-size: 0;

        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .page-header>.button svg {
        display: block;
        width: 21px;
        height: 21px;
        margin: 0;

        color: #ffffff !important;
        stroke: #ffffff !important;
    }
}

@media (max-width: 680px) {
    .topbar {
        padding: 0 14px;
    }

    .page {
        padding: 20px 14px;
    }

    .page-header,
    .ai-briefing__header {
        align-items: stretch;
        flex-direction: column;
    }

    .button-row {
        width: 100%;
    }

    .button-row .button {
        flex: 1;
    }

    .global-search {
        padding-right: 10px;
    }

    .toast-container {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }

}

html {
    background: var(--page-background, #f5f5f7);
}

body {
    min-height: 100vh;
    background: var(--workspace);
    color: var(--text-primary);
}

.app-shell,
.app-main,
.sidebar,
.topbar {
    visibility: visible;
}

/* Shared dark glass surfaces. Kept after module imports to cover page-specific panels. */
.sidebar,
.topbar,
.card,
.modal,
.login-card,
.staff-table-card,
.rota-toolbar,
.rota-grid-card,
.ai-tool-card,
.ai-composer-card,
.ai-result-card,
.work-car-card,
.record-drawer {
    background: var(--surface-dark);
    border-color: var(--surface-border);
    color: var(--surface-text);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .24);
}

.sidebar,
.topbar,
.card,
.modal,
.login-card,
.staff-table-card,
.rota-toolbar,
.rota-grid-card,
.ai-tool-card,
.ai-composer-card,
.ai-result-card,
.work-car-card,
.record-drawer {
    backdrop-filter: blur(12px);
}

.topbar {
    background: var(--surface-dark);
    border-bottom-color: var(--surface-border);
}

.global-search {
    background: transparent;
    border-color: var(--surface-border);
    color: var(--surface-text);
}


.staff-search,
.staff-view-tab,
.work-car-view-tab,
.ai-mode-badge,
.rota-status-badge,
.rota-check-field,
.driver-details-toggle,
.staff-subsection,
.certificate-card {
    background: rgba(255, 255, 255, .08);
    border-color: var(--surface-border);
    color: var(--surface-text);
}

.global-search input {
    background: transparent;
    border-color: transparent;
    color: var(--surface-text);
}

.staff-search input,
input,
select,
textarea {
    background: rgba(255, 255, 255, .12);
    border-color: var(--surface-border);
    color: var(--surface-text);
}

input::placeholder,
textarea::placeholder {
    color: var(--surface-muted);
}

.search-action,
.button--secondary,
.icon-button:hover,
.tab,
.staff-drawer-tab.active,
.rota-department-tab:not(.active) {
    background: rgba(255, 255, 255, .10);
    border-color: var(--surface-border);
    color: var(--surface-text);
}

.search-action--ai,
.staff-drawer-tab.active { color: var(--surface-text); }

.ai-tool-card--placeholder,
.ai-tool-card--placeholder .ai-tool-card__icon,
.ai-tool-card--placeholder .ai-tool-card__tag,
.rota-empty-shift,
.rota-weekly-hours,
.rota-check-field,
.staff-profile-summary,
.staff-drawer-tabs,
.staff-table thead th,
.rota-grid thead th,
.rota-grid tfoot td,
.rota-table thead th,
.rota-card .rota-table thead,
.rota-table tbody th,
.ai-result-actions {
    background: var(--surface-dark-strong);
    border-color: var(--surface-border);
    color: var(--surface-text);
}

.staff-table tbody tr:hover td,
.rota-grid tbody tr:hover td,
.list-item:hover,
.rota-table .is-today,
.rota-grid thead th.is-today,
.rota-grid tfoot td.is-today {
    background: rgba(0, 191, 175, 0.159);
}

.rota-grid td,
.rota-grid th,
.rota-table th,
.rota-table td,
.staff-table th,
.staff-table td,
.ai-result-text {
    border-color: var(--surface-border);
    color: var(--surface-text);
}

.rota-cell.is-off {
    background: rgba(255, 255, 255, .10);
    border-color: var(--surface-border);
}

.text-link,
.card-header>svg,
.staff-search>svg { color: #FCA5A5; }

.global-search svg { color: var(--surface-text); }

/* Gray button fix: retains contrast on dark surfaces without the white hover flash. */
.gray-button-fix {
    background: rgba(255, 255, 255, .10) !important;
    border-color: var(--surface-border) !important;
    color: var(--surface-text) !important;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.gray-button-fix:hover { background: rgba(255, 255, 255, .08) !important; border-color: rgba(255, 255, 255, .24) !important; }
.gray-button-fix:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.onboarding-panel .card-header > div { padding-bottom: 18px; }

/* Dashboard card surface, reused by the non-.card library surfaces below. */
.saleems-card-surface,
.shopping-card,
.shopping-empty {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--surface-dark);
    background-image: var(--topography-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.saleems-card-surface::before,
.shopping-card::before,
.shopping-empty::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: var(--glass-overlay);
    content: "";
    pointer-events: none;
}

.saleems-card-surface > *,
.shopping-card > *,
.shopping-empty > * { position: relative; z-index: 1; }

/* Major panels share one contained topography layer; controls and table cells remain plain. */
.card,
.modal,
.login-card,
.staff-table-card,
.rota-toolbar,
.rota-grid-card,
.ai-tool-card,
.ai-composer-card,
.ai-result-card,
.work-car-card,
.work-car-summary,
.record-drawer {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--surface-dark);
    background-image: var(--topography-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.card::before,
.modal::before,
.login-card::before,
.staff-table-card::before,
.rota-toolbar::before,
.rota-grid-card::before,
.ai-tool-card::before,
.ai-composer-card::before,
.ai-result-card::before,
.work-car-card::before,
.work-car-summary::before,
.record-drawer::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: var(--glass-overlay);
    content: "";
    pointer-events: none;
}

.card>*,
.modal>*,
.login-card>*,
.staff-table-card>*,
.rota-toolbar>*,
.rota-grid-card>*,
.ai-tool-card>*,
.ai-composer-card>*,
.ai-result-card>*,
.work-car-card>*,
.work-car-summary>*,
.record-drawer>* {
    position: relative;
    z-index: 1;
}

/* Shared layout surfaces keep their existing dimensions while using the card theme. */
.topbar,
.sidebar {
    isolation: isolate;
    background-color: var(--surface-dark);
    --layout-overlay: var(--glass-overlay);
}

.topbar {
    overflow: hidden;
}

.sidebar {
    overflow-x: hidden;
    --layout-overlay: var(--glass-overlay-strong);
    background-image:
        linear-gradient(var(--glass-overlay-strong), var(--glass-overlay-strong)),
        var(--topography-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.sidebar::before {
    display: none;
}

.topbar::before,
.sidebar::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: var(--surface-dark);
    background-image:
        linear-gradient(var(--layout-overlay), var(--layout-overlay)),
        var(--topography-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    content: "";
    pointer-events: none;
}

.topbar>*,
.sidebar>* {
    position: relative;
    z-index: 1;
}

/* Tables use one image at table level; cell overlays keep the pattern coherent and readable. */
.staff-table,
.rota-grid,
.rota-table {
    background-color: var(--surface-dark);
    background-image: var(--topography-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.staff-table th,
.rota-grid thead th,
.rota-table thead th {
    background-color: rgba(0, 0, 0, .80);
    border-color: rgba(255, 255, 255, .08);
    color: var(--surface-text);
}

.staff-table tbody td,
.rota-grid tbody td,
.rota-grid tbody th,
.rota-table tbody td,
.rota-table tbody th {
    background-color: rgba(0, 0, 0, .70);
    border-color: rgba(255, 255, 255, .08);
    color: var(--surface-text);
}

.staff-table tbody tr:nth-child(even):not(:hover) td,
.rota-grid tbody tr:nth-child(even) td,
.rota-grid tbody tr:nth-child(even) th,
.rota-table tbody tr:nth-child(even) td,
.rota-table tbody tr:nth-child(even) th {
    background-color: rgba(0, 0, 0, .76);
}

.rota-staff-column,
.rota-staff-cell,
.rota-grid tfoot th {
    background-color: rgba(0, 0, 0, .84) !important;
}

.staff-table tfoot th,
.staff-table tfoot td,
.rota-grid tfoot th,
.rota-grid tfoot td,
.rota-table tfoot th,
.rota-table tfoot td {
    background-color: rgba(0, 0, 0, .82);
    border-color: rgba(255, 255, 255, .08);
    color: var(--surface-text);
}

.rota-shift-cell.is-today,
.rota-table .is-today,
.rota-grid thead th.is-today,
.rota-grid tfoot td.is-today {
    background-color: rgba(4, 147, 119, 0.34);
}

/* Keep the dashboard current-day tint above alternating rota row backgrounds. */
.rota-table tbody tr td.is-today {
    background-color: rgba(4, 147, 119, 0.20);
    box-shadow: inset 0 0 0 999px rgba(2, 141, 120, 0.16);
}

/* Keep the full rota current-day tint above alternating row backgrounds. */
.rota-grid tbody tr td.rota-shift-cell.is-today {
    background-color: rgba(4, 147, 119, 0.20);
    box-shadow: inset 0 0 0 999px rgba(2, 141, 120, 0.16);
}

/* Hover the complete rota row, including the sticky staff-name column. */
.rota-grid tbody tr:hover td,
.rota-grid tbody tr:hover th {
    background-color: rgba(0, 151, 108, 0.22);
    box-shadow: inset 0 0 0 999px rgba(1, 123, 132, 0.14);
}

.rota-grid tbody tr:hover .rota-staff-cell {
    background-color: rgba(0, 151, 108, .32) !important;
}

/* Missing Work Cars dates use the same subdued topography treatment as the main cards. */
.work-car-reminder--not-recorded {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--surface-dark);
    background-image: var(--topography-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-color: var(--surface-border);
}

.work-car-reminder--not-recorded::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--glass-overlay);
    content: "";
    pointer-events: none;
}

.work-car-reminder--not-recorded>* {
    position: relative;
    z-index: 1;
}

.work-car-reminder--not-recorded strong {
    color: var(--surface-text);
}

.work-car-reminder--not-recorded span,
.work-car-reminder--not-recorded small {
    color: var(--surface-muted);
}

.work-car-reminder--not-recorded .work-car-reminder__icon {
    background: rgba(255, 255, 255, .12);
    color: var(--surface-text);
}

/* Drawer danger zones need contrast against the dark glass drawer surface. */
.staff-danger-zone,
.drawer-danger-zone {
    border-color: rgba(248, 113, 113, .62);
    background: rgba(127, 29, 29, .44);
}

.staff-danger-zone h3,
.drawer-danger-zone h3 {
    color: #FECACA;
}

.staff-danger-zone p,
.drawer-danger-zone p {
    color: rgba(255, 255, 255, .82);
}

.staff-danger-zone .button--danger,
.drawer-danger-zone .button--danger {
    border-color: #FCA5A5;
    background: #DC2626;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(127, 29, 29, .38);
}

.staff-danger-zone .button--danger:hover,
.drawer-danger-zone .button--danger:hover {
    background: #B91C1C;
}

.staff-danger-zone .button--danger-outline,
.drawer-danger-zone .button--danger-outline {
    border-color: rgba(255, 255, 255, .46);
    background: rgba(255, 255, 255, .12);
    color: #FFFFFF;
}

.staff-danger-zone .button--danger-outline:hover,
.drawer-danger-zone .button--danger-outline:hover {
    border-color: #FCA5A5;
    background: rgba(255, 255, 255, .20);
}

/* Shift Pattern modal fields are light controls inside a dark modal. */
.rota-modal .form-field input,
.rota-modal .form-field select {
    background: #FFFFFF;
    border-color: rgba(24, 24, 27, .28);
    color: #18181B;
}

.rota-modal .form-field input::placeholder {
    color: #71717A;
}

.rota-modal .form-field select option {
    background: #FFFFFF;
    color: #18181B;
}

/* Page headers sit on the light page backdrop, not the dark panel surfaces. */
.page-header h1 {
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-secondary);
}

.notification-button,
.notification-button svg {
    color: var(--surface-text);
}

/* Drawers are viewport overlays, not themed cards in document flow. */
.record-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    z-index: 120;
    transition:
        transform 180ms ease,
        visibility 0s linear 180ms;
}

.record-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition:
        transform 180ms ease,
        visibility 0s linear 0s;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 110;
    transition:
        opacity 180ms ease,
        visibility 0s linear 180ms;
}

.drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity 180ms ease,
        visibility 0s linear 0s;
}

.staff-drawer-content,
.work-car-drawer__content,
.record-drawer__form {
    min-height: 0;
    overflow-y: auto;
}

body.drawer-open {
    overflow: hidden;
}

/* Drawer chrome matches the existing topography treatment while remaining sticky. */
.record-drawer__header,
.record-drawer__footer {
    background-color: var(--surface-dark-strong);
    background-image:
        linear-gradient(var(--glass-overlay-strong), var(--glass-overlay-strong)),
        var(--topography-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-color: var(--surface-border);
    color: var(--surface-text);
}

/* Rota page actions sit on the light page backdrop, so they need an opaque surface. */
.rota-header-actions .button--secondary,
.rota-header-actions .rota-status-badge {
    background: var(--surface-dark-strong);
    border-color: var(--surface-border);
    color: var(--surface-text);
}

.rota-header-actions .rota-status-badge--published {
    background: rgba(21, 128, 61, .82);
    color: white;
}

/* These controls and headings sit on the light page canvas, not dark panels. */
.page>.page-header,
.page>.page-header h1,
.page>.page-header p,
.page>.page-header .eyebrow,
.page>.page-header .page-eyebrow {
    color: #ffffff;
}

.staff-search,
.staff-view-tab,
.work-car-view-tab,
.ai-mode-badge {
    background: #FFFFFF;
    border-color: rgba(24, 24, 27, .28);
    color: #18181B;
}

.staff-search {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.staff-search input {
    background: transparent;
    color: #18181B;
}

.staff-search input::placeholder {
    color: #71717A;
}

.staff-search>svg {
    color: #52525B;
}

.staff-view-tab span,
.work-car-view-tab span {
    background: #F4F4F5;
    color: #3F3F46;
}

/* Drawer fields remain deliberately light so entered values and native selects stay readable. */
.record-drawer .form-field input,
.record-drawer .form-field select,
.record-drawer .form-field textarea {
    background: #FFFFFF;
    border-color: rgba(24, 24, 27, .28);
    color: #18181B;
}

.record-drawer .form-field input::placeholder,
.record-drawer .form-field textarea::placeholder {
    color: #71717A;
}

.record-drawer .form-field select option {
    background: #FFFFFF;
    color: #18181B;
}

/* Rota switcher controls intentionally sit on a light surface. */
.rota-controls-card {
    background: rgba(0, 0, 0, 0.609);
    border-color: rgba(8, 8, 8, 0.323);
    color: #18181B;
}

.rota-controls-card .rota-department-tab:not(.active),
.rota-controls-card .rota-department-settings,
.rota-controls-card .rota-date-jump input,
.rota-controls-card .button--secondary {
    background: #FFFFFF;
    border-color: rgba(24, 24, 27, .28);
    color: #18181B;
}

.rota-controls-card .rota-week-label strong,
.rota-controls-card .rota-week-label span {
    background: transparent;
    color: white;
}

.rota-controls-card .rota-department-tab:not(.active):hover,
.rota-controls-card .button--secondary:hover {
    background: #F4F4F5;
}

.rota-shift-settings {
    width: 22px;
    height: 22px;
    color: #18181B;
}

.rota-shift-settings svg {
    width: 12px;
    height: 12px;
}

/* =========================
   Onboarding V1
   ========================= */
.onboarding-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
}

.onboarding-tabs a {
    text-decoration: none;
    color: var(--surface-text);
    border: 1px solid var(--surface-border);
    background: var(--surface-dark-strong);
    padding: 10px 15px;
    border-radius: 10px;
    font-weight: 700;
}

.onboarding-tabs a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.onboarding-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.onboarding-stat {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.onboarding-stat span {
    font-size: 13px;
    color: var(--surface-muted);
    font-weight: 700;
}

.onboarding-stat strong {
    font-size: 30px;
    line-height: 1;
    color: var(--surface-text);
}

.onboarding-stat small {
    color: var(--surface-muted);
}

.onboarding-panel {
    overflow: hidden;
}

.onboarding-table-wrap {
    overflow: auto;
}

.onboarding-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.onboarding-table th,
.onboarding-table td {
    padding: 14px 16px;
    border-top: 1px solid var(--surface-border);
    text-align: left;
    vertical-align: middle;
    color: var(--surface-text);
}

.onboarding-table th {
    color: var(--surface-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.onboarding-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(148, 163, 184, .16);
    color: var(--surface-muted);
    white-space: nowrap;
}

.onboarding-status.is-complete {
    background: rgba(34, 197, 94, .14);
    color: #86efac;
}

.onboarding-status.is-progress {
    background: rgba(245, 158, 11, .15);
    color: #fcd34d;
}

.onboarding-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.onboarding-progress__bar {
    height: 8px;
    flex: 1;
    min-width: 100px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .18);
    overflow: hidden;
}

.onboarding-progress__bar span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
}

.onboarding-progress small {
    white-space: nowrap;
    color: var(--surface-muted);
}

.onboarding-first-run {
    padding: 52px 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--surface-text);
}

.onboarding-first-run p {
    max-width: 620px;
    color: var(--surface-muted);
}

.onboarding-content-list {
    display: flex;
    flex-direction: column;
}

.onboarding-content-row {
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) minmax(180px, .7fr) auto;
    gap: 14px;
    align-items: center;
    padding: 15px 18px;
    border-top: 1px solid var(--surface-border);
}

.content-library-item__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: max-content;
}

.content-library-item__actions form { margin: 0; }

.onboarding-content-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: var(--surface-text);
}

.onboarding-content-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--surface-text);
}

.onboarding-content-main>span {
    color: var(--surface-muted);
    font-size: 12px;
}

.onboarding-department-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.onboarding-department-tags span {
    font-size: 11px;
    border-radius: 999px;
    padding: 3px 7px;
    background: rgba(255, 255, 255, .08);
    color: var(--surface-muted);
}

.onboarding-content-actions-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--surface-muted);
    font-size: 12px;
}

.onboarding-content-actions-summary>span {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.onboarding-content-actions-summary svg {
    width: 14px;
    height: 14px;
}

.onboarding-builder-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, .66);
    display: flex;
    justify-content: flex-end;
    padding: 0;
}

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

.onboarding-builder {
    width: min(680px, 92vw);
    height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    overflow: hidden;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, .14);
    color: #fff;
    border-radius: 0;
    box-shadow: -24px 0 60px rgba(0, 0, 0, .34);
    animation: onboarding-drawer-in .2s ease-out;
}

@keyframes onboarding-drawer-in {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.onboarding-builder form {
    display: flex;
    flex-direction: column;
    max-height: 100dvh;
}

.onboarding-builder__header,
.onboarding-builder__footer {
    padding: 18px 22px;
    background: #0b1220;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.onboarding-builder__header h2 {
    margin: 2px 0 4px;
}

.onboarding-builder__header p {
    margin: 0;
    color: #9ca3af;
}

.onboarding-builder__footer {
    border-bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    justify-content: flex-end;
}

.onboarding-builder__body {
    padding: 22px;
    overflow: auto;
}

.onboarding-builder__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.onboarding-builder-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.onboarding-builder .form-field span,
.onboarding-builder .form-field small {
    color: #d1d5db;
}

.onboarding-builder .form-field input,
.onboarding-builder .form-field select,
.onboarding-builder .form-field textarea {
    background: #fff;
    color: #111827;
    border-color: #d1d5db;
}

.input-suffix {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.input-suffix input {
    border: 0 !important;
    flex: 1;
}

.input-suffix span {
    color: #4b5563 !important;
    padding-right: 12px;
}

.onboarding-section {
    padding-top: 18px;
    margin-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.onboarding-section--first {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.onboarding-section h3 {
    margin: 0;
}

.onboarding-section p {
    margin: 3px 0 0;
    color: #9ca3af;
    font-size: 13px;
}

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

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

.check-card,
.action-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .045);
    color: #fff;
    cursor: pointer;
}

.check-card input,
.action-check input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.action-check span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.action-check small {
    color: #9ca3af;
}

.onboarding-builder-help {
    align-self: start;
    position: sticky;
    top: 0;
    padding: 17px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .1);
}

.onboarding-builder-help h3 {
    margin-top: 0;
}

.onboarding-builder-help ul {
    padding-left: 20px;
    color: #d1d5db;
    line-height: 1.6;
}

.onboarding-builder-help p {
    color: #9ca3af;
    font-size: 13px;
}

.question-builder-card {
    margin-top: 8px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question-builder-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.onboarding-profile-hero {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 18px;
}

.staff-avatar--large {
    width: 54px;
    height: 54px;
}

.onboarding-profile-hero .staff-person>div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--surface-text);
}

.onboarding-profile-hero .staff-person>div span {
    color: var(--surface-muted);
    font-size: 13px;
}

.onboarding-profile-progress {
    width: min(420px, 50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.onboarding-profile-progress>div:first-child {
    display: flex;
    justify-content: space-between;
    color: var(--surface-text);
}

.onboarding-profile-progress span {
    color: var(--surface-muted);
}

.onboarding-assignment-list {
    display: flex;
    flex-direction: column;
}

.onboarding-assignment {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 15px 18px;
    border-top: 1px solid var(--surface-border);
    color: var(--surface-text);
    text-decoration: none;
}

.onboarding-assignment:hover {
    background: rgba(255, 255, 255, .035);
}

.onboarding-assignment__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .07);
}

.onboarding-assignment__icon.is-complete {
    background: rgba(34, 197, 94, .14);
    color: #86efac;
}

.onboarding-assignment>div:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.onboarding-assignment span,
.onboarding-assignment small {
    color: var(--surface-muted);
}

.page-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 8px;
}

.page-back-link svg {
    width: 16px;
    height: 16px;
}

.onboarding-completion-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, .75fr);
    gap: 18px;
    align-items: start;
}

.onboarding-learning-card {
    overflow: hidden;
}

.onboarding-learning-header {
    padding: 20px;
}

.onboarding-learning-header h2 {
    margin: 5px 0;
    color: var(--surface-text);
}

.onboarding-learning-header p {
    color: var(--surface-muted);
}

.onboarding-file-preview iframe,
.onboarding-file-preview object {
    width: 100%;
    height: 68vh;
    min-height: 520px;
    border: 0;
    background: white;
}

.onboarding-file-preview video,
.onboarding-file-preview img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #05070a;
    display: block;
}

.onboarding-download-file {
    margin: 0 20px 20px;
    padding: 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, .06);
    color: var(--surface-text);
}

.onboarding-download-file>div {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.onboarding-download-file span {
    color: var(--surface-muted);
}

.onboarding-text-content {
    padding: 0 20px 24px;
    white-space: pre-wrap;
    line-height: 1.7;
    color: var(--surface-text);
}

.onboarding-completion-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 84px;
}

.onboarding-completion-actions>.card {
    padding: 17px;
}

.onboarding-question {
    padding: 14px 0;
    border-top: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    gap: 9px;
    color: var(--surface-text);
}

.onboarding-question>span {
    color: var(--surface-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.question-options label {
    display: flex;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--surface-border);
    border-radius: 9px;
    cursor: pointer;
}

.question-options input {
    accent-color: var(--accent);
}

.onboarding-question textarea {
    width: 100%;
    border-radius: 9px;
    padding: 10px;
}

.signature-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    color: var(--surface-text);
}

.signature-block canvas {
    width: 100%;
    height: 150px;
    background: #fff;
    border-radius: 10px;
    touch-action: none;
    cursor: crosshair;
}

.signature-block>div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.signature-block small {
    color: var(--surface-muted);
}

.onboarding-submit-card {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.onboarding-submit-card>div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--surface-text);
}

.onboarding-submit-card span {
    color: var(--surface-muted);
    font-size: 13px;
}

.dashboard-onboarding-widget .onboarding-widget-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0 14px;
}

.dashboard-onboarding-widget .onboarding-widget-summary div {
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .055);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dashboard-onboarding-widget .onboarding-widget-summary strong {
    font-size: 22px;
    color: var(--surface-text);
}

.dashboard-onboarding-widget .onboarding-widget-summary span {
    font-size: 11px;
    color: var(--surface-muted);
}

/* ============================================
   ONBOARDING - STAFF FORM FIELDS
   ============================================ */

.staff-form {
    width: 100%;
}

.staff-form__heading {
    margin-bottom: 24px;
}

.staff-form__heading h3 {
    margin: 0 0 8px;
}

.staff-form__heading p {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
}

.staff-form__fields {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.staff-form__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.staff-form__field label {
    display: block;
    width: 100%;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.staff-form__field label em {
    color: var(--accent, #14b8a6);
    font-style: normal;
    margin-left: 2px;
}

.staff-form__field input,
.staff-form__field textarea,
.staff-form__field select {
    display: block;
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;

    padding: 12px 14px;

    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;

    color: #fff;
    font: inherit;
    font-size: 15px;

    outline: none;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.staff-form__field textarea {
    min-height: 120px;
    resize: vertical;
}

.staff-form__field input:hover,
.staff-form__field textarea:hover,
.staff-form__field select:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.staff-form__field input:focus,
.staff-form__field textarea:focus,
.staff-form__field select:focus {
    border-color: var(--accent, #14b8a6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.staff-form__field input::placeholder,
.staff-form__field textarea::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.staff-form__field input[type="date"] {
    color-scheme: dark;
}

@media (max-width: 768px) {
    .staff-form__fields {
        gap: 20px;
    }

    .staff-form__field label {
        font-size: 16px;
    }

    .staff-form__field input,
    .staff-form__field textarea,
    .staff-form__field select {
        width: 100%;
        min-height: 52px;
        font-size: 16px;
        padding: 13px 14px;
    }

    .staff-form__field textarea {
        min-height: 120px;
    }
}

@media(max-width:900px) {
    .onboarding-stat-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .onboarding-builder-grid {
        grid-template-columns: 1fr
    }

    .onboarding-builder-help {
        position: static
    }

    .onboarding-completion-layout {
        grid-template-columns: 1fr
    }

    .onboarding-completion-actions {
        position: static
    }

    .onboarding-profile-hero {
        align-items: flex-start;
        flex-direction: column
    }

    .onboarding-profile-progress {
        width: 100%
    }

    .onboarding-content-row {
        grid-template-columns: auto 1fr auto
    }

    .onboarding-content-actions-summary {
        grid-column: 2/-1
    }

    .onboarding-content-row>.onboarding-status {
        grid-column: 2
    }

    .content-library-item__actions {
        grid-column: 2 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

}

@media(max-width:620px) {
    .onboarding-stat-grid {
        grid-template-columns: 1fr 1fr
    }

    .onboarding-builder-backdrop {
        padding: 0
    }

    .onboarding-builder {
        width: 100vw;
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0
    }

    .onboarding-builder form {
        max-height: 100dvh
    }

    .department-check-grid {
        grid-template-columns: 1fr
    }

    .onboarding-tabs {
        overflow: auto
    }

    .onboarding-content-row {
        padding: 13px
    }

    .onboarding-content-actions-summary {
        display: none
    }

    .onboarding-file-preview iframe,
    .onboarding-file-preview object {
        height: 60vh;
        min-height: 420px
    }

    .onboarding-assignment {
        grid-template-columns: auto 1fr auto
    }

    .onboarding-assignment>.onboarding-status {
        display: none
    }
}
