:root {
    color-scheme: light;
    --ink: #222925;
    --muted: #737d76;
    --line: #dce2dc;
    --paper: #f5f7f2;
    --white: #fff;
    --forest: #1e3028;
    --forest-light: #2b4238;
    --teal: #287a70;
    --red: #c94e3c;
    --yellow: #dce85f;
    --display: Georgia, "Times New Roman", serif;
    --body: "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--body); font-size: 15px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; min-height: 100vh; padding: 28px 20px 22px; color: #f4f6ef; background: var(--forest); }
.brand { display: flex; align-items: center; gap: 12px; width: fit-content; color: white; font-size: 15px; font-weight: 800; letter-spacing: 1px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; color: var(--forest); background: var(--yellow); font-family: var(--display); font-size: 24px; font-weight: 700; }
.brand small { display: block; margin-top: 3px; color: #a9b7ad; font-size: 9px; letter-spacing: 2px; }
.nav-caption, .admin-label, .eyebrow { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }
.nav-caption { margin: 58px 0 13px 10px; color: #9eada3; }
.side-nav { display: grid; gap: 5px; }
.side-nav a { display: flex; align-items: center; gap: 13px; min-height: 43px; padding: 0 10px; color: #d7e0d9; font-size: 14px; }
.side-nav a span { color: #8da096; font-size: 10px; }
.side-nav a:hover, .side-nav a.active { color: white; background: var(--forest-light); }
.side-nav a.active { box-shadow: inset 3px 0 var(--yellow); }
.sidebar-bottom { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid #405349; }
.admin-label { color: #9eada3; }
.admin-name { display: flex; align-items: center; gap: 8px; margin: 9px 0 16px; font-size: 14px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #91c777; }
.signout-button { display: flex; justify-content: space-between; width: 100%; padding: 10px 0 0; color: #c4d0c8; border: 0; border-top: 1px solid #405349; background: transparent; text-align: left; cursor: pointer; }
.workspace { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 64px; padding: 0 clamp(22px, 4vw, 58px); color: var(--muted); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.7); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.topbar time { font-size: 12px; font-weight: 400; letter-spacing: 0; }
.page-content { max-width: 1260px; margin: 0 auto; padding: 42px clamp(22px, 4vw, 58px) 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 35px; }
.eyebrow { color: var(--teal); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 10px 0 7px; font-family: var(--display); font-size: 42px; font-weight: 400; line-height: 1.08; }
.page-heading p, .section-heading p { margin-bottom: 0; color: var(--muted); }
.heading-stamp { min-width: 94px; padding: 10px 12px; color: var(--teal); border: 1px solid #a9c9c1; font-size: 9px; line-height: 1.65; letter-spacing: 1px; text-align: center; }
.heading-stamp strong { font-size: 10px; }
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); }
.metric { min-height: 150px; padding: 22px 25px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric > span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin: 12px 0 8px; font-family: var(--display); font-size: 42px; font-weight: 400; line-height: 1; }
.metric small { color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: 1.5px; }
.metric-red small { color: var(--red); }
.overview-section { margin-top: 45px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }
h2 { margin: 7px 0 0; font-family: var(--display); font-size: 27px; font-weight: 400; }
.workspace-links { border-top: 1px solid var(--line); }
.workspace-links a { display: grid; grid-template-columns: 48px minmax(0,1fr) 30px; align-items: center; gap: 13px; min-height: 83px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.workspace-links a:hover { background: rgba(255,255,255,.7); }
.workspace-index { display: grid; width: 34px; height: 34px; place-items: center; color: var(--forest); background: var(--yellow); font-family: var(--display); font-size: 17px; }
.workspace-index.teal { color: white; background: var(--teal); }
.workspace-index.red { color: white; background: var(--red); }
.workspace-links strong, .workspace-links small { display: block; }
.workspace-links strong { font-size: 15px; }
.workspace-links small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.arrow { color: var(--teal); font-size: 20px; text-align: right; }
.login-page { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr); min-height: 100vh; background: var(--white); }
.login-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; min-height: 100vh; padding: 35px clamp(28px, 5vw, 72px); color: white; background: var(--forest); }
.login-aside::after { position: absolute; right: -115px; bottom: 80px; width: 300px; height: 300px; border: 1px solid #506659; content: ""; transform: rotate(45deg); }
.brand-login { position: relative; z-index: 1; }
.login-note { position: relative; z-index: 1; max-width: 430px; margin: 55px 0; }
.login-note .eyebrow { color: var(--yellow); }
.login-note h1 { margin-top: 18px; font-size: clamp(42px, 5vw, 68px); }
.login-note p { max-width: 340px; color: #bdc9c0; line-height: 1.7; }
.login-footer { position: relative; z-index: 1; color: #91a197; font-size: 9px; letter-spacing: 1.6px; }
.login-footer span { padding: 0 6px; color: var(--yellow); }
.login-panel { display: grid; place-items: center; padding: 38px 26px; background: radial-gradient(circle at 82% 18%, #e6eee4 0, transparent 31%), var(--paper); }
.login-form, .form-panel { width: min(100%, 470px); padding: 34px; border-top: 4px solid var(--teal); background: var(--white); box-shadow: 0 18px 55px rgba(32,47,39,.08); }
.login-form h2 { margin: 11px 0 8px; font-size: 34px; }
.form-intro { margin-bottom: 25px; color: var(--muted); font-size: 13px; line-height: 1.6; }
label { display: block; margin: 15px 0 7px; font-size: 12px; font-weight: 700; }
input, select { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); border: 1px solid #cbd4cc; border-radius: 0; outline-color: var(--teal); background: white; }
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(40,122,112,.12); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 40px; padding: 0 15px; border: 0; cursor: pointer; font-size: 12px; font-weight: 800; }
.button-primary { color: white; background: var(--forest); }
.button-primary:hover { background: var(--teal); }
.login-submit { justify-content: space-between; width: 100%; min-height: 48px; margin-top: 24px; }
.button-secondary { color: var(--ink); border: 1px solid var(--line); background: var(--white); }
.button-danger { color: white; background: var(--red); }
.button-small { min-height: 32px; padding: 0 10px; font-size: 11px; }
.field-error, .validation-summary { color: #a53125; font-size: 12px; }
.validation-summary:empty { display: none; }
.validation-summary ul { margin: 0 0 14px; padding: 10px 12px 10px 30px; background: #fff1ee; }
.field-error { display: block; margin-top: 4px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.search-box { max-width: 320px; }
.history-filters { display: grid; grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(130px, 1fr)) auto; align-items: end; gap: 12px; margin-bottom: 16px; padding: 15px; border: 1px solid var(--line); background: rgba(255,255,255,.72); }
.history-filters label { margin-top: 0; }
.history-filters input, .history-filters select { min-height: 38px; }
.filter-search { min-width: 0; }
.filter-actions { display: flex; gap: 6px; }
.sort-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
.sort-link:hover { color: var(--teal); }
.sort-link span { color: var(--teal); font-size: 12px; }
.data-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); background: white; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 12px 14px; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafbf8; font-size: 9px; letter-spacing: 1.2px; white-space: nowrap; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; justify-content: flex-end; gap: 7px; }
.data-table form { margin: 0; }
.table-muted { color: var(--muted); }
.alert { margin-bottom: 18px; padding: 11px 14px; border-left: 3px solid var(--teal); background: white; }
.alert-error { border-color: var(--red); color: #8c2e24; }
.empty-state { padding: 36px 16px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.used-toggle { display: flex; align-items: center; gap: 9px; padding-top: 22px; }
.used-toggle input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--teal); }
.used-toggle label { margin: 0; }
.used-toggle span { color: var(--muted); font-size: 11px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.detail-line { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.credit-select { min-width: 200px; }
.user-row { display: grid; grid-template-columns: minmax(250px, 2fr) minmax(82px, .7fr) minmax(120px, 1fr) minmax(82px, .7fr) minmax(75px, .6fr) auto; align-items: center; gap: 12px; }
.user-edit-form { display: grid; grid-template-columns: minmax(95px, .8fr) minmax(150px, 1fr) auto; gap: 6px; }
.user-edit-form input { min-width: 0; min-height: 34px; padding: 6px 8px; font-size: 12px; }
.user-meta { color: var(--muted); font-size: 12px; }
.create-form { max-width: 760px; }

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
    .sidebar { padding-inline: 15px; }
    .user-row { grid-template-columns: minmax(215px, 1.7fr) minmax(68px, .6fr) minmax(105px, .9fr) minmax(68px, .6fr) minmax(60px, .5fr) auto; gap: 8px; }
    .user-edit-form { grid-template-columns: minmax(85px, .8fr) minmax(110px, 1fr) auto; }
    .history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { min-height: 0; padding: 15px 18px; }
    .nav-caption, .sidebar-bottom { display: none; }
    .side-nav { display: flex; overflow-x: auto; gap: 4px; margin-top: 13px; }
    .side-nav a { flex: 0 0 auto; min-height: 38px; padding-inline: 9px; font-size: 12px; }
    .topbar { min-height: 52px; padding-inline: 18px; }
    .page-content { padding: 28px 18px 42px; }
    .metric { min-height: 125px; padding: 17px 14px; }
    .metric strong { font-size: 34px; }
    .metric > span { font-size: 11px; }
    .login-page { display: block; }
    .login-aside { min-height: 250px; padding: 22px 25px; }
    .login-note { margin: 35px 0 10px; }
    .login-note h1 { font-size: 39px; }
    .login-note p, .login-footer { display: none; }
    .login-panel { min-height: calc(100vh - 250px); padding: 25px 18px; }
    .login-form, .form-panel { padding: 25px 20px; }
    .user-row { min-width: 850px; }
    .toolbar { align-items: flex-end; }
    .history-filters { gap: 8px; padding: 12px; }
}

@media (max-width: 480px) {
    .page-heading { gap: 10px; }
    h1 { font-size: 34px; }
    .heading-stamp { min-width: 76px; padding: 8px 7px; }
    .metric-row { grid-template-columns: 1fr; }
    .metric { min-height: 102px; border-right: 0; border-bottom: 1px solid var(--line); }
    .metric:last-child { border-bottom: 0; }
    .metric strong { margin: 8px 0 5px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .search-box { max-width: none; }
    .history-filters { grid-template-columns: 1fr; }
    .filter-actions { justify-content: flex-end; }
}
@@MEDIA@@