/* Shared application UI. PDF document views keep their original print styles. */
:root {
    color-scheme: light;
    --bg: #f5f7f6;
    --surface: #ffffff;
    --surface-soft: #f8faf9;
    --text: #202d27;
    --muted: #69766e;
    --border: #e3e9e5;
    --input-border: #ccd7d0;
    --green: #176447;
    --green-soft: #eaf4ee;
    --green-border: #cce3d4;
    --primary: #176447;
    --primary-ink: #ffffff;
    --primary-hover: #104d35;
    --danger: #b23b42;
    --danger-soft: #fdf0f0;
    --danger-border: #efcdd0;
    --warning: #966319;
    --warning-soft: #fcf5e9;
    --warning-border: #eaddbb;
    --blue: #476985;
    --blue-soft: #edf3f7;
    --purple: #776087;
    --purple-soft: #f3eff7;
    --sidebar: #104832;
    --sidebar-ink: #f3f8f5;
    --sidebar-muted: #b8d7c8;
    --sidebar-line: #34614c;
    --sidebar-hover: #1c543c;
    --sidebar-active: #2a664b;
    --focus: #2c8c63;
    --shadow: 0 6px 24px rgb(20 40 29 / 4%);
    --radius: 9px;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #131a17;
    --surface: #1b2420;
    --surface-soft: #222d27;
    --text: #e6eee9;
    --muted: #a1b0a7;
    --border: #34423a;
    --input-border: #46594d;
    --green: #85d9ad;
    --green-soft: #233e2e;
    --green-border: #3a5d47;
    --primary: #8adbaf;
    --primary-ink: #122c1e;
    --primary-hover: #a3e8c2;
    --danger: #f0a0a7;
    --danger-soft: #382629;
    --danger-border: #634044;
    --warning: #dfba77;
    --warning-soft: #393024;
    --warning-border: #5b4b32;
    --blue: #9cbed7;
    --blue-soft: #26353f;
    --purple: #c5add9;
    --purple-soft: #342d3d;
    --sidebar: #101f18;
    --sidebar-ink: #e4efe8;
    --sidebar-muted: #adc2b6;
    --sidebar-line: #304739;
    --sidebar-hover: #1b3426;
    --sidebar-active: #254631;
    --focus: #85d9ad;
    --shadow: 0 6px 24px rgb(0 0 0 / 8%);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; min-height: 100%; background: var(--bg); }
body { margin: 0; font: 14px/1.55 Inter, "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--green-soft); color: var(--text); }
svg { flex-shrink: 0; }
.ui-icon { width: 19px; height: 19px; vertical-align: middle; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(23px, 2.2vw, 28px); line-height: 1.25; font-weight: 650; letter-spacing: -.035em; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
strong { font-weight: 600; }
.muted, .helper, .hint, .company-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.helper, .hint, .company-note { margin: 7px 0 0; font-size: 12px; }
.text-green { color: var(--green); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 10px 16px; background: var(--surface); border-radius: 6px; }
.skip-link:focus { top: 12px; }

/* Navigation and application frame */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-width: 0; overflow-y: auto; background: var(--sidebar); color: var(--sidebar-ink); border-right: 1px solid var(--sidebar-line); z-index: 40; }
.sidebar-top { display: flex; align-items: center; padding: 25px 18px 28px; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--sidebar-ink); min-width: 0; }
.brand-logo { display: grid; place-items: center; flex: 0 0 33px; height: 35px; width: 33px; border: 1px solid var(--sidebar-line); border-radius: 8px; background: var(--sidebar-hover); color: var(--sidebar-ink); }
.brand-logo .ui-icon { width: 20px; height: 20px; }
.brand-title { display: block; font-size: 13px; letter-spacing: -.02em; font-weight: 650; white-space: nowrap; }
.brand-sub { display: block; margin-top: 2px; font-size: 10px; color: var(--sidebar-muted); }
.menu-nav { padding: 4px 12px 24px; }
.menu-title { margin: 0 12px 10px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--sidebar-muted); }
.menu-title-secondary { margin-top: 30px; }
.menu { display: flex; align-items: center; gap: 11px; padding: 11px 12px; margin-bottom: 4px; border-radius: 6px; color: var(--sidebar-muted); font-size: 12.5px; font-weight: 500; }
.menu:hover { background: var(--sidebar-hover); color: var(--sidebar-ink); }
.menu.active { background: var(--sidebar-active); color: var(--sidebar-ink); }
.menu .ui-icon { width: 18px; height: 18px; }
.sidebar-bottom { margin-top: auto; padding: 14px 12px 18px; border-top: 1px solid var(--sidebar-line); }
.session-panel { display: flex; align-items: center; gap: 9px; padding: 10px 8px; border-radius: 6px; color: var(--sidebar-ink); }
.session-panel:hover, .session-panel.active { background: var(--sidebar-hover); }
.session-symbol { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sidebar-active); flex-shrink: 0; font-size: 12px; }
.session-description { flex: 1; min-width: 0; }
.session-description strong { display: block; font-size: 11px; }
.session-description small { display: block; color: var(--sidebar-muted); font-size: 11px; overflow-wrap: anywhere; }
.session-panel > .ui-icon { width: 14px; }
.session-dot { display: inline-block; width: 5px; height: 5px; margin-left: 4px; background: #85d9ad; border-radius: 50%; vertical-align: middle; }
.logout { display: flex; align-items: center; gap: 12px; background: none; color: var(--sidebar-muted); border: 0; border-radius: 6px; width: 100%; padding: 11px 12px; margin-top: 9px; font-size: 12px; text-align: left; }
.logout:hover { background: var(--sidebar-hover); color: var(--sidebar-ink); }
.sidebar-close { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgb(6 19 12 / 58%); }
.main { min-width: 0; display: flex; flex-direction: column; }
.header { min-height: 65px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 28px; border-bottom: 1px solid var(--border); background: var(--surface); }
.header-leading, .header-actions { display: flex; align-items: center; gap: 14px; min-width: 0; }
.header-actions { flex-shrink: 0; }
.sidebar-toggle-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); }
.sidebar-toggle-btn:hover { color: var(--green); background: var(--green-soft); border-color: var(--green-border); }
.header-breadcrumb { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--muted); font-size: 12px; }
.header-breadcrumb strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.header-avatar { display: grid; place-items: center; width: 30px; height: 30px; background: var(--green-soft); color: var(--green); border: 1px solid var(--green-border); border-radius: 50%; font-size: 11px; font-weight: 600; }
.theme-switch { display: flex; padding: 3px; gap: 2px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; }
.theme-switch button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 9px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); font-size: 11px; line-height: 1.5; }
.theme-switch .ui-icon { width: 14px; height: 14px; }
html[data-theme="light"] [data-theme-choice="light"], html[data-theme="dark"] [data-theme-choice="dark"] { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 3%); }
.theme-switch button:hover { color: var(--green); }
.content { flex: 1; width: 100%; padding: 30px 30px 40px; min-width: 0; }
.content:focus { outline: none; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding: 17px 30px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--border); }
html[data-sidebar-open="false"] .app { grid-template-columns: minmax(0, 1fr); }
html[data-sidebar-open="false"] .sidebar { display: none; }

/* Shared page, form, table and feedback components */
.page-title, .form-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 25px; flex-wrap: wrap; }
.form-intro { display: block; }
.page-title h1, .form-intro h1 { margin-bottom: 7px; }
.page-title p, .form-intro p { margin: 0; }
.page-title > div:first-child { min-width: 0; }
.eyebrow { font-size: 10px; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.period-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.period-label .ui-icon { width: 15px; height: 15px; }
.card, .form-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 23px; margin-bottom: 20px; }
.card h3, .form-section h3 { margin: 0 0 18px; }
.card > :last-child { margin-bottom: 0; }
.expense-form, .company-form, .form-page { max-width: 960px; margin: 0 auto; }
.account-form { max-width: 820px; margin: 0 auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 550; line-height: 1.5; text-align: center; text-decoration: none; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary, .btn-outline { color: var(--text); background: var(--surface); border-color: var(--input-border); }
.btn-secondary:hover, .btn-outline:hover { background: var(--surface-soft); border-color: var(--muted); }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.btn-danger:hover { border-color: var(--danger); }
.actions, .form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.actions form { margin: 0; }
.form-actions { justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 20px; margin-top: 25px; }
.section-title { padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.card .form-detail-title { margin-top: 30px; }
.form-grid, .company-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-group, .form-grid > div, .company-grid > div { min-width: 0; }
.full, .form-group.full, .company-grid .wide { grid-column: 1 / -1; }
label { display: block; color: var(--text); margin-bottom: 7px; font-size: 12px; font-weight: 600; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { display: block; width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; color: var(--text); background: var(--surface); border: 1px solid var(--input-border); border-radius: 6px; outline-offset: 2px; font-size: 13px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid var(--green-border); outline-offset: 1px; }
input[readonly] { background: var(--surface-soft) !important; color: var(--muted) !important; }
input[aria-invalid="true"] { border-color: var(--danger) !important; }
textarea { min-height: 115px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--green); width: 16px; height: 16px; vertical-align: middle; }
input[type="file"] { padding: 8px 10px !important; background: var(--surface-soft) !important; border-style: dashed !important; }
input[type="file"]::file-selector-button { padding: 5px 10px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; margin-right: 12px; cursor: pointer; }
.remove-check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 12px; }
.company-grid .preview { display: block; max-width: 160px; max-height: 100px; object-fit: contain; padding: 7px; margin-top: 12px; border-radius: 5px; border: 1px solid var(--border); background: #fff; }
.table-wrapper, .dashboard-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { color: var(--muted); background: var(--surface-soft); font-weight: 550; font-size: 11px; white-space: nowrap; padding: 12px 14px; border-block: 1px solid var(--border); }
td { padding: 16px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; line-height: 1.6; }
tbody tr:hover { background: var(--surface-soft); }
tbody tr:last-child td { border-bottom: 0; }
td .muted { margin: 3px 0 0; font-size: 11px; }
td .btn { min-height: 31px; padding: 5px 10px; font-size: 11px; white-space: nowrap; }
td .actions { flex-wrap: nowrap; }
td img { background: #fff; padding: 4px; border-radius: 4px; }
.money, .money-value { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.text-right { text-align: right; }
.badge, .dashboard-status { display: inline-flex; align-items: center; justify-content: center; padding: 3px 8px; border: 1px solid transparent; border-radius: 4px; font-size: 10px; font-weight: 550; white-space: nowrap; width: fit-content; }
.badge.success, .dashboard-status.recorded { color: var(--green); background: var(--green-soft); border-color: var(--green-border); }
.badge.danger, .dashboard-status.cancelled { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.alert { padding: 13px 16px; border: 1px solid; border-radius: 7px; margin-bottom: 22px; font-size: 13px; }
.alert-success { color: var(--green); background: var(--green-soft); border-color: var(--green-border); }
.alert-error { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.alert ul { margin: 7px 0 0; padding-left: 20px; }
.alert a { text-decoration: underline; color: inherit; }
.detail-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: start; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border: 0; }
.detail-row > :last-child { overflow-wrap: anywhere; }
.expense-section-tabs { display: flex; flex-wrap: wrap; gap: 22px; border-bottom: 1px solid var(--border); margin: -5px 0 25px; }
.expense-section-tab { padding: 9px 0 12px; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.expense-section-tab.is-active { color: var(--green); border-color: var(--green); font-weight: 600; }
.expense-section-tab:hover { color: var(--green); }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.filter-grid .filter-search, .filter-grid .filter-company { grid-column: span 3; }
.filter-grid .filter-date, .filter-grid .filter-status { grid-column: span 2; }
.filter-grid .form-group { min-width: 0; }
.filter-card h3 { font-size: 13px; }
.summary-strip { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; padding: 18px 23px; }
.summary-strip .muted { font-size: 11px; margin: 0 0 5px; }
.summary-strip h2 { margin: 0; font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary-strip > div { min-width: 0; max-width: 100%; }
.summary-strip > div + div { padding-left: 32px; border-left: 1px solid var(--border); }
.expense-table { min-width: 940px; }
.expense-table th:nth-child(7), .expense-table td:nth-child(7) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.expense-table td:nth-child(3), .expense-table td:nth-child(4) { white-space: nowrap; }
.expense-table td:nth-child(7) { font-weight: 600; }
.is-hidden { display: none !important; }

/* Dashboard: retain all four metrics and the eight latest transactions. */
.dashboard-wrap { width: 100%; margin: 0 auto; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 25px; }
.stat-card { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 19px 19px 14px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { margin: 0; color: var(--muted); font-size: 11px; font-weight: 500; }
.stat-label br { display: none; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 6px; color: var(--green); background: var(--green-soft); flex-shrink: 0; }
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.orange { color: var(--warning); background: var(--warning-soft); }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.purple { color: var(--purple); background: var(--purple-soft); }
.stat-value { margin-top: 17px; font-size: clamp(20px, 1.8vw, 28px); line-height: 1.25; letter-spacing: -.04em; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value .currency { display: inline; font-size: 13px; font-weight: 500; letter-spacing: -.01em; color: var(--muted); }
.stat-description { color: var(--muted); font-size: 10px; margin-top: 6px; }
.stat-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 18px; color: var(--muted); font-size: 10px; }
.stat-highlight { color: var(--green); font-weight: 500; }
.latest-card { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.latest-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px; }
.latest-title h2 { margin: 0 0 4px; font-size: 15px; }
.latest-title p { margin: 0; color: var(--muted); font-size: 11px; }
.latest-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
input#dashboardTransactionSearch { width: 190px; min-height: 36px; font-size: 11px; padding: 8px 10px; }
.latest-actions .btn { min-height: 36px; font-size: 11px; padding: 7px 10px; }
.dashboard-table { min-width: 900px; }
.dashboard-table th:nth-child(6), .dashboard-table td:nth-child(6) { text-align: right; }
.dashboard-table td:nth-child(3) { white-space: nowrap; }
.transaction-number { white-space: nowrap; font-size: 11px; font-weight: 600; }
.company-name { display: block; max-width: 165px; font-size: 10px; font-weight: 500; line-height: 1.55; }
.company-unassigned { color: var(--warning); font-size: 11px; }
.detail-link, .history-link { color: var(--green); font-size: 11px; font-weight: 550; white-space: nowrap; }
.detail-link:hover, .history-link:hover { text-decoration: underline; }
.empty-dashboard { padding: 35px; text-align: center; color: var(--muted); }
.latest-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 13px 20px; font-size: 10px; color: var(--muted); border-top: 1px solid var(--border); }
.search-empty { text-align: center; padding: 25px; color: var(--muted); }

/* Login uses the same tokens and theme preference as the app. */
.login-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.login-topbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 22px 36px; }
.login-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 13px; font-weight: 600; }
.login-main { flex: 1; display: grid; place-items: center; padding: 40px 20px; }
.login-container { width: 100%; max-width: 420px; padding: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.login-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--green-soft); color: var(--green); margin-bottom: 27px; }
.login-symbol .ui-icon { width: 23px; height: 23px; }
.login-container h1 { font-size: 25px; line-height: 1.3; margin: 0 0 10px; }
.subtitle { color: var(--muted); font-size: 12px; line-height: 1.7; margin-bottom: 27px; }
.login-container .form-group { margin-bottom: 19px; }
.password-field { position: relative; }
.password-field input { padding-right: 45px !important; }
.password-field button { position: absolute; right: 4px; top: 4px; height: 34px; width: 34px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--muted); }
.password-field button:hover { color: var(--green); background: var(--surface-soft); }
.password-field .ui-icon { width: 17px; }
.login-submit { width: 100%; min-height: 42px; margin-top: 3px; justify-content: space-between; padding: 10px 14px; }
.login-note { font-size: 11px; line-height: 1.7; color: var(--muted); border-top: 1px solid var(--border); padding-top: 21px; margin: 25px 0 0; }
.login-footer { padding: 20px; text-align: center; font-size: 11px; color: var(--muted); }

@media (max-width: 1279px) {
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-value { font-size: 26px; }
    .header { padding-inline: 23px; }
    .content { padding: 25px 23px 35px; }
    .latest-actions { width: 100%; }
    input#dashboardTransactionSearch { flex: 1; }
}
@media (max-width: 767px) {
    .app { display: block; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: min(284px, calc(100vw - 36px)); z-index: 40; box-shadow: 20px 0 60px rgb(0 0 0 / 15%); }
    .sidebar-top { padding: 22px 15px; }
    .sidebar-close { display: grid; place-items: center; width: 30px; height: 34px; margin-left: auto; flex-shrink: 0; background: transparent; border: 0; color: var(--sidebar-ink); border-radius: 5px; }
    .sidebar-close:hover { background: var(--sidebar-hover); }
    .menu-open { overflow: hidden; }
    .main { min-height: 100vh; min-height: 100dvh; }
    .header { min-height: 61px; padding: 11px 16px; gap: 10px; }
    .header-leading, .header-actions { gap: 10px; }
    .header-breadcrumb { font-size: 11px; }
    .header-breadcrumb > span { display: none; }
    .header-avatar { display: none; }
    .theme-switch button { padding: 6px 7px; }
    .theme-switch button span { display: none; }
    .content { padding: 23px 16px 30px; }
    .footer { padding: 16px; font-size: 10px; }
    .footer > span:last-child { display: none; }
    .page-title { align-items: flex-start; gap: 16px; }
    .page-title, .form-intro { margin-bottom: 20px; }
    .card, .form-section { padding: 18px; }
    .dashboard-stats { gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 23px; }
    .stat-footer { font-size: 9px; }
    .latest-header { padding: 18px; }
    .latest-actions input#dashboardTransactionSearch { flex-basis: 100%; }
    .latest-footer { padding: 13px 18px; }
    .form-grid, .company-grid { grid-template-columns: 1fr; gap: 18px; }
    .full, .form-group.full, .company-grid .wide { grid-column: auto; }
    .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .filter-grid .filter-search, .filter-grid .filter-company, .filter-grid .filter-status { grid-column: 1 / -1; }
    .filter-grid .filter-date { grid-column: auto; }
    .detail-row { grid-template-columns: 1fr; gap: 5px; }
    .summary-strip { gap: 20px; }
    .summary-strip > div + div { padding-left: 0; border: 0; }
    .summary-strip h2 { font-size: 21px; }
    .login-topbar { padding: 18px 20px; }
    .login-brand { font-size: 12px; }
    .login-main { padding-block: 20px; }
    .login-container { padding: 28px; }
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { font-size: 16px; }
    input#dashboardTransactionSearch { font-size: 16px; }
}
@media (max-width: 420px) {
    .dashboard-stats { grid-template-columns: 1fr; }
    .stat-card { padding: 18px; }
    .stat-value { font-size: 28px; }
    .stat-footer { font-size: 10px; }
    .page-title .actions { width: 100%; }
    .form-actions .btn { flex: 1; }
    .login-container { padding: 25px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media print {
    .sidebar, .header, .footer, .expense-section-tabs, .skip-link { display: none !important; }
    .app { display: block; }
    .content { padding: 0; }
}