html, body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', Roboto, sans-serif;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

h1:focus {
    outline: none;
}

/* ===== Admin shell (Layout/MainLayout.razor) ===== */
:root { --line: #E2E8F0; --muted: #64748B; --navy: #0F172A; --sky: #0369A1; }

/* topbar */
.admin .topbar { border-bottom: 1px solid var(--line); }
.admin .topbar .mud-toolbar { gap: .5rem; padding-inline: 12px; }
.crumb { display: flex; align-items: center; gap: .25rem; font-size: .8125rem; color: var(--muted); min-width: 0; }
.crumb b { color: var(--navy); font-weight: 600; white-space: nowrap; }
.tb-chip { display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .65rem; max-width: 240px;
           border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer;
           transition: border-color .15s, background-color .15s; }
.tb-chip:hover { border-color: #93C5FD; background: #F8FAFC; }
.tb-chip.static { cursor: default; }
.tb-chip.static:hover { border-color: var(--line); background: #fff; }
.tb-chip .mud-icon-root { color: var(--muted); }
.tb-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-user { display: inline-flex; align-items: center; gap: .55rem; padding: 3px 8px 3px 3px; border: 0; border-radius: 999px; background: none; font: inherit; cursor: pointer; transition: background-color .15s; }
.tb-user:hover { background: #F1F5F9; }
.tb-user .avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff;
                   background: linear-gradient(135deg, #0EA5E9, #0369A1); }
.tb-user-text { flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.tb-user-text b { font-size: .8125rem; color: var(--navy); }
.tb-user-text small { font-size: .7rem; color: var(--muted); }
.tb-chip:focus-visible, .tb-user:focus-visible { outline: 2px solid #38BDF8; outline-offset: 2px; }

/* sidebar */
.admin .sidebar { border-right: 0; }
.sidebar-brand { display: flex; align-items: center; height: 56px; padding: 0 16px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-nav { padding: 8px 8px 16px; }
.nav-section { padding: 14px 10px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #64748B; }
.admin .sidebar .mud-nav-link { border-radius: 8px; padding: 7px 10px; margin: 1px 0; font-size: .8125rem; font-weight: 500; color: #CBD5E1;
                                transition: background-color .15s, color .15s; }
.admin .sidebar .mud-nav-link:hover:not(.active) { background: rgba(255,255,255,.06); color: #fff; }
.admin .sidebar .mud-nav-link .mud-nav-link-icon { width: 20px; height: 20px; margin-right: 10px; color: #94A3B8; }
.admin .sidebar .mud-nav-link.active:not(.mud-nav-link-disabled) { background: rgba(56,189,248,.14) !important; color: #fff !important; font-weight: 600; box-shadow: inset 3px 0 0 #38BDF8; }
.admin .sidebar .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon { color: #38BDF8 !important; }
.admin .sidebar .mud-nav-link:focus-visible { outline: 2px solid #38BDF8; outline-offset: -2px; }

/* content + screen transition */
.admin .main { min-height: 100dvh; }
.page { padding: 16px 20px 32px; max-width: 1600px; animation: page-in .18s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }
@media (max-width: 600px) { .page { padding: 12px 12px 24px; } }

/* ===== Compact components (all app screens) ===== */
.admin .mud-paper.mud-elevation-1, .admin .mud-table.mud-elevation-1, .admin .mud-tabs.mud-elevation-1 { box-shadow: none; border: 1px solid var(--line); }
.admin .mud-card { box-shadow: none; border: 1px solid var(--line); }
.admin .page > .mud-typography-h5:first-child, .admin .page > .mud-stack:first-child .mud-typography-h5 { margin-bottom: 12px !important; }

/* tables: tight rows, quiet header */
.admin .mud-table-head .mud-table-cell { background: #F8FAFC; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 8px 12px; white-space: nowrap; }
.admin .mud-table-body .mud-table-cell { padding: 7px 12px; font-size: .8125rem; }
.admin .mud-table-dense .mud-table-body .mud-table-cell { padding: 5px 12px; }
.admin .mud-table-hover .mud-table-body .mud-table-row { cursor: pointer; transition: background-color .12s; }
.admin .mud-simple-table table td, .admin .mud-simple-table table th { padding: 6px 12px; font-size: .8125rem; }

/* inputs, buttons, alerts, tabs */
.admin .mud-input-control { margin-top: 4px; }
.admin .mud-button-root { border-radius: 8px; }
.admin .mud-button-filled { box-shadow: none !important; }
.admin .mud-alert { padding: 6px 12px; font-size: .8125rem; }
.admin .mud-tab { min-height: 42px; text-transform: none; font-weight: 600; font-size: .8125rem; }
.admin .mud-chip { font-size: .72rem; height: 22px; }

/* reusable helpers for pages */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.toolbar > .tb-grow { flex: 1 1 220px; min-width: 0; }
.toolbar > .tb-fixed { flex: 0 1 180px; min-width: 140px; }
.list-card { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.list-card:last-child { border-bottom: 0; }
.list-card .tb-grow { flex: 1 1 260px; min-width: 0; }
.muted { color: var(--muted); }








#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.toolbar .mud-input-control { margin: 0; }

/* ===== Forms & detail pages ===== */
.emp-head { position: sticky; top: 56px; z-index: 5; display: flex; align-items: center; gap: 8px; margin: -16px -20px 12px; padding: 10px 20px;
            background: rgba(241,245,249,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.emp-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; flex: 1; }
.emp-title .mud-typography-h5 { margin: 0 !important; }
.emp-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 600px) { .emp-head { margin: -12px -12px 10px; padding: 8px 12px; } }

.form-section { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 2px; }
.form-section:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; align-items: end; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 520px) { .form-grid .span-2 { grid-column: auto; } }
.resign-box { padding: 12px; margin-bottom: 12px; border: 1px solid #FECACA; background: #FEF2F2; border-radius: 8px; }
.upload-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
              background: #fff; font-size: .8125rem; font-weight: 600; color: var(--sky); cursor: pointer; transition: border-color .15s, background-color .15s; }
.upload-btn:hover { border-color: #93C5FD; background: #F8FAFC; }
.upload-btn:focus-within { outline: 2px solid #38BDF8; outline-offset: 2px; }

/* ===== List rows (approvals etc.) ===== */
.row-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--sky); background: #E0F2FE; }
.row-actions { display: flex; gap: 4px; flex: none; margin-left: auto; }
.list-card { transition: background-color .15s; }
.list-card:hover { background: #F8FAFC; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 600; color: #075985; background: #E0F2FE; vertical-align: 1px; }
.small { font-size: .78rem; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 12px; color: #94A3B8; font-size: .8125rem; }
.empty-state .mud-icon-root { font-size: 2rem; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.zero { color: #CBD5E1; }
.warn-text { color: #B45309; font-weight: 600; }
.err-text { color: #DC2626; font-weight: 600; }

/* ===== Timesheet ===== */
.month-nav { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.month-nav b { font-size: .8125rem; min-width: 104px; text-align: center; }
.admin .row-selected .mud-table-cell { background: #E0F2FE !important; }
.detail-drawer { top: 0 !important; height: 100dvh !important; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.detail-body { overflow: auto; flex: 1; }
.detail-body .day-off td { background: #F8FAFC; color: #94A3B8; }
.admin .mud-table-cell.zero, .admin td.zero { color: #CBD5E1; }
.admin .mud-table-cell.warn-text { color: #B45309; }
.admin .mud-table-cell.err-text, .admin td.err-text { color: #DC2626; }
.admin .mud-drawer.detail-drawer { background: #fff; color: var(--navy); }
.admin .mud-drawer.detail-drawer .mud-icon-button { color: var(--muted); }

/* ===== Punch ===== */
.punch-wrap { max-width: 480px; margin: 0 auto; }
.punch-card { text-align: center; padding: 20px 16px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.punch-clock { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.punch-clock small { font-size: 1.25rem; color: #94A3B8; font-weight: 600; }
.punch-today { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 12px; }
.punch-today div { padding: 8px; border-radius: 8px; background: #F8FAFC; border: 1px solid var(--line); }
.punch-today small { display: block; font-size: .72rem; color: var(--muted); }
.punch-today b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.selfie-btn { width: 100%; justify-content: center; height: 40px; margin-bottom: 10px; }
.selfie-btn.done { color: #059669; border-color: #A7F3D0; background: #ECFDF5; }
.admin .punch-btn { height: 56px; font-size: 1.05rem; border-radius: 12px; }
.punch-log { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.list-card.voided { opacity: .55; text-decoration: line-through; }
.tag.warn { color: #92400E; background: #FEF3C7; }

/* ===== Requests ===== */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stat-strip > div { padding: 10px 14px; border-right: 1px solid var(--line); }
.stat-strip > div:last-child { border-right: 0; }
.stat-strip small { display: block; font-size: .72rem; color: var(--muted); }
.stat-strip b { font-size: 1.15rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat-strip .hl { background: #ECFDF5; }
.stat-strip .hl b { color: #059669; }
.split { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 20px; align-items: start; }
.split-list { border: 1px solid var(--line); border-radius: 10px; min-height: 120px; }
.split-list > .form-section { margin: 0; padding: 10px 12px 6px; border-bottom: 1px solid var(--line); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.status { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 600; color: #475569; background: #F1F5F9; vertical-align: 1px; }
.status.pending { color: #92400E; background: #FEF3C7; }
.status.ok { color: #065F46; background: #D1FAE5; }
.status.bad { color: #991B1B; background: #FEE2E2; }

/* ===== Review / Shifts ===== */
.admin .row-voided .mud-table-cell { color: #94A3B8; }
.admin .row-voided .strike { text-decoration: line-through; }
.admin .row-flagged .mud-table-cell:first-child { box-shadow: inset 3px 0 0 #F59E0B; }
.days { display: inline-flex; gap: 3px; }
.days i { font-style: normal; font-size: .68rem; font-weight: 600; width: 24px; text-align: center; padding: 2px 0; border-radius: 4px; color: #CBD5E1; background: #F8FAFC; }
.days i.on { color: #075985; background: #E0F2FE; }
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.day-picker button { width: 44px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: .8125rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s; }
.day-picker button.on { background: var(--sky); border-color: var(--sky); color: #fff; }
.day-picker button:focus-visible { outline: 2px solid #38BDF8; outline-offset: 2px; }

.items-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .items-layout { grid-template-columns: 1fr; } }
.form-errors { color: var(--mud-palette-error); margin: 8px 0; }
.form-errors div { padding: 2px 0; }
.admin .row-error .mud-table-cell { background: #FEF2F2 !important; }

/* ===== Help page + install button ===== */
.help { max-width: 860px; }
.help ol, .help ul { margin: .25rem 0 .75rem; padding-left: 1.25rem; line-height: 1.6; }
.help code { background: #F1F5F9; padding: 1px 5px; border-radius: 4px; font-size: .8125rem; word-break: break-word; }
.help table code { white-space: normal; }
.pwa-btn { white-space: nowrap; }
