:root {
    color-scheme: light;
    --page: #edf3ff;
    --paper: #ffffff;
    --ink: #182a48;
    --muted: #4e6180;
    --line: #d4dfef;
    --accent: #2758b5;
    --accent-strong: #20458d;
    --accent-soft: #e0eaff;
    --gold: #8b510f;
    --gold-soft: #fff1da;
    --danger: #a13632;
    --danger-soft: #fff1ee;
    --shadow: 0 15px 35px -24px #3c579365, inset 0 1px 0 #fff;
    --glass: linear-gradient(145deg, #fffffff5, #f8fbffd4);
    --radius: 21px;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 2% 6%, #dceaff 0, transparent 47%),
        radial-gradient(ellipse at 94% 26%, #e5dfff 0, transparent 51%),
        radial-gradient(ellipse at 49% 84%, #ddf4f8 0, transparent 52%),
        linear-gradient(155deg, #f5f8ff, var(--page));
    color: var(--ink);
}
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.22; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #4273cb; outline-offset: 3px; }

.container { width: min(100% - 64px, 1080px); margin-inline: auto; }
.app-main { padding-block: 42px 64px; }
.site-header {
    border-bottom: 1px solid #ffffffd6;
    background: #f7faffbf;
    box-shadow: 0 5px 25px -20px #3e5f97aa;
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
}
.header-inner { display: flex; align-items: center; min-height: 70px; gap: 34px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 760; }
.trial-tag { border: 1px solid var(--line); border-radius: 20px; padding: 2px 7px; color: var(--muted); font-size: .68rem; font-weight: 650; white-space: nowrap; }
.brand-icon { display: block; width: 42px; height: 42px; border: 1px solid #fff; border-radius: 13px; box-shadow: 0 5px 12px #5071b42c; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.nav-link { border-radius: 20px; padding: 8px 13px; color: var(--muted); font-size: .9rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.nav-link:hover { background: var(--page); color: var(--ink); }
.nav-link.is-current { background: linear-gradient(140deg, #fff, #e3edff); box-shadow: 0 2px 8px #456aac21; color: var(--accent-strong); }
.header-account { display: flex; align-items: center; gap: 11px; min-width: 0; margin-left: auto; }
.account-id { max-width: 12em; overflow: hidden; color: var(--muted); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 3; transform: translateY(-200%); background: var(--paper); padding: 10px; }
.skip-link:focus { transform: none; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -.035em; }
.page-heading p { margin-top: 7px; }
.section-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.section-heading h2, .recent-card h2 { font-size: 1.08rem; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: .8rem; font-weight: 750; }
.surface { border: 1px solid #ffffffea; border-radius: var(--radius); background: var(--glass); box-shadow: var(--shadow); }
.stack { display: grid; gap: 14px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 36px 20px; text-align: center; }

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: .9rem;
    font-weight: 740;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s, border-color .15s;
}
.btn-primary { background: linear-gradient(150deg, #386bca, var(--accent-strong)); color: var(--paper); box-shadow: 0 6px 14px -8px #20458d; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { border-color: var(--line); background: #ffffffa8; color: var(--ink); }
.btn-secondary:hover { border-color: #a4b9e1; background: var(--page); }
.btn-quiet { background: transparent; color: var(--accent-strong); }
.btn-quiet:hover { background: var(--page); }
.btn-danger { border-color: #ecc2bc; background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fce3df; }
.btn-small { min-height: 36px; padding: 6px 11px; font-size: .83rem; }
.btn-wide { width: 100%; }
.btn:disabled, .btn[aria-disabled='true'], button.away-option:disabled { cursor: default; opacity: .65; }

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    border-radius: 50px;
    background: #edf2fa;
    padding: 3px 9px;
    color: #50607a;
    font-size: .75rem;
    font-weight: 740;
    white-space: nowrap;
}
.pill-success { background: var(--accent-soft); color: var(--accent-strong); }
.pill-warning { background: var(--gold-soft); color: var(--gold); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.message-list { display: grid; gap: 8px; margin: 0 0 20px; }
.notice, .punch-status:not(:empty) { border: 1px solid #c9dcd1; border-radius: 10px; background: #eaf4ef; padding: 10px 13px; color: #154f40; }
.notice.error, .punch-status[data-state='error'] { border-color: #ecc2bc; background: var(--danger-soft); color: var(--danger); }
.notice.warning { border-color: #ead5b1; background: var(--gold-soft); color: var(--gold); }
.punch-status:not(:empty) { margin-top: 14px; }

.dashboard-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.clock-card {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 260px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid #fff;
    background: radial-gradient(ellipse at 105% 6%, #c4defe 0, transparent 67%),
                linear-gradient(135deg, #f8fbff, #dfe6ff 69%, #d7eef7);
    color: var(--ink);
    box-shadow: var(--shadow);
}
.clock-card::before, .clock-card::after {
    position: absolute;
    z-index: -1;
    right: -82px;
    bottom: -151px;
    width: 352px;
    aspect-ratio: 1;
    border: 1px solid #ffffffbe;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff40, #8badf41c 60%, #ffffff60);
    box-shadow: inset 0 3px 10px #fff9, 0 9px 28px #526ba51d;
    content: '';
}
.clock-card::after { right: -111px; bottom: -180px; width: 410px; border-color: #ffffff7a; }
.clock-card-inner { display: flex; width: 100%; flex-direction: column; justify-content: center; padding: 27px 31px; }
.clock-zone { display: flex; align-items: center; gap: 8px; color: var(--accent-strong); font-size: .9rem; font-weight: 680; }
.clock-dot { width: 7px; height: 7px; border-radius: 50%; background: #447dd7; box-shadow: 0 0 0 4px #447dd725; }
.clock-face { display: block; margin: 9px 0 1px; font-size: clamp(2.9rem, 7.7vw, 5.35rem); font-style: normal; font-variant-numeric: tabular-nums; font-weight: 720; letter-spacing: -.065em; line-height: 1.16; }
.clock-date { color: var(--accent-strong); font-size: .98rem; }
.clock-footnote { margin-top: 22px; color: var(--muted); font-size: .77rem; }
.shift-card { display: grid; grid-template-rows: auto 1fr auto; gap: 14px; padding: 23px 25px; }
.shift-detail { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding-block: 6px; }
.shift-emphasis { font-size: 1.37rem; font-weight: 760; }
.shift-detail .muted { font-size: .87rem; }
.shift-actions { display: flex; gap: 8px; }
.shift-actions form { flex: 1; min-width: 0; }
.shift-actions .btn { min-height: 46px; }
.break-timer { width: fit-content; border-radius: 7px; background: var(--accent-soft); padding: 3px 8px; color: var(--accent-strong); font-size: .78rem; font-variant-numeric: tabular-nums; font-weight: 750; }
.break-timer.is-overdue { background: var(--gold-soft); color: var(--gold); }

.away-section { margin-top: 28px; }
.away-heading { margin-bottom: 12px; }
.away-heading p { margin-top: 4px; font-size: .85rem; }
.away-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.away-option { display: flex; width: 100%; min-height: 82px; align-items: center; gap: 12px; border: 1px solid #fff; border-radius: 17px; background: var(--glass); padding: 13px 15px; color: var(--ink); text-align: left; }
button.away-option:hover { border-color: #a6bce4; background: #fbfdff; }
.away-unavailable { background: #f4f7fcab; color: var(--muted); }
.away-label { display: grid; row-gap: 2px; }
.away-label strong { font-size: .92rem; }
.away-label > span { color: var(--muted); font-size: .8rem; }
.away-icon { position: relative; display: block; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.away-icon::before, .away-icon::after { position: absolute; content: ''; }
.away-icon-smoke_rest::before { inset: 11px 13px; border-inline: 3px solid currentColor; border-radius: 2px; }
.away-icon-restroom::before { top: 10px; left: 17px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.away-icon-restroom::after { top: 18px; left: 14px; width: 12px; height: 13px; border-top: 3px solid currentColor; border-inline: 2px solid currentColor; border-radius: 4px 4px 2px 2px; }
.away-icon-meal::before { top: 10px; left: 10px; width: 20px; height: 20px; border: 2px solid currentColor; border-radius: 50%; }
.away-icon-meal::after { top: 15px; left: 15px; width: 10px; height: 10px; border: 1px solid currentColor; border-radius: 50%; }
.away-unavailable .away-icon { background: #e8eef9; color: #5b6c88; }

.recent-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 23px; padding: 18px 20px; }
.recent-card p { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; font-size: .86rem; }
.recent-kind { font-weight: 700; }
.recent-card .btn { flex: 0 0 auto; }

.history-list { display: grid; gap: 13px; }
.history-card { padding: 20px 22px; }
.history-punches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.history-punches > div { border-radius: 13px; background: #edf3ffa3; padding: 10px 12px; }
.history-punches dt { color: var(--muted); font-size: .78rem; }
.history-punches dd { margin-top: 4px; font-size: .94rem; font-variant-numeric: tabular-nums; font-weight: 710; }
.history-breaks { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 11px; font-size: .87rem; }
.history-breaks summary { width: fit-content; cursor: pointer; font-weight: 730; }
.history-breaks summary .muted { margin-left: 6px; font-weight: 500; }
.history-breaks ul { display: grid; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
.history-breaks li { display: flex; align-items: center; gap: 10px; border-radius: 10px; background: #f5f8ff; padding: 7px 10px; }
.history-breaks li strong { min-width: 6em; }
.history-interval { color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.history-empty .btn { margin-top: 6px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; color: var(--muted); font-size: .86rem; }
.attendance-record-heading { min-width: 0; overflow-wrap: anywhere; }
.attendance-record-heading p { margin-top: 4px; font-size: .85rem; }
.attendance-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 12px; padding: 16px; }
.attendance-filters .field { min-width: 0; }
.attendance-filter-employee { overflow-wrap: anywhere; }
.attendance-filter-errors { grid-column: 1 / -1; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field, .form-fields > div { display: grid; gap: 5px; }
.field label, .form-fields label { font-weight: 720; }
.field input:not([type='checkbox'], [type='radio']), .field select, .field textarea,
.form-fields input:not([type='checkbox'], [type='radio']), .form-fields select, .form-fields textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffffc9;
    padding: 8px 10px;
    color: var(--ink);
}
.form-fields { display: grid; gap: 13px; }
.helptext, .field-help { color: var(--muted); font-size: .82rem; }
.errorlist, .field-error { margin: 0; color: var(--danger); font-size: .85rem; }
.errorlist { padding-left: 18px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 10px 12px; }
.data-table thead th { background: #ecf2ffa8; color: var(--muted); font-size: .82rem; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .empty { display: table-cell; padding: 30px 12px; color: var(--muted); }

.account-panel { width: min(100%, 448px); margin: 24px auto 0; padding: 28px 30px; }
.account-page .app-main { position: relative; isolation: isolate; }
.account-page .app-main::before {
    position: absolute;
    z-index: -1;
    inset: 38px 4% auto;
    height: min(470px, 68vh);
    border: 1px solid #fff;
    border-radius: 45% 39% 48% 47% / 32% 40% 52% 49%;
    background: linear-gradient(135deg, #ffffffc7, #c0d8ff5e 46%, #d9c9fc6b 82%, #fff);
    box-shadow: inset 0 12px 27px #fff9, 0 22px 46px #607fbc16;
    transform: rotate(-6deg);
    content: '';
}
.account-page .account-panel { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.staff-form-panel { width: min(100%, 660px); }
.account-panel .page-heading { margin-bottom: 5px; }
.account-panel > .muted { font-size: .86rem; }
.admin-otp { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; color: var(--muted); font-size: .88rem; }
.admin-otp summary { cursor: pointer; font-weight: 710; }
.admin-otp .field { margin-top: 8px; }
.staff-heading { margin-bottom: 4px; }
.staff-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 6px; }
.staff-totals .surface { display: grid; gap: 5px; padding: 14px 16px; color: var(--muted); font-size: .86rem; }
.staff-totals strong { color: var(--ink); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.staff-filters { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) auto; align-items: end; gap: 12px; padding: 16px 16px 0; }
.staff-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.table-wrap .data-table { min-width: 665px; }
.batch-control { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.batch-control > .field { flex: 1 1 220px; }
.batch-control.surface, .batch-selection { padding: 16px; }
.table-wrap .batch-table { min-width: 360px; }
.batch-table td { overflow-wrap: anywhere; }
.batch-department input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--accent); }
.data-table .staff-actions .btn { min-height: 38px; padding: 6px 10px; white-space: nowrap; }
nav.staff-actions { justify-content: center; padding: 0 12px 12px; }
.staff-status-active { background: var(--accent-soft); color: var(--accent-strong); }
.staff-status-pending { background: var(--gold-soft); color: var(--gold); }
.staff-status-disabled { background: var(--danger-soft); color: var(--danger); }
.permission-options { margin: 0; border: 1px solid var(--line); border-radius: 14px; padding: 10px 13px; }
.permission-options legend { padding-inline: 5px; font-weight: 720; }
.permission-options label { display: flex; align-items: center; gap: 7px; min-height: 36px; }
.permission-options input { accent-color: var(--accent); }
.first-password-dialog {
    position: fixed;
    inset: 0;
    width: min(480px, calc(100% - 28px));
    max-height: calc(100% - 28px);
    margin: auto;
    padding: 25px;
    color: var(--ink);
}
.first-password-dialog::backdrop { background: #16294d59; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.first-password-dialog .page-heading { margin-bottom: 3px; }
.first-password-dialog h1 { font-size: 1.45rem; }

@media (max-width: 760px) {
    .container { width: calc(100% - 36px); }
    .header-inner { gap: 15px; }
    .app-main { padding-block: 28px 45px; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
    .clock-card { min-height: 208px; }
    .clock-card-inner { padding: 22px 24px; }
    .clock-footnote { margin-top: 16px; }
    .shift-card { min-height: 202px; padding: 17px 19px; }
    .away-options { gap: 8px; }
    .away-option { gap: 8px; padding: 10px; }
    .account-panel { margin-top: 8px; }
    .attendance-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 13px; }
    .attendance-filter-employee, .attendance-filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
    .container { width: calc(100% - 28px); }
    .header-inner { column-gap: 8px; row-gap: 4px; min-height: 55px; flex-wrap: wrap; padding-block: 8px; }
    .brand-icon { width: 38px; height: 38px; border-radius: 11px; }
    .header-account { gap: 4px; }
    .account-id { max-width: 8em; }
    .main-nav { order: 3; width: 100%; }
    .nav-link { flex: 1; padding: 7px; text-align: center; }
    .page-heading { margin-bottom: 17px; }
    .away-options { grid-template-columns: 1fr; }
    .away-option { min-height: 60px; padding: 8px 11px; }
    .away-label { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
    .away-icon { width: 36px; height: 36px; }
    .away-icon-smoke_rest::before { inset: 9px 11px; }
    .away-icon-restroom::before { top: 8px; left: 15px; }
    .away-icon-restroom::after { top: 16px; left: 12px; }
    .away-icon-meal::before { top: 8px; left: 8px; }
    .away-icon-meal::after { top: 13px; left: 13px; }
    .recent-card, .history-card { padding: 14px; }
    .history-punches { gap: 7px; }
    .history-punches > div { padding: 8px; }
    .history-breaks li { flex-wrap: wrap; gap: 4px 7px; }
    .history-breaks li strong { min-width: auto; }
    .form-grid { grid-template-columns: 1fr; }
    .account-panel { padding: 20px; }
    .staff-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .staff-filters { grid-template-columns: 1fr auto; padding: 12px 12px 0; }
    .staff-filters .field:first-child { grid-column: -1 / 1; }
}

@media (prefers-reduced-motion: reduce) {
    .btn { transition: none; }
}

@media (max-width: 360px) {
    .account-id { display: none; }
}

.workspace-nav { gap: 4px; }
.workspace-nav .nav-link { display: inline-flex; min-height: 42px; align-items: center; gap: 8px; }
.workspace-nav .nav-link .workspace-icon { width: 17px; height: 17px; }

.workspace-icon { position: relative; display: inline-block; width: 23px; height: 23px; flex: 0 0 auto; color: inherit; }
.workspace-icon::before, .workspace-icon::after, .workspace-icon i { position: absolute; display: block; content: ''; pointer-events: none; }
.workspace-icon-grid::before { inset: 7%; border: 1.5px solid currentColor; border-radius: 25%; }
.workspace-icon-grid::after { top: 11%; bottom: 11%; left: 45%; width: 1.5px; background: currentColor; }
.workspace-icon-grid i { top: 45%; right: 11%; left: 11%; height: 1.5px; background: currentColor; }
.workspace-icon-clock::before { inset: 5%; border: 1.5px solid currentColor; border-radius: 50%; }
.workspace-icon-clock::after { top: 27%; left: 47%; width: 29%; height: 27%; border-bottom: 1.5px solid currentColor; border-left: 1.5px solid currentColor; border-radius: 0 0 0 2px; }
.workspace-icon-file::before { inset: 5% 13%; border: 1.5px solid currentColor; border-radius: 20%; }
.workspace-icon-file::after { top: 34%; right: 29%; left: 29%; height: 1.5px; background: currentColor; box-shadow: 0 4px currentColor; }
.workspace-icon-people::before { top: 7%; left: 32%; width: 37%; aspect-ratio: 1; border: 1.5px solid currentColor; border-radius: 50%; }
.workspace-icon-people::after { right: 10%; bottom: 6%; left: 10%; height: 43%; border: 1.5px solid currentColor; border-radius: 20px 20px 6px 6px; }
.workspace-icon-calendar::before { inset: 19% 8% 9%; border: 1.5px solid currentColor; border-radius: 20%; }
.workspace-icon-calendar::after { top: 10%; right: 30%; left: 30%; height: 25%; border-inline: 1.5px solid currentColor; }
.workspace-icon-calendar i { top: 44%; right: 12%; left: 12%; height: 1.5px; background: currentColor; }
.workspace-icon-points::before { inset: 8%; border: 1.5px solid currentColor; border-radius: 50%; }
.workspace-icon-points::after { top: 47%; right: 28%; left: 28%; height: 1.5px; border-radius: 2px; background: currentColor; }
.workspace-icon-wallet::before { inset: 20% 6% 14%; border: 1.5px solid currentColor; border-radius: 23%; }
.workspace-icon-wallet::after { top: 39%; right: 6%; width: 36%; height: 28%; border: 1.5px solid currentColor; border-radius: 4px 0 0 4px; background: var(--icon-fill, var(--paper)); }

.workspace-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 250px;
    overflow: hidden;
    border: 1px solid #fff;
    border-radius: 27px;
    background:
        radial-gradient(ellipse at 89% 15%, #c7d7ff 0, transparent 59%),
        radial-gradient(ellipse at 73% 112%, #b9e8f6 0, transparent 56%),
        linear-gradient(122deg, #fcfdff 4%, #e8efff 54%, #e2d9ff);
    color: var(--ink);
    box-shadow: var(--shadow);
}
.workspace-hero::before, .workspace-hero::after {
    position: absolute;
    z-index: -1;
    top: -43%;
    right: -2%;
    width: clamp(310px, 58vw, 620px);
    aspect-ratio: 1.44;
    border: 1px solid #ffffffe6;
    border-radius: 48% 42% 48% 38% / 39% 33% 61% 51%;
    background:
        radial-gradient(ellipse at 66% 24%, #ffffff8c, transparent 51%),
        conic-gradient(from 218deg at 68% 57%, #a5c8ff40, #fbffffc0, #afa9ef48, #d9f7ff95, #a5c8ff40);
    box-shadow: inset 0 10px 30px #ffffffb5, inset 0 -16px 28px #93bbf03b, 0 14px 42px #6679ad40;
    content: '';
    transform: rotate(-19deg);
}
.workspace-hero::after {
    top: 16%;
    right: 5%;
    width: clamp(220px, 41vw, 445px);
    border-radius: 46% 48% 34% 53% / 65% 47% 49% 39%;
    background: linear-gradient(158deg, #fff7, #a9d9f346 48%, #ffffffb0 82%, #e6efffb0);
    transform: rotate(-27deg);
}
.workspace-hero-content { align-self: center; padding: 31px 37px; }
.workspace-date { color: var(--accent-strong); font-size: .88rem; font-weight: 680; }
.workspace-hero h1 { margin: 9px 0 5px; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.04em; }
.workspace-user { color: var(--muted); overflow-wrap: anywhere; }
.workspace-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; margin-top: 23px; }
.workspace-hero-button { border-color: #fff; background: #ffffffe0; box-shadow: 0 5px 14px #4d6fb525; color: var(--accent-strong); }
.workspace-hero-button:hover { background: #fff; }
.workspace-hero-button .workspace-icon { width: 18px; height: 18px; }
.workspace-count { border-radius: 20px; background: var(--accent-soft); padding-inline: 7px; }
.workspace-status { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-strong); font-size: .82rem; }

.workspace-tools, .workspace-recent { margin-top: 27px; }
.workspace-section-heading { min-height: 36px; margin-bottom: 12px; }
.workspace-section-heading h2 { font-size: 1.19rem; }
.workspace-tools .workspace-section-heading { flex-wrap: wrap; }
.workspace-tools-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-inline-start: auto; }
.pwa-install { position: relative; }
.pwa-install summary { list-style: none; cursor: pointer; }
.pwa-install summary::-webkit-details-marker { display: none; }
.pwa-install-instructions {
    position: absolute;
    z-index: 2;
    inset-inline-end: 0;
    width: min(300px, calc(100vw - 32px));
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    padding: 12px;
    box-shadow: 0 8px 26px rgba(18, 43, 36, .12);
}
.pwa-install p { font-size: .83rem; }
.workspace-text-link { display: inline-flex; min-height: 36px; align-items: center; padding-left: 8px; font-size: .86rem; font-weight: 720; text-decoration: none; }
.workspace-text-link:hover { text-decoration: underline; }
.workspace-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.workspace-grid-admin { grid-template-columns: repeat(auto-fit, minmax(166px, 1fr)); }
.workspace-group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.workspace-group { display: grid; align-content: start; gap: 13px; padding: 17px; }
.workspace-group-heading { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.05rem; }
.workspace-group-links { display: flex; flex-wrap: wrap; gap: 8px; }
.workspace-tile { display: flex; min-height: 98px; align-items: center; gap: 10px; padding: 15px 13px; color: var(--ink); text-decoration: none; }
.workspace-tile:hover { border-color: #afc6ee; background: #ffffffef; }
.workspace-tile-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border: 1px solid #fff; border-radius: 14px; background: linear-gradient(145deg, #ffffffa0, var(--icon-fill)), var(--icon-fill); box-shadow: inset 0 1px 0 #fff, 0 4px 8px #3f599a19; color: var(--icon-ink); }
.workspace-tile-leave { --icon-fill: #e3effd; --icon-ink: #244e83; }
.workspace-tile-deduction { --icon-fill: #f7eee4; --icon-ink: #814a22; }
.workspace-tile-advance { --icon-fill: #ddf5fa; --icon-ink: #1b5a73; }
.workspace-tile-history { --icon-fill: #eceaf8; --icon-ink: #554889; }
.workspace-tile-text { display: grid; min-width: 0; gap: 3px; }
.workspace-tile-text strong { font-size: 1.03rem; }
.workspace-tile-text > span { color: var(--muted); font-size: .79rem; }
.workspace-empty { padding: 24px 18px; color: var(--muted); font-size: .91rem; text-align: center; }

.office-heading { margin-bottom: 17px; }
.office-toolbar { margin-bottom: 14px; padding: 0 16px; }
.office-type-nav { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); }
.office-tab { min-height: 49px; border-bottom: 2px solid transparent; padding: 12px 13px 10px; color: var(--muted); font-size: .9rem; font-weight: 680; text-decoration: none; }
.office-tab:hover, .office-tab.is-current { color: var(--accent-strong); }
.office-tab.is-current { border-color: var(--accent); }
.office-toolbar-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 18px; padding-block: 12px; }
.office-state-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.office-state-filter .field { width: min(175px, 100%); }
.office-state-filter label { color: var(--muted); font-size: .8rem; }
.office-create-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.office-create-menu { position: relative; }
.office-create-menu > summary { list-style: none; cursor: pointer; }
.office-create-menu > summary::-webkit-details-marker { display: none; }
.office-create-menu > div { position: absolute; top: calc(100% + 6px); right: 0; z-index: 2; width: max-content; min-width: 130px; padding: 5px; }
.office-create-menu > div a { display: block; min-height: 40px; border-radius: 7px; padding: 8px 11px; color: var(--ink); font-size: .9rem; text-decoration: none; }
.office-create-menu > div a:hover { background: var(--accent-soft); }
.office-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 70px; padding: 11px 16px; color: var(--ink); text-decoration: none; }
.office-row:hover { background: #f6faf8; }
.office-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.office-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.office-row:only-child { border-radius: var(--radius); }
.office-row + .office-row { border-top: 1px solid var(--line); }
.office-row .workspace-icon { color: var(--accent); }
.office-row-info { display: grid; min-width: 0; gap: 2px; }
.office-row-info strong { overflow-wrap: anywhere; }
.office-row-info > span { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

.office-form-panel { margin-top: 0; }
.office-form-fields textarea, .office-detail-card textarea { min-height: 110px; resize: vertical; }
.office-field-wide { grid-column: 1 / -1; }
.office-detail { max-width: 730px; margin-inline: auto; }
.office-detail .page-heading { margin-bottom: 1px; }
.office-detail-card { padding: 19px 22px; }
.office-detail-card h2 { font-size: 1.08rem; }
.office-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 15px; }
.office-facts > div { border-radius: 9px; background: #f3f6f4; padding: 10px 13px; }
.office-facts dt { color: var(--muted); font-size: .81rem; }
.office-facts dd { margin-top: 3px; overflow-wrap: anywhere; }
.office-read-note { white-space: pre-wrap; }

@media (max-width: 870px) {
    .workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 730px) {
    .site-header-signed-in { -webkit-backdrop-filter: none; backdrop-filter: none; }
    .site-header-signed-in .header-inner { min-height: 56px; flex-wrap: nowrap; }
    .site-header-signed-in + .app-main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
    .workspace-nav {
        position: fixed;
        z-index: 4;
        right: 12px;
        bottom: max(8px, env(safe-area-inset-bottom));
        left: 12px;
        justify-content: space-evenly;
        gap: 3px;
        width: auto;
        border: 1px solid #fff;
        border-radius: 24px;
        background: #f8fbffde;
        padding: 4px 8px;
        box-shadow: 0 10px 28px -10px #425d9a63, inset 0 1px 0 #fff;
        -webkit-backdrop-filter: blur(18px) saturate(145%);
        backdrop-filter: blur(18px) saturate(145%);
    }
    .workspace-nav .nav-link { min-height: 50px; max-width: 145px; flex: 1; flex-direction: column; justify-content: center; gap: 2px; padding: 5px 7px; font-size: .75rem; }
    .workspace-nav .nav-link .workspace-icon { width: 20px; height: 20px; }
    .workspace-hero { min-height: 200px; border-radius: 18px; }
    .workspace-hero::before { right: -31%; }
    .workspace-hero::after { right: -20%; }
    .workspace-hero-content { padding: 24px; }
}

@media (max-width: 420px) {
    .workspace-grid { gap: 9px; }
    .workspace-tile { min-height: 82px; gap: 8px; padding: 10px; }
    .workspace-tile-icon { width: 36px; height: 36px; border-radius: 10px; }
    .workspace-tile-icon .workspace-icon { width: 21px; height: 21px; }
    .workspace-tile-text strong { font-size: .94rem; }
    .workspace-tile-text > span { font-size: .73rem; }
    .office-toolbar { padding-inline: 10px; }
    .office-tab { padding-inline: 10px; }
    .office-create-menu > div { right: auto; left: 0; }
    .office-row { gap: 8px; padding-inline: 11px; }
    .office-row .workspace-icon { width: 20px; height: 20px; }
    .office-detail-card { padding: 14px; }
}
