:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --ink: #132033;
    --muted: #65758b;
    --line: #d9e2ec;
    --blue: #1159b5;
    --blue-dark: #0b3770;
    --cyan: #11a8c7;
    --success: #0b7a55;
}

.language-switch {
    position: fixed;
    top: 16px;
    right: 18px;
    z-index: 1200;
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid rgba(148, 163, 184, .38);
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 8px 24px rgba(15, 36, 64, .12);
    backdrop-filter: blur(12px);
}

.commission-save-notice {
    position: fixed;
    z-index: 1500;
    right: 22px;
    bottom: 24px;
    max-width: min(380px, calc(100vw - 32px));
    padding: 12px 17px;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 12px;
    color: #fff;
    background: #167553;
    box-shadow: 0 16px 38px rgba(8, 32, 48, .24);
    font-size: 13px;
    font-weight: 700;
}

.commission-save-notice.error { background: #b63b48; }
.commission-save-notice[hidden] { display: none; }

.report-export-exclusion {
    display: inline-flex;
    margin-top: 9px;
    padding: 6px 10px;
    border: 1px solid #f0c36a;
    border-radius: 8px;
    color: #76510b;
    background: #fff8e6;
    font-weight: 700;
}

/* Commission approver: operational pages are visible but strictly read-only. */
.role-commission-approver.endpoint-teams #team-form input,
.role-commission-approver.endpoint-teams #team-form select:not([name="team"]),
.role-commission-approver.endpoint-teams #team-form button,
.role-commission-approver.endpoint-project-close .project-close-table input,
.role-commission-approver.endpoint-project-close .project-close-table select,
.role-commission-approver.endpoint-project-close .project-close-table button,
.role-commission-approver.endpoint-workin-management .admin-record-management .action-cell {
    pointer-events: none;
    user-select: none;
}
.role-commission-approver.endpoint-teams #team-form input,
.role-commission-approver.endpoint-teams #team-form select:not([name="team"]),
.role-commission-approver.endpoint-teams #team-form button,
.role-commission-approver.endpoint-project-close .project-close-table input,
.role-commission-approver.endpoint-project-close .project-close-table select,
.role-commission-approver.endpoint-project-close .project-close-table button {
    opacity: .7;
}
.role-commission-approver.endpoint-workin-management .page-head-actions,
.role-commission-approver.endpoint-workin-management .admin-record-management .action-cell > * {
    display: none;
}

.commission-export-progress-layer {
    position: fixed;
    z-index: 1800;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 22, 40, .56);
    backdrop-filter: blur(8px);
}

.commission-export-progress-layer[hidden] { display: none; }
.commission-export-progress-card {
    width: min(480px, 100%);
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 20px;
    color: #18344f;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 30px 90px rgba(0, 14, 35, .34);
    text-align: center;
}
.commission-export-progress-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #145fba, #08829a); font-size: 27px; box-shadow: 0 12px 26px rgba(17, 89, 181, .25); }
.commission-export-progress-card h2 { margin: 7px 0 0; font-size: 25px; }
.commission-export-progress-card p { min-height: 24px; margin: 18px 0 12px; color: #597087; }
.commission-export-progress-track { height: 11px; overflow: hidden; border-radius: 999px; background: #dce7f0; }
.commission-export-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1159b5, #16a7a2); transition: width .36s ease; }
.commission-export-progress-card > strong { display: block; margin-top: 10px; color: #0d5eab; font-size: 28px; font-variant-numeric: tabular-nums; }
.commission-export-progress-card > small { display: block; margin-top: 9px; color: #718296; line-height: 1.5; }
.commission-export-progress-card > button { margin-top: 17px; }
.commission-export-progress-layer.complete .commission-export-progress-icon { background: #16815d; }
.commission-export-progress-layer.error .commission-export-progress-icon { background: #b63b48; }
.commission-export-progress-layer.error .commission-export-progress-track i { background: #b63b48; }

.language-switch button,
.language-switch a {
    min-width: 38px;
    min-height: 30px;
    padding: 4px 9px;
    border: 0;
    border-radius: 999px;
    color: #536579;
    background: transparent;
    font: 700 11px/1 system-ui, sans-serif;
    letter-spacing: .04em;
    cursor: pointer;
    text-decoration: none;
    display: inline-grid;
    place-items: center;
}

.language-switch button[aria-pressed="true"],
.language-switch a[aria-current="true"] {
    color: #fff;
    background: #0b5cab;
    box-shadow: 0 3px 9px rgba(11, 92, 171, .25);
}

@media (max-width: 760px) {
    .language-switch { top: 10px; right: 10px; }
    .language-switch button, .language-switch a { min-width: 34px; min-height: 28px; padding: 4px 7px; }
    .commission-save-notice { right: 16px; bottom: 88px; }
    .commission-export-progress-card { padding: 24px 18px; border-radius: 16px; }
}

.station-projects { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.station-projects-head { display: grid; grid-template-columns: 1fr auto; gap: 4px; margin-bottom: 10px; }
.station-project-list { display: grid; gap: 8px; }
.station-project-row { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #fff; }
.station-project-row small { color: var(--muted); }
.employee-management { margin-top: 18px; }
.external-employee-list { display: grid; gap: 8px; margin-top: 16px; }
.external-employee-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.dashboard-filter { display: flex; align-items: end; gap: 12px; margin-bottom: 16px; }
.dashboard-filter .field { min-width: 190px; }
.workin-metrics .metric { display: grid; gap: 4px; }
.workin-metrics small { color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 16px; margin-bottom: 16px; }
.workin-bars, .daily-workin-list { display: grid; gap: 10px; }
.workin-bar-row { display: grid; grid-template-columns: 72px minmax(100px, 1fr) 70px 80px; align-items: center; gap: 10px; }
.workin-bar-row small, .daily-workin-row small { color: var(--muted); }
.workin-bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: #e8eef5; }
.workin-bar-track i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.daily-workin-row { display: grid; grid-template-columns: 105px minmax(100px, 1fr) repeat(4, 80px); align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }

* { box-sizing: border-box; }

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    color: #fff;
    background: linear-gradient(180deg, var(--blue-dark), #102b4d 62%, #071d35);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 56px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: transparent;
    filter: drop-shadow(0 7px 13px rgba(0, 12, 32, .2));
}

.brand-mark img { display: block; width: 42px; height: 42px; }

.brand strong, .brand span { display: block; }
.brand span { color: #bcd4ed; font-size: 13px; margin-top: 2px; }

.nav {
    display: grid;
    gap: 6px;
    margin-top: 28px;
}

.nav a {
    color: #d7e7f8;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
}

.nav-more-panel {
    display: grid;
    gap: 6px;
}

.nav-more-button, .nav-backdrop { display: none; }
.nav-icon { display: none; }

.nav a.active, .nav a:hover {
    background: rgba(255, 255, 255, .13);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    color: #a8c1dc;
    font-size: 10px;
    line-height: 1.45;
}
.sidebar-footer strong, .sidebar-footer span, .sidebar-footer small { display: block; }
.sidebar-footer strong { color: #d9e9f8; font-size: 11px; font-weight: 650; margin-bottom: 4px; }
.sidebar-footer small { color: #88a8c6; font-size: 9px; margin-top: 1px; }
.nav-mobile-legal { display: none; }

.main {
    margin-left: 260px;
    padding: 26px;
}

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

.compact-head {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 0 0 14px;
    background: var(--bg);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--blue);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: 30px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; margin: 18px 0 10px; }

.primary-action, button.primary-action {
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    color: #fff;
    background: var(--blue);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.primary-action:hover { background: #0e4d9d; }

.secondary-action,
.danger-action {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.secondary-action {
    color: var(--blue);
    background: #eaf2fb;
}

.danger-action {
    color: #fff;
    background: #b42318;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

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

.metric, .panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(15, 45, 80, .05);
}

.metric { padding: 18px; }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 8px; font-size: 28px; }

.period-badge {
    padding: 10px 14px;
    border: 1px solid #cfe0f2;
    border-radius: 8px;
    color: var(--blue);
    background: #fff;
    font-weight: 800;
}

.backup-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.backup-list a {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f8fbfe;
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin: 2px 4px 2px 0;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #d6e2ee;
    color: #52677f;
    background: #f5f8fc;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.status-badge.pass {
    border-color: #b9e5d3;
    color: #0b7a55;
    background: #ebfff7;
}

.status-badge.fail {
    border-color: #f2b8b5;
    color: #b42318;
    background: #fff1f0;
}

.status-badge.pending {
    border-color: #d6e2ee;
    color: #52677f;
    background: #f5f8fc;
}

.close-line {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.close-overview-grid {
    display: grid;
    grid-template-columns: minmax(140px, .7fr) repeat(2, minmax(230px, 1.25fr)) minmax(170px, .85fr);
    gap: 12px;
    margin-bottom: 18px;
}

.close-overview-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}

.close-overview-card > strong { display: block; margin-bottom: 9px; }
.close-ready { border-color: #b9e5d3; background: #f3fff9; }
.close-status-stack { display: grid; justify-items: start; min-width: 105px; }
.project-close-table tbody tr.close-row-ready { background: #f5fff9; }
.project-close-table tbody tr.close-row-fail { background: #fff8f7; }
.project-close-table tbody tr:hover { background: #f3f8fd; }
.project-close-table-wrap { width: 100%; max-width: 100%; }
.project-close-table { min-width: 1500px; }
.project-close-table.is-compact-columns { min-width: 900px; }
.project-close-table { font-size: 11px; }
.project-close-table th { font-size: 10.5px; line-height: 1.2; padding: 7px 6px; }
.project-close-table td { font-size: 11px; line-height: 1.3; padding: 7px 6px; white-space: normal; vertical-align: top; }
.project-close-table td strong { font-size: 11px; }
.project-close-table td small { font-size: 9.5px; line-height: 1.2; }
.project-close-table .status-badge { font-size: 9.5px; padding: 4px 6px; }
.project-close-table select, .project-close-table input { font-size: 10.5px; min-height: 32px; padding: 5px 6px; width: 100%; min-width: 0; }
.project-close-table .secondary-action, .project-close-table .primary-action { font-size: 10px; min-height: 30px; padding: 6px 7px; }
.project-close-tools { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.project-close-tools form { margin: 0; }
.close-all-projects-button { min-height: 34px; white-space: nowrap; }
.project-close-filter { align-items: end; display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto; margin-bottom: 16px; }
.sortable-column { cursor: pointer; padding-right: 18px !important; position: relative; user-select: none; }
.sortable-column::after { color: #8a98a8; content: "↕"; font-size: 10px; position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.sortable-column[aria-sort="ascending"]::after { color: var(--blue); content: "↑"; }
.sortable-column[aria-sort="descending"]::after { color: var(--blue); content: "↓"; }
@media (max-width: 900px) { .project-close-filter { grid-template-columns: 1fr; } }
.project-close-table td:first-child,
.project-close-table td:nth-child(2),
.project-close-table td:nth-child(4),
.project-close-table td:nth-child(7),
.project-close-table td:nth-child(8),
.project-close-table td:nth-child(19),
.project-close-table td:nth-child(20),
.project-close-table td:nth-child(21) { white-space: nowrap; }
.commission-table-wrap { width: 100%; max-width: 100%; }
.commission-table { min-width: 2350px; table-layout: fixed; }
.commission-table.is-compact-columns { min-width: 1850px; }
.commission-table { font-size: 11px; }
.commission-table th { background: #f2f6fa; color: #41566c; font-size: 10.5px; line-height: 1.2; padding: 7px 6px; position: sticky; top: 0; z-index: 2; }
.commission-table td { border-bottom: 1px solid #e8eef4; font-size: 11px; line-height: 1.3; padding: 7px 6px; vertical-align: top; }
.commission-table td strong { font-size: 11px; }
.commission-table td small { font-size: 9.5px; line-height: 1.2; }
.commission-table .status-badge { font-size: 9.5px; padding: 3px 6px; }
.commission-table tbody tr:nth-child(even) { background: #fafcfe; }
.commission-table tbody tr:hover { background: #f0f7ff; }
.commission-table .locked-row { background: #f3f7f4; }
.commission-table .locked-row:hover { background: #eaf4ed; }
.money-cell { text-align: right; white-space: nowrap; }
.sequence-cell, .number-cell, .percent-cell { text-align: center; white-space: nowrap; }
.description-cell { color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.base-money { color: #516579; }
.commission-money { background: #eef7ff; color: #125ea5; }
.special-money { background: #fff7e6; color: #9a5a00; }
.override-money { background: #f5f0ff; color: #67419a; }
.inline-special-form { display: grid; gap: 4px; margin: 0; }
.inline-special-form input { background: #fff; border: 1px solid #e0cda9; border-radius: 5px; font-size: 9.5px; min-height: 25px; padding: 4px 5px; width: 100%; }
.inline-special-form button { border: 1px solid #c07a12; border-radius: 5px; color: #8b5400; background: #fff; cursor: pointer; font-size: 9.5px; font-weight: 800; min-height: 25px; padding: 4px 6px; }
.inline-special-form button:hover { color: #fff; background: #b56c00; }
.project-inline-summary { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.project-inline-summary small { border-radius: 4px; color: #506174; background: #eef3f7; font-size: 9px; padding: 2px 4px; }
.project-inline-summary .project-description-summary { display: block; flex-basis: 100%; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-members-cell > strong { display: block; margin-bottom: 4px; }
.project-member-summary { display: grid; gap: 2px; }
.project-member-summary small { background: #f1f6fa; border-radius: 4px; color: #40566c; display: block; overflow: hidden; padding: 2px 4px; text-overflow: ellipsis; white-space: nowrap; }
.project-member-summary b { color: #183f63; }
.project-member-summary em { color: #147846; font-style: normal; font-weight: 800; }
.commission-table.is-compact-columns th, .commission-table.is-compact-columns td { padding: 5px 4px; }
.commission-table.is-compact-columns, .commission-table.is-compact-columns td { font-size: 10px; }
.commission-table.is-compact-columns td small { font-size: 8.5px; }
.commission-overview { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.commission-tabs { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 5px; margin: 18px 0; overflow-x: auto; }
.commission-tabs a { border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; color: #506174; font-size: 12px; font-weight: 800; padding: 10px 14px; text-decoration: none; white-space: nowrap; }
.commission-tabs a:hover { background: #f3f7fa; color: var(--blue); }
.commission-tabs a.active { background: #fff; border-color: var(--line); color: var(--blue); margin-bottom: -1px; padding-bottom: 11px; }
.commission-tabs a span { background: #eaf1f7; border-radius: 10px; font-size: 9px; margin-left: 4px; padding: 2px 5px; }
.export-preview-note { align-items: center; background: #f1f7fc; border: 1px solid #dce9f4; border-radius: 8px; display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 9px 12px; }
.export-preview-note strong { color: #147846; }
.export-preview-note span { color: var(--muted); font-size: 10px; }
.commission-report-hero { align-items: center; background: linear-gradient(135deg, #123f65 0%, #1769aa 62%, #208a74 100%); border-radius: 16px; box-shadow: 0 12px 32px rgba(22, 76, 117, .18); color: #fff; display: flex; justify-content: space-between; margin-bottom: 14px; overflow: hidden; padding: 24px 28px; position: relative; }
.commission-report-hero::after { border: 1px solid rgba(255,255,255,.12); border-radius: 50%; content: ""; height: 210px; position: absolute; right: -45px; top: -95px; width: 210px; }
.commission-report-heading, .commission-report-total { position: relative; z-index: 1; }
.report-kicker { color: #aeead7; display: block; font-size: 11px; font-weight: 900; letter-spacing: .08em; margin-bottom: 6px; text-transform: uppercase; }
.commission-report-heading h2 { color: #fff; font-size: 26px; margin: 0 0 5px; }
.commission-report-heading p { color: rgba(255,255,255,.78); margin: 0; }
.commission-report-total { text-align: right; }
.commission-report-total span, .commission-report-total small { color: rgba(255,255,255,.72); display: block; }
.commission-report-total strong { display: inline-block; font-size: 30px; margin: 3px 6px 0 0; }
.commission-report-total small { display: inline; font-size: 12px; }
.report-summary-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.report-summary-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 14px rgba(30, 69, 100, .05); padding: 15px 17px; }
.report-summary-card span, .report-summary-card small { color: var(--muted); display: block; }
.report-summary-card span { font-size: 11px; font-weight: 800; }
.report-summary-card strong { color: #173e60; display: block; font-size: 21px; margin: 4px 0 1px; }
.report-summary-card small { font-size: 9.5px; }
.report-summary-card.external { border-left: 3px solid #d28b25; }
.commission-report-export { align-items: center; display: flex; gap: 22px; justify-content: space-between; }
.report-export-copy h3 { margin: 3px 0; }
.report-export-copy p { color: var(--muted); margin: 0; }
.report-step { color: #147846; font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.report-export-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.report-export-actions form { margin: 0; }
.report-export-actions button { min-height: 40px; }
.commission-report-preview { margin-top: 14px; }
.report-count-badge { background: #edf4fa; border-radius: 999px; color: #315a7c; font-size: 10px; font-weight: 800; padding: 6px 10px; }
.report-payee-group { border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; overflow: hidden; }
.report-payee-group summary { align-items: center; background: #f8fafc; cursor: pointer; display: flex; justify-content: space-between; list-style: none; padding: 12px 14px; }
.report-payee-group summary::-webkit-details-marker { display: none; }
.report-payee-group summary span { align-items: baseline; display: flex; gap: 8px; }
.report-payee-group summary small { color: var(--muted); }
.report-payee-group summary b { color: #147846; }
.report-payment-table { font-size: 10px; min-width: 1320px; }
.report-payment-table th, .report-payment-table td { padding: 7px 6px; }
.report-payment-table td:nth-child(n+5) { text-align: right; white-space: nowrap; }
.report-net-cell { background: #eefaf3; color: #147846; }
.commission-report-footer { align-items: center; background: #edf8f3; border-radius: 9px; display: flex; justify-content: space-between; margin-top: 12px; padding: 12px 14px; }
.commission-report-footer span { color: var(--muted); }
.commission-report-footer strong { color: #126b42; font-size: 15px; }
.approval-page-head { align-items: center; }
.approval-month-group, .history-month-group { margin: 18px 0 24px; }
.approval-month-head, .history-month-head { align-items: center; border-bottom: 2px solid #d8e5ef; display: flex; justify-content: space-between; margin-bottom: 12px; padding: 0 4px 9px; }
.approval-month-head span, .history-month-head span { color: var(--muted); font-size: 10px; font-weight: 800; }
.approval-month-head h2, .history-month-head h2 { color: #173f62; margin: 2px 0 0; }
.approval-month-head > strong, .history-month-head > strong { background: #eaf2f8; border-radius: 999px; color: #315a7c; padding: 6px 10px; }
.approval-team-grid, .history-team-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.approval-team-card, .history-team-card { margin: 0; }
.approval-team-card-head, .history-team-card-head { align-items: flex-start; display: flex; justify-content: space-between; }
.approval-team-card-head span, .history-team-card-head span { color: var(--muted); font-size: 10px; }
.approval-team-card-head h3, .history-team-card-head h3 { font-size: 20px; margin: 2px 0 10px; }
.approval-file-meta { display: grid; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.approval-file-meta span { color: #40566c; font-size: 11px; }
.approval-file-meta b { color: var(--muted); display: block; font-size: 9px; margin-bottom: 1px; }
.approval-card-actions, .history-file-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.approval-card-actions a, .history-file-actions a, .history-file-actions button { box-sizing: border-box; text-align: center; }
.history-file-actions form { margin: 0; }
.approval-signed-note, .history-submit-note { background: #edf8f3; border-radius: 7px; color: #176c47; font-size: 10px; line-height: 1.5; margin-top: 10px; padding: 8px 10px; }
.approval-old-versions, .history-old-versions { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 9px; }
.approval-old-versions summary, .history-old-versions summary { color: #456985; cursor: pointer; font-size: 10px; font-weight: 800; }
.approval-old-versions > div { align-items: center; display: flex; justify-content: space-between; padding: 7px 2px 0; }
.history-latest-file { background: #f7fafc; border-radius: 8px; display: grid; gap: 3px; padding: 10px 12px; }
.history-latest-file strong { color: #173f62; }
.history-latest-file span, .history-latest-file small { color: var(--muted); }
.history-desktop-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.history-desktop-layout:has(.history-selection-menu:not([hidden])) { grid-template-columns: minmax(0, 1fr) 300px; }
.history-table-content { min-width: 0; }
.history-month-group.panel { margin: 14px 0; padding: 0; overflow: visible; }
.history-month-group.panel .history-month-head { margin: 0; padding: 14px 16px 10px; }
.history-month-tools { align-items: center; display: flex; gap: 12px; }
.history-check-all { align-items: center; color: #45647e; cursor: pointer; display: flex; font-size: 10px; font-weight: 800; gap: 5px; }
.history-check-all input, .history-select-column input { accent-color: #1769aa; cursor: pointer; height: 17px; width: 17px; }
.history-main-table-wrap { border-radius: 0 0 10px 10px; }
.history-main-table { min-width: 1120px; }
.history-main-table th, .history-main-table td { padding: 9px 8px; vertical-align: middle; }
.history-main-table td small { color: var(--muted); display: block; font-size: 9px; margin-top: 2px; white-space: nowrap; }
.history-main-table .history-select-column { text-align: center; width: 48px; }
.history-row-selectable { background: #fbfdff; }
.history-row-selectable:has([data-history-select]:checked) { background: #eaf5ff; box-shadow: inset 3px 0 #1769aa; }
.history-unavailable-check, .muted-text { color: #a6b1bc; }
.history-team-name { color: #173f62; font-size: 14px; }
.history-file-links { display: flex; gap: 5px; white-space: nowrap; }
.history-file-links .secondary-action { font-size: 10px; min-height: 29px; padding: 6px 8px; }
.history-old-versions { border: 0; margin: 0; padding: 0; position: relative; }
.history-old-versions summary { white-space: nowrap; }
.history-old-popover { background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 12px 30px rgba(25, 54, 80, .18); min-width: 600px; padding: 8px; position: absolute; right: 0; top: 26px; z-index: 20; }
.history-old-popover table { font-size: 10px; }
.history-selection-menu { position: sticky; top: 14px; margin: 14px 0; }
.history-selection-menu[hidden] { display: none; }
.history-selection-kicker { color: #147846; display: block; font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.history-selection-menu > strong { color: #173f62; display: block; font-size: 21px; margin: 5px 0 13px; }
.history-selection-total { background: #edf7fc; border-radius: 9px; display: grid; grid-template-columns: 1fr auto; padding: 11px 12px; }
.history-selection-total small { color: var(--muted); grid-column: 1 / -1; }
.history-selection-total b { color: #126b42; font-size: 20px; }
.history-selection-total span { align-self: end; color: var(--muted); font-size: 10px; padding-bottom: 3px; }
.history-selection-list { display: grid; gap: 5px; margin: 11px 0; max-height: 220px; overflow-y: auto; }
.history-selection-list span { align-items: center; background: #f5f8fa; border-radius: 6px; color: #40566c; display: flex; font-size: 10px; justify-content: space-between; padding: 6px 8px; }
.history-selection-menu button { margin-top: 7px; width: 100%; }
.history-selection-menu > p { color: var(--muted); font-size: 9px; line-height: 1.45; margin: 10px 0 0; }
.export-preview-table { font-size: 10px; min-width: 2200px; table-layout: fixed; }
.export-preview-table th, .export-preview-table td { font-size: 10px; padding: 6px 5px; vertical-align: top; }
.export-preview-table td small { display: block; font-size: 8.5px; line-height: 1.3; white-space: nowrap; }
.hash-value { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.final-money { background: #eefaf3; color: #147846; }
.team-chip { border-left: 3px solid currentColor; border-radius: 5px; display: inline-block; font-size: 10px; font-weight: 800; padding: 3px 6px; white-space: nowrap; }
.commission-row-actions { display: grid; gap: 5px; min-width: 88px; }
.commission-row-actions form { margin: 0; }
.commission-row-actions .secondary-action,
.commission-close-button { box-sizing: border-box; font-size: 10px; line-height: 1.1; min-height: 27px; padding: 6px 7px; text-align: center; width: 100%; }
.commission-close-button { border: 1px solid #b42318; border-radius: 7px; color: #b42318; background: #fff; cursor: pointer; font-weight: 800; }
.commission-close-button:hover:not(:disabled) { color: #fff; background: #b42318; }
.commission-close-button:disabled { border-color: #cbd5df; color: #8a98a8; background: #f3f5f7; cursor: not-allowed; }
.team-color-legend { align-items: center; display: flex; gap: 10px; margin: 0 0 12px; }
.team-color-legend span { border-radius: 6px; font-size: 12px; font-weight: 800; padding: 5px 9px; }
.team-color-0 { background: #e8f2ff; color: #1769aa; }
.team-color-1 { background: #eaf8ef; color: #177545; }
.team-color-2 { background: #fff3df; color: #9a5a00; }
.team-color-3 { background: #f4ebff; color: #7040a0; }
.team-color-4 { background: #ffecef; color: #aa354b; }
.team-color-5 { background: #e5f8f7; color: #08766e; }
.team-color-6 { background: #f2f0e8; color: #685e2c; }
.team-color-7 { background: #edf0f5; color: #475569; }
.commission-filter { align-items: end; display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(140px, 1fr)) auto; }
.commission-person-adjustment-form { align-items: end; display: grid; gap: 12px; grid-template-columns: minmax(220px, 1.2fr) minmax(150px, .55fr) minmax(260px, 1.7fr) auto; }
.commission-person-adjustment-form .field { margin: 0; }
.commission-person-adjustment-form button { min-height: 42px; }
.commission-person-edit-table select,
.commission-person-edit-table input { min-width: 150px; width: 100%; }
.commission-person-edit-table .money-input { min-width: 110px; width: 120px; }
.commission-person-row-actions { display: flex; gap: 6px; white-space: nowrap; }
.commission-person-row-actions form { margin: 0; }
.commission-edit-form { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
@media (max-width: 1200px) {
    .commission-filter { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
    .commission-person-adjustment-form { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 700px) {
    .commission-filter { grid-template-columns: 1fr; }
    .commission-person-adjustment-form { grid-template-columns: 1fr; }
    .team-color-legend { align-items: flex-start; flex-direction: column; }
    .commission-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .commission-report-hero { align-items: flex-start; flex-direction: column; gap: 18px; padding: 20px; }
    .commission-report-total { text-align: left; }
    .report-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .commission-report-export { align-items: stretch; flex-direction: column; }
    .report-export-actions { display: grid; grid-template-columns: 1fr; }
    .report-export-actions button { width: 100%; }
    .commission-report-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
    .approval-team-grid, .history-team-grid { grid-template-columns: 1fr; }
    .approval-file-meta { grid-template-columns: 1fr; }
    .history-desktop-layout:has(.history-selection-menu:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
    .history-selection-menu { bottom: 64px; position: sticky; top: auto; z-index: 24; }
}
.column-view-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.column-settings { position: relative; }
.column-settings > summary {
    list-style: none;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--blue);
    background: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.column-settings > summary::-webkit-details-marker { display: none; }
.column-settings-menu {
    position: absolute;
    z-index: 12;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 4px 12px;
    width: min(480px, calc(100vw - 32px));
    max-height: 380px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
}
.column-settings-menu label { display: flex; align-items: center; gap: 7px; padding: 6px; font-size: 12px; cursor: pointer; }
.column-settings-menu input { width: auto; }
.project-workin-add > summary { cursor: pointer; list-style: none; }
.project-workin-add > summary::-webkit-details-marker { display: none; }
.project-workin-add > summary span { display: flex; align-items: baseline; gap: 10px; }
.project-workin-add > summary small { color: var(--muted); }
.project-workin-add-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.project-member-picker { max-height: 300px; overflow: auto; }
.project-member-names { min-width: 220px; white-space: normal; }

@media (max-width: 700px) {
    .column-view-tools { justify-content: flex-start; width: 100%; }
    .column-settings-menu { position: fixed; top: 80px; right: 16px; left: 16px; grid-template-columns: 1fr; width: auto; }
}

.close-user-audit {
    display: grid;
    gap: 2px;
    min-width: 150px;
}

.close-user-audit span { display: flex; align-items: baseline; gap: 5px; }
.close-user-audit small, .close-user-audit time { color: var(--muted); font-size: 11px; }
.close-user-audit time { margin: 0 0 5px; }

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

.login-wrap {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(380px, 460px);
    align-items: center;
    gap: clamp(40px, 8vw, 120px);
    overflow: hidden;
    padding: clamp(32px, 7vw, 110px);
    color: #fff;
    background: linear-gradient(135deg, #061a32 0%, #0a3157 48%, #075e7c 100%);
}

.login-panel {
    position: relative;
    z-index: 2;
    width: 100%;
    display: grid;
    gap: 18px;
    padding: 32px;
    border: 1px solid rgba(211, 239, 248, .34);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(247, 252, 255, .68), rgba(220, 240, 249, .5));
    box-shadow: 0 28px 80px rgba(0, 18, 42, .32), inset 0 1px 0 rgba(255, 255, 255, .48);
    backdrop-filter: blur(20px) saturate(138%);
    -webkit-backdrop-filter: blur(20px) saturate(138%);
    transform: translateY(-38px);
}

.guest-page { overflow: hidden; background: #061a32; }
.guest-page .main { width: 100%; min-height: 100vh; margin-left: 0; padding: 0; background: #061a32; }
.guest-page .guest-sidebar { display: none; }
.login-ambient { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.login-orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; animation: login-float 13s ease-in-out infinite alternate; }
.login-orb-one { top: -18%; right: 8%; width: 520px; height: 520px; background: radial-gradient(circle at 35% 35%, rgba(95, 228, 255, .65), rgba(17, 168, 199, .07) 68%, transparent 72%); }
.login-orb-two { bottom: -30%; left: 16%; width: 650px; height: 650px; background: radial-gradient(circle, rgba(17, 89, 181, .6), rgba(17, 89, 181, .03) 67%, transparent 71%); animation-duration: 17s; animation-delay: -5s; }
.login-orb-three { top: 36%; left: 43%; width: 240px; height: 240px; background: radial-gradient(circle, rgba(255, 212, 93, .22), transparent 68%); animation-duration: 10s; animation-delay: -3s; }
.login-grid-motion { position: absolute; inset: -35%; opacity: .18; background-image: linear-gradient(rgba(138, 215, 238, .2) 1px, transparent 1px), linear-gradient(90deg, rgba(138, 215, 238, .2) 1px, transparent 1px); background-size: 54px 54px; transform: perspective(520px) rotateX(62deg) rotateZ(-12deg); animation: login-grid-drift 24s linear infinite; }
.login-light-sweep { position: absolute; top: -20%; left: -35%; width: 32%; height: 145%; background: linear-gradient(90deg, transparent, rgba(127, 225, 255, .12), transparent); transform: rotate(13deg); animation: login-sweep 11s ease-in-out infinite; }
.login-particle { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #bcefff; box-shadow: 0 0 18px 4px rgba(88, 211, 241, .35); animation: login-pulse 4s ease-in-out infinite, login-rise 15s linear infinite; }
.login-particle.p1 { left: 10%; bottom: 8%; }.login-particle.p2 { left: 27%; bottom: 24%; animation-delay: -3s; }.login-particle.p3 { left: 46%; bottom: 12%; animation-delay: -7s; }.login-particle.p4 { left: 62%; bottom: 29%; animation-delay: -10s; }.login-particle.p5 { left: 79%; bottom: 9%; animation-delay: -5s; }.login-particle.p6 { left: 91%; bottom: 36%; animation-delay: -12s; }
.login-welcome { position: relative; z-index: 2; max-width: 650px; }
.login-screen-brand { position: absolute; z-index: 3; top: clamp(24px, 4vw, 48px); left: clamp(24px, 7vw, 110px); display: flex; align-items: center; gap: 11px; }
.login-screen-brand > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: #082849; background: #ffd45d; box-shadow: 0 10px 26px rgba(0, 12, 32, .2); font-size: 18px; font-weight: 900; }
.login-screen-brand strong, .login-screen-brand small { display: block; }
.login-screen-brand strong { color: #fff; font-size: 16px; }
.login-screen-brand small { margin-top: 1px; color: #add0e2; font-size: 11px; }
.login-kicker, .login-form-kicker { color: #75d9ee; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.login-welcome h2 { margin: 15px 0 18px; color: #fff; font-size: clamp(34px, 4vw, 58px); line-height: 1.16; letter-spacing: -.035em; }
.login-welcome p { margin: 0; color: #c3d9e9; font-size: 16px; line-height: 1.8; }
.login-live-status { display: inline-flex; align-items: center; gap: 9px; margin-top: 28px; padding: 9px 13px; border: 1px solid rgba(136, 226, 242, .22); border-radius: 999px; color: #d3eff5; background: rgba(4, 26, 48, .28); font-size: 12px; }
.login-live-status i { width: 8px; height: 8px; border-radius: 50%; background: #55e5a7; box-shadow: 0 0 0 0 rgba(85, 229, 167, .5); animation: login-status 2s ease-out infinite; }
.login-panel .panel-head { justify-content: center; margin-bottom: 2px; text-align: center; }
.login-panel .panel-head > div { width: 100%; }
.login-panel .panel-head h1 { margin-top: 7px; color: #12324f; font-size: 30px; }
.login-panel .panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.login-panel .login-form-kicker { color: var(--blue); font-size: 10px; }
.login-panel .field { gap: 8px; color: #29445e; font-size: 13px; font-weight: 700; }
.login-panel .field input { min-height: 48px; border-color: #cbd8e4; border-radius: 10px; background: rgba(248, 251, 253, .9); font-size: 15px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.login-panel .field input:focus { outline: 0; border-color: #1d74c9; box-shadow: 0 0 0 4px rgba(17, 89, 181, .12); transform: translateY(-1px); }
.login-submit { position: relative; display: flex; align-items: center; justify-content: center; min-height: 50px; margin-top: 3px; padding-inline: 48px; border-radius: 10px; background: linear-gradient(100deg, #1159b5, #087f9d); box-shadow: 0 12px 24px rgba(17, 89, 181, .22); text-align: center; transition: transform .2s, box-shadow .2s; }
.login-submit:hover { transform: translateY(-2px); background: linear-gradient(100deg, #0e4d9d, #08738e); box-shadow: 0 16px 30px rgba(17, 89, 181, .3); }
.login-submit b { position: absolute; right: 19px; font-size: 21px; font-weight: 400; transition: transform .2s; }.login-submit:hover b { transform: translateX(4px); }

@keyframes login-float { to { transform: translate3d(38px, 30px, 0) scale(1.08); } }
@keyframes login-grid-drift { to { background-position: 108px 54px, 108px 54px; } }
@keyframes login-sweep { 0%, 18% { transform: translateX(0) rotate(13deg); opacity: 0; } 42% { opacity: 1; } 72%, 100% { transform: translateX(510%) rotate(13deg); opacity: 0; } }
@keyframes login-pulse { 50% { opacity: .32; transform: scale(.65); } }
@keyframes login-rise { to { translate: 20px -115vh; } }
@keyframes login-status { 70%, 100% { box-shadow: 0 0 0 8px rgba(85, 229, 167, 0); } }

@media (max-width: 980px) {
    .login-wrap { grid-template-columns: 1fr; justify-items: center; padding: 40px 28px; }
    .login-welcome { display: none; }
    .login-panel { max-width: 460px; transform: translateY(-24px); }
    .login-screen-brand { left: 28px; }
}

@media (max-width: 600px) {
    .guest-page .main { margin-left: 0; padding-bottom: 0; }
    .login-wrap { min-height: 100vh; padding: 82px 16px 24px; }
    .login-panel { padding: 24px 20px; border-radius: 16px; transform: translateY(-12px); }
    .login-screen-brand { top: 22px; left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .login-orb, .login-grid-motion, .login-light-sweep, .login-particle, .login-live-status i { animation: none !important; }
}

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); }
.dashboard-stack {
    display: grid;
    gap: 16px;
}

.dashboard-table-scroll {
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.dashboard-table-scroll table {
    min-width: 980px;
}

.dashboard-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f3f7fb;
}

.dashboard-timeline-scroll {
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.panel { padding: 16px; }
.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 14px;
}
.panel-head span { color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; }
.admin-record-management { display: grid; gap: 16px; align-items: start; }
.log-session-metrics { margin-bottom: 16px; }
.admin-record-section .panel-head { align-items: end; }
.record-search { width: min(100%, 330px); }
.admin-record-table { max-height: 58vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.admin-record-table thead { position: sticky; z-index: 2; top: 0; background: #f4f7fb; }
.admin-record-table tbody tr:hover { background: #f8fbfe; }
.resizable-table-wrap { width: 100%; }
.resizable-table { width: 100%; min-width: 820px; table-layout: fixed; }
.resizable-table th { position: relative; }
.resizable-table th, .resizable-table td { overflow: hidden; text-overflow: ellipsis; }
.resizable-table th:last-child, .resizable-table td:last-child { overflow: visible; }
.column-resizer {
    position: absolute;
    z-index: 4;
    top: 0;
    right: -4px;
    width: 9px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}
.column-resizer::after {
    content: "";
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: 4px;
    width: 1px;
    background: #cbd8e5;
}
.column-resizer:hover::after, body.is-resizing-column .column-resizer::after { width: 2px; background: var(--blue); }
body.is-resizing-column { cursor: col-resize; user-select: none; }
.session-created-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.session-created-by { color: var(--blue); font-weight: 700; white-space: nowrap; }
.admin-record-table td:nth-child(2), .admin-record-table td:nth-child(4) { white-space: normal; }
.legacy-admin-records { display: none; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }

.timeline { display: grid; gap: 10px; }
.timeline-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfe;
}
.timeline-item strong, .timeline-item span { display: block; }
.timeline-item span { color: var(--muted); font-size: 13px; margin-top: 4px; }

.work-form { display: grid; gap: 16px; }
.workin-progress { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.workin-progress button { display: grid; justify-items: center; gap: 3px; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.workin-progress button span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: #e8eef5; font-weight: 800; }
.workin-progress button.active, .workin-progress button.done { color: var(--blue); }
.workin-progress button.active span, .workin-progress button.done span { color: #fff; background: var(--blue); }
.workin-progress i { height: 3px; border-radius: 3px; background: #dce5ef; }
.draft-notice { padding: 10px 12px; border: 1px solid #f1cd72; border-radius: 8px; color: #704d00; background: #fff8df; }
.wizard-actions, .worker-actions { display: flex; justify-content: space-between; gap: 8px; }
.wizard-actions .primary-action:active { transform: scale(.98); }
.worker-actions { margin-top: 8px; justify-content: flex-end; flex-wrap: wrap; }
.workin-review { display: grid; gap: 5px; margin-top: 14px; padding: 12px; border-radius: 8px; background: #edf7fb; }
.workin-review span { color: #41536b; font-size: 13px; }
.save-state { color: var(--muted); font-size: 12px; font-weight: 700; }
.gps-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.gps-input-row button { white-space: nowrap; }
.day-board.is-loading, .selected-workin-box.is-loading { opacity: .55; pointer-events: none; }
.workin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(430px, .62fr);
    gap: 16px;
    align-items: start;
}

.workin-layout.read-only-board {
    grid-template-columns: 1fr;
}

.workin-layout.read-only-board .day-board {
    position: static;
    max-height: none;
}

.workin-layout.read-only-board .day-list {
    max-height: none;
}

.workin-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.simple-flow {
    max-width: none;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.field {
    display: grid;
    gap: 7px;
    color: #2d3d52;
    font-weight: 700;
    font-size: 13px;
}
.span-2 { grid-column: span 2; }

input, select, textarea {
    width: 100%;
    border: 1px solid #cbd7e4;
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}
textarea { min-height: 86px; resize: vertical; }

select.locked {
    color: #52677f;
    background: #eef3f8;
    cursor: not-allowed;
}

.field-note {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.mode-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}

.segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfe;
}

.segmented label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 6px;
    cursor: pointer;
}

.segmented label:has(input:checked) {
    color: #fff;
    background: var(--blue);
}

.segmented input {
    width: auto;
    accent-color: var(--blue);
}

.step-panel {
    border-left: 4px solid var(--blue);
}

.step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.step-title span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--blue);
    font-weight: 800;
}

.role-grid {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.2fr);
    gap: 14px;
}
.mobile-collapse { min-width: 0; }
.mobile-collapse > summary { display: none; }
.mobile-collapse-content { min-width: 0; }
@media (min-width: 981px) {
    .mobile-collapse:not([open]) > .mobile-collapse-content { display: block; }
}

.radio-list, .check-list {
    display: grid;
    gap: 6px;
    max-height: 360px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfe;
}
.compact { max-height: 280px; }
.radio-list label, .check-list label, .mode-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
}
.radio-list input, .check-list input, .mode-row input { width: auto; }

.simple-list label {
    min-height: 38px;
    padding: 7px 8px;
    border-radius: 6px;
}

.simple-list label:hover {
    background: #edf4fb;
}

.section-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.section-line h3 {
    margin: 0;
}

.mini-search {
    max-width: 170px;
    min-height: 36px;
    padding: 8px 10px;
}
.selection-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.selection-tools label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.selection-tools label input { width: auto; min-height: 0; }
.text-action { border: 0; padding: 6px 8px; color: var(--blue); background: transparent; cursor: pointer; font-weight: 700; }
.danger-text { color: #b42318; }
.team-create-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 12px; }
.team-card-wrap { display: grid; gap: 2px; }
.team-card-wrap form { justify-self: end; }
.permission-guide { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.permission-guide span { display: grid; gap: 4px; padding: 10px; border-radius: 8px; background: #f5f8fb; color: var(--muted); font-size: 12px; }
.permission-guide strong { color: var(--ink); }
.users-permission-guide { gap: 7px; }
.users-permission-guide span { font-size: 10.5px; line-height: 1.25; padding: 7px 8px; }
.users-panel .panel-head { margin-bottom: 10px; }
.users-table-wrap { max-height: calc(100vh - 260px); }
.users-table { min-width: 1180px; table-layout: fixed; }
.users-table th { background: #f2f6fa; font-size: 10px; line-height: 1.15; padding: 6px; position: sticky; top: 0; z-index: 2; }
.users-table td { font-size: 10.5px; padding: 5px 4px; vertical-align: middle; }
.users-table th:nth-child(1), .users-table td:nth-child(1) { width: 125px; }
.users-table th:nth-child(2), .users-table td:nth-child(2) { width: 95px; }
.users-table th:nth-child(3), .users-table td:nth-child(3) { width: 260px; }
.users-table th:nth-child(4), .users-table td:nth-child(4) { width: 95px; }
.users-table th:nth-child(n+5):nth-child(-n+8), .users-table td:nth-child(n+5):nth-child(-n+8) { width: 66px; }
.users-table th:nth-child(9), .users-table td:nth-child(9) { width: 120px; }
.users-table input:not([type="checkbox"]), .users-table select { font-size: 10.5px; min-height: 30px; padding: 5px 6px; width: 100%; }
.users-table input[type="checkbox"] { height: 15px; width: 15px; }
.admin-record-management { font-size: 11px; }
.admin-record-management .panel { padding: 16px; }
.admin-record-management .panel-head { margin-bottom: 11px; }
.admin-record-management .panel-head h2 { font-size: 18px; }
.admin-record-management .panel-head span { font-size: 11px; }
.admin-record-management .record-search { font-size: 11px; min-height: 34px; padding: 6px 9px; }
.admin-record-management table th { font-size: 10.5px; line-height: 1.2; padding: 7px 6px; }
.admin-record-management table td { font-size: 11px; line-height: 1.3; padding: 7px 6px; }
.admin-record-management table td strong { font-size: 11px; }
.admin-record-management .secondary-action, .admin-record-management .danger-action { font-size: 10px; min-height: 30px; padding: 6px 8px; }
.permission-cell { text-align: center; }
.users-save-footer { align-items: center; display: flex; justify-content: flex-end; gap: 14px; padding-top: 12px; }
.users-save-footer span { color: var(--muted); font-size: 11px; }
.users-new-form { align-items: end; display: grid; gap: 10px; grid-template-columns: 1fr 130px 2fr 120px 150px repeat(4, auto) auto; }
.compact-check { align-items: center; display: flex; font-size: 10.5px; gap: 4px; padding-bottom: 9px; white-space: nowrap; }
@media (max-width: 1200px) { .users-new-form { grid-template-columns: repeat(3, minmax(150px, 1fr)); } }
@media (max-width: 700px) { .users-new-form { grid-template-columns: 1fr; } .users-bulk-save { width: auto; } }
.audit-readonly-note { min-height: 44px; padding: 11px 12px; border-radius: 8px; background: #f5f8fb; font-weight: 500; }
.qc-indicator { display: inline-flex; margin-top: 6px; padding: 3px 7px; color: #fff; border-radius: 999px; background: var(--success); font-size: 11px; font-weight: 800; }
.summary-member-details { min-width: 190px; }
.summary-member-details summary { color: var(--blue); cursor: pointer; font-weight: 700; white-space: nowrap; }
.summary-member-details[open] summary { margin-bottom: 8px; }

.team-preset {
    margin: 12px 0;
    padding: 12px;
    border-radius: 8px;
    background: #edf7fb;
    border: 1px solid #c4e7f0;
}

.member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.member-chip {
    border-radius: 999px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid #cae4ee;
    font-size: 13px;
}
.member-chip.leader { border-color: #ffd15f; background: #fff8df; }

.team-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 760px;
    overflow: auto;
}
.team-card {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfe;
    color: var(--ink);
    text-decoration: none;
}
.team-card span, .team-card small { font-size: 13px; color: #41536b; }
.team-card-members {
    display: grid;
    gap: 5px;
    max-height: 106px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-gutter: stable;
}

.team-card-members small {
    overflow-wrap: anywhere;
}

.team-card.active {
    border-color: var(--blue);
    background: #edf5ff;
}

.more-options {
    margin-top: 12px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.more-options summary {
    color: var(--blue);
    cursor: pointer;
    font-weight: 700;
}

.more-options .form-grid {
    margin-top: 12px;
}

.day-board {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 116px);
    overflow: hidden;
}

.day-list {
    display: grid;
    gap: 8px;
    max-height: calc(100vh - 178px);
    overflow: auto;
    padding-right: 4px;
}

.workin-month-divider {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 8px;
    color: #fff;
    background: var(--blue);
}
.workin-month-divider span { font-size: 11px; opacity: .85; }
.history-filter { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.history-filter .field { min-width: 180px; }
.history-period-range { display: grid; gap: 2px; min-width: 210px; min-height: 66px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: #f6f9fc; }
.history-period-range small, .history-period-range span { color: var(--muted); font-size: 11px; }
.history-period-range strong { color: var(--blue); font-size: 14px; }
.history-sequence { width: 58px; text-align: center; vertical-align: top; background: #eef5fb; }
.history-sequence strong { display: grid; place-items: center; width: 34px; height: 34px; margin: 2px auto; border-radius: 7px; color: #fff; background: var(--blue); font-size: 16px; }
.history-ref-group + .history-ref-group .history-ref-heading td { border-top: 4px solid #d9e4ee; }
.history-ref-heading td { background: #f6f9fc; }
.history-ref-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.history-ref-main { position: relative; display: grid; flex: 0 0 auto; justify-items: start; gap: 4px; }
.history-ref-main > strong { color: var(--blue); font-size: 15px; }
.history-ref-title > span { padding: 4px 7px; border-radius: 6px; background: #e6eef6; font-size: 12px; font-weight: 700; }
.history-ref-title > a, .history-ref-title > em { color: var(--ink); font-style: normal; font-weight: 700; }
.photo-completeness { position: relative; }
.photo-completeness > summary { display: inline-flex; align-items: center; gap: 4px; min-height: 23px; padding: 3px 7px; border: 1px solid; border-radius: 999px; cursor: pointer; list-style: none; font-size: 10px; font-weight: 800; white-space: nowrap; }
.photo-completeness > summary::-webkit-details-marker { display: none; }
.photo-completeness-icon { display: inline-grid; width: 13px; height: 13px; place-items: center; border-radius: 50%; color: currentColor; background: rgba(255, 255, 255, .6); font-size: 9px; }
.photo-completeness-complete > summary { color: #17633e; border-color: #82c79f; background: #e4f5eb; }
.photo-completeness-partial > summary { color: #775200; border-color: #e2bd57; background: #fff3c4; }
.photo-completeness-missing > summary { color: #9a3333; border-color: #e2a3a3; background: #fde9e9; }
.photo-completeness-neutral > summary { color: #607184; border-color: #cbd5df; background: #eef2f5; }
.photo-completeness-detail { position: absolute; z-index: 8; top: calc(100% + 6px); left: 0; width: min(300px, 78vw); padding: 9px 10px; border: 1px solid #cbdbe6; border-radius: 9px; background: #fff; box-shadow: 0 12px 30px rgba(20, 48, 72, .16); }
.photo-completeness-detail strong, .photo-completeness-detail span, .photo-completeness-detail small { display: block; }
.photo-completeness-detail span { margin-top: 5px; color: #4d6174; font-size: 11px; line-height: 1.5; }
.photo-completeness-detail small { margin-top: 6px; color: #78899a; font-size: 9px; }
.history-session-row td:first-child { display: grid; gap: 3px; }
.history-session-row td:first-child small { color: var(--muted); font-size: 10px; }
.workin-details-summary { margin-bottom: 16px; }
.workin-details-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.workin-details-heading h2 { margin: 0; }
.workin-details-heading span { color: var(--muted); font-size: 12px; }
.history-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.history-table { max-height: 68vh; }
.history-table table { min-width: 1400px; }

@media (max-width: 980px) {
    .history-ref-title { align-items: flex-start; gap: 7px; }
    .history-ref-main { min-width: 150px; }
    .history-ref-main > strong { font-size: 13px; }
    .photo-completeness > summary { min-height: 26px; padding: 4px 7px; font-size: 10px; }
    .photo-completeness-detail { position: static; width: min(280px, calc(100vw - 78px)); margin-top: 5px; box-shadow: 0 6px 18px rgba(20, 48, 72, .12); }
}

.day-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfe;
}

.day-row.has-entry {
    border-color: #acd2f7;
    background: #eef6ff;
}

.day-row.previous {
    background: #fbfcfe;
}

.day-row.previous.has-entry {
    border-color: #c9d7e7;
    background: #f5f8fc;
}

.day-row.older { background: #fdfdfd; }
.day-row.older.has-entry { border-color: #d6deea; background: #f8fafc; }

.day-number {
    width: 88px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--blue);
    background: #fff;
    border: 1px solid #cfe0f2;
    font-weight: 800;
    font-size: 12px;
}

.day-content {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.day-entry {
    display: grid;
    gap: 3px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(17, 89, 181, .14);
}

.day-entry:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.day-entry strong,
.day-entry span,
.day-entry small,
.entry-members em {
    overflow-wrap: anywhere;
}

.day-entry span {
    color: var(--ink);
    font-size: 13px;
}

.day-entry small {
    color: var(--muted);
    font-size: 12px;
}
.workin-entry-note { padding: 6px 8px; border-radius: 6px; background: #fff; }
.workin-edit-action { justify-self: start; margin-top: 4px; padding: 6px 10px; font-size: 12px; }

.entry-members {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 3px;
}

.entry-members em {
    padding: 4px 6px;
    border-radius: 999px;
    background: #fff;
    color: #324761;
    border: 1px solid #d4e3f2;
    font-style: normal;
    font-size: 11px;
}

.selected-workin-box {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #cfe0f2;
    border-radius: 8px;
    background: #f8fbfe;
}

.selected-workin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.selected-workin-head span {
    color: var(--blue);
    font-weight: 800;
    font-size: 13px;
}

.selected-workin-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-workin-member {
    max-width: 100%;
    padding: 7px 9px;
    border: 1px solid #d4e3f2;
    border-radius: 999px;
    background: #fff;
    color: #324761;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.selected-workin-member.leader {
    border-color: #ffd15f;
    background: #fff8df;
    color: #5f4300;
}

.team-summary-list {
    display: grid;
    gap: 10px;
}

.summary-stack {
    display: grid;
    gap: 16px;
}

.summary-filter-panel { margin-bottom: 18px; padding: 16px; }
.summary-filter-grid {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(150px, .7fr) minmax(260px, 1.7fr) auto auto;
    align-items: end;
    gap: 12px;
}
.summary-filter-grid .primary-action,
.summary-filter-grid .secondary-action { min-height: 42px; display: inline-grid; place-items: center; white-space: nowrap; }
.team-overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.team-overview-card { position: relative; overflow: hidden; padding: 0; border-color: #bed8ea; box-shadow: 0 8px 22px rgba(17, 75, 118, .08); }
.team-overview-card::before { position: absolute; inset: 0 auto 0 0; width: 3px; content: ""; background: linear-gradient(180deg, #1676a9, #29b8c6); }
.team-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 8px 14px; border-bottom: 1px solid #d6e7f2; background: linear-gradient(105deg, #edf7fc 0%, #f8fcfe 64%, #eef9f8 100%); }
.team-overview-head span { display: block; color: #6e8195; font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.team-overview-head h2 { margin: 1px 0 0; color: #164773; font-size: 16px; }
.team-overview-head > small { padding: 3px 6px; border: 1px solid #d5e2ed; border-radius: 999px; color: #667b8f; background: #fff; font-size: 9px; }
.team-overview-values { display: grid; grid-template-columns: .75fr 1.15fr 1fr; }
.team-overview-values > div { min-width: 0; padding: 9px 8px; text-align: center; }
.team-overview-values span { display: block; min-height: 22px; color: var(--muted); font-size: 9px; line-height: 1.2; }
.team-overview-values strong { display: block; margin-top: 2px; color: #153d62; font-size: 16px; font-variant-numeric: tabular-nums; }
.team-overview-values small { display: block; margin-top: 1px; color: #718397; font-size: 8px; }
.team-overview-money { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 6px 10px 6px 14px; border-top: 1px solid #d6e7f2; color: var(--muted); background: #f6fbfd; font-size: 9px; }
.team-overview-money > div { min-width: 0; margin-right: auto; }
.team-overview-money > div > span, .team-overview-money > div > small { display: block; }
.team-overview-money > div > small { margin-top: 1px; color: #8291a0; font-size: 7px; }
.team-overview-money strong { color: var(--success); font-size: 14px; }
.summary-head { align-items: center; gap: 18px; }
.summary-team-title { min-width: 135px; }
.summary-team-title h2 { margin-bottom: 4px; }
.summary-team-kpis { display: grid; grid-template-columns: repeat(3, minmax(105px, 1fr)); gap: 8px; margin-left: auto; }
.summary-team-kpis > div,
.summary-team-money { min-width: 105px; padding: 9px 12px; border: 1px solid #dbe7f1; border-radius: 10px; background: #f7fafc; }
.summary-team-kpis span,
.summary-team-money span { display: block; color: var(--muted); font-size: 11px; }
.summary-team-kpis strong,
.summary-team-money strong { display: inline-block; margin-top: 3px; color: #173a5b; font-size: 20px; font-variant-numeric: tabular-nums; }
.summary-team-kpis small,
.summary-team-money small { margin-left: 4px; color: var(--muted); font-size: 10px; }
.summary-team-money strong { color: var(--success); }

.manday-panel {
    overflow: hidden;
}

.summary-head > strong {
    color: var(--success);
    font-size: 22px;
}

@media (max-width: 980px) {
    .summary-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .team-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-project-filter { grid-column: 1 / -1; }
    .summary-head { align-items: stretch; flex-direction: column; }
    .summary-team-kpis { width: 100%; margin-left: 0; }
    .summary-team-money { width: 100%; }
}

@media (max-width: 600px) {
    .summary-filter-grid { grid-template-columns: 1fr; }
    .team-overview-grid { grid-template-columns: 1fr; }
    .summary-project-filter { grid-column: auto; }
    .summary-team-kpis { grid-template-columns: 1fr; }
}

.matrix-wrap {
    overflow: auto;
    max-height: calc(100vh - 220px);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.manday-matrix {
    min-width: 1040px;
}

.manday-matrix th,
.manday-matrix td {
    vertical-align: top;
    background: #fff;
}

.manday-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f3f7fb;
}

.manday-matrix th span,
.manday-matrix th small,
.manday-matrix td span,
.manday-matrix td small {
    display: block;
}

.manday-matrix th small,
.manday-matrix td small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
}

.manday-matrix td.has-manday {
    color: var(--blue);
    background: #eef6ff;
    font-weight: 900;
    text-align: center;
    min-width: 86px;
}

.manday-matrix td.has-manday strong,
.manday-matrix td.has-manday small {
    display: block;
}

.manday-matrix td.has-manday small {
    color: #52677f;
    font-weight: 700;
}

.manday-matrix td.has-money {
    color: #0b7a55;
    background: #ecfff7;
    font-weight: 900;
    text-align: right;
}

.manday-matrix td.total-money {
    color: #082849;
    background: #fff8df;
}

.summary-members {
    display: grid;
    gap: 5px;
    min-width: 260px;
}

.summary-member {
    display: grid;
    grid-template-columns: 58px minmax(120px, 1fr);
    gap: 4px 8px;
    padding: 6px;
    border: 1px solid #d8e5f2;
    border-radius: 8px;
    background: #f8fbfe;
}

.summary-member strong {
    color: var(--blue);
    font-size: 11px;
    grid-row: span 2;
}

.summary-member.worker strong {
    color: #52677f;
}

.summary-member span,
.summary-member small {
    overflow-wrap: anywhere;
}

.summary-member small {
    color: var(--muted);
}

.manday-matrix .sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f8fbfe;
}

.manday-matrix thead .sticky-col {
    z-index: 4;
    background: #eaf2fb;
}

.team-summary {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfe;
    overflow: hidden;
}

.team-summary summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
}

.team-summary summary strong {
    color: var(--blue);
}

.team-summary summary span {
    color: var(--muted);
    font-size: 13px;
}

.project-summary-list {
    display: grid;
    gap: 10px;
    padding: 0 12px 12px;
}

.project-summary-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #d8e5f2;
    background: #fff;
}

.project-summary-head {
    display: grid;
    gap: 3px;
}

.project-summary-head span,
.project-summary-head small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.member-summary-list {
    display: grid;
    gap: 6px;
}

.member-summary-row {
    display: grid;
    grid-template-columns: 72px minmax(160px, .8fr) minmax(180px, 1fr);
    gap: 8px;
    align-items: start;
    padding: 8px;
    border-radius: 8px;
    background: #f8fbfe;
}

.member-summary-row span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}

.member-summary-row.worker span {
    color: #52677f;
}

.member-summary-row strong,
.member-summary-row small {
    overflow-wrap: anywhere;
}

.member-summary-row small {
    color: var(--muted);
}

.commission-admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.commission-admin-table {
    min-width: 0;
}

.compact-panel-head {
    margin-bottom: 8px;
}

.commission-admin-table input {
    min-width: 120px;
}

.commission-admin-table td {
    vertical-align: middle;
}

.action-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.flash-stack { display: grid; gap: 8px; margin-bottom: 14px; }
.flash {
    border-radius: 8px;
    padding: 11px 14px;
    border: 1px solid #b9e5d3;
    color: var(--success);
    background: #ebfff7;
}

.popup-layer {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 29, 53, .32);
}

.popup-card {
    width: min(420px, 100%);
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 24px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(8, 40, 73, .24);
    text-align: center;
}

.popup-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
}

.popup-card.success .popup-icon {
    background: var(--success);
}

.popup-card.error .popup-icon {
    background: #b42318;
}

.popup-card strong {
    font-size: 20px;
}

.popup-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.empty, .muted { color: var(--muted); }
.is-hidden { display: none; }
.smart-field { position: relative; }
.smart-search {
    position: relative;
    display: block;
    min-width: 0;
}
.smart-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    max-height: min(52vh, 420px);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #b9c9da;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(22, 42, 66, .18);
}
.smart-option {
    display: grid;
    width: 100%;
    min-height: 58px;
    gap: 3px;
    padding: 10px 12px;
    border: 0;
    border-radius: 7px;
    color: var(--ink);
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.smart-option:hover, .smart-option.is-active {
    background: #eaf3fc;
    outline: none;
}
.smart-option strong, .smart-option span, .smart-option small { display: block; }
.smart-option span { overflow-wrap: anywhere; }
.smart-option small { color: var(--muted); }
.smart-empty { padding: 14px 12px; color: var(--muted); font-weight: 500; }
.smart-empty.error { color: #b42318; }
.location-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.location-filter label {
    display: flex;
    align-items: center;
    gap: 7px;
}
.location-filter select { width: auto; min-width: 105px; }
.location-button { white-space: nowrap; }
.mobile-submit-bar { display: none; }

.page-description {
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.5;
}
.audit-overview-grid {
    display: grid;
    grid-template-columns: minmax(360px, .85fr) minmax(360px, 1.15fr);
    gap: 16px;
    margin-bottom: 16px;
}
.audit-create-panel { overflow: visible; }
.profile-builder summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}
.profile-builder summary span { color: var(--muted); font-size: 13px; }
.profile-builder[open] summary { margin-bottom: 18px; }
.audit-settings-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.audit-settings-head::-webkit-details-marker { display: none; }
.audit-add-settings[open] .audit-settings-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.audit-settings-head .eyebrow { margin-bottom: 3px; }
.audit-settings-toggle { flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; color: var(--blue); background: #edf5ff; font-weight: 800; font-size: 13px; }
.audit-add-settings[open] .audit-settings-toggle::before { content: "ซ่อน"; }
.audit-add-settings[open] .audit-settings-toggle { font-size: 0; }
.audit-add-settings[open] .audit-settings-toggle::before { font-size: 13px; }
.audit-settings-content { padding-top: 14px; }
.audit-setting-groups { display: grid; gap: 10px; }
.audit-setting-group { border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; }
.audit-setting-group > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding: 12px; }
.audit-setting-group[open] { padding: 0 12px 12px; border-color: #9fc4eb; background: #fff; }
.audit-setting-group[open] > summary { margin: 0 -12px 14px; border-bottom: 1px solid var(--line); }
.profile-builder summary .audit-setting-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #fff; background: var(--blue); font-size: 14px; font-weight: 800; }
.audit-subheading { display: flex; align-items: center; gap: 7px; margin: 12px 0 8px; font-size: 14px; }
.audit-subheading span, .audit-field-label b { color: var(--blue); }
.audit-field-label { display: flex; gap: 7px; align-items: center; }
.audit-existing-profiles-head { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.audit-existing-profiles-head h3 { margin: 0; }
.audit-existing-profiles-head span { color: var(--muted); font-size: 13px; }
.profile-edit-list { display: grid; gap: 8px; margin-top: 12px; }
.profile-editor { padding-top: 10px; border-top: 1px solid var(--line); }
.audit-card-list { display: grid; gap: 9px; }
.audit-history-filter { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto; gap: 8px; align-items: end; margin-bottom: 14px; }
.audit-title-manager { margin-bottom: 12px; }
.audit-title-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.audit-title-options { display: grid; gap: 4px; margin-top: 10px; }
.audit-title-options > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 6px; background: #f8fbfe; }
.audit-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 14px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
}
.audit-card:hover { border-color: #9ab8d8; background: #f8fbfe; }
.audit-card-link { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 0; flex: 1; color: inherit; text-decoration: none; }
.audit-export-action { flex: 0 0 auto; white-space: nowrap; }
.audit-head-actions { justify-content: flex-end; }
.audit-card-main, .audit-card-meta { display: grid; gap: 4px; }
.audit-card-main { min-width: 0; }
.audit-card-main > span:not(.status-badge), .audit-card-meta { color: var(--muted); font-size: 13px; }
.audit-card-main .status-badge { justify-self: start; }
.audit-card-meta { flex-shrink: 0; text-align: right; }
.audit-fail-text { color: #b42318; font-weight: 700; }
.empty-state { padding: 30px; color: var(--muted); text-align: center; }
.stock-tabs { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 5px; margin: 0 0 18px; overflow-x: auto; }
.stock-tabs a { border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; color: #506174; font-size: 12px; font-weight: 800; padding: 10px 14px; text-decoration: none; white-space: nowrap; }
.stock-tabs a:hover { background: #f3f7fa; color: var(--blue); }
.stock-tabs a.active { background: #fff; border-color: var(--line); color: var(--blue); margin-bottom: -1px; padding-bottom: 11px; }
.settings-tabs { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 5px; margin: 0 0 18px; overflow-x: auto; }
.settings-tabs a { border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; color: #506174; font-size: 12px; font-weight: 800; padding: 10px 14px; text-decoration: none; white-space: nowrap; }
.settings-tabs a:hover { background: #f3f7fa; color: var(--blue); }
.settings-tabs a.active { background: #fff; border-color: var(--line); color: var(--blue); margin-bottom: -1px; padding-bottom: 11px; }
.stock-empty-state strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }
.stock-empty-state p { margin: 0; }
.stock-audit-filter .field { min-width: min(360px, 100%); }
.stock-audit-table td small { display: block; color: var(--muted); margin-top: 4px; min-width: 180px; }
.stock-audit-table th small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.stock-number-column { min-width: 110px; text-align: right; }
.stock-number-value { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 110px; text-align: right; white-space: nowrap; }
.stock-equipment-summary { min-width: 280px; max-width: 540px; line-height: 1.55; }
.stock-control-head { align-items: center; }
.stock-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stock-summary-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 17px 18px; border: 1px solid #c9dbea; border-radius: 14px; background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(235,245,252,.88)); box-shadow: 0 8px 24px rgba(11,55,112,.06); }
.stock-summary-card span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.stock-summary-card strong { grid-row: span 2; align-self: center; color: var(--blue); font-size: 28px; font-variant-numeric: tabular-nums; }
.stock-summary-card small { color: var(--muted); }
.stock-summary-card.warning { border-color: #ead08a; background: linear-gradient(145deg, #fffdf7, #fff5d8); }
.stock-summary-card.warning strong { color: #9a6810; }
.stock-operation-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.stock-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.stock-section-head h2 { margin: 2px 0 0; font-size: 20px; }
.stock-section-head .eyebrow { margin: 0; }
.stock-scanner { display: grid; justify-items: center; gap: 10px; padding: 12px; margin-bottom: 14px; border-radius: 13px; background: #071a30; color: #fff; }
.stock-scanner video { width: min(100%, 520px); max-height: 340px; border-radius: 10px; object-fit: cover; }
.stock-scanner p { margin: 0; font-size: 12px; color: #d8e8f8; }
.stock-code-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.stock-selected-product { min-height: 78px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 12px 0; border: 1px dashed #a8bfd5; border-radius: 12px; background: #f7fbfe; }
.stock-selected-product img { width: 58px; height: 58px; border-radius: 9px; object-fit: cover; }
.stock-selected-gallery { display: flex; gap: 5px; max-width: 190px; overflow-x: auto; padding-bottom: 3px; }
.stock-selected-gallery img { width: 48px; height: 48px; flex: 0 0 48px; }
.stock-selected-product strong, .stock-selected-product small { display: block; }
.stock-selected-product small, .stock-product-placeholder { color: var(--muted); }
.stock-selected-product .stock-selected-balance { margin-left: auto; text-align: right; }
.stock-selected-product .stock-selected-balance strong { color: var(--blue); font-size: 20px; font-variant-numeric: tabular-nums; }
.stock-movement-form { display: grid; gap: 11px; }
.stock-unit-conversion { padding: 10px 12px; border: 1px solid #a9cee0; border-radius: 10px; background: #eef8fc; color: #12536c; font-size: 12px; font-weight: 800; }
.stock-movement-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stock-admin-stack { display: grid; gap: 12px; }
.stock-admin-panel { padding: 0; overflow: hidden; }
.stock-admin-panel > summary { padding: 15px 17px; cursor: pointer; color: var(--blue); font-weight: 850; }
.stock-admin-panel[open] > summary { border-bottom: 1px solid var(--line); background: #f5f9fc; }
.stock-admin-form { display: grid; gap: 12px; padding: 15px 17px 17px; }
.stock-admin-form p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.stock-admin-form .wide { grid-column: 1 / -1; }
.stock-reset-panel { border-color: rgba(190, 49, 68, .28); }
.stock-reset-panel > summary { color: #9f2738; }
.stock-reset-warning { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid rgba(190, 49, 68, .22); border-radius: 12px; background: rgba(190, 49, 68, .06); color: #7f2332; }
.stock-reset-warning span { font-size: 12px; line-height: 1.55; }
.stock-reset-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stock-reset-counts span { display: flex; justify-content: space-between; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfd; color: var(--muted); font-size: 12px; }
.stock-reset-counts b { color: var(--blue); }
.stock-reset-audit { display: grid; gap: 8px; padding: 0 17px 17px; }
.stock-reset-audit > div { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stock-reset-audit small { color: var(--muted); overflow-wrap: anywhere; }
.stock-inbox-zip-form { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.stock-import-image-link { display: grid; justify-items: center; gap: 4px; min-width: 68px; color: var(--blue); font-size: 10px; text-decoration: none; }
.stock-import-image-link img { width: 58px; height: 58px; border: 1px solid var(--line); border-radius: 9px; background: #fff; object-fit: cover; }
.stock-import-image-link:hover img { border-color: var(--blue); box-shadow: 0 6px 18px rgba(11, 55, 112, .16); }
.stock-package-unit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .45fr); gap: 8px; }
.stock-package-unit-grid input { min-width: 0; }
.stock-catalog-panel, .stock-history-panel { margin-bottom: 16px; }
.stock-team-filter { display: flex; align-items: end; gap: 8px; margin-bottom: 14px; }
.stock-team-filter .field { min-width: 220px; }
.stock-filter { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(150px, .4fr) minmax(140px, .35fr) auto auto; align-items: end; gap: 8px; margin-bottom: 13px; }
.stock-product-table td small, .stock-history-panel td small { display: block; color: var(--muted); margin-top: 3px; }
.stock-check-cell { width: 42px; text-align: center; }
.stock-check-cell input { width: 17px; height: 17px; accent-color: #176b87; }
.stock-qr-cell { width: 74px; text-align: center; }
.stock-qr-cell img { display: block; width: 54px; height: 54px; margin: auto; padding: 3px; border: 1px solid #d9e4ec; border-radius: 7px; background: #fff; image-rendering: pixelated; }
.stock-summary-text { font-size: 16px !important; line-height: 1.25; }
.stock-pdf-review { padding: 18px; }
.stock-pdf-review-table { min-width: 1120px; }
.stock-pdf-review-table td { vertical-align: top; }
.stock-pdf-review-table td:nth-child(3) { min-width: 310px; }
.stock-pdf-review-table td:nth-child(4) { min-width: 300px; }
.stock-pdf-review-table select, .stock-pdf-review-table input[type="number"] { width: 100%; min-width: 130px; }
.stock-pdf-review-table tr.is-review { background: #fff8df; }
.stock-pdf-review-table tr.is-excluded { opacity: .46; background: #f1f4f6; }
.stock-pdf-new-product { display: grid; gap: 7px; margin-top: 8px; padding: 9px; border: 1px solid #c7dce7; border-radius: 9px; background: #f4fafc; }
.stock-pdf-new-product[hidden] { display: none; }
.stock-pdf-new-product label { display: grid; gap: 3px; color: #476176; font-size: 11px; font-weight: 800; }
.stock-pdf-new-product input { width: 100%; min-width: 0; }
.stock-pdf-new-unit-row { display: grid; grid-template-columns: 1fr 1fr .7fr; gap: 6px; }
.stock-pdf-confirm-bar { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid #b8d5e3; border-radius: 12px; background: rgba(239,248,252,.96); box-shadow: 0 8px 22px rgba(17,48,74,.12); }
.stock-product-cell { display: flex; align-items: center; gap: 10px; min-width: 280px; }
.stock-product-cell img, .stock-product-no-image { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 9px; object-fit: cover; }
.stock-product-detail-button { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.stock-product-detail-button:hover strong { color: var(--blue); }
.stock-product-primary-image { width: 46px; height: 46px; flex: 0 0 46px; border: 1px solid var(--line); border-radius: 9px; background: #fff; object-fit: cover; }
.stock-product-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; }
.stock-product-modal[hidden] { display: none; }
body.stock-modal-open { overflow: hidden; }
.stock-product-modal-backdrop { position: absolute; inset: 0; background: rgba(5, 25, 48, .62); backdrop-filter: blur(5px); }
.stock-product-modal-card { position: relative; width: min(920px, 100%); max-height: min(86vh, 820px); overflow: auto; border: 1px solid rgba(255,255,255,.7); border-radius: 20px; background: #fff; box-shadow: 0 28px 80px rgba(4, 24, 48, .32); }
.stock-product-detail-content { display: grid; gap: 20px; padding: 22px; }
.stock-product-detail-content > header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.stock-product-detail-content h2, .stock-product-detail-content h3, .stock-product-detail-content p { margin: 0; }
.stock-modal-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #f5f9fc; color: var(--blue); font-size: 25px; line-height: 1; cursor: pointer; }
.stock-product-detail-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.stock-detail-qr { display: grid; justify-items: center; align-content: center; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfd; text-align: center; }
.stock-detail-qr img { width: 94px; height: 94px; border-radius: 8px; background: #fff; object-fit: contain; }
.stock-detail-qr strong { max-width: 130px; overflow-wrap: anywhere; font-size: 11px; }
.stock-detail-qr .secondary-action { padding: 7px 9px; font-size: 10px; }
.stock-product-detail-metrics > div { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7fafc; }
.stock-product-detail-metrics span, .stock-product-detail-metrics small { color: var(--muted); font-size: 11px; }
.stock-product-media-row { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 14px; align-items: stretch; margin-top: 10px; }
.stock-detail-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 12px; }
.stock-detail-gallery figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfd; }
.stock-detail-gallery figure.is-primary { border-color: rgba(23,107,135,.55); box-shadow: 0 0 0 2px rgba(23,107,135,.1); }
.stock-detail-gallery img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #fff; }
.stock-detail-gallery figcaption { display: grid; gap: 7px; padding: 9px; }
.stock-detail-gallery figcaption > div { display: flex; flex-wrap: wrap; gap: 8px; }
.stock-detail-gallery form { margin: 0; }
.stock-product-detail-info dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 10px 0 0; }
.stock-product-detail-info dl > div { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.stock-product-detail-info dt { color: var(--muted); font-size: 11px; }
.stock-product-detail-info dd { margin: 3px 0 0; }
.stock-detail-image-add { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; padding-top: 14px; border-top: 1px solid var(--line); }
.stock-code-field, .stock-live-search { position: relative; }
.stock-search-suggestions { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; max-height: 320px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 16px 36px rgba(4,35,65,.18); }
.stock-search-suggestions[hidden] { display: none; }
.stock-search-suggestions button { display: grid; width: 100%; gap: 2px; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.stock-search-suggestions button:hover, .stock-search-suggestions button:focus { background: #edf6fb; outline: none; }
.stock-search-suggestions small, .stock-search-suggestions > span { color: var(--muted); font-size: 11px; }
.stock-popup-issue-form { display: grid; grid-template-columns: minmax(170px,1.4fr) repeat(3,minmax(120px,1fr)) auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid rgba(23,107,135,.25); border-radius: 14px; background: #f1f8fb; }
.stock-popup-issue-form h3 { margin: 0 0 4px; }
.stock-popup-issue-form > div > small { color: var(--muted); line-height: 1.4; }
.stock-product-no-image { display: grid; place-items: center; color: #7891aa; background: #edf4f9; }
.stock-balance-value { color: #14724d; font-size: 16px; font-weight: 850; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-balance-value.low, .stock-out { color: #b42318; }
.stock-in { color: #14724d; }
.stock-import-summary { display: grid; grid-template-columns: auto auto 1fr; gap: 10px 20px; align-items: center; padding: 14px 17px; margin-bottom: 14px; border: 1px solid #9ad3bb; border-radius: 12px; background: #effaf5; }
.stock-import-summary.has-error { border-color: #efb2aa; background: #fff4f2; }
.stock-import-summary p { justify-self: end; margin: 0; color: var(--muted); }
.stock-import-error-row { background: #fff8f7; }
.stock-import-duplicate-row { background: #fffbec; }
.stock-import-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.stock-import-toolbar label { color: var(--ink); font-weight: 800; }
.stock-row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.stock-row-actions form { margin: 0; }
.stock-catalog-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stock-catalog-actions form { margin: 0; }
.stock-management-warning { display: flex; align-items: center; gap: 12px; margin: -2px 0 13px; padding: 11px 13px; border: 1px solid #e7bd68; border-radius: 10px; background: #fff8e7; color: #704c0b; }
.stock-management-warning strong { white-space: nowrap; }
.stock-management-warning span { font-size: 12px; line-height: 1.45; }
.stock-edit-row td { padding: 0 !important; background: #f5f9fc; }
.stock-inline-edit-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
.stock-inline-edit-form .wide { grid-column: span 2; }
.stock-inline-edit-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.stock-job-progress-layer { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 18px; background: rgba(5,22,42,.58); backdrop-filter: blur(7px); }
.stock-job-progress-card { width: min(460px, 100%); padding: 24px; border-radius: 18px; background: rgba(255,255,255,.97); box-shadow: 0 24px 70px rgba(0,0,0,.24); }
.stock-job-progress-card h2 { margin: 4px 0 14px; }
.stock-job-progress-card > strong { display: block; margin-bottom: 8px; color: var(--blue); font-size: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.stock-job-progress-track { height: 10px; overflow: hidden; border-radius: 999px; background: #dce8f1; }
.stock-job-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #176b87, #36a7ca); transition: width .25s ease; }
.stock-job-progress-card p { margin: 12px 0 0; color: var(--muted); }
.stock-job-progress-layer.has-error .stock-job-progress-track i { background: #b42318; }
.stock-import-confirm { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; }
.stock-import-confirm strong { display: block; }
.stock-import-confirm p { margin: 4px 0 0; color: var(--muted); }

@media (max-width: 980px) {
    .stock-operation-grid { grid-template-columns: 1fr; }
    .stock-team-filter { align-items: stretch; flex-direction: column; }
    .stock-movement-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .stock-summary-grid { grid-template-columns: 1fr; gap: 8px; }
    .stock-product-modal { padding: 8px; align-items: end; }
    .stock-product-modal-card { max-height: 92vh; border-radius: 18px 18px 0 0; }
    .stock-product-detail-content { padding: 16px; }
    .stock-product-detail-metrics { grid-template-columns: 1fr; }
    .stock-product-media-row { grid-template-columns: minmax(0,1fr) 112px; gap: 8px; align-items: start; }
    .stock-detail-qr { padding: 8px 5px; }
    .stock-detail-qr img { width: 78px; height: 78px; }
    .stock-detail-qr strong { max-width: 100px; font-size: 9px; }
    .stock-detail-qr .secondary-action { padding: 6px; font-size: 9px; }
    .stock-detail-gallery { grid-template-columns: 1fr; }
    .stock-product-detail-info dl { grid-template-columns: 1fr; }
    .stock-detail-image-add { grid-template-columns: 1fr; }
    .stock-popup-issue-form { grid-template-columns: 1fr 1fr; }
    .stock-popup-issue-form > div, .stock-popup-issue-form > button { grid-column: 1 / -1; }
    .stock-summary-card { padding: 13px 14px; }
    .stock-operation-grid { gap: 10px; }
    .stock-scan-panel { padding: 13px; }
    .stock-section-head { align-items: flex-start; }
    .stock-movement-fields, .stock-filter { grid-template-columns: 1fr; }
    .stock-code-input { grid-template-columns: minmax(0, 1fr) auto; }
    .stock-selected-product { align-items: flex-start; flex-wrap: wrap; }
    .stock-selected-product .stock-selected-balance { width: 100%; margin-left: 0; text-align: left; }
    .stock-import-summary { grid-template-columns: 1fr 1fr; }
    .stock-import-summary p { grid-column: 1 / -1; justify-self: start; }
    .stock-import-confirm { align-items: stretch; flex-direction: column; }
    .stock-import-toolbar { align-items: flex-start; flex-direction: column; }
    .stock-management-warning { align-items: flex-start; flex-direction: column; gap: 4px; }
    .stock-inline-edit-form { grid-template-columns: 1fr; }
    .stock-inline-edit-form .wide { grid-column: auto; }
}
.muted-text { color: var(--muted); white-space: nowrap; }
.deduct-money { color: #b42318; }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--blue); text-decoration: none; font-weight: 700; }
.audit-detail-head { align-items: flex-end; }
.audit-overall {
    display: grid;
    min-width: 120px;
    gap: 2px;
    padding: 11px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    text-align: center;
    background: #fff;
}
.audit-overall small { color: var(--muted); }
.audit-overall.pass { color: var(--success); border-color: #88cfb5; background: #edf9f4; }
.audit-overall.fail { color: #b42318; border-color: #efaaa3; background: #fff3f1; }
.audit-overall.pending { color: #8a6413; border-color: #ecd28c; background: #fff9e8; }
.audit-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
    gap: 16px;
    align-items: start;
}
.audit-checklist, .audit-side { display: grid; gap: 14px; }
.audit-side { position: sticky; top: 16px; }
.audit-summary-strip {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    text-align: center;
}
.audit-summary-strip span { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.audit-summary-strip strong { color: var(--ink); font-size: 15px; }
.audit-item-card { border-left: 4px solid #d5dee8; }
.audit-item-card.pass { border-left-color: var(--success); }
.audit-item-card.fail { border-left-color: #b42318; }
.audit-item-title { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.audit-item-number {
    display: grid;
    flex: 0 0 30px;
    height: 30px;
    place-items: center;
    color: var(--blue);
    border-radius: 50%;
    background: #eaf2fb;
    font-weight: 800;
}
.audit-item-title h2 { padding-top: 4px; line-height: 1.4; }
.audit-item-controls { display: flex; gap: 8px; margin-bottom: 13px; }
.audit-status-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 43px;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
}
.audit-status-choice input { width: auto; min-height: 0; accent-color: currentColor; }
.audit-status-choice.pass:has(input:checked) { color: var(--success); border-color: #88cfb5; background: #edf9f4; }
.audit-status-choice.fail:has(input:checked) { color: #b42318; border-color: #efaaa3; background: #fff3f1; }
.audit-status-choice.pending:has(input:checked) { color: #8a6413; border-color: #ecd28c; background: #fff9e8; }
.audit-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 12px 0; }
.audit-photo {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: 9px;
    background: #e7edf3;
}
.audit-photo img { width: 100%; height: 100%; object-fit: cover; }
.audit-photo span {
    position: absolute;
    inset: auto 0 0;
    padding: 18px 7px 6px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, .72));
    font-size: 11px;
}
.audit-photo-form { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, .8fr) minmax(220px, 1fr); gap: 8px; align-items: end; margin-top: 12px; }
.audit-photo-form.stacked { grid-template-columns: 1fr; }
.audit-photo-form input[type="file"] { padding: 8px; font-size: 13px; }
.audit-upload-status { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.audit-photo-form button:disabled { opacity: .65; cursor: wait; }
.photo-source-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.photo-source-button { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 1 1 120px; text-align: center; overflow: hidden; }
.photo-source-input { position: absolute; width: 1px !important; height: 1px; min-height: 0 !important; opacity: 0; pointer-events: none; }
.audit-photo-category {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 7px;
    color: #fff;
    border-radius: 999px;
    background: rgba(7, 29, 53, .78);
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
}
.workin-photo-row td { padding-top: 0; border-top: 0; }
.workin-photo-details { min-width: 760px; padding: 8px 10px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px; }
.workin-photo-details > summary { cursor: pointer; font-weight: 800; }
.workin-photo-categories { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 8px; margin-top: 10px; }
.workin-photo-category-card { display: grid; align-content: start; gap: 7px; min-height: 120px; padding: 9px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.workin-photo-category-card h3 { margin: 0; font-size: 13px; }
.workin-photo-category-head { display: grid; gap: 6px; }
.photo-requirement-status { width: fit-content; padding: 4px 7px; border: 1px solid; border-radius: 6px; font-size: 11px; font-weight: 800; }
.photo-requirement-status.required { color: #725000; background: #fff3bf; border-color: #e2c456; }
.photo-requirement-status.complete { color: #125b39; background: #e4f5eb; border-color: #82c79f; }
.workin-photo-category-card small { color: var(--muted); }
.workin-photo-thumbnails { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.workin-photo-thumbnails a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 5px; background: #e7edf3; }
.workin-photo-thumbnails img { width: 100%; height: 100%; object-fit: cover; }
.workin-photo-thumb { position: relative; min-width: 0; }
.workin-photo-edit-bar { display: flex; align-items: center; gap: 9px; margin: 10px 0 0; }
.workin-photo-edit-bar span { color: var(--muted); font-size: 11px; }
.workin-photo-delete { display: none; position: absolute; z-index: 2; top: 4px; right: 4px; min-height: 30px; padding: 4px 7px; border: 0; border-radius: 6px; color: #fff; background: #b42318; font-size: 11px; font-weight: 800; cursor: pointer; }
.is-photo-editing .workin-photo-delete { display: block; }
.workin-photo-delete:disabled { opacity: .45; cursor: not-allowed; }
.is-photo-editing .workin-photo-thumb a { outline: 2px solid #e6a19a; outline-offset: -2px; }
.workin-photo-more { color: var(--blue); font-size: 12px; font-weight: 700; }
.workin-photo-picker { position: relative; width: fit-content; overflow: hidden; }
.workin-photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.workin-photo-submit { margin-top: 10px; }
.workin-project-link { margin-top: 10px; margin-right: 7px; }
.workin-photo-profile-settings > summary { display: grid; gap: 3px; cursor: pointer; }
.workin-photo-profile-settings > summary span { color: var(--muted); font-size: 12px; font-weight: 500; }
.workin-photo-profile-content { margin-top: 14px; }
.workin-photo-profile-add { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px; align-items: end; }
.workin-photo-profile-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 7px; margin-top: 12px; }
.workin-photo-profile-list form { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.workin-photo-profile-list span { font-size: 13px; font-weight: 700; }
.project-detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.project-detail-fields > div { display: grid; gap: 5px; min-height: 72px; padding: 12px; background: #fff; }
.project-detail-fields small { color: var(--muted); }
.project-photo-library { margin-top: 18px; }
.project-photo-section { padding: 16px 0; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.project-photo-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.project-photo-section-head h3 { margin: 0; }
.project-photo-section-head span { color: var(--muted); font-size: 12px; }
.project-photo-title { display: grid; gap: 6px; }
.project-photo-section-head .photo-requirement-status { color: #725000; }
.project-photo-section-head .photo-requirement-status.complete { color: #125b39; }
.project-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.project-photo-grid .workin-photo-thumb { display: grid; }
.project-photo-grid a { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); text-decoration: none; }
.project-photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e7edf3; }
.project-photo-grid span { padding: 8px 9px; color: var(--muted); font-size: 12px; }
.upload-dialog-backdrop {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(8, 24, 40, .68);
}
.upload-dialog-backdrop[hidden] { display: none; }
.upload-dialog {
    display: grid;
    justify-items: center;
    gap: 12px;
    width: min(380px, 100%);
    padding: 24px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    text-align: center;
}
.upload-dialog h2, .upload-dialog p { margin: 0; }
.upload-dialog p { color: var(--muted); line-height: 1.5; }
.upload-dialog-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #e8f1f8; color: #155c8a; font-size: 26px; font-weight: 900; }
.upload-dialog-backdrop[data-state="success"] .upload-dialog-icon { background: #e8f7ef; color: var(--success); }
.upload-dialog-backdrop[data-state="error"] .upload-dialog-icon { background: #fff0ee; color: #b42318; }
.upload-dialog progress { width: 100%; height: 12px; accent-color: #1677a6; }
.audit-add-item form { display: grid; grid-template-columns: minmax(220px, 1fr) 140px 120px auto; gap: 8px; margin-top: 12px; }
.audit-profile-rows { display: grid; gap: 8px; }
.audit-profile-row { display: grid; grid-template-columns: minmax(220px, 1fr) 140px 150px auto; gap: 8px; align-items: center; }
.audit-add-row { justify-self: start; margin-top: 8px; }
.audit-value-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.audit-value-unit { min-width: 42px; color: var(--blue); }
.audit-save-button { width: 100%; margin-top: 14px; }
.audit-mobile-save { display: none; }
.storage-status-list { display: grid; gap: 9px; }
.storage-status-list span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f5f8fb;
}
.storage-status-list em { color: var(--muted); font-style: normal; overflow-wrap: anywhere; text-align: right; }
.storage-current-target { display: grid; gap: 7px; margin-top: 14px; }
.storage-current-target span { align-items: flex-start; background: #f6f9fb; border-radius: 7px; display: grid; gap: 4px; grid-template-columns: 150px minmax(0, 1fr); overflow-wrap: anywhere; padding: 8px 10px; }
.storage-growth-panel { display: grid; gap: 14px; }
.role-commission-manager.endpoint-data-admin form,
.role-commission-approver.endpoint-data-admin form,
.role-commission-manager.endpoint-file-storage-admin .storage-settings-panel form,
.role-commission-approver.endpoint-file-storage-admin .storage-settings-panel form,
.role-commission-manager.endpoint-cut-cycle-settings form,
.role-commission-approver.endpoint-cut-cycle-settings form { opacity: .58; pointer-events: none; }
.role-commission-manager.endpoint-data-admin .primary-action,
.role-commission-approver.endpoint-data-admin .primary-action { opacity: .58; pointer-events: none; }
.storage-fullscreen-button { align-items: center; display: inline-flex; gap: 7px; white-space: nowrap; }
.endpoint-file-storage-admin.storage-fullscreen { overflow: auto; }
.endpoint-file-storage-admin.storage-fullscreen .sidebar { display: none; }
.endpoint-file-storage-admin.storage-fullscreen .main { margin-left: 0; min-height: 100vh; padding: 18px clamp(14px, 2vw, 30px); width: 100%; }
.endpoint-file-storage-admin.storage-fullscreen .compact-head { background: rgba(243, 247, 251, .96); padding-top: 8px; }
.storage-health-metrics { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.storage-health-metrics > div { background: linear-gradient(145deg, #f5f9fc, #fff); border: 1px solid #dce7ef; border-radius: 10px; padding: 13px 14px; }
.storage-health-metrics span { color: var(--muted); display: block; font-size: 11px; }
.storage-health-metrics strong { display: block; font-size: 20px; margin-top: 5px; }
.storage-health-badge { border-radius: 999px; font-size: 11px; font-weight: 700; padding: 6px 10px; }
.storage-health-badge.healthy { background: #e7f7ef; color: #16734b; }
.storage-health-badge.warning { background: #fff0dc; color: #9a5900; }
.storage-capacity-warning { background: #fff4e5; border: 1px solid #f2c989; border-radius: 8px; color: #7d4b00; margin: 0; padding: 9px 11px; }
.storage-growth-table { min-width: 720px; }
.storage-browser-layout { display: grid; gap: 16px; grid-template-columns: minmax(330px, 0.85fr) minmax(0, 1.65fr); }
.storage-tree-panel, .storage-directory-panel { min-width: 0; }
.storage-tree-root, .storage-tree-root ul { list-style: none; margin: 0; padding-left: 0; }
.storage-tree-root ul { border-left: 1px dashed #ccd8e3; margin-left: 9px; padding-left: 14px; }
.storage-tree-node { font-size: 11px; margin: 3px 0; min-width: 0; }
.storage-tree-node summary { align-items: baseline; cursor: pointer; display: grid; gap: 5px; grid-template-columns: 12px minmax(80px, auto) minmax(120px, 1fr); padding: 3px 0; }
.storage-tree-node summary::marker { content: ""; }
.storage-tree-node details[open] > summary .storage-tree-icon { transform: rotate(90deg); }
.storage-tree-node a { color: #24577f; min-width: 0; overflow-wrap: anywhere; text-decoration: none; }
.storage-tree-node a:hover { text-decoration: underline; }
.storage-tree-node summary em { color: #738292; font-size: 9px; font-style: normal; line-height: 1.25; }
.storage-tree-file { align-items: baseline; display: grid; gap: 5px; grid-template-columns: 12px minmax(0, 1fr); padding: 2px 0; }
.storage-tree-panel { max-height: 760px; overflow: auto; }
.storage-limit-note { background: #fff7e6; border-radius: 6px; color: #8a5700; font-size: 10px; padding: 7px 9px; }
.storage-directory-actions { align-items: center; display: flex; gap: 10px; justify-content: space-between; margin-bottom: 10px; }
.storage-directory-actions code { color: #506174; font-size: 10px; overflow-wrap: anywhere; text-align: right; }
.storage-directory-table { min-width: 760px; }
.storage-directory-table td:first-child { max-width: 380px; overflow-wrap: anywhere; }
.storage-browser-error { align-items: flex-start; background: #fff8ef; border-color: #f0d2a6; display: grid; gap: 5px; }
.storage-browser-error span { color: #7d5a27; }
@media (max-width: 1100px) { .storage-browser-layout { grid-template-columns: 1fr; } .storage-tree-panel { max-height: 520px; } .storage-health-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .storage-health-metrics { grid-template-columns: 1fr; } }

@media (max-width: 980px) {
    .sidebar {
        position: fixed;
        z-index: 70;
        inset: auto 0 0;
        width: 100%;
        min-height: 0;
        height: calc(68px + env(safe-area-inset-bottom));
        padding: 0 6px env(safe-area-inset-bottom);
        color: var(--muted);
        background: rgba(255, 255, 255, .97);
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 24px rgba(22, 42, 66, .1);
        backdrop-filter: blur(14px);
    }
    .sidebar.guest-sidebar { display: none; }
    .brand, .sidebar-footer { display: none; }
    .nav {
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        gap: 2px;
        height: 68px;
        margin: 0;
    }
    .nav > a, .nav-more-button {
        display: flex;
        flex: 1 1 0;
        min-width: 58px;
        max-width: 110px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        padding: 7px 4px 5px;
        border: 0;
        border-radius: 10px;
        color: var(--muted);
        background: transparent;
        font: inherit;
        font-size: 11px;
        font-weight: 700;
        text-decoration: none;
        cursor: pointer;
    }
    .nav > a.active, .nav > a:hover,
    .nav-more-button:hover, .nav-more-button[aria-expanded="true"],
    .nav:has(.nav-more-panel a.active) .nav-more-button {
        color: var(--blue);
        background: #edf4fc;
    }
    .nav-icon {
        display: grid;
        min-height: 25px;
        place-items: center;
        font-size: 23px;
        font-weight: 800;
        line-height: 1;
    }
    .nav-more-panel {
        position: fixed;
        z-index: 82;
        left: 12px;
        right: 12px;
        bottom: calc(76px + env(safe-area-inset-bottom));
        display: none;
        gap: 4px;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 18px 48px rgba(14, 34, 58, .24);
    }
    .nav.mobile-open .nav-more-panel { display: grid; }
    .nav-more-panel a {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 50px;
        padding: 10px 14px;
        color: var(--ink);
        border-radius: 10px;
        font-size: 14px;
    }
    .nav-more-panel a.active { color: var(--blue); background: #edf4fc; }
    .nav-more-panel .nav-icon { width: 28px; font-size: 20px; }
    .nav-mobile-legal { border-top: 1px solid var(--line); color: #60758a; display: grid; gap: 2px; margin-top: 5px; padding: 11px 14px 4px; }
    .nav-mobile-legal strong { color: #274d70; font-size: 11px; }
    .nav-mobile-legal span, .nav-mobile-legal small { font-size: 9px; }
    .nav-backdrop {
        position: fixed;
        z-index: 60;
        inset: 0;
        width: 100%;
        border: 0;
        background: rgba(7, 29, 53, .34);
    }
    .main { margin-left: 0; padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
    .metrics, .grid.two, .form-grid, .role-grid, .team-overview {
        grid-template-columns: 1fr;
    }
    .permission-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .audit-overview-grid, .audit-detail-grid { grid-template-columns: 1fr; }
    .audit-side { position: static; }
    .workin-layout {
        grid-template-columns: 1fr;
    }
    .member-summary-row {
        grid-template-columns: 1fr;
    }
    .day-board {
        position: static;
        max-height: none;
    }
    .day-list {
        max-height: 520px;
    }
    .mobile-collapse {
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
    }
    .mobile-collapse > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 46px;
        padding: 10px 12px;
        cursor: pointer;
        font-weight: 800;
        list-style: none;
    }
    .mobile-collapse > summary::-webkit-details-marker { display: none; }
    .mobile-collapse > summary::after { content: "+"; color: var(--blue); font-size: 22px; line-height: 1; }
    .mobile-collapse[open] > summary::after { content: "−"; }
    .mobile-collapse > summary small { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
    .mobile-collapse-content { padding: 0 10px 10px; }
    .day-board-collapse { border: 0; }
    .day-board-collapse > .mobile-collapse-content { padding: 0; }
    .day-board-collapse .panel-head { padding: 8px 10px 0; }
    .span-2 { grid-column: span 1; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .compact-head { position: static; }
    .segmented { display: grid; width: 100%; }
    .mini-search { max-width: none; }
.section-line { align-items: stretch; flex-direction: column; }
}

@media (max-width: 640px) {
    body { font-size: 14px; }
    .main { padding: 9px 9px calc(84px + env(safe-area-inset-bottom)); }
    .page-head { gap: 8px; margin-bottom: 10px; }
    .page-head h1 { font-size: 23px; line-height: 1.2; }
    h2 { font-size: 16px; }
    h3 { font-size: 14px; margin: 12px 0 7px; }
    .eyebrow { margin-bottom: 2px; font-size: 10px; }
    .page-description { margin-top: 4px; font-size: 12px; line-height: 1.4; }
    .grid, .dashboard-stack, .work-form, .workin-main { gap: 10px; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 10px; }
    .dashboard-filter { align-items: stretch; flex-direction: column; }
    .dashboard-filter .field { min-width: 0; }
    .workin-bar-row { grid-template-columns: 64px minmax(70px, 1fr) 60px; }
    .workin-bar-row small { grid-column: 2 / -1; }
    .daily-workin-row { grid-template-columns: 90px 1fr 62px; }
    .daily-workin-row span:nth-of-type(n+2), .daily-workin-row small { grid-column: auto; }
    .form-grid { gap: 8px; }
    .field { gap: 4px; font-size: 12px; }
    .field-note { font-size: 10px; }
    input, select, textarea {
        min-height: 40px;
        padding: 8px 9px;
        border-radius: 7px;
        font-size: 14px;
    }
    textarea { min-height: 68px; }
    .primary-action, button.primary-action,
    .secondary-action, .danger-action {
        min-height: 40px;
        padding: 8px 11px;
        font-size: 13px;
    }
    .panel { padding: 10px; }
    .panel-head { gap: 8px; margin-bottom: 9px; }
    .panel-head span { font-size: 11px; }
    .mode-row { gap: 10px; margin-bottom: 9px; }
    .section-line { gap: 6px; margin-top: 10px; }
    .radio-list, .check-list { gap: 3px; padding: 6px; }
    .radio-list label, .check-list label, .mode-row label { gap: 6px; font-size: 12px; }
    .page-head .primary-action { display: none; }
    .mobile-submit-bar {
        position: fixed;
        z-index: 50;
        left: 0;
        right: 0;
        bottom: calc(68px + env(safe-area-inset-bottom));
        display: block;
        padding: 10px 12px;
        border-top: 1px solid var(--line);
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 -8px 24px rgba(22, 42, 66, .12);
    }
    .mobile-submit-bar { padding: 7px 9px; }
    .mobile-submit-bar .primary-action { width: 100%; min-height: 42px; }
    .location-filter { align-items: stretch; }
    .gps-input-row { grid-template-columns: 1fr; }
    .location-filter > * { flex: 1 1 100%; }
    .location-filter label { justify-content: space-between; }
    .location-filter select { width: 55%; }
    .workin-layout { padding-bottom: 68px; }
    .smart-results { position: fixed; top: auto; left: 12px; right: 12px; bottom: 146px; max-height: 48vh; }
    .smart-option { min-height: 52px; padding: 8px 9px; font-size: 12px; }
    .simple-list label { min-height: 40px; padding: 5px 6px; }
    .radio-list, .check-list { max-height: 260px; }
    .selection-tools { align-items: stretch; justify-content: flex-start; }
    .selection-tools .mini-search { flex: 1 1 100%; }
    .selection-tools label, .text-action { font-size: 11px; }
    .permission-guide { gap: 6px; margin-bottom: 10px; }
    .permission-guide span { gap: 2px; padding: 7px; font-size: 10px; }
    .permission-guide { grid-template-columns: 1fr; }
    .audit-card { align-items: stretch; flex-direction: column; }
    .audit-history-filter { grid-template-columns: 1fr; }
    .audit-title-add { grid-template-columns: 1fr; }
    .admin-record-section .panel-head { align-items: stretch; }
    .record-search { width: 100%; }
    .audit-setting-group > summary { grid-template-columns: auto 1fr; }
    .audit-setting-group > summary > span:last-child { grid-column: 2; }
    .audit-existing-profiles-head { flex-direction: column; }
    .audit-card-meta { grid-template-columns: repeat(3, auto); text-align: left; }
    .audit-card-meta small { grid-column: 1 / -1; }
    .audit-summary-strip { align-items: stretch; flex-direction: column; text-align: left; }
    .audit-summary-strip span { grid-template-columns: 110px 1fr; }
    .audit-item-controls { display: grid; grid-template-columns: repeat(3, 1fr); }
    .audit-status-choice { min-height: 38px; padding: 5px 3px; font-size: 12px; }
    .audit-photo-form, .audit-add-item form, .audit-profile-row { grid-template-columns: 1fr; }
    .workin-photo-categories { grid-template-columns: 1fr 1fr; }
    .project-detail-fields { grid-template-columns: 1fr; }
    .project-detail-fields .span-2 { grid-column: auto; }
    .project-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .workin-photo-profile-add { grid-template-columns: 1fr; }
    .audit-photo-form .secondary-action, .audit-add-item .secondary-action { min-height: 40px; }
    .audit-detail-grid { padding-bottom: 68px; }
    .audit-mobile-save {
        position: fixed;
        z-index: 50;
        left: 0;
        right: 0;
        bottom: calc(68px + env(safe-area-inset-bottom));
        display: block;
        padding: 7px 9px;
        border-top: 1px solid var(--line);
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 -8px 24px rgba(22, 42, 66, .12);
    }
    .audit-mobile-save .primary-action { width: 100%; min-height: 42px; }
    th, td { padding: 8px 7px; font-size: 12px; }
}

.commission-signature-history { margin-bottom: 14px; }
.commission-sign-links { display: flex; flex-wrap: wrap; gap: 6px; min-width: 190px; }
.commission-sign-links .primary-action, .commission-sign-links .secondary-action { min-height: 32px; padding: 6px 9px; font-size: 11px; }
.commission-sign-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 16px; overflow: hidden; border: 1px solid #ccd9e6; border-radius: 12px; background: #fff; box-shadow: 0 7px 22px rgba(20, 48, 78, .06); }
.commission-sign-summary > div { display: grid; gap: 4px; min-width: 0; padding: 13px 16px; border-right: 1px solid var(--line); }
.commission-sign-summary > div:last-child { border-right: 0; }
.commission-sign-summary span { color: var(--muted); font-size: 11px; font-weight: 700; }
.commission-sign-summary strong { overflow: hidden; color: #173f62; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.commission-sign-status.is-pending { color: #9a5d00; }
.commission-sign-status.is-signed { color: var(--success); }
.commission-sign-layout { display: grid; grid-template-columns: minmax(620px, 1.7fr) minmax(360px, .8fr); gap: 16px; align-items: start; }
.commission-pdf-panel, .commission-sign-panel { min-width: 0; }
.commission-document-head { align-items: center; }
.commission-document-head .secondary-action { flex: 0 0 auto; }
.commission-pdf-browser-wrap { background: #dfe6ed; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.commission-pdf-frame { display: block; width: 100%; height: clamp(720px, calc(100vh - 170px), 1040px); border: 0; background: #eef2f6; }
.commission-pdf-fallback { display: none; margin: 0; padding: 10px 14px; text-align: center; }
.commission-sign-panel { position: sticky; top: 16px; width: 100%; }
.commission-signer-card { display: grid; gap: 3px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #cfe0ef; border-radius: 10px; background: #f4f9fd; }
.commission-signer-card span, .commission-signer-card small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.commission-signer-card strong { color: #173f62; font-size: 16px; }
.signature-canvas-wrap { position: relative; overflow: hidden; border: 2px dashed #9fb0c2; border-radius: 10px; background: #fff; touch-action: none; }
.signature-canvas { display: block; width: 100%; height: 240px; cursor: crosshair; touch-action: none; }
.signature-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #96a3b1; pointer-events: none; font-size: 16px; }
.signature-confirmation { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start; margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; color: #334b62; font-size: 12px; line-height: 1.45; cursor: pointer; }
.signature-confirmation input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--blue); }
.signature-actions { display: grid; grid-template-columns: minmax(110px, .6fr) minmax(190px, 1.4fr); gap: 8px; margin-top: 12px; }
.signature-actions button { min-height: 44px; }
.signature-actions button:disabled { cursor: not-allowed; opacity: .52; }
.signature-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.commission-upload-form { display: grid; grid-template-columns: minmax(260px, 1.6fr) minmax(170px, .7fr) minmax(170px, .7fr); gap: 16px; align-items: end; }
.commission-upload-form .upload-file-field, .commission-upload-form .upload-workflow-note { grid-column: 1 / -1; }
.commission-upload-form input[type="file"] { padding: 12px; border: 1px dashed #9fb0c2; background: #f8fafc; }
.upload-workflow-note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; background: #eef6ff; color: #27445f; }
.signature-position-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.signature-position-pages { display: grid; gap: 18px; min-width: 0; }
.signature-page-card { overflow: hidden; }
.signature-page-canvas { position: relative; width: 100%; line-height: 0; background: #dce3e9; box-shadow: inset 0 0 0 1px #cad3dc; user-select: none; }
.signature-page-canvas img { display: block; width: 100%; height: auto; pointer-events: none; }
.signature-box-layer { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.signature-position-box { position: absolute; min-width: 20px; min-height: 12px; border: 2px solid #0878d1; background: rgba(17, 132, 218, .16); color: #063c67; line-height: 1.2; box-sizing: border-box; }
.signature-position-box span { position: absolute; left: 0; bottom: 100%; max-width: 220px; padding: 4px 7px; background: #0878d1; color: white; font-size: 11px; white-space: nowrap; }
.signature-position-box button { position: absolute; top: -12px; right: -12px; width: 25px; height: 25px; padding: 0; border-radius: 50%; background: #b42318; color: #fff; line-height: 1; }
.signature-position-box.is-drawing { border-style: dashed; pointer-events: none; }
.signature-position-sidebar { position: sticky; top: 18px; display: grid; gap: 12px; }
.signature-position-sidebar h2 { margin: 0; font-size: 28px; }
.signature-position-sidebar p { margin: 0; color: var(--muted); line-height: 1.55; }
.signature-position-kicker { color: var(--blue); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.signature-position-list { display: grid; gap: 7px; max-height: 310px; overflow: auto; }
.signature-position-list > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.signature-position-list small { grid-column: 1 / -1; color: var(--muted); }
.approval-amount-card { display: grid; gap: 10px; padding: 14px; border: 1px solid #b7cde0; border-radius: 10px; background: #f4f9fd; }
.approval-amount-card .field { gap: 5px; }
.detected-amount { display: grid; gap: 3px; padding: 11px 12px; border-radius: 8px; background: #e7f6ed; color: #165b33; }
.detected-amount strong { font-size: 21px; }
.amount-not-detected { display: grid; gap: 3px; padding: 11px 12px; border-radius: 8px; background: #fff5e5; color: #754900; }
.amount-confirmation { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 12px; line-height: 1.45; }
.amount-confirmation input { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
.site-bonus-intro { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.site-bonus-intro h2 { margin: 5px 0; }
.site-bonus-intro p { margin: 0; color: var(--muted); }
.site-bonus-rule { min-width: 310px; display: grid; gap: 3px; padding: 14px 16px; border-radius: 10px; background: #eef6ff; }
.site-bonus-rule b, .site-bonus-rule small { color: var(--muted); }
.site-tier-grid { display: grid; grid-template-columns: repeat(10, minmax(82px, 1fr)); gap: 7px; overflow-x: auto; }
.site-tier-grid > div { min-width: 82px; display: grid; grid-template-columns: auto 1fr; gap: 1px 4px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.site-tier-grid strong { grid-column: 1 / -1; margin-top: 5px; color: #08704b; font-size: 16px; }
.site-tier-grid span, .site-tier-grid small { color: var(--muted); font-size: 11px; }
.site-bonus-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.site-bonus-card { min-width: 0; border-top: 4px solid #a7b4c0; }
.site-bonus-card.is-achieved { border-top-color: #14935f; }
.site-bonus-card-head, .site-bonus-member-head, .site-bonus-submit { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.site-bonus-card-head span, .site-bonus-member-head span { color: var(--muted); font-size: 12px; }
.site-bonus-card-head h2, .site-bonus-member-head h3 { margin: 2px 0 0; }
.site-bonus-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.site-bonus-metrics > div { display: grid; gap: 2px; padding: 10px; border-radius: 9px; background: #f5f8fa; }
.site-bonus-metrics span, .site-bonus-metrics small { color: var(--muted); font-size: 11px; }
.site-bonus-metrics strong { font-size: 18px; }
.site-bonus-warning { margin: 9px 0; padding: 9px 11px; border-radius: 8px; background: #fff2dc; color: #784700; font-size: 12px; }
.site-bonus-gap { margin: 9px 0; padding: 9px 11px; border-radius: 8px; background: #f2f5f7; color: #405365; }
.site-bonus-details { margin-top: 10px; }
.site-bonus-details summary { cursor: pointer; color: var(--blue); font-weight: 700; }
.site-bonus-details table { min-width: 680px; margin-top: 10px; }
.site-bonus-details td small { display: block; max-width: 300px; color: var(--muted); }
.site-zero-capacity { background: #fff8eb; }
.site-bonus-member-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.site-bonus-member-list { display: grid; gap: 7px; margin: 11px 0; }
.site-bonus-member { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(180px, .8fr); gap: 9px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; }
.site-bonus-member label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.site-bonus-member label input { margin-top: 3px; accent-color: #14935f; }
.site-bonus-member label small { display: block; color: var(--muted); }
.site-bonus-member input[type=text], .site-bonus-member > input { min-width: 0; }
.site-bonus-member.is-ineligible { background: #f5f5f5; opacity: .76; }
.site-bonus-submit { margin-top: 12px; padding: 13px; border-radius: 10px; background: #edf8f3; }
.site-bonus-submit > div { display: grid; gap: 2px; }
.site-bonus-submit span, .site-bonus-submit small { color: var(--muted); }
.site-bonus-submit strong { color: #08704b; font-size: 20px; }
.site-bonus-confirmed { display: grid; gap: 3px; margin-top: 14px; padding: 13px; border: 1px solid #9bd3b8; border-radius: 10px; background: #edf8f3; color: #17633f; }
.site-bonus-signed-lock { display: grid; gap: 4px; margin-top: 14px; padding: 13px; border: 1px solid #e4b2ad; border-radius: 10px; background: #fff3f1; color: #842d24; }
.site-bonus-create-file, .site-bonus-file-ready { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding: 13px; border: 1px solid #96bddf; border-radius: 10px; background: #eef6ff; }
.site-bonus-create-file > div, .site-bonus-file-ready > div:first-child { display: grid; gap: 3px; }
.site-bonus-create-file span, .site-bonus-file-ready span { color: var(--muted); font-size: 12px; }
.site-bonus-file-ready > div:last-child { display: flex; gap: 8px; }
@media (max-width: 720px) { .site-bonus-create-file, .site-bonus-file-ready { align-items: stretch; flex-direction: column; } .site-bonus-file-ready > div:last-child { display: grid; } }
@media (max-width: 1100px) { .site-bonus-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .site-bonus-intro, .site-bonus-card-head, .site-bonus-member-head, .site-bonus-submit { align-items: stretch; flex-direction: column; } .site-bonus-rule { min-width: 0; } .site-bonus-metrics { grid-template-columns: repeat(2, 1fr); } .site-bonus-member { grid-template-columns: 1fr; } }
@media (max-width: 980px) { .commission-upload-form, .signature-position-layout { grid-template-columns: 1fr; } .signature-position-sidebar { position: static; } }
.signed-complete-card { display: grid; justify-items: center; gap: 10px; padding: 24px 12px; text-align: center; }
.signed-complete-card h2, .signed-complete-card p { margin: 0; }
.signed-complete-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: #fff; background: #27814a; font-size: 30px; font-weight: 800; }
.approval-workflow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0 0 20px; overflow: hidden; border: 1px solid #d3dfeb; border-radius: 12px; background: #d3dfeb; }
.approval-workflow > div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 13px 15px; background: #fff; }
.approval-workflow b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: var(--blue); }
.approval-workflow span, .approval-workflow strong, .approval-workflow small { display: block; }
.approval-workflow strong { color: #173f62; font-size: 13px; }
.approval-workflow small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.approval-page-head .page-description { max-width: 820px; font-size: 14px; line-height: 1.6; }
.approval-team-card { padding: 20px; }
.approval-team-card.is-expired { border-color: #e6b8b4; background: #fffafa; }
.approval-team-card-head span { font-size: 12px; }
.approval-team-card-head h3 { font-size: 24px; }
.approval-document-title { margin: 2px 0 14px; color: #173f62; font-size: 17px; line-height: 1.45; }
.approval-file-meta { gap: 12px 18px; }
.approval-file-meta span { font-size: 13px; line-height: 1.45; }
.approval-file-meta b { font-size: 11px; margin-bottom: 3px; }
.approval-card-actions a { min-height: 40px; padding: 9px 14px; font-size: 13px; }
.approval-reject-box { margin-top: 14px; border-top: 1px solid #ead4d1; padding-top: 12px; }
.approval-reject-box summary { cursor: pointer; color: #a43b32; font-size: 13px; font-weight: 800; }
.approval-reject-box form, .approval-cancel-box { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid #ebcbc7; border-radius: 9px; background: #fff7f6; }
.approval-reject-box label, .approval-cancel-box label { display: grid; gap: 6px; color: #633a36; font-size: 13px; font-weight: 700; }
.approval-reject-box textarea { min-height: 88px; resize: vertical; }
.approval-reject-box textarea, .approval-cancel-box input { box-sizing: border-box; width: 100%; padding: 10px 12px; border: 1px solid #cbb8b5; border-radius: 7px; background: #fff; color: var(--ink); font: inherit; }
.approval-reject-box .danger-action, .approval-cancel-box .danger-action { justify-self: start; min-height: 39px; padding: 8px 14px; font-size: 13px; }
.approval-cancel-box { margin-top: 14px; }
.approval-rejected-note { margin-top: 13px; padding: 11px 13px; border-left: 4px solid #b42318; border-radius: 6px; background: #fff1f0; color: #7a2822; font-size: 13px; line-height: 1.5; }
.approval-rejected-note p { margin: 4px 0; }
.approval-rejected-note small, .history-rejection-reason { color: #8f423b; }
.commission-sign-reject { margin-top: 18px; }

@media (max-width: 1180px) {
    .commission-sign-layout { grid-template-columns: minmax(0, 1fr); }
    .commission-sign-panel { position: static; width: min(100%, 980px); margin-inline: auto; }
    .commission-sign-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .commission-sign-summary > div:nth-child(3) { border-right: 0; }
    .commission-sign-summary > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 980px) {
    .commission-document-head { align-items: flex-start; flex-direction: column; }
    .commission-pdf-frame { height: 68vh; min-height: 540px; }
    .signature-canvas { height: 220px; }
    .approval-workflow { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .commission-sign-head { align-items: flex-start; }
    .commission-sign-head .secondary-action { width: 100%; text-align: center; }
    .commission-pdf-panel, .commission-sign-panel { padding: 12px; }
    .commission-pdf-frame { height: 64vh; min-height: 480px; }
    .commission-pdf-fallback { display: block; }
    .commission-sign-summary { grid-template-columns: 1fr 1fr; }
    .commission-sign-summary > div, .commission-sign-summary > div:nth-child(3) { border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
    .commission-sign-summary > div:nth-child(-n+2) { border-top: 0; }
    .commission-sign-summary > div:nth-child(even) { border-right: 0; }
    .commission-sign-summary > div:last-child { grid-column: 1 / -1; border-right: 0; }
    .signature-canvas { height: 210px; }
    .signature-actions { grid-template-columns: 1fr; }
}

/* Solar Corporate Flow design system: typography, filters, sorting and data tables */
body, button, input, select, textarea {
    font-family: "Leelawadee UI", "Noto Sans Thai", "Segoe UI", Tahoma, Arial, sans-serif;
}

body { font-size: 14px; line-height: 1.55; }
h1 { color: #123a5d; font-size: clamp(26px, 2.25vw, 34px); font-weight: 800; line-height: 1.25; }
h2 { color: #173f62; font-size: 20px; font-weight: 800; line-height: 1.35; }
h3 { color: #244c6d; font-size: 16px; font-weight: 800; line-height: 1.4; }
.page-description { color: #60758a; font-size: 14px; line-height: 1.65; }
.eyebrow { color: #087f9d; font-size: 11px; font-weight: 900; letter-spacing: .09em; }

.dashboard-filter,
.project-close-filter,
.commission-filter,
.history-filter,
.audit-history-filter,
.stock-audit-filter,
.location-filter {
    position: relative;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid #cfdeea;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff 0%, #f5fafe 100%);
    box-shadow: 0 8px 24px rgba(20, 64, 98, .06);
}

.dashboard-filter::before,
.project-close-filter::before,
.commission-filter::before,
.history-filter::before,
.audit-history-filter::before,
.stock-audit-filter::before {
    position: absolute;
    top: 18px;
    left: 13px;
    content: "⌕";
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #0d6f99;
    background: #e5f4fa;
    font-size: 22px;
    font-weight: 800;
}

.dashboard-filter,
.project-close-filter,
.commission-filter,
.history-filter,
.audit-history-filter,
.stock-audit-filter { padding-left: 58px; }

.field { gap: 7px; color: #40566c; font-size: 12px; font-weight: 800; }
.field input,
.field select,
.field textarea,
.dashboard-filter input,
.dashboard-filter select,
.history-filter input,
.history-filter select {
    min-height: 42px;
    border: 1px solid #c7d5e2;
    border-radius: 9px;
    color: #193b58;
    background-color: #fff;
    font-size: 13px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field input:hover, .field select:hover, .field textarea:hover { border-color: #8fb5d0; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 0;
    border-color: #1776b5;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(23, 118, 181, .11);
}

.dashboard-filter .primary-action, .dashboard-filter button[type="submit"],
.project-close-filter .primary-action, .project-close-filter button[type="submit"],
.commission-filter .primary-action, .commission-filter button[type="submit"],
.history-filter .primary-action, .history-filter button[type="submit"],
.audit-history-filter .primary-action, .audit-history-filter button[type="submit"],
.stock-audit-filter .primary-action, .stock-audit-filter button[type="submit"] {
    border: 0;
    min-height: 42px;
    padding: 9px 17px;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(105deg, #1159b5, #087f9d);
    box-shadow: 0 8px 18px rgba(17, 89, 181, .17);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.table-wrap {
    border: 1px solid #d4e0ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(18, 54, 84, .045);
}

table { color: #263f56; }
thead th,
.commission-table th,
.project-close-table th,
.users-table th,
.admin-record-management table th {
    border-bottom: 1px solid #cbd9e5;
    color: #3e5870;
    background: linear-gradient(180deg, #f8fbfd, #edf4f8);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .025em;
    line-height: 1.35;
    text-transform: none;
}

tbody tr { transition: background-color .14s ease, box-shadow .14s ease; }
tbody tr:nth-child(even) { background-color: #fbfdff; }
tbody tr:hover { background-color: #eef7fc; }
td { font-size: 12.5px; line-height: 1.5; }

.sortable-column {
    padding-right: 30px !important;
    color: #234f70 !important;
    transition: color .16s ease, background .16s ease;
}
.sortable-column:hover { color: #08729a !important; background: #e4f2f8 !important; }
.sortable-column::after {
    right: 9px;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 5px;
    color: #67859d;
    background: rgba(255, 255, 255, .8);
    font-size: 11px;
}
.sortable-column[aria-sort="ascending"],
.sortable-column[aria-sort="descending"] { color: #075f8a !important; background: #dff0f8 !important; }
.sortable-column[aria-sort="ascending"]::after,
.sortable-column[aria-sort="descending"]::after { color: #fff; background: #087f9d; }

@media (max-width: 900px) {
    .dashboard-filter::before, .project-close-filter::before, .commission-filter::before,
    .history-filter::before, .audit-history-filter::before, .stock-audit-filter::before { display: none; }
    .dashboard-filter, .project-close-filter, .commission-filter, .history-filter,
    .audit-history-filter, .stock-audit-filter, .location-filter { padding: 13px; border-radius: 11px; }
}

/* Theme continuity: a quiet echo of the Login background inside the application */
.app-page .page-head:not(.compact-head) {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 96px;
    padding: 20px 22px;
    border: 1px solid #c9dce9;
    border-radius: 16px;
    background:
        radial-gradient(circle at 92% 18%, rgba(72, 192, 218, .15), transparent 30%),
        linear-gradient(118deg, #fafdff 0%, #edf7fb 58%, #e8f4f8 100%);
    box-shadow: 0 9px 26px rgba(20, 64, 98, .065);
}

.app-page .page-head:not(.compact-head)::after {
    position: absolute;
    z-index: -1;
    right: -46px;
    bottom: -64px;
    width: 230px;
    height: 150px;
    border: 1px solid rgba(17, 127, 157, .13);
    border-radius: 50%;
    content: "";
    box-shadow: 0 0 0 26px rgba(17, 127, 157, .025), 0 0 0 55px rgba(17, 89, 181, .018);
}

.app-page .page-head:not(.compact-head) h1 { color: #103b5d; }
.app-page .page-head:not(.compact-head) .page-description { max-width: 920px; color: #587087; }

.endpoint-dashboard .page-head:not(.compact-head) {
    color: #fff;
    border-color: rgba(122, 207, 225, .22);
    background:
        radial-gradient(circle at 84% 22%, rgba(86, 216, 239, .32), transparent 27%),
        linear-gradient(118deg, #092844 0%, #0c4668 64%, #087b91 100%);
    box-shadow: 0 14px 34px rgba(5, 42, 67, .18);
}

.endpoint-dashboard .page-head:not(.compact-head)::before {
    position: absolute;
    z-index: -1;
    top: -140%;
    left: -20%;
    width: 22%;
    height: 380%;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(167, 235, 248, .11), transparent);
    transform: rotate(18deg);
    animation: dashboard-head-sweep 18s ease-in-out infinite;
}

.endpoint-dashboard .page-head:not(.compact-head) h1,
.endpoint-dashboard .page-head:not(.compact-head) h2 { color: #fff; }
.endpoint-dashboard .page-head:not(.compact-head) .eyebrow { color: #82ddec; }
.endpoint-dashboard .page-head:not(.compact-head) .page-description { color: #c9e2ec; }
.endpoint-dashboard .page-head:not(.compact-head) .primary-action {
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .14);
    box-shadow: none;
    backdrop-filter: blur(7px);
}
.endpoint-dashboard .page-head:not(.compact-head) .primary-action:hover { background: rgba(255, 255, 255, .22); }

@keyframes dashboard-head-sweep {
    0%, 25% { translate: 0 0; opacity: 0; }
    42% { opacity: 1; }
    70%, 100% { translate: 620% 0; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .endpoint-dashboard .page-head:not(.compact-head)::before { animation: none; }
}

@media (max-width: 700px) {
    .stock-package-unit-grid { grid-template-columns: minmax(0, 1fr) minmax(96px, .55fr); }
    .app-page .page-head:not(.compact-head) { min-height: 0; padding: 16px; border-radius: 12px; }
}

/* Branded navigation motion and lightweight dashboard glass */
.app-page .sidebar {
    overflow: hidden;
    background: linear-gradient(180deg, #0b3d73 0%, #102b4d 52%, #071d35 100%);
    background-size: 100% 150%;
    animation: sidebar-tone-shift 22s ease-in-out infinite alternate;
}

.app-page .sidebar::before {
    position: absolute;
    inset: -40% -80% auto;
    height: 48%;
    content: "";
    background: linear-gradient(105deg, transparent 40%, rgba(79, 199, 222, .09) 50%, transparent 60%);
    transform: rotate(-8deg);
    animation: sidebar-soft-sweep 16s ease-in-out infinite;
    pointer-events: none;
}

.app-page .sidebar::after {
    position: absolute;
    top: 12%;
    right: -92px;
    width: 210px;
    height: 210px;
    content: "";
    border-radius: 50%;
    background: radial-gradient(circle at 38% 38%, rgba(89, 218, 235, .15), rgba(27, 139, 184, .055) 50%, transparent 72%);
    filter: blur(1px);
    animation: sidebar-orb-drift 18s ease-in-out infinite alternate;
    pointer-events: none;
}

.app-page .sidebar > * { position: relative; z-index: 1; }
.app-page .brand-mark { animation: brand-mark-breathe 5.5s ease-in-out infinite; }
.app-page .nav a { position: relative; overflow: hidden; transition: color .18s ease, background .18s ease, transform .18s ease; }
.app-page .nav a:hover { transform: translateX(3px); }
.app-page .nav a.active::after {
    position: absolute;
    top: 18%;
    right: 7px;
    width: 3px;
    height: 64%;
    border-radius: 99px;
    content: "";
    background: #58d6e8;
    box-shadow: 0 0 12px rgba(88, 214, 232, .6);
}

.endpoint-dashboard .main {
    background:
        radial-gradient(circle at 88% 12%, rgba(17, 168, 199, .095), transparent 26%),
        linear-gradient(145deg, #f3f7fb, #edf5f9 55%, #f4f8fb);
}

.endpoint-dashboard .metric,
.endpoint-dashboard .dashboard-grid > .panel,
.endpoint-dashboard .main > .panel,
.endpoint-dashboard .dashboard-filter {
    border-color: rgba(188, 207, 221, .76);
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 10px 30px rgba(18, 57, 87, .065);
    backdrop-filter: blur(9px);
}

.endpoint-dashboard .metric { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.endpoint-dashboard .metric:hover {
    transform: translateY(-2px);
    border-color: rgba(89, 164, 194, .48);
    box-shadow: 0 14px 34px rgba(18, 57, 87, .1);
}

.login-screen-brand > span { overflow: hidden; padding: 0; background: transparent; }
.login-screen-brand > span img { display: block; width: 42px; height: 42px; }

@keyframes sidebar-tone-shift { to { background-position: 0 100%; } }
@keyframes sidebar-soft-sweep {
    0%, 34% { translate: -30% -40%; opacity: 0; }
    52% { opacity: 1; }
    76%, 100% { translate: 38% 205%; opacity: 0; }
}
@keyframes sidebar-orb-drift {
    0% { transform: translate3d(0, -10px, 0) scale(.94); opacity: .55; }
    52% { opacity: .88; }
    100% { transform: translate3d(-30px, 340px, 0) scale(1.08); opacity: .62; }
}
@keyframes brand-mark-breathe { 50% { transform: translateY(-2px); filter: drop-shadow(0 10px 16px rgba(22, 177, 204, .25)); } }

@media (prefers-reduced-motion: reduce) {
    .app-page .sidebar, .app-page .sidebar::before, .app-page .sidebar::after, .app-page .brand-mark { animation: none; }
    .app-page .nav a:hover, .endpoint-dashboard .metric:hover { transform: none; }
}

@media (max-width: 980px) {
    .app-page .sidebar {
        overflow: visible;
        color: #c9dceb;
        border-top-color: rgba(105, 201, 221, .34);
        background: linear-gradient(100deg, rgba(7, 29, 53, .985), rgba(11, 61, 115, .985));
        box-shadow: 0 -10px 28px rgba(4, 23, 43, .28);
        animation: none;
    }
    .app-page .sidebar::before, .app-page .sidebar::after { display: none; }
    .app-page .sidebar > .nav { z-index: auto; }
    .app-page .nav > a,
    .app-page .nav-more-button { color: #c6d9e9; }
    .app-page .nav > a:hover,
    .app-page .nav > a.active,
    .app-page .nav-more-button:hover,
    .app-page .nav-more-button[aria-expanded="true"],
    .app-page .nav:has(.nav-more-panel a.active) .nav-more-button {
        color: #fff;
        background: rgba(100, 211, 230, .16);
    }
    .app-page .nav > a.active::after {
        top: auto;
        right: 22%;
        bottom: 2px;
        left: 22%;
        width: auto;
        height: 3px;
        background: #63d7e8;
    }
    .app-page .nav-more-panel {
        max-height: min(70vh, 560px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .app-page .nav-more-panel a { color: var(--ink); }
    .app-page .nav-more-panel a:hover,
    .app-page .nav-more-panel a.active { color: var(--blue); background: #edf4fc; transform: none; }
}

/* Admin System Monitor */
.system-monitor-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.system-monitor-panel { overflow: hidden; }
.system-session-list { display: grid; gap: 10px; }
.system-session-card { padding: 13px; border: 1px solid #d8e4ed; border-left: 3px solid #deaa42; border-radius: 11px; background: #fbfcfd; }
.system-session-card.online { border-left-color: #2dad72; }
.system-session-primary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.system-session-primary > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.system-session-primary strong { color: #173f62; font-size: 15px; }
.system-session-primary em { padding: 3px 6px; border-radius: 999px; color: #1769aa; background: #e7f2fb; font-size: 9px; font-style: normal; font-weight: 800; }
.system-online-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #d5a53e; box-shadow: 0 0 0 4px rgba(213, 165, 62, .12); }
.system-session-card.online .system-online-dot { background: #2dad72; box-shadow: 0 0 0 4px rgba(45, 173, 114, .12); }
.status-badge.online { color: #17633e; border-color: #8bd0a8; background: #e5f6ec; }
.status-badge.idle { color: #775200; border-color: #e2bd57; background: #fff3c4; }
.system-session-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.system-session-grid > div { min-width: 0; padding: 8px 9px; border-radius: 8px; background: #f1f6f9; }
.system-session-grid span, .system-session-grid small { display: block; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.system-session-grid strong { display: block; margin: 3px 0 2px; color: #294b67; font-size: 11px; overflow-wrap: anywhere; }
.system-session-card form { display: flex; justify-content: flex-end; margin-top: 10px; }

@media (max-width: 1100px) {
    .system-session-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .system-monitor-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .system-session-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .system-session-primary { align-items: flex-start; }
    .system-session-primary > div { align-items: flex-start; flex-wrap: wrap; }
    .system-session-card form .secondary-action { width: 100%; min-height: 42px; }
}
