:root {
    --primary: #1677ff;
    --primary-dark: #0f5fc7;
    --primary-soft: #eaf3ff;
    --navy: #0b1f3a;
    --sidebar: #102844;
    --sidebar-hover: #18395f;
    --surface: #ffffff;
    --background: #f4f7fb;
    --border: #e4eaf2;
    --text: #172033;
    --muted: #6f7d90;
    --success: #0f9f6e;
    --warning: #d88700;
    --danger: #dc3e4f;
    --shadow: 0 8px 24px rgba(22, 40, 70, .07);
    --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--background);
    color: var(--text);
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: 248px;
    background: linear-gradient(180deg, #102844 0%, #0b2038 100%);
    color: #dce8f7;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
}
.brand {
    height: 68px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2e8cff, #5bb8ff);
    color: white;
    font-weight: 800;
    letter-spacing: -.04em;
    box-shadow: 0 7px 18px rgba(46,140,255,.32);
}
.brand-title { color: white; font-weight: 750; letter-spacing: .02em; font-size: 15px; }
.brand-subtitle { color: #8fa8c5; font-size: 10px; margin-top: 2px; letter-spacing: .06em; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-label { padding: 14px 12px 7px; color: #7791af; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.nav-link {
    margin: 3px 0;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 9px;
    color: #c6d6e8;
    transition: .18s ease;
}
.nav-link:hover { background: var(--sidebar-hover); color: white; }
.nav-link.active { background: rgba(46,140,255,.20); color: #fff; box-shadow: inset 3px 0 0 #48a4ff; }
.nav-link svg { width: 19px; height: 19px; opacity: .9; flex: 0 0 auto; }
.nav-link span { font-size: 13px; font-weight: 560; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #2e8cff; display: grid; place-items: center; color: #fff; font-weight: 700; flex: 0 0 auto; }
.user-copy { min-width: 0; }
.user-name { color: white; font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: #8fa8c5; font-size: 10px; margin-top: 2px; text-transform: capitalize; }

.main-shell { margin-left: 248px; width: calc(100% - 248px); min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 68px;
    padding: 0 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mobile-toggle { display: none; border: 0; background: transparent; padding: 6px; color: var(--navy); }
.mobile-toggle svg { width: 24px; height: 24px; }
.company-context { min-width: 0; }
.company-name { font-size: 14px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); background: #fff; border-radius: 9px; color: #53657b; }
.icon-button:hover { background: #f8fafc; color: var(--primary); }
.icon-button svg { width: 18px; height: 18px; }
.logout-button { border: 0; background: transparent; }

.page { padding: 25px 26px 40px; max-width: 1680px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-title { margin: 0; color: var(--navy); font-size: 24px; line-height: 1.2; letter-spacing: -.025em; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.btn { min-height: 38px; padding: 8px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; font-weight: 650; font-size: 12px; transition: .18s ease; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 6px 16px rgba(22,119,255,.22); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: #34445a; border-color: var(--border); }
.btn-secondary:hover { border-color: #b9c7d8; background: #f9fbfd; }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3cbd0; }
.btn-danger:hover { background: #fff4f5; }
.btn-sm { min-height: 31px; padding: 5px 10px; font-size: 11px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); }
.card-title { margin: 0; font-size: 14px; color: var(--navy); font-weight: 720; }
.card-subtitle { margin-top: 4px; color: var(--muted); font-size: 11px; }
.card-body { padding: 19px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.stat-card { padding: 17px; min-height: 116px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; right: -28px; top: -30px; background: var(--primary-soft); }
.stat-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .055em; }
.stat-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); }
.stat-icon svg { width: 18px; height: 18px; }
.stat-value { position: relative; z-index: 1; margin-top: 12px; font-size: 27px; font-weight: 780; letter-spacing: -.04em; color: var(--navy); }
.stat-note { position: relative; z-index: 1; color: var(--muted); font-size: 10px; margin-top: 4px; }
.stat-card.danger .stat-icon { background: #fff0f1; color: var(--danger); }
.stat-card.warning .stat-icon { background: #fff7e8; color: var(--warning); }
.stat-card.success .stat-icon { background: #eafaf4; color: var(--success); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 17px; margin-bottom: 17px; }
.dashboard-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.chart-wrap { min-height: 270px; position: relative; }

.filters { margin-bottom: 15px; padding: 14px; display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.filter-grow { flex: 1 1 280px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { color: #415169; font-size: 11px; font-weight: 650; }
.form-control {
    width: 100%;
    min-height: 39px;
    padding: 8px 11px;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: .18s ease;
}
.form-control:focus { border-color: #6aaaff; box-shadow: 0 0 0 3px rgba(22,119,255,.11); }
textarea.form-control { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-hint { color: var(--muted); font-size: 10px; }
.form-error { color: var(--danger); font-size: 10px; }
.form-footer { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 9px; }
.checkbox-row { min-height: 39px; display: flex; align-items: center; gap: 8px; color: #415169; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--primary); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { padding: 11px 14px; background: #f7f9fc; color: #6d7c90; border-bottom: 1px solid var(--border); text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .055em; font-weight: 750; white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #edf1f6; vertical-align: middle; color: #34445a; font-size: 12px; }
.data-table tbody tr:hover { background: #fbfcfe; }
.data-table tr:last-child td { border-bottom: 0; }
.table-primary { color: var(--navy); font-weight: 680; }
.table-secondary { color: var(--muted); font-size: 10px; margin-top: 3px; }
.table-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 9px; line-height: 1.2; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-blue { color: #1468d2; background: #eaf3ff; }
.badge-green { color: #0b8c61; background: #e8f9f2; }
.badge-yellow { color: #b16b00; background: #fff5df; }
.badge-red { color: #c53243; background: #fff0f2; }
.badge-gray { color: #617187; background: #eff3f7; }
.badge-purple { color: #7145c5; background: #f2edff; }

.alert { margin-bottom: 16px; padding: 12px 14px; border-radius: 9px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid; }
.alert-success { color: #087953; background: #ecfbf5; border-color: #bdebd9; }
.alert-danger { color: #ad2938; background: #fff3f4; border-color: #f4c6cc; }
.alert ul { margin: 5px 0 0; padding-left: 18px; }

.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 14px; background: #f1f5fa; color: #7a8ba1; }
.empty-icon svg { width: 24px; height: 24px; }
.empty-title { color: var(--navy); font-weight: 700; margin-bottom: 5px; }
.empty-copy { font-size: 12px; }

.pagination { padding: 13px 15px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pagination-info { color: var(--muted); font-size: 11px; }
.pagination-links { display: flex; gap: 5px; }
.page-link { min-width: 31px; height: 31px; padding: 0 8px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: #53657b; font-size: 11px; }
.page-link:hover { border-color: #9fc5f8; color: var(--primary); }
.page-link.disabled { opacity: .45; pointer-events: none; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 42%) 1fr; background: #fff; }
.login-panel { padding: 48px clamp(34px, 7vw, 92px); display: flex; flex-direction: column; justify-content: center; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 52px; }
.login-brand .brand-mark { width: 42px; height: 42px; }
.login-heading { margin: 0; font-size: 30px; letter-spacing: -.035em; color: var(--navy); }
.login-copy { margin: 10px 0 29px; color: var(--muted); line-height: 1.65; }
.login-form { max-width: 420px; }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 44px; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #6f7d90; padding: 7px; }
.login-submit { width: 100%; margin-top: 10px; min-height: 44px; }
.login-demo { max-width: 420px; margin-top: 22px; padding: 12px 14px; border: 1px dashed #b9cee8; border-radius: 9px; background: #f6faff; color: #52657c; font-size: 11px; line-height: 1.65; }
.login-visual { position: relative; overflow: hidden; padding: 58px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, #0b2442 0%, #113c69 58%, #1d6db0 100%); color: white; }
.login-visual::before, .login-visual::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); }
.login-visual::before { width: 520px; height: 520px; right: -180px; top: -190px; }
.login-visual::after { width: 360px; height: 360px; left: -120px; bottom: -160px; }
.visual-copy { position: relative; z-index: 1; max-width: 560px; }
.visual-kicker { display: inline-flex; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.14); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.visual-title { margin: 21px 0 14px; font-size: clamp(34px, 4vw, 55px); line-height: 1.05; letter-spacing: -.045em; }
.visual-text { max-width: 500px; color: #c5d8eb; font-size: 15px; line-height: 1.7; }
.visual-metrics { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 620px; }
.visual-metric { padding: 15px; border-radius: 12px; background: rgba(7,28,52,.34); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(8px); }
.visual-metric strong { display: block; font-size: 20px; }
.visual-metric span { display: block; margin-top: 4px; color: #a9c3dd; font-size: 10px; }

.overlay { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(6,18,34,.48); }
body.sidebar-open .overlay { display: block; }

@media (max-width: 1180px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .main-shell { margin-left: 0; width: 100%; }
    .mobile-toggle { display: block; }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { min-height: 100vh; }
}
@media (max-width: 720px) {
    .topbar { padding: 0 16px; }
    .page { padding: 19px 15px 30px; }
    .page-heading { flex-direction: column; }
    .page-actions { width: 100%; justify-content: flex-start; }
    .stats-grid { grid-template-columns: 1fr; }
    .dashboard-lower { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .filters { align-items: stretch; }
    .filters .btn { width: 100%; }
    .company-meta { display: none; }
}

/* Finance and settings module */
.theme-emerald-operations { --primary:#059669; --primary-dark:#047857; --primary-soft:#e8f8f1; --sidebar:#073b35; --sidebar-hover:#0b5148; }
.theme-charcoal-gold { --primary:#b98b2f; --primary-dark:#8a671f; --primary-soft:#fff7df; --sidebar:#202024; --sidebar-hover:#34343a; }
.theme-violet-suite { --primary:#7c3aed; --primary-dark:#5b21b6; --primary-soft:#f1eafe; --sidebar:#2e1a52; --sidebar-hover:#442873; }
.theme-ocean-teal { --primary:#0891b2; --primary-dark:#0e7490; --primary-soft:#e7f8fb; --sidebar:#083344; --sidebar-hover:#0e4e63; }
.theme-sunset-orange { --primary:#ea580c; --primary-dark:#c2410c; --primary-soft:#fff0e8; --sidebar:#431407; --sidebar-hover:#67220c; }
.brand-logo { width:36px; height:36px; object-fit:contain; border-radius:9px; background:#fff; padding:3px; }
.mb-2 { margin-bottom:17px; }
.mt-1 { margin-top:10px; }
.mt-2 { margin-top:17px; }
.money { font-size:clamp(18px,2vw,24px) !important; white-space:nowrap; }
.text-success { color:var(--success) !important; }
.text-danger { color:var(--danger) !important; }
.muted { color:var(--muted); }

.module-tabs { display:flex; gap:7px; overflow-x:auto; padding:5px 0 14px; margin-bottom:4px; scrollbar-width:thin; }
.module-tab { flex:0 0 auto; padding:8px 12px; border:1px solid var(--border); background:#fff; border-radius:8px; color:#607188; font-size:11px; font-weight:680; }
.module-tab:hover, .module-tab.active { color:var(--primary); border-color:#9fc5f8; background:var(--primary-soft); }

.finance-kpi-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.finance-kpi-grid > div { padding:14px; border:1px solid var(--border); border-radius:10px; background:#fafcff; }
.finance-kpi-grid span { display:block; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.05em; }
.finance-kpi-grid strong { display:block; margin-top:7px; color:var(--navy); font-size:17px; }
.report-bars > div { display:grid; grid-template-columns:130px 1fr auto; align-items:center; gap:10px; margin-top:12px; font-size:11px; }
.bar-track { height:8px; background:#edf3fa; border-radius:99px; overflow:hidden; }
.bar-fill { height:100%; background:var(--primary); border-radius:99px; }
.bar-track.danger .bar-fill { background:var(--danger); }
.cash-row { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:13px 0; border-bottom:1px solid var(--border); }
.cash-row:last-child { border-bottom:0; }
.cash-row b,.cash-row small { display:block; }
.cash-row small { color:var(--muted); margin-top:4px; font-size:10px; }

.settings-grid { display:grid; grid-template-columns:minmax(280px,.75fr) minmax(0,1.6fr); gap:17px; }
.settings-wide { min-width:0; }
.journal-entry-table { min-width:1150px; }
.journal-entry-table .form-control { min-width:130px; }
.journal-entry-table td { padding:7px; }
.journal-entry-table tfoot td { background:#f7f9fc; }
.journal-lines-detail { margin-top:10px; min-width:430px; padding:9px 12px; border:1px solid var(--border); border-radius:8px; background:#fafcff; }
.journal-lines-detail > div { display:flex; justify-content:space-between; gap:20px; padding:5px 0; font-size:11px; }
details summary { cursor:pointer; color:var(--primary); }

.report-sheet { background:#fff; border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); padding:26px; }
.report-title { text-align:center; padding-bottom:18px; border-bottom:2px solid var(--navy); }
.report-title h2 { margin:0; color:var(--navy); font-size:20px; }
.report-title p { margin:5px 0 0; color:var(--muted); font-size:11px; }
.report-section { padding:19px 0 5px; }
.report-section h3 { margin:0 0 9px; color:var(--navy); font-size:14px; }
.report-row,.report-total,.report-grand-total { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:8px 4px; }
.report-row { border-bottom:1px dashed #e4eaf2; font-size:12px; }
.report-total { margin-top:5px; border-top:1px solid var(--navy); font-weight:720; }
.report-grand-total { margin-top:18px; padding:17px; border-radius:10px; background:var(--navy); color:#fff; }
.report-grand-total strong { font-size:20px; }
.report-grand-total small { color:#bcd0e6; }
.report-grand-total.positive { background:#087a59; }
.report-grand-total.negative { background:#a62d3b; }
.balance-grid { display:grid; grid-template-columns:1fr 1fr; gap:17px; align-items:start; }

.aging-stats { grid-template-columns:repeat(5,minmax(0,1fr)); }
.payment-details { position:relative; }
.payment-form,.popover-form { position:absolute; z-index:20; right:0; width:300px; display:grid; gap:8px; padding:12px; margin-top:6px; background:#fff; border:1px solid var(--border); border-radius:10px; box-shadow:0 18px 50px rgba(10,31,58,.18); }
.truncate-cell { max-width:280px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.settings-shell { display:grid; grid-template-columns:220px minmax(0,1fr); gap:17px; align-items:start; }
.settings-nav { position:sticky; top:86px; display:flex; flex-direction:column; padding:9px; background:#fff; border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.settings-nav-item { border:0; background:transparent; text-align:left; padding:11px 12px; border-radius:8px; color:#5c6d83; font-size:12px; }
.settings-nav-item:hover,.settings-nav-item.active { background:var(--primary-soft); color:var(--primary); font-weight:700; }
.settings-content { min-width:0; }
.settings-panel { display:none; }
.settings-panel.active { display:block; }
.theme-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.theme-option { display:flex; flex-direction:column; gap:8px; padding:10px; border:1px solid var(--border); border-radius:10px; cursor:pointer; font-size:11px; }
.theme-option:has(input:checked) { border-color:var(--primary); box-shadow:0 0 0 2px var(--primary-soft); }
.theme-option input { position:absolute; opacity:0; }
.theme-preview { height:55px; border-radius:7px; background:linear-gradient(135deg,#0f172a,#2563eb,#38bdf8); }
.theme-preview-emerald-operations { background:linear-gradient(135deg,#052e2b,#059669,#34d399); }
.theme-preview-charcoal-gold { background:linear-gradient(135deg,#18181b,#b98b2f,#facc15); }
.theme-preview-violet-suite { background:linear-gradient(135deg,#2e1065,#7c3aed,#c4b5fd); }
.theme-preview-ocean-teal { background:linear-gradient(135deg,#083344,#0891b2,#67e8f9); }
.theme-preview-sunset-orange { background:linear-gradient(135deg,#431407,#ea580c,#fdba74); }
.checkbox-stack { padding:9px 12px; border:1px solid var(--border); border-radius:9px; background:#fafcff; }
.mobile-info { margin-top:16px; padding:14px; border:1px solid #b9cee8; border-radius:9px; background:#f6faff; display:grid; gap:6px; }
.mobile-info code { word-break:break-all; color:var(--primary); }
.mobile-info span { color:var(--muted); font-size:11px; }
.channel-fields { display:grid; gap:10px; margin-top:10px; }
.mini-check { display:inline-flex; align-items:center; gap:4px; margin:2px 7px 2px 0; font-size:10px; }
.role-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; padding:17px; }
.role-card { border:1px solid var(--border); border-radius:10px; padding:14px; background:#fafcff; }
.permission-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin:12px 0; }
.permission-grid label { display:flex; align-items:flex-start; gap:7px; font-size:10px; color:#53657b; }
.data-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.data-actions form { display:flex; align-items:center; gap:8px; }
.audit-json { max-width:500px; max-height:260px; overflow:auto; white-space:pre-wrap; padding:10px; background:#101827; color:#d8e6f4; border-radius:8px; font-size:10px; }

@media (max-width:1180px){
    .aging-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .settings-grid,.balance-grid { grid-template-columns:1fr; }
}
@media (max-width:900px){
    .settings-shell { grid-template-columns:1fr; }
    .settings-nav { position:static; flex-direction:row; overflow-x:auto; }
    .settings-nav-item { white-space:nowrap; }
    .theme-grid,.role-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:720px){
    .finance-kpi-grid,.theme-grid,.role-grid,.permission-grid { grid-template-columns:1fr; }
    .aging-stats { grid-template-columns:1fr; }
    .report-bars > div { grid-template-columns:1fr; }
    .payment-form,.popover-form { position:fixed; inset:auto 12px 12px 12px; width:auto; max-height:70vh; overflow:auto; }
    .report-sheet { padding:17px; }
    .report-row,.report-total,.report-grand-total { align-items:flex-start; flex-direction:column; gap:4px; }
}

/* Hide oversized company logo */
.brand-logo {
    display: none !important;
}
