/*
 * v0.2 Workforce Hours — application styles.
 * Visual system mirrors urenstaat.nl (see docs/03-UI-GUIDE.md).
 */

:root {
    --brand-500: #22c55e;
    --brand-600: #16a34a;
    --brand-50:  #dcfce7;

    --surface:   #ffffff;
    --bg:        #f3f6fa;
    --info-box:  #eaeef3;

    --text:        #0f172a;
    --text-muted:  #64748b;
    --border:      #e2e8f0;
    --day-fill:    #eef0f2;

    --accent-amber: #f59e0b;
    --danger:       #dc2626;

    --radius-card:  14px;
    --radius-input: 10px;
    --radius-cell:  10px;

    --shadow-card: 0 6px 24px rgba(15, 23, 42, .06);
    --shadow-pop:  0 12px 32px rgba(15, 23, 42, .10);

    --gutter-mobile:    16px;
    --gutter-desktop:   32px;
    --card-pad-mobile:  20px;
    --card-pad-desktop: 28px;

    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.45;
    min-height: 100vh;
    overflow-x: hidden;
}

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

button { font-family: inherit; }

h1, h2, h3, h4 { color: var(--text); margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    flex-shrink: 0;
}

.topbar__brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--brand-500);
    color: #fff;
    font-weight: 700;
}

.topbar__title { margin-left: auto; font-weight: 600; color: var(--text-muted); display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }

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

.topbar__user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

.topbar__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--brand-500);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
}

.menu-toggle {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.menu-toggle:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

@media (min-width: 992px) {
    .menu-toggle { display: none; }
    .topbar__title { display: inline; }
}

/* ---------- Off-canvas / sidebar ---------- */
.offcanvas {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(80vw, 280px);
    background: var(--surface);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform .2s ease-out;
    z-index: 40;
    display: flex;
    flex-direction: column;
}

.offcanvas.is-open { transform: translateX(0); }

.offcanvas__header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.offcanvas__close {
    appearance: none;
    background: none;
    border: 0;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

.offcanvas__nav { padding: 8px; overflow-y: auto; }

.offcanvas__group { margin: 12px 8px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }

.offcanvas__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.offcanvas__link:hover { background: var(--bg); text-decoration: none; }
.offcanvas__link.is-active { background: var(--brand-50); color: var(--brand-600); }

.offcanvas__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease-out;
    z-index: 35;
}

.offcanvas__backdrop.is-open { opacity: 1; pointer-events: auto; }

@media (min-width: 992px) {
    .offcanvas {
        position: static;
        transform: none;
        width: 240px;
        border-right: 1px solid var(--border);
    }
    .offcanvas__header { display: none; }
    .offcanvas__close { display: none; }
    .offcanvas__backdrop { display: none; }
}

/* ---------- Layout container ---------- */
.shell-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.main {
    flex: 1 1 auto;
    padding: 16px;
    min-width: 0;
    width: 100%;
}

@media (min-width: 992px) {
    .main { padding: 32px; }
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 20px;
}

.card__body { padding: 20px; min-width: 0; overflow-x: auto; }

@media (min-width: 768px) {
    .card__body { padding: 28px; }
}

.card__header {
    background: var(--brand-500);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.card__title { font-size: 16px; }

.card__total { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-input);
    border: 1px solid transparent;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    min-height: 44px;
    text-align: center;
    transition: background .15s ease, border-color .15s ease;
}

.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.btn--brand {
    background: var(--brand-500);
    color: #fff;
    border-color: var(--brand-500);
}

.btn--brand:hover { background: var(--brand-600); border-color: var(--brand-600); }

.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn--ghost:hover { background: var(--bg); }

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

.btn--danger:hover { background: #fee2e2; border-color: #fecaca; }

.btn--block { width: 100%; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field__label { font-size: 14px; font-weight: 500; color: var(--text-muted); }

.input,
.select,
.textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-input);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
}

.textarea { resize: vertical; min-height: 96px; }

.field-error { color: var(--danger); font-size: 13px; margin-top: 4px; }

/* ---------- Auth screens ---------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    min-height: 100vh;
    background: var(--bg);
}

body.auth-page {
    display: block;
    padding: 0;
    min-height: 100vh;
    background: var(--bg);
}

body.auth-page > main.auth-page {
    width: 100%;
    min-height: 100vh;
}

body.auth-page .app-footer {
    display: none;
}

.auth-card { width: 100%; max-width: 420px; }

.auth-card .card__body { padding: 28px; }

.auth-card .auth-card__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.auth-card__sub { color: var(--text-muted); margin-bottom: 24px; }

.auth-card__hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-input);
    background: var(--info-box);
    border: 1px solid var(--border);
}

.auth-card__links {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 14px;
}

@media (max-width: 575.98px) {
    body.auth-page > main.auth-page {
        align-items: flex-start;
        padding: 24px 12px;
    }

    .auth-card {
        max-width: 100%;
        margin: 0 auto;
    }

    .auth-card .card__body {
        padding: 22px;
    }
}

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-input);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert--success { background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-500); }
.alert--error { background: #fee2e2; color: var(--danger); border: 1px solid #fca5a5; }
.alert--info { background: var(--info-box); color: var(--text); border: 1px solid var(--border); }

/* ---------- Tables ---------- */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

@media (max-width: 767.98px) {
    .table:not(.table--responsive) {
        display: table;
        width: 100%;
        min-width: 100%;
        max-width: none;
    }
}

.table th, .table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

.table th {
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: none;
}

.table tr:last-child td { border-bottom: 0; }

.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }

.card__body > .table {
    margin: 0;
    min-width: 100%;
}

/* ---------- Page header ---------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.page-header__title { margin: 0; font-size: 24px; font-weight: 700; }
.page-header__sub { color: var(--text-muted); margin-top: 4px; font-size: 14px; }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Badges & pills ---------- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.badge--brand { background: var(--brand-50); color: var(--brand-600); }
.badge--danger { background: #fee2e2; color: var(--danger); }
.badge--amber  { background: #fef3c7; color: #b45309; }

/* ---------- Stats grid (dashboard) ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px;
}

.stat__label { color: var(--text-muted); font-size: 14px; font-weight: 500; }

.stat__value {
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
    color: var(--text);
}

.stat__delta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Day strip (signature component) ---------- */
.day-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 16px;
}

.day-cell {
    appearance: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 56px;
    padding: 6px 4px;
    border-radius: var(--radius-cell);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: default;
    position: relative;
    text-decoration: none;
}

.day-cell.is-filled { background: var(--day-fill); border-color: transparent; }
.day-cell.is-empty .day-cell__value { color: var(--text-muted); font-weight: 500; }
.day-cell:focus-visible { outline: 2px solid rgba(34, 197, 94, .5); outline-offset: 2px; }

.day-cell__label { font-size: 12px; color: var(--text-muted); font-weight: 500; line-height: 1.1; }
.day-cell__value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }

.day-cell__dot {
    position: absolute;
    bottom: 6px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent-amber);
}
.day-cell--has-note .day-cell__value { margin-bottom: 4px; }
.day-cell--split {
    background: linear-gradient(135deg, var(--brand-50) 50%, var(--day-fill) 50%);
    border-color: transparent;
}

@media (min-width: 768px) {
    .day-strip { gap: 10px; }
    .day-cell { width: 56px; height: 64px; }
    .day-cell__value { font-size: 18px; }
}

/* ---------- Empty state ---------- */
.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty__title { color: var(--text); font-size: 18px; font-weight: 600; margin-bottom: 8px; }

/* ---------- Footer ---------- */
.app-footer {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ---------- Locale switcher (used by includes/locale-switcher.jspf) ---------- */
.locale-switcher { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted); }
.locale-switcher__option { color: var(--text-muted); padding: 4px 6px; border-radius: 6px; text-decoration: none; }
.locale-switcher__option.is-active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.locale-switcher__sep { opacity: .5; }

/* ---------- Filter bar ---------- */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 12px 16px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

.filter-pill {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    max-width: 100%;
}

.filter-bar .btn { margin-left: auto; }

/* ---------- Utility ---------- */
.muted { color: var(--text-muted); }
.text-right { text-align: right; }
.flex-spacer { flex: 1 1 auto; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.hide-mobile { display: none; }
@media (min-width: 768px) { .hide-mobile { display: initial; } .hide-desktop { display: none; } }

/* ---------- Editor card (signature urenstaat layout) ---------- */
.editor-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 20px;
}

.editor-card__header {
    background: var(--brand-500);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.editor-card__title { font-size: 16px; font-weight: 600; line-height: 1.2; }
.editor-card__total {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.editor-card__body { padding: var(--card-pad-mobile); }
@media (min-width: 768px) { .editor-card__body { padding: var(--card-pad-desktop); } }

.editor-card__project {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    padding: 0;
    margin: 0 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: default;
    text-align: left;
    width: 100%;
}

.editor-card__project i { color: var(--text-muted); font-size: 16px; }

.editor-card__notes {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    min-height: 64px;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
}

.editor-card__notes:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
}

/* ---------- Section head (label + 3-dot menu) ---------- */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 6px;
}

.section-head__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.section-head__menu {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
}

.section-head__menu:hover { background: var(--bg); color: var(--text); }

/* ---------- Bottom mobile app bar (5 icons) ---------- */
.appbar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-around;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 4px env(safe-area-inset-bottom, 6px);
    z-index: 25;
}

.appbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 6px 4px;
    min-width: 56px;
    flex: 1 1 0;
    text-align: center;
}

.appbar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    line-height: 1;
}

.appbar__item.is-active { color: var(--text); }
.appbar__item.is-active .appbar__icon {
    background: var(--brand-500);
    color: #fff;
}

.appbar__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-600);
    font-weight: 700;
    font-size: 13px;
}

.appbar__label { line-height: 1.1; }

@media (min-width: 992px) { .appbar { display: none; } }

/* ---------- Week section header (admin tables) ---------- */
.week-head {
    background: var(--brand-500);
    color: #fff;
    padding: 8px 14px;
    font-weight: 600;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 6px;
}

.week-head__label { font-size: 14px; font-weight: 600; }
.week-head__range { font-size: 12px; opacity: .92; font-weight: 500; }

.table tr.week-head {
    display: table-row;
    margin: 0;
    padding: 0;
    border-radius: 0;
}

.table tr.week-head th {
    background: var(--brand-500);
    color: #fff;
    padding: 8px 14px;
    border: 0;
}

.table tr.week-head th .week-head__label,
.table tr.week-head th .week-head__range {
    display: inline-block;
}

.table tr.week-head th .week-head__range {
    float: right;
}

.week-table { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; margin-bottom: 24px; }
.week-table .table { box-shadow: none; }

/* ---------- Document card (printed/preview reports) ---------- */
.doc-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 20px;
}

@media (min-width: 768px) { .doc-card { padding: 40px 48px; } }

.doc-card__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.doc-card__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 20px;
}

.doc-card__meta { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.doc-card__meta strong { color: var(--text); }

.doc-card__title { font-size: 28px; font-weight: 700; margin: 0 0 12px; }

.doc-card__top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.doc-card__logo {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--brand-500);
    color: #fff;
    font-size: 14px;
}

.doc-card__info {
    background: var(--info-box);
    border-radius: var(--radius-input);
    padding: 16px 18px;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 24px;
    max-width: 520px;
    margin: 18px 0;
    font-size: 14px;
}

.doc-card__info dt { color: var(--text-muted); }
.doc-card__info dd { margin: 0; font-weight: 600; color: var(--text); }

.info-box {
    background: var(--info-box);
    border-radius: var(--radius-input);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 24px;
    font-size: 14px;
}

.info-box__label { color: var(--text-muted); }
.info-box__value { color: var(--text); font-weight: 500; }

/* ---------- Materials section (employee hours form) ---------- */
.materials-section { margin-top: 16px; }

.materials-grid {
    display: grid;
    gap: 12px;
}

.material-row {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    padding: 12px;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .material-row {
        grid-template-columns: 2fr 1fr 1fr 1fr 80px 80px;
    }
}

.material-row .field { margin-bottom: 0; }

.material-row__remove {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--danger);
    border-radius: var(--radius-input);
    height: 40px;
    cursor: pointer;
    align-self: end;
    font-size: 13px;
    width: 100%;
}

.material-row__remove:hover { background: #fee2e2; border-color: #fca5a5; }

.last-used-launcher {
    margin: 8px 0 16px;
}

.last-used-launcher__button {
    width: 100%;
    justify-content: center;
}

.last-used-panel {
    background: var(--info-box);
    border-radius: var(--radius-input);
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.last-used-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.last-used-panel__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
    text-transform: none;
}

.last-used-panel__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 0;
}

.last-used-panel__close:hover {
    color: var(--text);
}

.last-used-client {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.last-used-client__name {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.last-used-client__grid {
    display: grid;
    grid-template-columns: minmax(70px, max-content) 1fr;
    gap: 6px 12px;
    margin: 0;
}

.last-used-client__grid dt {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.last-used-client__grid dd {
    margin: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.last-used-client__empty,
.last-used__empty {
    color: var(--text-muted);
    font-size: 13px;
}

.last-used-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.last-used-panel .last-used__item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
}

.last-used__product {
    font-weight: 700;
    line-height: 1.25;
}

.last-used__meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.last-used__quantity {
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.last-used__reuse {
    height: 34px;
    padding: 0 12px;
}

@media (max-width: 575px) {
    .last-used-panel .last-used__item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .last-used__quantity {
        white-space: normal;
    }
}

/* ---------- Detail tabs (admin client detail) ---------- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}

.tabs__tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 10px 14px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.tabs__tab.is-active {
    color: var(--text);
    border-bottom-color: var(--brand-500);
}

.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; }

/* ---------- Big primary actions on mobile dashboard ---------- */
.primary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.primary-actions .btn {
    height: 56px;
    font-size: 16px;
    border-radius: 14px;
}

@media (min-width: 768px) {
    .primary-actions { grid-template-columns: repeat(2, max-content); }
    .primary-actions .btn { padding-left: 28px; padding-right: 28px; }
}

/* ---------- Field grid ---------- */
.field-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .field-grid--2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Segmented picker (off-day reasons) ---------- */
.segmented {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

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

.segmented__option {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    padding: 14px 12px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    min-height: 48px;
    text-align: center;
}

.segmented input:checked + .segmented__option {
    border-color: var(--brand-500);
    background: var(--brand-50);
    color: var(--brand-600);
    font-weight: 600;
}

.segmented input:focus-visible + .segmented__option {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .25);
}

/* ---------- Auth misc ---------- */
.auth-card__body p { margin: 0 0 16px; line-height: 1.5; }

/* ---------- Responsive table (admin all-hours, all-offdays) ---------- */
.table--responsive { display: block; width: 100%; }
.table--responsive thead { display: none; }
.table--responsive tbody { display: block; }
.table--responsive tr {
    display: block;
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    margin-bottom: 12px;
    padding: 12px 16px;
    border: 0;
}
.table--responsive td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; font-size: 14px; }
.table--responsive td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 12px;
}

@media (min-width: 768px) {
    .table--responsive { display: table; }
    .table--responsive thead { display: table-header-group; }
    .table--responsive tbody { display: table-row-group; }
    .table--responsive tr { display: table-row; background: transparent; box-shadow: none; margin: 0; padding: 0; }
    .table--responsive td { display: table-cell; padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .table--responsive td::before { content: none; }
}

/* ---------- Topbar mobile collapse (ROADMAP-72/73) ---------- */
.topbar__brand-text {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    /* hidden < 768px to keep mobile topbar compact */
    display: none;
}
@media (min-width: 768px) { .topbar__brand-text { display: inline; } }
.topbar__user .topbar__avatar { width: 32px; height: 32px; font-size: 13px; }

.offcanvas__locale {
    padding: 8px 14px;
}

/* ---------- Week selector (ROADMAP-67, UI-Guide component I) ---------- */
.week-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg);
    border-radius: 999px;
    padding: 4px;
    margin: 0 8px;
}

.week-selector__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
}
.week-selector__nav:hover { background: var(--surface); text-decoration: none; }
.week-selector__nav:focus-visible { outline: 2px solid rgba(34, 197, 94, .5); outline-offset: 2px; }

.week-selector__label {
    appearance: none;
    background: var(--surface);
    border: 0;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    line-height: 1.2;
    min-height: 32px;
}
.week-selector__label:hover { background: var(--brand-50); color: var(--brand-600); }
.week-selector__label:focus-visible { outline: 2px solid rgba(34, 197, 94, .5); outline-offset: 2px; }

.week-selector__quick {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface);
    border-radius: 999px;
    padding: 2px 4px 2px 10px;
    min-height: 32px;
}

.week-selector__prefix {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.week-selector__input {
    width: 48px;
    min-height: 30px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    padding: 4px 6px;
    font-variant-numeric: tabular-nums;
}

.week-selector__input:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
}

.week-selector__go,
.week-selector__more {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    min-width: 30px;
    min-height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 7px;
}

.week-selector__go {
    color: #fff;
    background: var(--brand-500);
}

.week-selector__go:hover { background: var(--brand-600); }
.week-selector__more:hover { background: var(--brand-50); color: var(--brand-600); }
.week-selector__go:focus-visible,
.week-selector__more:focus-visible { outline: 2px solid rgba(34, 197, 94, .5); outline-offset: 2px; }

.week-selector__week { font-variant-numeric: tabular-nums; }
.week-selector__year { color: var(--text-muted); font-weight: 500; font-variant-numeric: tabular-nums; }

.week-selector__pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-pop);
    padding: 16px;
    width: min(280px, calc(100vw - 32px));
    z-index: 50;
}
.week-selector__pop[hidden] { display: none; }

.week-selector__form { display: flex; flex-direction: column; gap: 10px; }
.week-selector__form .field__label { margin: 4px 0 2px; font-size: 13px; }
.week-selector__form .input { width: 100%; }

.week-selector__reset {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 6px 4px 0;
    text-decoration: none;
}
.week-selector__reset:hover { color: var(--brand-600); text-decoration: underline; }

@media (max-width: 767.98px) {
    .topbar { flex-wrap: wrap; padding-bottom: 0; row-gap: 0; }
    .week-selector {
        order: 10;
        flex: 0 0 100%;
        justify-content: center;
        margin: 0;
        border-radius: 0;
        border-top: 1px solid var(--border);
        background: var(--surface);
        padding: 4px 0;
    }
    .week-selector__nav { width: 44px; height: 44px; }
    .week-selector__label { min-height: 44px; padding: 6px 16px; }
    .week-selector__quick {
        min-height: 44px;
        padding: 4px 6px 4px 12px;
    }
    .week-selector__input {
        min-height: 36px;
        width: 54px;
    }
    .week-selector__go,
    .week-selector__more {
        min-width: 36px;
        min-height: 36px;
    }
    .filter-bar .btn {
        flex: 1 1 100%;
        margin-left: 0;
        white-space: normal;
    }
    .page-header__actions,
    .row-actions,
    .report-panel__actions {
        width: 100%;
    }
    .page-header__actions .btn,
    .row-actions .btn,
    .report-panel__actions .btn {
        flex: 1 1 auto;
        white-space: normal;
    }
}

/* ---------- Radio group (off-day full/half toggle) ---------- */
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    cursor: pointer;
    min-height: 44px;
    padding: 0 4px;
}
.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-500);
    cursor: pointer;
    flex-shrink: 0;
}

/* ---------- Week card (ROADMAP-68, UI-Guide component H) ---------- */
.employee-week-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.employee-week-summary__primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.employee-week-summary__eyebrow {
    margin: 0 0 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.employee-week-summary__total {
    color: var(--text);
    font-size: 36px;
    line-height: 1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.employee-week-summary__unit {
    margin-left: 6px;
    color: var(--text-muted);
    font-weight: 600;
}

.employee-week-summary__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.employee-week-metric {
    min-height: 96px;
    padding: 16px;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.employee-week-metric__label {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.employee-week-metric__value {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
    .employee-week-summary {
        grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
        align-items: stretch;
    }

    .employee-week-summary__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .employee-week-summary__primary {
        align-items: flex-start;
        flex-direction: column;
    }

    .employee-week-summary__primary .btn {
        width: 100%;
    }
}

.week-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 28px;
}

/* When a week-card sits inside a card__body, bleed it to the card edges.
   The outer .card { overflow: hidden } clips the green header to the card's radius. */
.card__body > .week-card {
    margin: -20px -20px 20px;
    border-radius: 0;
    box-shadow: none;
}
@media (min-width: 768px) {
    .card__body > .week-card {
        margin: -28px -28px 20px;
    }
}

.week-card__header {
    background: var(--brand-500);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.week-card__title { font-size: 16px; font-weight: 600; }
.week-card__total { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.week-card__body { padding: 20px; }
@media (min-width: 768px) { .week-card__body { padding: 28px; } }

.week-card__project {
    appearance: none;
    background: var(--info-box);
    border: 0;
    border-radius: var(--radius-input);
    color: var(--text);
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.week-card__project:hover { background: var(--bg); text-decoration: none; }
.week-card__project i { color: var(--text-muted); }

.week-card__project--summary {
    cursor: default;
}

.week-card__project--summary:hover {
    background: var(--info-box);
}

.week-card__project--summary strong {
    font-variant-numeric: tabular-nums;
}

.week-card__project--summary span[aria-hidden] {
    display: none;
}

.week-card__notes {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    padding: 10px 12px;
    min-height: 64px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    margin-top: 8px;
}

.week-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

/* ---------- Section head (UI-Guide component C) ---------- */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    margin-bottom: 4px;
}
.section-head__label { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.section-head__menu {
    appearance: none;
    background: none;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
}
.section-head__menu:hover { background: var(--bg); }

/* ---------- Modal / mobile sheet (ROADMAP-76b) ---------- */
.modal-sheet__backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .4);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease-out;
    z-index: 60;
}
.modal-sheet__backdrop.is-open { opacity: 1; pointer-events: auto; }

.modal-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    box-shadow: var(--shadow-pop);
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease-out, opacity .2s ease-out;
    z-index: 70;
    max-height: 92vh;
    overflow-y: auto;
}
.modal-sheet.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }

.modal-sheet__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-sheet__title { font-size: 18px; font-weight: 600; }
.modal-sheet__close {
    appearance: none; background: none; border: 0;
    font-size: 24px; line-height: 1; color: var(--text-muted); cursor: pointer;
}
.modal-sheet__body { padding: 20px; }
.modal-sheet__footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

@media (min-width: 576px) {
    .modal-sheet {
        left: 50%; right: auto; bottom: auto;
        top: 50%;
        transform: translate(-50%, calc(-50% + 16px));
        width: min(520px, calc(100vw - 32px));
        border-radius: var(--radius-card);
        max-height: 80vh;
    }
    .modal-sheet.is-open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
}

.inline-client-panel {
    margin-top: -6px;
    margin-bottom: 16px;
}
.inline-client-panel__summary {
    width: fit-content;
    list-style: none;
    cursor: pointer;
}
.inline-client-panel__summary::-webkit-details-marker { display: none; }
.inline-client-panel[open] .inline-client-panel__summary { margin-bottom: 10px; }
.inline-client-panel__body {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    padding: 16px;
}
.inline-client-panel__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}
.inline-client-panel__footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    background: var(--surface);
    padding: 12px 16px;
}

/* ---------- Multi-select chips (ROADMAP-75b) ---------- */
.chip-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--brand-50); color: var(--brand-600);
    font-size: 13px; font-weight: 500;
}
.chip__remove {
    appearance: none; border: 0; background: none;
    color: var(--brand-600); cursor: pointer; padding: 0; font-size: 14px; line-height: 1;
}

.report-bulk-bar {
    display: none;
    position: sticky; top: 56px; z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
    padding: 10px 16px;
    gap: 8px; align-items: center;
    margin-bottom: 8px;
}
.report-bulk-bar.is-selecting { display: flex; }
.report-bulk-bar__count { color: var(--text-muted); font-size: 13px; margin-right: auto; }

/* ---------- Urenstaat-style reports + signatures ---------- */
.report-workspace { display: grid; gap: 20px; }

.filter-bar--reports {
    align-items: end;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
}

.filter-bar--reports .btn { margin-left: 0; }

.filter-pill--static {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    min-width: 120px;
}

.filter-pill--multi {
    min-width: 180px;
    max-width: 230px;
    overflow: hidden;
}

.export-menu {
    position: relative;
    margin-left: auto;
}

.export-menu__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.export-menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 190px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    box-shadow: var(--shadow-pop);
    padding: 8px;
    display: none;
    z-index: 30;
}

.export-menu__panel.is-open { display: grid; }

.export-menu__panel button {
    appearance: none;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.export-menu__panel button:hover { background: var(--bg); }

.doc-sign-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.doc-card--preview {
    margin-bottom: 0;
    min-height: 260px;
}

.signature-panel {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
}

.signature-panel__canvas {
    width: 100%;
    height: 150px;
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    background: #fff;
    touch-action: none;
}

.signature-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.signature-pad {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
}

.signature-pad__canvas,
.signature-pad__image {
    width: 100%;
    min-height: 150px;
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    background: #fff;
    touch-action: none;
    object-fit: contain;
}

.weekly-doc .doc-card { margin-bottom: 0; }

@media print {
    .signature-pad .field,
    .signature-pad__actions,
    .signature-pad canvas,
    .signature-pad [data-signature-error] { display: none !important; }
    .signature-pad { box-shadow: none; border: 1px solid var(--border); }
}

.tbl-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    background: var(--surface);
}

.table-wrap .table {
    margin-bottom: 0;
    box-shadow: none;
    min-width: 880px;
}

.report-table th,
.report-table td {
    font-size: 13px;
    white-space: nowrap;
}

.report-table__summary td {
    background: var(--info-box);
    color: var(--text-muted);
    font-weight: 600;
}

.report-panel {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px;
    margin-bottom: 24px;
}

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

.report-panel__title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
}

.report-panel__grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.report-panel__checks {
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.report-panel__checks legend {
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.report-panel__checks label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    font-size: 14px;
}

.report-panel__range {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 12px 0;
}

.report-panel__actions { margin-top: 0; flex-wrap: wrap; }

@media (min-width: 900px) {
    .doc-sign-layout {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    }

    .report-panel__range {
        grid-template-columns: max-content 1fr max-content 1fr;
        align-items: center;
    }
}

@media (max-width: 575px) {
    .export-menu {
        width: 100%;
        margin-left: 0;
    }

    .export-menu__button,
    .export-menu__panel {
        width: 100%;
    }

    .filter-pill--multi {
        width: 100%;
        max-width: none;
    }

    .doc-card__top {
        display: grid;
    }
}

/* ---------- Print ---------- */
@media print {
    .topbar, .offcanvas, .offcanvas__backdrop, .appbar, .app-footer, .menu-toggle, .filter-bar, .week-selector, .report-bulk-bar { display: none !important; }
    body { background: #fff; }
    .doc-card { box-shadow: none; padding: 0; }
}

/* ROADMAP-77b: visually-hidden helper for accessible labels */
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* Final safety override: a closed sheet must be truly invisible on every viewport. */
.modal-sheet:not(.is-open),
.modal-sheet__backdrop:not(.is-open) {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}
.modal-sheet.is-open,
.modal-sheet__backdrop.is-open {
    visibility: visible !important;
}

/* Final table safety: section header rows should span the whole card, not shrink to text. */
.table:not(.table--responsive) {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
}
.table:not(.table--responsive) thead,
.table:not(.table--responsive) tbody {
    width: 100%;
}

/* ---------- Assignment widgets (admin employee/client detail) ---------- */
.assign-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 20px;
    align-items: center;
    min-height: 32px;
}

.assign-pills__empty {
    font-size: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 4px 6px 4px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.pill__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.pill__remove {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    padding: 0 6px;
    cursor: pointer;
    border-radius: 999px;
    opacity: 0.7;
}
.pill__remove:hover {
    background: rgba(6, 95, 70, 0.12);
    opacity: 1;
}

.assign-search {
    position: relative;
    margin-bottom: 8px;
}

.assign-search__results {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-input, 10px);
    background: var(--surface, #fff);
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
}

.assign-search__result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 14px;
}
.assign-search__result:last-child {
    border-bottom: 0;
}
.assign-search__result:hover,
.assign-search__result:focus-visible {
    background: #f8fafc;
    outline: none;
}

.assign-search__name {
    font-weight: 600;
    color: var(--text, #0f172a);
}

.assign-search__meta {
    font-size: 12px;
}

.assign-search__empty {
    margin-top: 8px;
    font-size: 14px;
}
