:root {
    --navy-950: #0c2a3b;
    --navy-900: #12384f;
    --navy-800: #184b65;
    --navy-700: #24617a;
    --teal-700: #0c7774;
    --teal-600: #11958c;
    --teal-500: #1ab0a2;
    --teal-100: #dff7f2;
    --gold-500: #efb64a;
    --gold-100: #fff4d9;
    --coral-500: #ec735d;
    --coral-100: #ffebe7;
    --blue-500: #3f82e7;
    --blue-100: #e8f1ff;
    --ink: #17293b;
    --muted: #718091;
    --muted-2: #94a0ad;
    --line: #e4e9ef;
    --canvas: #f4f7f9;
    --white: #ffffff;
    --danger: #d85353;
    --success: #168b6a;
    --warning: #b77914;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow: 0 12px 34px rgba(23, 49, 68, .08);
    --sidebar: 264px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
code { padding: 2px 5px; border-radius: 5px; background: rgba(12, 42, 59, .08); font: 600 .86em ui-monospace, SFMono-Regular, Consolas, monospace; }
.skip-link { position: fixed; z-index: 1000; left: 16px; top: -60px; padding: 10px 14px; background: var(--white); border-radius: 10px; color: var(--navy-900); box-shadow: var(--shadow); }
.skip-link:focus { top: 16px; }

/* Login */
.login-body { min-height: 100vh; background: #edf3f4; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, 1.03fr) minmax(480px, .97fr); }
.login-story { position: relative; overflow: hidden; display: flex; min-height: 100vh; padding: 52px clamp(48px, 6vw, 96px) 34px; color: #fff; background: radial-gradient(circle at 75% 76%, rgba(26, 176, 162, .28), transparent 34%), linear-gradient(145deg, #0b2a3b 0%, #16475e 55%, #0c6b6b 140%); flex-direction: column; isolation: isolate; }
.login-story::after { content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; right: -190px; bottom: -130px; box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018); }
.login-glow { position: absolute; z-index: -1; border-radius: 50%; filter: blur(8px); opacity: .8; }
.glow-one { width: 280px; height: 280px; background: rgba(20, 182, 170, .14); top: -100px; right: -60px; }
.glow-two { width: 180px; height: 180px; background: rgba(239, 182, 74, .12); left: -80px; bottom: 22%; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; width: 48px; height: 48px; overflow: hidden; flex: 0 0 auto; place-items: center; border: 2px solid rgba(255,255,255,.78); border-radius: 15px; background: #fff; box-shadow: 0 8px 22px rgba(15, 169, 155, .25); }
.brand-mark > img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 40%; transform: scale(1.65); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.08rem; letter-spacing: -.01em; }
.brand small { margin-top: 2px; font-size: .7rem; opacity: .66; letter-spacing: .08em; text-transform: uppercase; }
.story-copy { margin: auto 0; max-width: 660px; padding: 72px 0 48px; }
.story-kicker { display: flex; max-width: 590px; align-items: flex-start; gap: 10px; margin-bottom: 24px; color: #92e2d8; font-size: .68rem; font-weight: 800; letter-spacing: .12em; line-height: 1.55; }
.story-kicker span { width: 30px; height: 2px; margin-top: .48rem; flex: 0 0 auto; background: var(--gold-500); }
.story-copy h1 { max-width: 610px; margin: 0; font-size: clamp(2.5rem, 4.5vw, 4.65rem); line-height: 1.05; letter-spacing: -.055em; }
.story-copy h1 em { color: #67d8cb; font-family: Georgia, serif; font-weight: 500; }
.story-copy > p { max-width: 590px; margin: 27px 0 0; color: rgba(255,255,255,.72); font-size: 1.04rem; line-height: 1.75; }
.story-copy > .story-tagline { display: flex; margin-top: 18px; flex-wrap: wrap; gap: 7px 12px; color: #fff; font-size: .9rem; font-weight: 780; letter-spacing: .01em; line-height: 1.4; }
.story-tagline strong { color: var(--gold-500); }
.story-tagline span { color: #75ddd1; }
.story-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 54px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.13); }
.story-features > div { display: flex; gap: 12px; }
.story-features > div > span { color: var(--gold-500); font-size: .67rem; font-weight: 900; letter-spacing: .08em; }
.story-features p { margin: 0; }
.story-features strong, .story-features small { display: block; }
.story-features strong { font-size: .9rem; }
.story-features small { margin-top: 4px; color: rgba(255,255,255,.58); font-size: .72rem; line-height: 1.4; }
.story-footer { margin: 0; color: rgba(255,255,255,.45); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.login-panel { position: relative; display: grid; padding: 48px clamp(40px, 7vw, 112px); place-items: center; background: linear-gradient(145deg, #f7faf9 0%, #edf3f3 100%); }
.login-card { width: min(100%, 470px); }
.login-brand-logo { width: clamp(210px, 17vw, 270px); overflow: hidden; padding: 8px; border: 1px solid rgba(255,255,255,.38); border-radius: 24px; background: #fff; box-shadow: 0 18px 42px rgba(4,28,41,.24); }
.login-brand-logo img { display: block; width: 100%; height: auto; border-radius: 17px; object-fit: contain; }
.mobile-login-logo { display: none; }
.login-eyebrow { color: var(--teal-700); font-size: .72rem; font-weight: 850; letter-spacing: .16em; }
.login-card h2 { margin: 11px 0 8px; color: var(--navy-950); font-size: clamp(2rem, 3vw, 2.7rem); letter-spacing: -.045em; }
.login-card > p { margin: 0 0 34px; color: var(--muted); }
.stack-form { display: grid; gap: 19px; }
.field { display: grid; gap: 8px; min-width: 0; color: var(--ink); }
.field > span { font-size: .82rem; font-weight: 750; }
.field small { color: var(--muted); font-size: .72rem; font-weight: 500; }
.input-wrap { display: flex; align-items: center; min-width: 0; height: 54px; padding: 0 14px; border: 1px solid #d9e1e4; border-radius: 12px; background: #fff; transition: .2s ease; }
.input-wrap:focus-within { border-color: var(--teal-500); box-shadow: 0 0 0 4px rgba(26,176,162,.1); }
.input-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.field-icon { width: 29px; color: var(--teal-700); font-size: .8rem; font-weight: 900; }
.password-toggle { border: 0; background: transparent; color: var(--teal-700); font-size: .72rem; font-weight: 800; cursor: pointer; }
.form-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: .72rem; }
.login-help-note { justify-content: flex-start; line-height: 1.5; }
.login-help-note::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--teal-500); content: ""; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 17px; height: 17px; accent-color: var(--teal-700); }
.btn { display: inline-flex; min-height: 42px; padding: 10px 17px; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 10px; font-weight: 780; font-size: .82rem; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--teal-700), var(--teal-600)); box-shadow: 0 8px 20px rgba(12,119,116,.2); }
.btn-primary:hover { box-shadow: 0 12px 25px rgba(12,119,116,.28); }
.btn-secondary { border-color: var(--line); background: #fff; color: var(--navy-800); }
.btn-large { min-height: 54px; border-radius: 12px; }
.btn-block { width: 100%; }
.login-alert { margin: -15px 0 20px; padding: 11px 13px; border-radius: 9px; background: var(--teal-100); color: var(--teal-700); font-size: .78rem; font-weight: 650; }
.login-alert.error { background: var(--coral-100); color: #ad4938; }
.security-note { display: flex; gap: 8px; justify-content: center; margin-top: 24px !important; color: var(--muted-2) !important; font-size: .68rem; }
.security-note span { color: var(--teal-600); }

/* App shell */
.app-body { min-height: 100vh; background: var(--canvas); }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: var(--sidebar); overflow: hidden; padding: 25px 18px 20px; flex-direction: column; color: #fff; background: linear-gradient(180deg, #102f42 0%, #0d2738 100%); }
.brand-sidebar { flex: 0 0 auto; padding: 0 10px 18px; }
.brand-sidebar .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
.brand-sidebar strong { font-size: .95rem; }
.brand-sidebar small { font-size: .57rem; }
.side-nav { min-height: 0; margin-top: 6px; padding-right: 4px; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: rgba(102,216,204,.45) transparent; scrollbar-width: thin; }
.side-nav::-webkit-scrollbar { width: 5px; }
.side-nav::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(102,216,204,.36); }
.nav-group { padding: 0 0 9px; }
.nav-group + .nav-group { margin-top: 7px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.075); }
.nav-group:last-child { padding-bottom: 4px; }
.nav-label { display: flex; margin: 0 12px 7px; align-items: center; gap: 7px; color: rgba(255,255,255,.42); font-size: .56rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.nav-label::before { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: rgba(102,216,204,.72); content: ""; }
.nav-item { display: flex; min-height: 45px; margin-bottom: 4px; padding: 9px 12px; align-items: center; gap: 11px; border-radius: 11px; color: rgba(255,255,255,.63); font-size: .8rem; font-weight: 620; transition: .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: linear-gradient(110deg, rgba(26,176,162,.27), rgba(26,176,162,.08)); box-shadow: inset 3px 0 0 #4bd4c4; }
.nav-icon { display: grid; width: 25px; height: 25px; place-items: center; color: #66d8cc; font-size: .85rem; font-weight: 850; }
.sidebar-help { margin: 12px 3px 10px; padding: 14px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.04); }
.help-orbit { display: grid; width: 31px; height: 31px; margin-bottom: 10px; place-items: center; border-radius: 50%; color: var(--navy-950); background: var(--gold-500); font-weight: 900; }
.sidebar-help strong { font-size: .75rem; }
.sidebar-help p { margin: 4px 0 0; color: rgba(255,255,255,.45); font-size: .66rem; line-height: 1.5; }
.logout-link { margin: 0; flex: 0 0 auto; border-top: 1px solid rgba(255,255,255,.07); border-radius: 0; }
.sidebar-backdrop { display: none; }
.main-column { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; height: 70px; padding: 0 clamp(20px, 3vw, 42px); align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.menu-button { display: none !important; }
.topbar-title { display: grid; }
.topbar-title .eyebrow { color: var(--muted-2); font-size: .59rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.topbar-title strong { color: var(--navy-900); font-size: 1rem; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.today-pill { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .71rem; }
.today-pill span { color: var(--teal-500); font-size: .55rem; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip img, .member-cell img { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; }
.user-chip-copy { display: grid; }
.user-chip-copy strong { max-width: 175px; overflow: hidden; color: var(--navy-950); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-copy small { color: var(--muted); font-size: .64rem; }
.avatar { display: inline-grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--teal-600), var(--navy-700)); font-size: .72rem; font-weight: 850; }
.avatar-sm { width: 38px; height: 38px; }
.avatar-xl { width: 96px; height: 96px; border: 5px solid #fff; border-radius: 25px; font-size: 1.6rem; box-shadow: var(--shadow); }
.content { width: min(100%, 1540px); min-height: calc(100vh - 124px); margin: 0 auto; padding: clamp(18px, 2.4vw, 30px) clamp(18px, 3vw, 42px) 40px; }
.footer { display: flex; padding: 18px clamp(20px, 3vw, 42px) 24px; justify-content: space-between; gap: 20px; color: var(--muted-2); font-size: .65rem; }

/* Common content */
.alert { display: flex; margin-bottom: 18px; padding: 12px 15px; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 12px; font-size: .78rem; }
.alert > span { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 50%; font-weight: 900; }
.alert p { flex: 1; margin: 0; }
.alert button { border: 0; background: transparent; font-size: 1.15rem; cursor: pointer; }
.alert-success { border-color: #bceadd; background: #ebfaf5; color: #127158; }
.alert-success > span { background: #c9f0e4; }
.alert-error { border-color: #f2c6bf; background: #fff1ee; color: #a74635; }
.alert-error > span { background: #ffdcd5; }
.alert-warning { border-color: #f1dfb6; background: #fff9e9; color: #8c681d; }
.surface { border: 1px solid rgba(218,226,232,.82); border-radius: var(--radius); background: var(--white); box-shadow: 0 8px 25px rgba(31,55,72,.035); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-head h2 { margin: 4px 0 0; color: var(--navy-950); font-size: 1.08rem; letter-spacing: -.025em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: .75rem; }
.section-kicker { color: var(--teal-700); font-size: .57rem; font-weight: 850; letter-spacing: .15em; }
.text-link { color: var(--teal-700); font-size: .71rem; font-weight: 750; }
.icon-button { display: inline-grid; width: 38px; height: 38px; padding: 0; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy-900); font-size: 1rem; cursor: pointer; }
.page-heading { display: flex; margin: 0 0 18px; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 4px 0; color: var(--navy-950); font-size: clamp(1.6rem, 2.6vw, 2.15rem); letter-spacing: -.045em; }
.page-heading p { max-width: 680px; margin: 0; color: var(--muted); font-size: .82rem; }
.align-right { text-align: right; }
.block-muted { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.text-income { color: var(--success) !important; }
.text-expense { color: var(--danger) !important; }
.income-dot, .expense-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.income-dot { background: var(--teal-500); }
.expense-dot { background: var(--coral-500); }

/* Dashboard */
.hero-card { position: relative; overflow: hidden; display: flex; min-height: 176px; margin-bottom: 22px; padding: 30px clamp(26px, 4vw, 48px); align-items: center; color: #fff; border-radius: 20px; background: linear-gradient(112deg, #153d53 0%, #17616b 72%, #178a82 120%); box-shadow: var(--shadow); }
.hero-copy { position: relative; z-index: 2; }
.hero-kicker { display: block; margin-bottom: 8px; color: #7fe0d6; font-size: .58rem; font-weight: 850; letter-spacing: .15em; }
.hero-card h1 { margin: 0; font-size: clamp(1.65rem, 3.2vw, 2.65rem); letter-spacing: -.045em; }
.hero-card p { max-width: 570px; margin: 8px 0 0; color: rgba(255,255,255,.7); font-size: .8rem; }
.hero-decoration { position: absolute; width: 300px; height: 300px; right: 0; top: 50%; transform: translateY(-50%); }
.hero-decoration span { position: absolute; inset: 40px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.025), 0 0 0 70px rgba(255,255,255,.018); }
.hero-decoration span:nth-child(2) { inset: 92px; border-color: rgba(239,182,74,.25); box-shadow: none; }
.hero-decoration img { position: absolute; width: 132px; height: 116px; right: 52px; top: 92px; padding: 7px; border: 1px solid rgba(255,255,255,.42); border-radius: 23px; background: rgba(255,255,255,.92); box-shadow: 0 18px 40px rgba(7,38,52,.2); object-fit: contain; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { position: relative; display: grid; min-width: 0; min-height: 125px; padding: 20px; grid-template-columns: 43px 1fr auto; align-items: start; gap: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 24px rgba(31,55,72,.035); }
.stat-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 13px; font-weight: 850; }
.stat-members .stat-icon { color: var(--teal-700); background: var(--teal-100); }
.stat-docs .stat-icon { color: #376bbf; background: var(--blue-100); }
.stat-out .stat-icon { color: #ae761b; background: var(--gold-100); }
.stat-in .stat-icon { color: #b44f3d; background: var(--coral-100); }
.stat-card > div:nth-child(2) { min-width: 0; }
.stat-card span { display: block; color: var(--muted); font-size: .68rem; }
.stat-card strong { display: block; margin: 2px 0; color: var(--navy-950); font-size: 1.75rem; letter-spacing: -.04em; }
.stat-card small { display: flex; align-items: center; gap: 5px; color: var(--muted-2); font-size: .6rem; }
.stat-card small i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-500); }
.stat-card > a { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; color: var(--muted-2); background: var(--canvas); font-size: .75rem; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; margin-bottom: 20px; }
.chart-panel, .quick-panel, .recent-panel { padding: 22px; }
.finance-total { display: flex; margin: 22px 0 8px; align-items: end; justify-content: space-between; gap: 15px; }
.finance-total > div > span { display: block; color: var(--muted); font-size: .68rem; }
.finance-total strong { color: var(--navy-950); font-size: 1.35rem; letter-spacing: -.03em; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: .62rem; }
.legend span { display: flex !important; align-items: center; gap: 6px; }
.bar-chart-scroll { overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; scrollbar-color: #bed1d8 transparent; }
.bar-chart { display: flex; min-width: 0; height: 148px; padding-top: 12px; align-items: flex-end; justify-content: space-around; gap: 6px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent, transparent 36px, rgba(228,233,239,.55) 37px); }
.bar-group { display: grid; width: 7.4%; height: 100%; flex: 0 0 7.4%; align-items: end; text-align: center; }
.bars { display: flex; height: 116px; align-items: flex-end; justify-content: center; gap: 4px; }
.bar { display: block; width: 10px; min-height: 4px; border-radius: 5px 5px 1px 1px; transition: height .4s ease; }
.income-bar { background: linear-gradient(to top, var(--teal-700), var(--teal-500)); }
.expense-bar { background: linear-gradient(to top, #d8604a, #f58a74); }
.bar-group small { margin-top: 6px; color: var(--muted-2); font-size: .58rem; }
.quick-grid { display: grid; gap: 8px; margin-top: 17px; }
.quick-grid a { display: grid; padding: 11px; grid-template-columns: 39px 1fr auto; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 12px; transition: .18s ease; }
.quick-grid a:hover { border-color: var(--line); background: var(--canvas); transform: translateX(2px); }
.quick-icon { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 11px; font-size: .72rem; font-weight: 850; }
.quick-icon.teal { color: var(--teal-700); background: var(--teal-100); }
.quick-icon.gold { color: #a76f14; background: var(--gold-100); }
.quick-icon.coral { color: #b8503e; background: var(--coral-100); }
.quick-icon.blue { color: #376bbf; background: var(--blue-100); }
.quick-grid strong, .quick-grid small { display: block; }
.quick-grid strong { color: var(--navy-950); font-size: .75rem; }
.quick-grid small { margin-top: 2px; color: var(--muted); font-size: .63rem; }
.quick-grid b { color: var(--muted-2); font-size: .75rem; }
.document-list { margin-top: 15px; }
.document-list > a { display: grid; padding: 13px 7px; grid-template-columns: 44px 1fr auto 24px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.document-list > a:last-child { border-bottom: 0; }
.file-badge { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: #b74e3d; background: var(--coral-100); font-size: .55rem; font-weight: 900; }
.list-copy { min-width: 0; }
.list-copy strong, .list-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-copy strong { color: var(--navy-950); font-size: .75rem; }
.list-copy small { margin-top: 3px; color: var(--muted); font-size: .62rem; }

/* Forms */
.form-panel { margin-bottom: 22px; padding: clamp(20px, 3vw, 30px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.span-2 { grid-column: 1 / -1; }
.field input, .field select, .field textarea, .filter-row select, .inline-edit select, .status-form select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #dce3e8; border-radius: 10px; outline: none; color: var(--ink); background: #fff; transition: .18s ease; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-row select:focus, .inline-edit select:focus { border-color: var(--teal-500); box-shadow: 0 0 0 4px rgba(26,176,162,.09); }
.upload-zone { position: relative; display: grid; min-height: 145px; padding: 20px; place-items: center; align-content: center; border: 1.5px dashed #b9d5d3; border-radius: 14px; background: #f6fbfa; text-align: center; cursor: pointer; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { display: grid; width: 38px; height: 38px; margin-bottom: 7px; place-items: center; border-radius: 12px; color: var(--teal-700); background: var(--teal-100); font-weight: 900; }
.upload-zone strong { color: var(--navy-900); font-size: .8rem; }
.upload-zone small, .upload-zone em { color: var(--muted); font-size: .68rem; font-style: normal; }
.upload-zone em { margin-top: 6px; color: var(--teal-700); font-weight: 700; }
.form-actions { display: flex; padding-top: 5px; justify-content: flex-end; gap: 10px; }
.number-preview { padding: 17px 19px; border: 1px solid #cce9e4; border-radius: 12px; background: linear-gradient(100deg, #f0fbf8, #f8fdfc); }
.number-preview span, .number-preview small { display: block; color: var(--muted); font-size: .66rem; }
.number-preview strong { display: block; margin: 3px 0; color: var(--teal-700); font-size: 1rem; letter-spacing: .02em; }
.number-preview.is-loading { opacity: .72; }
.number-preview.is-awaiting { border-color: #e4d7b7; background: #fffaf0; }
.number-preview.is-awaiting strong { color: var(--warning); }

/* Tables and lists */
.table-panel { overflow: hidden; }
.table-toolbar { display: flex; padding: 17px 20px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.table-toolbar h2 { margin: 0; color: var(--navy-950); font-size: 1rem; }
.table-toolbar > div > span { color: var(--muted); font-size: .67rem; }
.table-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.table-search-row { display: flex; padding: 12px 20px; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #fff; }
.table-search-control { display: flex; width: min(380px, 100%); min-height: 40px; align-items: center; border: 1px solid #d8e2e8; border-radius: 10px; background: #f9fbfc; transition: border-color .18s ease, box-shadow .18s ease; }
.table-search-control:focus-within { border-color: var(--teal-500); box-shadow: 0 0 0 4px rgba(26,176,162,.09); }
.table-search-icon { padding-left: 12px; color: var(--teal-700); font-size: 1rem; }
.table-search-control input { min-width: 0; padding: 0 10px; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .74rem; }
.table-search-control button { width: 38px; align-self: stretch; border: 0; border-left: 1px solid var(--line); color: var(--muted); background: transparent; font-size: 1rem; cursor: pointer; }
.table-search-control button[hidden] { display: none; }
.table-search-count { color: var(--muted); font-size: .67rem; white-space: nowrap; }
.filter-row { display: flex; align-items: center; gap: 8px; }
.filter-row select { width: auto; min-height: 40px; padding: 8px 10px; font-size: .72rem; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted-2); background: #fafcfd; font-size: .6rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
td { color: #405064; font-size: .72rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfdfd; }
.table-primary, .member-cell, .transaction-cell { display: flex; min-width: 220px; align-items: center; gap: 11px; }
.table-primary > span:last-child, .member-cell > span:last-child, .transaction-cell > span:last-child { min-width: 0; }
.table-primary strong, .table-primary small, .member-cell strong, .member-cell small, .transaction-cell strong, .transaction-cell small { display: block; }
.table-primary strong, .member-cell strong, .transaction-cell strong { overflow: hidden; color: var(--navy-950); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.table-primary small, .member-cell small, .transaction-cell small { max-width: 330px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.category-pill { display: inline-flex; padding: 5px 8px; border-radius: 7px; color: var(--navy-700); background: #eef4f7; font-size: .63rem; font-weight: 700; white-space: nowrap; }
.status-badge { display: inline-flex; padding: 5px 8px; align-items: center; border-radius: 99px; font-size: .6rem; font-weight: 800; white-space: nowrap; }
.status-success { color: #147259; background: #e4f7f0; }
.status-warning { color: #9b6915; background: #fff3d8; }
.status-danger { color: #ad4938; background: #ffebe7; }
.status-neutral { color: #45647b; background: #edf3f7; }
.date-cell { white-space: nowrap; }
.date-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: .61rem; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.row-actions form { margin: 0; }
.btn-icon { display: inline-grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--teal-700); background: #fff; font-weight: 850; cursor: pointer; }
.btn-icon:hover { border-color: #b8d7d4; background: #eef9f7; }
.btn-icon.edit { color: #2367b4; }
.btn-icon.read { color: #087f78; background: #f0fbf9; }
.btn-icon.download { color: #6d4db5; background: #f7f3ff; }
.btn-icon.history { color: #8b641d; }
.btn-icon.reset-password { color: #a26a12; background: #fff9e9; }
.btn-icon.reset-password:hover { border-color: #e8ce96; background: #fff3d5; }
.btn-icon.danger { color: var(--danger); }
.btn-icon.danger:hover { border-color: #efc4c4; background: #fff1f1; }
.btn-icon.is-disabled { color: #9aa8b3; background: #f5f7f8; cursor: not-allowed; opacity: .58; }
.letter-actions { flex-wrap: nowrap; }
.current-file-name { overflow: hidden; color: var(--teal-700) !important; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.inline-edit { display: flex; justify-content: flex-end; gap: 5px; }
.inline-edit select, .status-form select { width: auto; min-height: 32px; padding: 5px 7px; font-size: .64rem; }
.letter-number { color: var(--navy-950); font-size: .68rem; white-space: nowrap; }
.transaction-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; font-weight: 900; }
.transaction-icon.income { color: var(--success); background: var(--teal-100); }
.transaction-icon.expense { color: var(--danger); background: var(--coral-100); }
.empty-state { padding: 58px 24px; text-align: center; }
.empty-icon { display: grid; width: 55px; height: 55px; margin: 0 auto 13px; place-items: center; border-radius: 17px; color: var(--teal-700); background: var(--teal-100); font-size: 1.15rem; font-weight: 900; }
.empty-state h2, .empty-state h3 { margin: 0 0 5px; color: var(--navy-950); }
.empty-state p { max-width: 500px; margin: 0 auto 16px; color: var(--muted); font-size: .78rem; }
.empty-inline { padding: 26px 10px; color: var(--muted); font-size: .75rem; text-align: center; }

/* Members, finance, profile */
.mini-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 20px; }
.mini-stat-grid article { padding: 17px 19px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.mini-stat-grid span { display: block; color: var(--muted); font-size: .65rem; }
.mini-stat-grid strong { display: block; margin-top: 4px; color: var(--navy-950); font-size: 1.45rem; }
.finance-summary-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.finance-summary-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.finance-summary-grid article.balance { color: #fff; border: 0; background: linear-gradient(120deg, var(--navy-900), var(--teal-700)); box-shadow: var(--shadow); }
.finance-summary-grid span, .finance-summary-grid small { display: block; color: var(--muted); font-size: .66rem; }
.finance-summary-grid strong { display: block; margin: 6px 0; color: var(--navy-950); font-size: clamp(1.2rem, 2vw, 1.65rem); letter-spacing: -.035em; }
.finance-summary-grid .balance span, .finance-summary-grid .balance small { color: rgba(255,255,255,.65); }
.finance-summary-grid .balance strong { color: #fff; }
.finance-summary-grid small i { margin-right: 6px; }
.finance-monthly { margin-bottom: 20px; }
.monthly-disclosure { overflow: hidden; }
.monthly-disclosure > summary { display: flex; padding: 18px 22px; align-items: center; justify-content: space-between; gap: 18px; list-style: none; cursor: pointer; }
.monthly-disclosure > summary::-webkit-details-marker { display: none; }
.monthly-summary-copy { display: grid; gap: 2px; }
.monthly-summary-copy strong { color: var(--navy-950); font-size: 1rem; }
.monthly-summary-copy small { color: var(--muted); font-size: .67rem; font-weight: 500; }
.disclosure-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #f7fbfb; color: var(--teal-700); font-size: 1.2rem; font-weight: 800; transition: transform .2s ease; }
.monthly-disclosure[open] .disclosure-icon { transform: rotate(180deg); }
.monthly-disclosure-content { padding: 0 22px 20px; border-top: 1px solid var(--line); }
.monthly-scroll { display: flex; overflow-x: auto; gap: 10px; margin-top: 16px; padding-bottom: 4px; }
.month-card { min-width: 160px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfd; }
.month-card span, .month-card strong, .month-card small { display: block; }
.month-card span { color: var(--muted); font-size: .62rem; }
.month-card strong { margin: 5px 0 2px; font-size: .72rem; }
.month-card small { font-size: .67rem; }
.profile-layout { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; align-items: start; gap: 20px; }
.profile-card { overflow: hidden; padding-bottom: 24px; text-align: center; }
.profile-cover { height: 100px; background: radial-gradient(circle at 70% 20%, rgba(255,255,255,.18), transparent 25%), linear-gradient(125deg, var(--navy-900), var(--teal-600)); }
.profile-avatar-wrap { height: 46px; transform: translateY(-48px); }
.profile-avatar-wrap img { width: 96px; height: 96px; border: 5px solid #fff; border-radius: 25px; object-fit: cover; box-shadow: var(--shadow); }
.profile-card h2 { margin: 8px 20px 2px; color: var(--navy-950); font-size: 1.1rem; }
.profile-card > p { margin: 0 0 9px; color: var(--muted); font-size: .72rem; }
.profile-facts { margin: 22px 22px 0; border-top: 1px solid var(--line); text-align: left; }
.profile-facts > div { display: flex; padding: 12px 0; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.profile-facts dt { color: var(--muted); font-size: .66rem; }
.profile-facts dd { margin: 0; color: var(--navy-950); font-size: .68rem; font-weight: 750; text-align: right; }
.profile-forms { display: grid; gap: 20px; }
.profile-form-panel { margin-bottom: 0; }
.password-required-alert { max-width: 920px; }
.password-required-alert strong { color: #6f5115; }
.password-change-focus { border-color: #e5c878; box-shadow: 0 14px 36px rgba(157,111,25,.11); }
.password-reset-state { display: block; margin-top: 5px; color: #9b6915; font-weight: 750; }

/* Finance import, period filters, and printable reports */
[hidden] { display: none !important; }
.report-filter-panel { margin-bottom: 20px; padding: 20px 22px; }
.btn-print { color: var(--navy-800); border-color: #bfd7d5; background: #eef9f7; }
.btn-print:hover { color: var(--teal-700); background: #e2f5f1; }
.finance-filter-form { display: grid; margin-top: 18px; grid-template-columns: minmax(150px, .8fr) minmax(240px, 1.5fr) minmax(150px, .8fr) minmax(145px, .7fr) auto; align-items: end; gap: 11px; }
.period-fields { display: flex; align-items: end; gap: 10px; }
.period-fields .field { flex: 1; }
.filter-submit { min-height: 44px; white-space: nowrap; }
.finance-summary-grid.four-cards { grid-template-columns: repeat(4, 1fr); }
.import-panel { border-color: #c8e3df; box-shadow: 0 16px 42px rgba(12,119,116,.08); }
.import-rules { display: grid; margin-top: 22px; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.import-rules > div { display: flex; padding: 14px; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfc; }
.import-rules > div > strong { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: var(--teal-700); background: var(--teal-100); font-size: .68rem; }
.import-rules b, .import-rules small { display: block; }
.import-rules b { color: var(--navy-950); font-size: .72rem; }
.import-rules small { margin-top: 3px; color: var(--muted); font-size: .62rem; line-height: 1.45; }
.import-form { margin-top: 18px; }
.import-history-panel { margin-bottom: 20px; }
.source-badge { display: inline-flex; padding: 4px 7px; border-radius: 7px; color: #2f67b1; background: var(--blue-100); font-size: .59rem; font-weight: 800; }
.source-badge.manual { color: var(--teal-700); background: var(--teal-100); }
.edit-source-note { display: flex; margin-top: 18px; padding: 12px 14px; align-items: flex-start; gap: 10px; border: 1px solid #cfe2f7; border-radius: 11px; color: #315b86; background: #f0f7ff; font-size: .72rem; }
.edit-source-note strong { flex: 0 0 auto; color: #1e548d; }
.current-proof { display: flex; padding: 11px 13px; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fafcfd; font-size: .72rem; }
.version-history-panel { margin-bottom: 22px; }
.version-badge { display: inline-flex; min-width: 38px; padding: 5px 9px; align-items: center; justify-content: center; border: 1px solid #d8e2e8; border-radius: 99px; color: #526779; background: #f4f7f9; font-size: .64rem; font-weight: 850; }
.version-badge.current { color: #0e756b; border-color: #bfe1dc; background: #e9f8f4; }
.version-update-note { display: flex; margin: 18px 0; padding: 13px 15px; align-items: center; gap: 12px; border: 1px solid #cfe5e1; border-radius: 12px; background: #f2fbf9; }
.version-update-note strong, .version-update-note small { display: block; }
.version-update-note strong { color: var(--navy-900); font-size: .75rem; }
.version-update-note small { margin-top: 2px; color: var(--muted); font-size: .65rem; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-label-row > a { color: var(--teal-700); font-size: .65rem; font-weight: 800; text-decoration: none; }
.field-label-row > a:hover { text-decoration: underline; }
.master-list-note { display: flex; margin-bottom: 16px; padding: 13px 15px; align-items: flex-start; gap: 11px; border: 1px solid #cfe5e1; border-radius: 13px; color: #476373; background: #f2fbf9; font-size: .72rem; line-height: 1.55; }
.master-list-note > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--teal-700); font-weight: 850; }
.master-list-note p { margin: 1px 0 0; }
.master-list-note strong { color: var(--navy-900); }
.master-tabs { display: grid; margin-bottom: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.master-tab { display: grid; min-height: 94px; padding: 14px; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: center; column-gap: 11px; border: 1px solid var(--line); border-radius: 14px; color: inherit; background: #fff; text-decoration: none; transition: .18s ease; }
.master-tab > span { display: grid; width: 36px; height: 36px; grid-row: 1 / 3; place-items: center; border-radius: 11px; color: var(--teal-700); background: var(--teal-100); font-size: .72rem; font-weight: 900; }
.master-tab strong { align-self: end; color: var(--navy-950); font-size: .76rem; }
.master-tab small { align-self: start; margin-top: 3px; color: var(--muted); font-size: .61rem; line-height: 1.4; }
.master-tab:hover { transform: translateY(-1px); border-color: #b9d9d5; box-shadow: 0 9px 24px rgba(12,64,76,.07); }
.master-tab.active { border-color: var(--teal-500); background: #f4fcfa; box-shadow: inset 0 0 0 1px rgba(26,176,162,.12); }
.master-tab.active > span { color: #fff; background: var(--teal-700); }
.master-option-form { margin-bottom: 20px; }
.role-explanation-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.role-explanation-card { display: flex; min-height: 170px; padding: 20px; align-items: flex-start; gap: 13px; }
.role-card-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--teal-600), var(--navy-700)); font-size: .72rem; font-weight: 850; }
.role-explanation-card > div > span { color: var(--teal-700); font-size: .6rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.role-explanation-card h2 { margin: 4px 0 7px; color: var(--navy-950); font-size: .94rem; }
.role-explanation-card p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.55; }
.access-panel { overflow: hidden; }
.access-panel > .section-head { padding: 20px 22px 13px; }
.access-note { display: flex; margin: 0 22px 18px; padding: 13px 15px; align-items: flex-start; gap: 12px; border: 1px solid #cbe8e3; border-radius: 11px; background: #f0faf8; }
.access-note strong { color: var(--teal-700); font-size: .72rem; }
.access-note p { margin: 0; color: var(--muted); font-size: .69rem; line-height: 1.55; }
.access-matrix-scroll { overflow-x: auto; border-block: 1px solid var(--line); }
.access-matrix { width: 100%; min-width: 900px; border-collapse: collapse; }
.access-matrix th, .access-matrix td { padding: 14px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.access-matrix th:first-child, .access-matrix td:first-child { width: 310px; padding-left: 22px; text-align: left; }
.access-matrix th { color: var(--muted-2); background: #f8fafb; font-size: .62rem; letter-spacing: .04em; text-transform: uppercase; }
.access-matrix td:first-child strong, .access-matrix td:first-child small { display: block; }
.access-matrix td:first-child strong { color: var(--navy-950); font-size: .76rem; }
.access-matrix td:first-child small { margin-top: 3px; color: var(--muted); font-size: .64rem; }
.access-check { display: inline-grid; min-width: 70px; justify-items: center; gap: 4px; cursor: pointer; }
.access-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.access-check span { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid #cbd5dc; border-radius: 8px; background: #fff; transition: .18s ease; }
.access-check span::after { content: '✓'; color: #fff; font-size: .78rem; font-weight: 900; transform: scale(0); transition: .18s ease; }
.access-check input:checked + span { border-color: var(--teal-700); background: var(--teal-700); box-shadow: 0 4px 12px rgba(12,119,116,.2); }
.access-check input:checked + span::after { transform: scale(1); }
.access-check input:focus-visible + span { outline: 3px solid rgba(26,176,162,.2); outline-offset: 2px; }
.access-check em { color: var(--muted); font-size: .58rem; font-style: normal; }
.access-form-actions { display: flex; padding: 17px 22px 20px; align-items: center; justify-content: space-between; gap: 16px; }
.access-form-actions > span { color: var(--muted); font-size: .67rem; }
.access-restricted-panel { display: grid; min-height: 350px; padding: 35px; align-content: center; justify-items: center; text-align: center; }
.access-restricted-panel h2 { margin: 12px 0 5px; color: var(--navy-950); }
.access-restricted-panel p { margin: 0; color: var(--muted); font-size: .75rem; }
.table-read-link { display: inline-flex; min-height: 35px; padding: 7px 11px; align-items: center; justify-content: center; border: 1px solid #bfe0dc; border-radius: 9px; color: var(--teal-700); background: #effaf8; font-size: .68rem; font-weight: 850; text-decoration: none; }
.table-read-link:hover { color: #fff; border-color: var(--teal-700); background: var(--teal-700); }
.reader-page-heading { align-items: center; }
.reader-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.reader-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; align-items: start; gap: 18px; }
.reader-stage { min-width: 0; overflow: hidden; }
.reader-toolbar { display: flex; min-height: 72px; padding: 13px 16px; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #fff; }
.reader-toolbar > div { display: flex; min-width: 0; align-items: center; gap: 11px; }
.reader-toolbar strong, .reader-toolbar small { display: block; }
.reader-toolbar strong { max-width: min(58vw, 680px); overflow: hidden; color: var(--navy-950); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.reader-toolbar small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.reader-notice { display: flex; margin: 14px; padding: 11px 13px; align-items: flex-start; gap: 9px; border: 1px solid #cfe2f7; border-radius: 11px; color: #315b86; background: #f0f7ff; font-size: .68rem; line-height: 1.5; }
.reader-notice > span { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: #4f86bd; font-weight: 850; }
.reader-notice p { margin: 1px 0 0; }
.reader-frame-wrap { height: min(76vh, 940px); min-height: 620px; background: #dfe6ea; }
.reader-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.reader-image-wrap { display: grid; min-height: 560px; padding: 28px; place-items: center; background: #e8eef1; }
.reader-image-wrap img { max-height: 76vh; border-radius: 4px; background: #fff; box-shadow: 0 16px 45px rgba(12,42,59,.18); object-fit: contain; }
.reader-text-content { min-height: 560px; padding: clamp(24px, 5vw, 64px); color: #263b4d; background: #fff; font-family: Georgia, 'Times New Roman', serif; font-size: .86rem; line-height: 1.75; }
.reader-text-content p { margin: 0 0 7px; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader-spreadsheet { display: grid; gap: 12px; padding: 15px; background: #f4f7f9; }
.reader-spreadsheet details { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.reader-spreadsheet summary { padding: 12px 14px; color: var(--navy-900); font-size: .75rem; font-weight: 850; cursor: pointer; }
.reader-spreadsheet summary small { margin-left: 7px; color: var(--muted); font-size: .62rem; font-weight: 500; }
.reader-sheet-scroll { max-height: 620px; overflow: auto; border-top: 1px solid var(--line); }
.reader-sheet-scroll table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: .65rem; }
.reader-sheet-scroll th { position: sticky; left: 0; min-width: 44px; color: var(--muted); background: #f3f6f8; }
.reader-sheet-scroll th, .reader-sheet-scroll td { max-width: 280px; padding: 7px 9px; border: 1px solid #e6eaee; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-truncated { margin: 0; padding: 10px 13px; color: var(--warning); background: #fff9e9; font-size: .65rem; }
.reader-unsupported { display: grid; min-height: 560px; padding: 40px; place-items: center; align-content: center; text-align: center; }
.reader-unsupported > div { display: grid; width: 72px; height: 72px; place-items: center; border-radius: 20px; color: var(--teal-700); background: var(--teal-100); font-weight: 900; }
.reader-unsupported h2 { margin: 18px 0 5px; color: var(--navy-950); }
.reader-unsupported p { max-width: 560px; margin: 0; color: var(--muted); }
.reader-unsupported small { max-width: 520px; margin-top: 10px; color: var(--muted-2); }
.reader-sidebar { position: sticky; top: 88px; padding: 18px; }
.reader-sidebar dl { margin: 13px 0 0; }
.reader-sidebar dl > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.reader-sidebar dt { color: var(--muted); font-size: .61rem; text-transform: uppercase; letter-spacing: .06em; }
.reader-sidebar dd { margin: 3px 0 0; color: var(--navy-950); font-size: .7rem; font-weight: 720; overflow-wrap: anywhere; }
.reader-watermark-info { margin-top: 15px; padding: 13px; border: 1px solid #cfe5e1; border-radius: 11px; background: #f2fbf9; }
.reader-watermark-info strong { color: var(--teal-700); font-size: .7rem; }
.reader-watermark-info p { margin: 4px 0 0; color: var(--muted); font-size: .64rem; line-height: 1.55; }
.reader-download-status { position: fixed; z-index: 80; right: 22px; bottom: 20px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid #cfe2e8; border-radius: 11px; color: #315b68; background: #f1f8fa; box-shadow: 0 14px 35px rgba(12,42,59,.18); font-size: .72rem; }
.reader-download-status[data-type='success'] { color: #127158; border-color: #bceadd; background: #ebfaf5; }
.reader-download-status[data-type='error'] { color: #a74635; border-color: #f2c6bf; background: #fff1ee; }
.table-pagination { display: grid; padding: 14px 18px 16px; grid-template-columns: auto minmax(150px, 1fr) auto; align-items: center; gap: 14px; border-top: 1px solid var(--line); background: #fbfcfd; }
.table-page-size { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .7rem; }
.table-page-size select { min-height: 34px; padding: 5px 28px 5px 9px; border: 1px solid #d9e2e8; border-radius: 8px; outline: none; color: var(--ink); background: #fff; font-size: .7rem; }
.table-page-size select:focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(26,176,162,.09); }
.table-page-summary { color: var(--muted); font-size: .68rem; text-align: center; }
.table-page-buttons { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px; }
.table-page-button { display: inline-grid; min-width: 33px; height: 33px; padding: 0 9px; place-items: center; border: 1px solid #dce4e9; border-radius: 8px; color: var(--navy-800); background: #fff; font-size: .67rem; font-weight: 750; cursor: pointer; }
.table-page-button:hover:not(:disabled), .table-page-button.active { color: #fff; border-color: var(--teal-700); background: var(--teal-700); }
.table-page-button:disabled { color: #aab3bc; background: #f2f5f7; cursor: not-allowed; }
.table-page-button.previous, .table-page-button.next { min-width: 82px; }
.table-page-ellipsis { min-width: 18px; color: var(--muted-2); text-align: center; }

@media (max-width: 1180px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .login-shell { grid-template-columns: .9fr 1.1fr; }
    .story-copy h1 { font-size: 3.2rem; }
    .story-features { grid-template-columns: 1fr; gap: 13px; }
    .story-features small { display: none; }
    .filter-row { flex-wrap: wrap; justify-content: flex-end; }
    .finance-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .role-explanation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-submit { width: 100%; }
    .finance-summary-grid.four-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 940px) {
    :root { --sidebar: 0px; }
    .sidebar { width: 268px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: 25px 0 70px rgba(6,28,43,.28); }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; z-index: 25; inset: 0; display: block; visibility: hidden; background: rgba(8,24,35,.48); opacity: 0; transition: .25s ease; }
    body.sidebar-open .sidebar-backdrop { visibility: visible; opacity: 1; }
    .main-column { margin-left: 0; }
    .menu-button { display: inline-grid !important; }
    .topbar { justify-content: flex-start; }
    .topbar-actions { margin-left: auto; }
    .login-shell { grid-template-columns: 1fr; }
    .login-story { display: none; }
    .login-panel { min-height: 100vh; padding: 30px; }
    .mobile-login-logo { display: block; position: absolute; top: 26px; left: 30px; width: 150px; overflow: hidden; padding: 5px; border: 1px solid #d9e5e5; border-radius: 17px; background: #fff; box-shadow: 0 12px 30px rgba(12,42,59,.12); }
    .mobile-login-logo img { display: block; width: 100%; height: auto; border-radius: 12px; object-fit: contain; }
    .login-card { margin-top: 154px; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .topbar { height: 64px; padding: 0 14px; }
    .topbar-title .eyebrow, .today-pill, .user-chip-copy { display: none; }
    .content { padding: 18px 14px 34px; }
    .footer { padding: 16px 14px 22px; flex-direction: column; gap: 4px; }
    .page-heading { align-items: stretch; flex-direction: column; gap: 15px; }
    .page-heading .btn { align-self: flex-start; }
    .role-explanation-grid { grid-template-columns: 1fr; }
    .role-explanation-card { min-height: 0; }
    .access-note, .access-form-actions { align-items: stretch; flex-direction: column; }
    .access-form-actions .btn { width: 100%; }
    .hero-card { min-height: 190px; padding: 27px 22px; }
    .hero-decoration { right: -120px; opacity: .65; }
    .hero-card p { max-width: 77%; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { min-height: 126px; padding: 15px; grid-template-columns: 38px 1fr; gap: 10px; }
    .stat-icon { width: 38px; height: 38px; }
    .stat-card > a { position: absolute; top: 14px; right: 14px; }
    .stat-card strong { font-size: 1.45rem; }
    .stat-card small { grid-column: 1 / -1; }
    .chart-panel, .quick-panel, .recent-panel { padding: 18px; }
    .bar-chart { min-width: 600px; }
    .finance-total { align-items: flex-start; flex-direction: column; }
    .document-list > a { grid-template-columns: 42px 1fr 20px; }
    .document-list .status-badge { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .form-actions { justify-content: stretch; }
    .form-actions .btn { flex: 1; }
    .table-toolbar { align-items: stretch; flex-direction: column; }
    .table-toolbar-actions { width: 100%; justify-content: flex-start; }
    .table-toolbar-actions .btn { flex: 1 1 auto; }
    .table-search-row { padding: 11px 14px; align-items: stretch; flex-direction: column; gap: 7px; }
    .table-search-control { width: 100%; }
    .filter-row { align-items: stretch; flex-direction: column; }
    .filter-row select, .filter-row .btn { width: 100%; }
    .responsive-table { overflow: visible; }
    .responsive-table table, .responsive-table tbody { display: block; }
    .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
    .responsive-table tr { display: grid; padding: 14px 16px; border-bottom: 9px solid var(--canvas); }
    .responsive-table tr:last-child { border-bottom: 0; }
    .responsive-table td { display: grid; padding: 8px 0; grid-template-columns: 95px minmax(0, 1fr); align-items: center; border: 0; text-align: left !important; }
    .responsive-table td::before { content: attr(data-label); color: var(--muted-2); font-size: .59rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .responsive-table tbody tr:hover td { background: transparent; }
    .table-primary, .member-cell, .transaction-cell { min-width: 0; }
    .row-actions, .inline-edit { justify-content: flex-start; }
    .inline-edit { flex-wrap: wrap; }
    .mini-stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .finance-summary-grid { grid-template-columns: 1fr; gap: 10px; }
    .finance-summary-grid.four-cards { grid-template-columns: 1fr; }
    .edit-source-note, .current-proof { align-items: stretch; flex-direction: column; }
    .table-pagination { padding: 13px 14px 15px; grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
    .table-page-summary { text-align: left; }
    .table-page-buttons { justify-content: flex-start; }
    .report-filter-panel .section-head { align-items: stretch; flex-direction: column; }
    .monthly-disclosure > summary { padding: 16px; }
    .monthly-disclosure-content { padding: 0 16px 16px; }
    .finance-filter-form { grid-template-columns: 1fr; }
    .period-fields { align-items: stretch; flex-direction: column; }
    .import-rules { grid-template-columns: 1fr; }
    .profile-layout { grid-template-columns: 1fr; }
    .master-tabs { grid-template-columns: 1fr; }
    .master-tab { min-height: 82px; }
    .reader-layout { grid-template-columns: 1fr; }
    .reader-sidebar { position: static; }
    .reader-frame-wrap { min-height: 520px; height: 70vh; }
}

@media (max-width: 460px) {
    .login-panel { padding: 24px 18px; align-items: start; }
    .mobile-login-logo { top: 18px; left: 20px; width: 124px; }
    .login-card { margin-top: 132px; }
    .login-card h2 { font-size: 2rem; }
    .form-meta { align-items: flex-start; flex-direction: column; }
    .login-help-note { flex-direction: row; }
    .stat-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 104px; grid-template-columns: 42px 1fr; }
    .hero-card p { max-width: 100%; }
    .hero-decoration { display: none; }
    .section-head { align-items: flex-start; }
    .compact-list > a { grid-template-columns: 39px minmax(0,1fr) 18px; padding-left: 0; padding-right: 0; }
    .file-badge { width: 38px; height: 38px; }
    .mini-stat-grid { grid-template-columns: 1fr 1fr; }
    .responsive-table td { grid-template-columns: 82px minmax(0, 1fr); }
    .reader-heading-actions { justify-content: stretch; }
    .reader-heading-actions .btn { flex: 1; }
    .reader-frame-wrap, .reader-image-wrap, .reader-text-content, .reader-unsupported { min-height: 440px; }
    .reader-image-wrap { padding: 14px; }
    .reader-text-content { padding: 24px 20px; }
    .reader-toolbar strong { max-width: 58vw; }
}

@media (max-height: 760px) {
    .sidebar-help { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
