:root { --sidebar-width: 256px; --topbar-height: 72px; }
body { background: var(--bg); color: var(--text); font-family: "Segoe UI", system-ui, sans-serif; }
a { text-decoration: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 6px; font-weight: 600; }
.form-label { font-size: .84rem; font-weight: 600; }
.form-control, .form-select { border-color: var(--line); border-radius: 6px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); z-index: 1030; }
.sidebar-brand { height: var(--topbar-height); display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 4px solid var(--green); color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 7px; background: var(--blue); color: white; font-size: 1.4rem; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text strong { font-size: 1.08rem; font-weight: 600; }
.brand-text small { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.app-nav { padding: 24px 14px; }
.nav-section { padding: 0 12px 10px; color: var(--muted); font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; }
.app-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin: 3px 0; border-radius: 6px; color: var(--text); font-size: .9rem; }
.app-nav a i { font-size: 1.05rem; color: var(--muted); }
.app-nav a:hover { background: var(--bs-tertiary-bg); }
.app-nav a.active { background: rgba(var(--bs-primary-rgb), .1); color: var(--blue); font-weight: 600; }
.app-nav a.active i { color: var(--blue); }
.sidebar-footer { margin-top: auto; padding: 20px 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.online-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; }
.topbar { position: fixed; top: 0; left: var(--sidebar-width); right: 0; height: var(--topbar-height); display: flex; align-items: center; gap: 14px; padding: 0 28px; background: var(--panel); border-bottom: 4px solid var(--green); z-index: 1020; }
.topbar-context, .user-summary { display: flex; flex-direction: column; }
.topbar-context small, .user-summary small { color: var(--muted); font-size: .73rem; }
.topbar-context strong, .user-summary strong { font-weight: 500; font-size: .92rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.user-summary { text-align: right; }
.icon-button { border: 1px solid var(--line); color: var(--muted); background: var(--panel); width: 36px; height: 36px; border-radius: 6px; }
.icon-button:hover { color: var(--blue); border-color: var(--blue); }
.app-main { margin-left: var(--sidebar-width); padding: calc(var(--topbar-height) + 28px) 28px 0; min-height: 100vh; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-title h1 { font-size: 1.7rem; font-weight: 500; margin: 0 0 6px; letter-spacing: -.025em; }
.page-title p { margin: 0; color: var(--muted); font-size: .9rem; }
.workspace-label { flex-shrink: 0; font-size: .75rem; border: 1px solid var(--line); background: var(--panel); color: var(--muted); padding: 7px 11px; border-radius: 5px; }
.card { box-shadow: 0 1px 3px rgba(20,40,60,.025); }
.card h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.section-heading p { margin: 5px 0 0; font-size: .8rem; color: var(--muted); }
.card-footer { background: var(--tda-card-cap-bg); padding: .875rem 1.25rem; border-top-color: var(--line); }
.stat-card .card-body { position: relative; padding: 20px; }
.stat-icon { position: absolute; right: 18px; top: 22px; font-size: 1.3rem; color: var(--blue); }
.stat-label { font-size: .83rem; color: var(--muted); }
.stat-value { font-size: 2.2rem; font-weight: 500; margin: 8px 0 3px; line-height: 1.2; }
.stat-card small { font-size: .72rem; color: var(--muted); }
.table th { background: var(--tda-card-cap-bg); color: var(--muted); font-size: .72rem; font-weight: 600; padding: 13px 20px; white-space: nowrap; }
.table td { padding: 16px 20px; font-size: .84rem; }
.table td small { font-size: .73rem; }
.document-name { display: flex; align-items: center; gap: 8px; }
.document-name strong { font-weight: 500; overflow-wrap: anywhere; }
.status-reason { max-width: 360px; }
.badge { font-weight: 500; }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-state > i { font-size: 2.5rem; color: var(--blue); }
.empty-state h3 { color: var(--text); font-size: 1.05rem; margin: 18px 0 8px; }
.empty-state p { font-size: .85rem; margin: 0; }
.workflow-list { padding-left: 25px; margin-bottom: 26px; }
.workflow-list li { padding-left: 8px; margin: 0 0 20px; font-size: .86rem; }
.workflow-list span { display: block; color: var(--muted); font-size: .79rem; margin-top: 4px; }
.summary-line { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 12px 0; font-size: .85rem; }
.summary-line span { color: var(--muted); }
.summary-line strong { font-weight: 500; text-align: right; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px 0; margin-top: 28px; color: var(--muted); font-size: .7rem; }
.editor-card { width: 100%; min-width: 0; }
.feature-list { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-options { display: flex; gap: 15px; }
.theme-options label { display: flex; gap: 10px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 6px; flex: 1; cursor: pointer; }
.theme-options label:has(input:checked) { border-color: var(--blue); background: rgba(var(--bs-primary-rgb), .06); }
.theme-options strong { font-weight: 500; }
.settings-grid .card form { display: flex; flex-direction: column; flex: 1; }
.settings-grid .card-body { flex: 1; }
.scanner-frame { position: relative; background: var(--bs-tertiary-bg); border: 1px dashed var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; max-height: 380px; }
.scanner-frame video { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.scanner-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.scanner-placeholder i { font-size: 3.5rem; margin-bottom: 10px; }
.review-output { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.review-output span { background: var(--bs-tertiary-bg); padding: 14px; border-radius: 6px; color: var(--muted); font-size: .8rem; }
.review-output strong { display: block; color: var(--text); font-weight: 500; margin-top: 5px; }
.qr-label { width: min(320px, 100%); height: auto; }
.login-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: min(440px,100%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 36px; box-shadow: 0 2px 8px rgba(20,40,60,.08); }
.login-brand { display: flex; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 25px; margin-bottom: 28px; }
.login-brand .brand-mark { width: 52px; height: 52px; font-size: 1.7rem; }
.login-brand .brand-text strong { font-size: 1.5rem; }
.login-card h1 { font-size: 1.5rem; font-weight: 500; }
.login-footnote { border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .78rem; margin-top: 26px; padding-top: 20px; }
.skip-link { position: fixed; z-index: 2000; background: var(--panel); padding: 10px; }
.htmx-request { opacity: .7; }
.table-filters { padding: 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.filter-actions { display: flex; gap: 8px; margin-top: 16px; }
.table-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--line); }
.record-link { font-weight: 600; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.detail-heading h2 { font-size: 1.4rem; font-weight: 500; margin: 12px 0 6px; }
.detail-heading p { color: var(--muted); font-size: .85rem; margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; }
.detail-save { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.wizard-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 28px; }
.wizard-steps li { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); }
.wizard-steps li > span { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line); font-size: .85rem; }
.wizard-steps strong, .wizard-steps small { display: block; }
.wizard-steps strong { font-size: .85rem; font-weight: 600; }
.wizard-steps small { font-size: .72rem; margin-top: 3px; }
.wizard-steps li.active { border-color: var(--blue); background: rgba(var(--bs-primary-rgb), .05); color: var(--blue); }
.wizard-steps li.active > span { color: white; background: var(--blue); border-color: var(--blue); }
.wizard-steps li.complete > span { border-color: var(--green); color: var(--green); }
.search-progress { display: none; align-items: center; gap: 8px; }
.search-progress.htmx-request { display: inline-flex; }
.endpoint-summary { padding: 12px; background: var(--bs-tertiary-bg); border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; font-size: .85rem; }
.wizard-summary { margin: 0; }
.wizard-summary > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.wizard-summary dt { color: var(--muted); font-weight: 500; }
.wizard-summary dd { margin: 0; }
@media (max-width: 767.98px) { .wizard-steps { gap: 8px; } .wizard-steps li { padding: 10px; justify-content: center; gap: 7px; } .wizard-steps small { display: none; } .wizard-steps strong { font-size: .73rem; } .wizard-summary > div { grid-template-columns: 1fr; gap: 5px; } }
@media (max-width: 420px) { .wizard-steps li { flex-direction: column; text-align: center; } }
@media (max-width: 991.98px) { .topbar { left: 0; padding: 0 18px; } .app-main { margin-left: 0; padding: calc(var(--topbar-height) + 22px) 18px 0; } .workspace-label { display: none; } }
@media (max-width: 575.98px) { .page-title h1 { font-size: 1.5rem; } .login-card { padding: 26px; } .table th, .table td { padding: 12px; } .stat-value { font-size: 1.9rem; } .stat-icon { display: none; } .section-heading { align-items: flex-start; } .review-output { grid-template-columns: 1fr; } }
@media print { .sidebar, .topbar, .page-title, .app-footer, .skip-link { display: none !important; } .app-main { margin: 0; padding: 0; } body { background: white; } .print-label { border: 0; color: black; box-shadow: none; } }

/* Settings follow the Texas Door Audit administration hub and settings rows. */
.hub-section + .hub-section { margin-top: 2rem; }
.hub-section-heading { margin-bottom: 1rem; padding-left: .85rem; border-left: 4px solid var(--green); }
.hub-section-heading h2 { margin: 0; color: var(--blue); font-size: 1.05rem; font-weight: 700; }
.hub-section-heading p { margin: .3rem 0 0; color: var(--muted); font-size: .86rem; }
.report-hub-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.report-hub-card { color: inherit; text-decoration: none; }
.report-hub-card .card-body { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 16px; min-height: 132px; padding: 20px; }
.report-hub-card:hover, .report-hub-card:focus-visible { color: inherit; border-color: var(--bs-primary); box-shadow: 0 3px 12px rgba(60,64,67,.12); }
.report-hub-card h2, .report-hub-card h3 { margin: 0 0 5px; font-size: 1.05rem; }
.report-hub-card p { margin: 0; color: var(--bs-secondary-color); font-size: .86rem; }
.report-hub-icon { display: grid; width: 48px; height: 48px; place-items: center; color: var(--bs-primary); background: rgba(var(--bs-primary-rgb),.1); border-radius: 8px; font-size: 1.35rem; }
.settings-card-form { display: block; }
.settings-card-body { padding: 20px; }
.settings-card-body-flush { padding: 0; }
.settings-card-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.settings-card-footer .btn { min-width: 150px; }
.settings-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.settings-toggle-row label { flex: 1; cursor: pointer; }
.settings-toggle-row strong, .settings-toggle-row small { display: block; }
.settings-toggle-row small { color: var(--muted); font-size: .78rem; margin-top: 3px; }
.settings-switch { flex-shrink: 0; margin: 0; }
.time-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.time-options label { position: relative; }
.time-options input { position: absolute; opacity: 0; }
.time-options span { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.time-options i { grid-row: 1/3; color: var(--blue); font-size: 1.2rem; }
.time-options small { color: var(--muted); }
.time-options input:checked + span { border-color: var(--blue); background: rgba(var(--bs-primary-rgb),.1); }
.time-options input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 767.98px) { .report-hub-grid, .time-options { grid-template-columns: 1fr; } }
.policy-summary strong { text-align: right; }
details > summary { cursor: pointer; }

.document-preview { display: block; width: 100%; height: 72vh; min-height: 420px; border: 0; background: var(--bs-tertiary-bg); }
@media (max-width: 575.98px) { .document-preview { height: 65vh; min-height: 340px; } }

/* Equal-sized settings links across all categories, without stretching lone cards. */
.settings-sections { display:grid; gap:28px; }
.settings-card-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.settings-card-grid .settings-link { height:196px; margin:0; min-width:0; }
.settings-card-grid .settings-link .card-body { height:100%; min-height:0; grid-template-columns:40px minmax(0,1fr) 12px; gap:12px; padding:18px; }
.settings-card-grid .report-hub-icon { width:40px; height:40px; }
.settings-card-grid h3 { font-size:1.05rem; line-height:1.35; margin:0 0 7px; }
.settings-card-grid p { line-height:1.5; }
@media (max-width:1199.98px) and (min-width:768px) {
 .settings-card-grid .settings-link { height:240px; }
 .settings-card-grid .settings-link .card-body { grid-template-columns:minmax(0,1fr) 12px; align-content:center; }
 .settings-card-grid .report-hub-icon { display:none; }
}
@media (max-width:767.98px) { .settings-card-grid {grid-template-columns:1fr;} .settings-card-grid .settings-link {height:180px;} }
