:root {
    font-family: "Segoe UI", Arial, sans-serif;
    color: #161616;
    background: #f6f6f6;
    --blue: #000091;
    --blue-hover: #1212ff;
    --border: #dddddd;
    --muted: #666666;
    --success: #18753c;
    --danger: #ce0500;
    --warning: #e47900;
    --surface: #ffffff;
    --surface-alt: #eeeeee;
    --shadow: 0 2px 8px rgb(0 0 0 / 8%);
    --radius: 4px;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; line-height: 1.5; background: #f6f6f6; }
.site-header { background: #fff; border-top: 4px solid var(--blue); border-bottom: 1px solid var(--border); box-shadow: 0 2px 6px rgb(0 0 0 / 8%); }
.site-header__inner { display: flex; max-width: 1440px; margin: auto; padding: .75rem 1.25rem; align-items: center; gap: 1.25rem; }
.site-brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--blue); font-size: 1.2rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.site-brand__mark { padding: .25rem .42rem; color: #fff; background: var(--blue); letter-spacing: .08em; }
.site-navigation { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 1rem; }
.site-navigation__links, .site-user { display: flex; align-items: center; gap: .2rem; }
.site-navigation a { display: inline-flex; min-height: 2.65rem; padding: .5rem .62rem; align-items: center; color: var(--blue); border-radius: var(--radius); font-weight: 700; text-decoration: none; white-space: nowrap; }
.site-navigation a:hover, .site-navigation .site-signout { color: #fff; background: var(--blue); }
.site-navigation a:hover { background: var(--blue-hover); }
.site-user__name { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.site-menu-toggle { display: none; margin-left: auto; }
main { max-width: 1240px; min-height: calc(100vh - 9rem); margin: 2rem auto; padding: 0 1.25rem; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; }
h1 { margin: .15rem 0 .5rem; font-size: clamp(2rem, 4vw, 2.7rem); }
h2 { margin: 0; font-size: 1.55rem; }
a { color: var(--blue); }
.page-heading, .page-header { margin-bottom: 1.5rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.eyebrow { margin: 0 0 .3rem; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.lead { color: #3a3a3a; font-size: 1.08rem; }
.card { padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card + .card { margin-top: 1.25rem; }
.dashboard-grid, .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.dashboard-grid .card, .summary-grid .card { margin: 0; }
.metric { display: block; margin-top: .4rem; color: var(--blue); font-size: 1.8rem; font-weight: 800; }
.muted, .help, .form-hint { color: var(--muted); font-size: .9rem; }
.actions, .dialog-actions, .section-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.section-heading { justify-content: space-between; margin-bottom: 1rem; }
button, .button, main a.button { display: inline-flex; width: auto; min-height: 2.6rem; padding: .55rem .85rem; align-items: center; justify-content: center; color: #fff; background: var(--blue); border: 1px solid var(--blue); border-radius: var(--radius); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--blue-hover); }
.secondary-button, button.secondary, a.secondary { color: var(--blue); background: #fff; }
.secondary-button:hover, button.secondary:hover, a.secondary:hover { color: #fff; background: var(--blue); }
.danger-button, button.danger { color: var(--danger); background: #fff; border-color: var(--danger); }
.danger-button:hover, button.danger:hover { color: #fff; background: var(--danger); }
.success-button, button.success { color: #fff; background: var(--success); border-color: var(--success); }
.large-action { min-height: 3.6rem; padding: .8rem 1.5rem; font-size: 1.05rem; }
label { display: block; margin: .85rem 0 .35rem; font-weight: 700; }
input, select, textarea { width: 100%; padding: .65rem .7rem; color: #161616; background: var(--surface-alt); border: 0; border-bottom: 2px solid var(--blue); border-radius: var(--radius) var(--radius) 0 0; font: inherit; }
textarea { min-height: 6rem; resize: vertical; }
input[type="checkbox"] { width: 1.2rem; height: 1.2rem; accent-color: var(--blue); }
.checkbox-label { display: flex; align-items: center; gap: .55rem; font-weight: 500; }
input:focus, select:focus, textarea:focus, button:focus, a:focus { outline: 3px solid #0a76f6; outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.validation-summary-valid, .field-validation-valid { display: none; }
.validation-summary-errors, .field-validation-error { color: #7f1d1d; font-weight: 600; }
.validation-summary-errors { margin-bottom: 1rem; padding: .75rem 1rem; background: #fee2e2; border-left: 4px solid var(--danger); }
.notice { margin-bottom: 1.5rem; padding: 1rem; color: #0d3b1e; background: #b8fec9; border-left: 5px solid var(--success); }
.notice.warning { color: #6b3500; background: #fff4e5; border-left-color: var(--warning); }
.status-badge { display: inline-block; padding: .25rem .6rem; color: var(--blue); background: #ececfe; border-radius: 1rem; font-size: .82rem; font-weight: 700; }
.status-approved, .status-paid { color: #166534; background: #dcfce7; }
.status-rejected { color: #7f1d1d; background: #fee2e2; }
.status-warning { color: #6b3500; background: #fff4e5; }
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .78rem .7rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: #3a3a3a; background: var(--surface-alt); font-size: .88rem; }
tbody tr:hover { background: #f5f5fe; }
td form { margin: 0; }
.month-nav { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 1.5rem; }
.month-nav a { min-height: 2.25rem; padding: .4rem .65rem; color: var(--blue); background: #fff; border: 1px solid var(--blue); border-radius: var(--radius); font-weight: 700; text-decoration: none; }
.month-nav a.current { color: #fff; background: var(--blue); }
dialog { width: min(38rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 1.25rem; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 42px rgb(0 0 0 / 30%); }
dialog::backdrop { background: rgb(0 0 0 / 48%); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.empty-state { max-width: 760px; }
.version-badge { position: fixed; z-index: 1000; right: .75rem; bottom: .75rem; padding: .28rem .62rem; color: #fff; background: var(--blue); border-radius: 1rem; box-shadow: 0 2px 8px rgb(0 0 0 / 25%); font-size: .75rem; font-weight: 800; pointer-events: none; }
.site-footer { min-height: 3rem; padding: 1rem; color: var(--muted); text-align: center; }
.validation-page main { max-width: 1800px; }
.validation-workspace { display: grid; height: calc(100dvh - 12.5rem); min-height: 600px; grid-template-columns: minmax(15rem, 22%) minmax(0, 1fr); gap: 1rem; }
.expense-queue { overflow-y: auto; padding: .6rem; }
.expense-queue a { display: block; margin-bottom: .45rem; padding: .75rem; color: #161616; background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--blue); border-radius: var(--radius); text-decoration: none; }
.expense-queue a.current { background: #ececfe; border-color: var(--blue); }
.review-pane { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(20rem, 34%); gap: 1rem; }
.receipt-viewer { display: grid; min-height: 0; overflow: hidden; place-items: center; background: #303030; border-radius: var(--radius); }
.receipt-viewer iframe, .receipt-viewer img { width: 100%; height: 100%; min-height: 0; object-fit: contain; border: 0; }
.review-sidebar { display: flex; min-height: 0; flex-direction: column; }
.review-information { overflow-y: auto; }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: auto; padding-top: 1rem; }
.review-actions button { width: 100%; }
.detail-list { margin: 0; }
.detail-list div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.detail-list dt { color: var(--muted); font-weight: 700; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 1180px) {
    .site-header__inner { flex-wrap: wrap; }
    .site-menu-toggle { display: inline-flex; }
    .site-navigation { display: none; width: 100%; flex-basis: 100%; align-items: stretch; flex-direction: column; }
    .site-navigation.open { display: flex; }
    .site-navigation__links, .site-user { align-items: stretch; flex-direction: column; }
    .site-navigation a { width: 100%; justify-content: flex-start; }
    .validation-workspace { height: auto; grid-template-columns: 1fr; }
    .expense-queue { display: flex; max-height: none; overflow-x: auto; }
    .expense-queue a { min-width: 15rem; margin: 0 .45rem 0 0; }
}
@media (max-width: 760px) {
    main { margin-top: 1.25rem; padding-inline: 1rem; }
    .page-header { align-items: stretch; flex-direction: column; }
    .form-grid, .review-pane { grid-template-columns: 1fr; }
    .receipt-viewer { min-height: 60dvh; }
    .review-actions { position: sticky; z-index: 5; bottom: 0; padding: .75rem; background: #fff; }
    .actions > *, .page-header .actions > * { width: 100%; }
    .version-badge { right: .5rem; bottom: .5rem; }
}
