:root {
    --blue-950: #102a56;
    --blue-800: #164b91;
    --blue-700: #1768c5;
    --blue-600: #2380e8;
    --blue-100: #e8f3ff;
    --blue-50: #f4f9ff;
    --cyan-50: #e9f9fb;
    --purple-50: #f2efff;
    --text: #182844;
    --muted: #6e7f99;
    --line: #e4ebf4;
    --surface: #ffffff;
    --bg: #f4f8fc;
    --danger: #d84f5f;
    --success: #18856f;
    --shadow: 0 12px 35px rgba(34, 75, 125, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: Inter, Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.brand { display: flex; align-items: center; gap: 11px; font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #72b6ff, #1c76d4); box-shadow: 0 7px 18px rgba(24, 113, 207, .22); }
.brand-light .brand-mark { color: var(--blue-700); background: #fff; box-shadow: 0 8px 20px rgba(15, 55, 107, .18); }
.eyebrow { display: inline-block; margin-bottom: 12px; font-size: .72rem; line-height: 1; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.eyebrow.blue { color: var(--blue-600); }
.muted { color: var(--muted); }

/* Login */
.login-page { min-height: 100vh; background: #fff; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(36px, 5vw, 74px); color: #fff; background: linear-gradient(145deg, #163b75 0%, #1769b8 55%, #2f91df 100%); }
.login-brand::before, .login-brand::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); }
.login-brand::before { width: 540px; height: 540px; right: -290px; top: -110px; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); }
.login-brand::after { width: 270px; height: 270px; left: -160px; bottom: 70px; background: rgba(255,255,255,.035); }
.login-brand > * { position: relative; z-index: 1; }
.login-copy { max-width: 570px; }
.login-copy h1 { margin: 0 0 20px; font-size: clamp(2.5rem, 4.6vw, 4.6rem); line-height: 1.08; letter-spacing: -.055em; }
.login-copy p { max-width: 510px; margin: 0; color: rgba(255,255,255,.73); font-size: 1.05rem; line-height: 1.75; }
.security-note { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.72); font-size: .8rem; }
.security-dot { width: 9px; height: 9px; border-radius: 50%; background: #70ebc1; box-shadow: 0 0 0 5px rgba(112,235,193,.12); }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-form-wrap { width: min(100%, 420px); }
.login-form-wrap h2 { margin: 0 0 8px; font-size: 2rem; letter-spacing: -.04em; }
.login-form-wrap > p { margin: 0 0 30px; }
.mobile-brand { display: none; margin-bottom: 56px; }
.form-stack { display: grid; gap: 20px; }
label { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; column-gap: 4px; row-gap: 8px; color: #34445e; font-size: .83rem; font-weight: 600; }
label > span, label > small { color: var(--danger); }
label > small { font-weight: 500; color: #9aa8ba; }
label > input,
label > textarea,
label > select,
label > .money-field,
label > .password-field,
label > .form-hint { grid-column: 1 / -1; }
input, textarea, select { width: 100%; border: 1px solid #dce5f0; border-radius: 11px; padding: 13px 14px; outline: none; color: var(--text); background: #fff; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { border-color: #72aff0; box-shadow: 0 0 0 4px rgba(48, 134, 225, .1); }
textarea { resize: vertical; min-height: 92px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; opacity: .55; }
.login-foot { margin-top: 24px !important; text-align: center; color: #91a0b2; font-size: .75rem; }

/* Application layout */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 250px; display: flex; flex-direction: column; padding: 30px 20px 22px; background: #fff; border-right: 1px solid var(--line); }
.sidebar .brand { padding: 0 10px; margin-bottom: 42px; }
.nav { display: grid; gap: 6px; }
.nav-label { padding: 0 12px 9px; color: #a0adbd; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 0 13px; border-radius: 11px; color: #687991; font-weight: 600; font-size: .78rem; letter-spacing: .025em; transition: .2s; }
.nav-item:hover { color: var(--blue-700); background: var(--blue-50); }
.nav-item.active { color: var(--blue-700); background: var(--blue-100); font-weight: 650; }
.nav-icon { width: 20px; text-align: center; font-size: 1.15rem; }
.sidebar-help { margin-top: auto; padding: 17px; border-radius: 14px; background: linear-gradient(140deg, #f0f7ff, #e6f3ff); }
.sidebar-help .help-icon { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 8px; color: #fff; background: var(--blue-600); font-weight: 700; }
.sidebar-help strong, .sidebar-help small { display: block; }
.sidebar-help strong { font-size: .8rem; margin-bottom: 5px; }
.sidebar-help small { color: var(--muted); font-size: .68rem; line-height: 1.5; }
.logout { margin-top: 10px; color: #8a98aa; }
.main-content { grid-column: 2; min-width: 0; }
.topbar { height: 74px; position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: flex-end; padding: 0 clamp(22px, 3.5vw, 54px); border-bottom: 1px solid rgba(222,230,240,.85); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); }
.top-date { margin-right: 25px; color: #8492a6; font-size: .75rem; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #2d8ce8, #1766be); font-weight: 700; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: .78rem; }
.user-chip small { margin-top: 2px; color: #9aa7b8; font-size: .65rem; }
.menu-toggle { display: none; border: 0; background: none; font-size: 1.3rem; cursor: pointer; }
.content { padding: 42px clamp(22px, 3.5vw, 54px) 60px; max-width: 1680px; margin: auto; }
.page-heading { margin-bottom: 30px; }
.page-heading h1 { margin: 0 0 8px; font-size: clamp(1.75rem, 2.5vw, 2.25rem); letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--muted); }
.heading-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.last-update { display: inline-block; margin-top: 9px; color: #98a6b7; font-size: 10px; }

/* Cards and data */
.card { border: 1px solid rgba(222,231,241,.9); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 22px; }
.stat-card { display: flex; align-items: flex-start; gap: 14px; min-height: 145px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 7px 22px rgba(35, 75, 120, .055); }
.stat-card > div { min-width: 0; display: flex; flex-direction: column; }
.stat-icon, .quick-icon { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-size: 1.1rem; }
.blue-bg { color: #1774d2; background: var(--blue-100); }
.cyan-bg { color: #188da1; background: var(--cyan-50); }
.purple-bg { color: #7964d9; background: var(--purple-50); }
.green-bg { color: #16816e; background: #e8f7f3; }
.white-bg { color: #2476ca; background: rgba(255,255,255,.9); }
.stat-card small { margin: 3px 0 12px; overflow: hidden; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; font-size: .72rem; }
.stat-card strong { margin-bottom: 8px; overflow: hidden; font-size: clamp(1.05rem, 1.5vw, 1.35rem); letter-spacing: -.035em; white-space: nowrap; text-overflow: ellipsis; }
.stat-card span:last-child { color: #93a1b2; font-size: .67rem; }
.stat-card.accent { color: #fff; border-color: transparent; background: linear-gradient(145deg, #1e73c9, #3495e4); }
.stat-card.accent small, .stat-card.accent span:last-child { color: rgba(255,255,255,.72); }
.negative { color: var(--danger) !important; }
.dashboard-insights { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 22px; margin-bottom: 22px; }
.monthly-chart-card, .composition-card { overflow: hidden; }
.chart-legend { display: inline-flex; align-items: center; gap: 6px; color: #8090a4; font-size: 9px; white-space: nowrap; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; background: linear-gradient(180deg, #65b7f2, #277ed4); }
.vertical-chart { height: 214px; display: grid; grid-template-columns: repeat(12, minmax(28px, 1fr)); align-items: end; gap: clamp(5px, .8vw, 10px); padding: 6px 24px 20px; overflow-x: auto; }
.chart-column { height: 100%; min-width: 28px; display: grid; grid-template-rows: 18px 1fr 18px; align-items: end; gap: 5px; text-align: center; }
.chart-value { overflow: hidden; color: #8a99ab; font-size: 7px; font-weight: 650; white-space: nowrap; }
.bar-track { position: relative; height: 100%; overflow: hidden; border-radius: 7px 7px 4px 4px; background: #f0f5fa; }
.bar-track i { position: absolute; right: 0; bottom: 0; left: 0; display: block; min-height: 0; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #65b7f2 0%, #287fd5 100%); box-shadow: 0 4px 10px rgba(39,126,212,.18); transition: height .35s ease; }
.chart-column strong { color: #77879b; font-size: 8px; font-weight: 650; }
.chart-column.current-month .bar-track { background: #e5f1fc; box-shadow: inset 0 0 0 1px #c6def5; }
.chart-column.current-month .bar-track i { background: linear-gradient(180deg, #42c2b2 0%, #208f83 100%); }
.chart-column.current-month strong { color: #168477; }
.composition-list { display: grid; gap: 12px; padding: 2px 24px 21px; }
.composition-item > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.composition-item span { color: #667890; font-size: 10px; }
.composition-item strong { color: var(--text); font-size: 10px; }
.mini-track { height: 5px; overflow: hidden; border-radius: 999px; background: #edf2f6; }
.mini-track i { display: block; height: 100%; border-radius: inherit; }
.mini-track .tone-blue { background: #2b83dc; }
.mini-track .tone-cyan { background: #29a5b8; }
.mini-track .tone-purple { background: #7868d9; }
.mini-track .tone-amber { background: #e2a13d; }
.mini-track .tone-green { background: #35a987; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(270px, .7fr); gap: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 22px 24px 18px; }
.card-head h2 { margin: 0 0 5px; font-size: 1rem; letter-spacing: -.02em; }
.card-head p { margin: 0; color: #96a4b5; font-size: .72rem; }
.card-head a { color: var(--blue-600); font-size: .75rem; font-weight: 600; }
.report-heading { margin-bottom: 20px; }
.report-filter { margin-bottom: 20px; }
.report-sheet { max-width: 920px; margin: 0 auto; overflow: hidden; }
.report-title { padding: 28px 30px; color: #fff; background: linear-gradient(135deg, #176fc1, #2c8de0); }
.report-title span { color: #dceeff; font-size: 9px; font-weight: 750; letter-spacing: .09em; }
.report-title h2 { margin: 8px 0 5px; font-size: 1.3rem; letter-spacing: -.025em; }
.report-title p { margin: 0; color: rgba(255,255,255,.78); font-size: .74rem; }
.report-section-title { padding: 12px 22px; color: #1766ad; border-top: 1px solid #c8dff2; border-bottom: 1px solid #c8dff2; background: #eaf4fd; font-size: .72rem; font-weight: 750; }
.report-row { display: grid; grid-template-columns: 42px minmax(180px, 1fr) minmax(170px, .42fr); min-height: 35px; border-bottom: 1px solid #e2eaf2; }
.report-row > * { display: flex; align-items: center; padding: 7px 13px; }
.report-row > * + * { border-left: 1px solid #e2eaf2; }
.report-row span { justify-content: center; color: #8392a4; font-size: 9px; }
.report-row strong { color: #53677f; font-size: 10px; font-weight: 550; }
.report-row b { justify-content: flex-end; color: #24364b; font-size: 10px; }
.report-row.report-total { background: #f7fafd; }
.report-row.report-total strong, .report-row.report-total b { font-weight: 750; }
.report-row.report-status { background: #fbfdff; }
.status-text-ok { color: var(--success) !important; }
.status-text-no { color: var(--danger) !important; }
.report-footer-info { display: grid; grid-template-columns: repeat(3, 1fr); padding: 20px 22px; gap: 12px; background: #f7fafd; }
.report-footer-info span { padding: 13px; border: 1px solid #e0e9f2; border-radius: 11px; background: #fff; }
.report-footer-info small, .report-footer-info b { display: block; }
.report-footer-info small { margin-bottom: 5px; color: #8b9aab; font-size: 9px; }
.report-footer-info b { color: #344b63; font-size: 11px; }
.quick-card { padding-bottom: 12px; }
.quick-card > a { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; margin: 0 12px 7px; padding: 12px; border-radius: 12px; transition: .2s; }
.quick-card > a:hover { background: var(--blue-50); transform: translateX(2px); }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { margin-bottom: 4px; font-size: .78rem; }
.quick-card small { color: #96a4b5; font-size: .66rem; }
.quick-card b { color: #a5b2c2; font-size: 1.2rem; }
.table-card { margin-top: 22px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 8px 12px; color: #91a0b3; background: #f8fafc; font-weight: 600; line-height: 1.25; text-align: left; white-space: nowrap; }
td { padding: 8px 12px; border-top: 1px solid #edf1f6; color: #5e6f87; line-height: 1.25; white-space: nowrap; }
td strong { color: var(--text); }
tfoot td { border-top: 2px solid #d9e5f1; color: var(--blue-800); background: #f2f8ff; }
.cell-note { display: block; max-width: 220px; overflow: hidden; margin-top: 4px; color: #a0adbd; text-overflow: ellipsis; }
.pill { display: inline-block; padding: 5px 8px; border-radius: 999px; color: var(--blue-700); background: var(--blue-100); font-size: .66rem; font-weight: 600; }
.empty-state { padding: 40px 20px; border-top: 1px solid #edf1f6; text-align: center; }
.empty-state > span { display: block; margin-bottom: 10px; color: #9eb3ca; font-size: 1.6rem; }
.empty-state strong { font-size: .82rem; }
.empty-state p { margin: 6px 0 0; color: #9ba8b8; font-size: .72rem; }

/* Forms */
.two-column { display: grid; grid-template-columns: minmax(0, 1fr) 285px; align-items: start; gap: 22px; }
.form-card { overflow: hidden; }
.data-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 3px 24px 24px; }
.data-form .full { grid-column: 1 / -1; }
.data-form .span-two { grid-column: span 2; }
.data-form > .date-compact { grid-column: 1 / -1; width: 230px; max-width: 100%; }
.matching-form > .date-compact { grid-column: 1; width: 100%; }
.form-hint { display: block; margin-top: -2px; color: #8898aa !important; font-size: .62rem; font-weight: 400; line-height: 1.45; }
.required-note { color: #9aa8b8; font-size: .68rem; }
.money-field { display: flex; align-items: stretch; border: 1px solid #dce5f0; border-radius: 11px; overflow: hidden; transition: .2s; }
.money-field:focus-within { border-color: #72aff0; box-shadow: 0 0 0 4px rgba(48,134,225,.1); }
.money-field b { display: grid; place-items: center; min-width: 48px; padding: 0 11px; color: #72839a; background: #f5f8fb; border-right: 1px solid #dce5f0; font-size: .75rem; }
.money-field input { border: 0; border-radius: 0; box-shadow: none; }
.money-field input:focus { box-shadow: none; }
.money-field.minus-input { border-color: #f0d7dc; }
.money-field.minus-input b { min-width: 60px; color: var(--danger); background: #fff6f7; border-color: #f0d7dc; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.btn { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border: 0; border-radius: 11px; cursor: pointer; font-size: .78rem; font-weight: 650; transition: transform .18s, box-shadow .18s, background .18s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, #287fd4, #1e6abe); box-shadow: 0 8px 20px rgba(32, 111, 192, .2); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(32,111,192,.28); }
.btn-ghost { color: #6f7f94; background: #f2f5f8; }
.btn-soft { color: var(--blue-700); background: var(--blue-100); }
.btn-small { min-height: 35px; padding: 0 12px; font-size: .7rem; }
.btn-block { width: 100%; margin-top: 5px; }
.info-panel { position: sticky; top: 96px; padding: 24px; border: 1px solid #dbe9f7; border-radius: var(--radius); background: linear-gradient(150deg, #f6fbff, #edf6ff); }
.info-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--blue-600); font-weight: 700; }
.info-panel h3 { margin: 18px 0 8px; font-size: .9rem; }
.info-panel p, .info-panel li { color: #6f8198; font-size: .72rem; line-height: 1.65; }
.info-panel ul { margin: 14px 0 0; padding-left: 17px; }
.info-panel li { margin-bottom: 7px; }
.info-panel .tiny { margin-top: 18px; font-size: .68rem; }
.date-items-head { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.date-items-head strong, .date-items-head small { display: block; }
.date-items-head small { margin-top: 4px; color: #9aa8b8; font-size: .68rem; font-weight: 400; }
.date-items { display: grid; gap: 10px; }
.date-row { display: grid; grid-template-columns: 28px minmax(150px, .75fr) minmax(190px, 1fr) 30px; align-items: end; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfe; }
.row-number { align-self: center; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--blue-700); background: var(--blue-100); font-size: .7rem; font-weight: 700; }
.remove-row { width: 30px; height: 42px; border: 0; color: #a2afbf; background: transparent; cursor: pointer; font-size: 1.2rem; }
.remove-row:hover { color: var(--danger); }
.bank-total { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; border-radius: 12px; color: var(--blue-800); background: var(--blue-50); font-size: .78rem; }
.bank-total strong { font-size: 1.05rem; }
.date-example { display: flex; align-items: center; justify-content: center; margin: 22px 0; }
.date-example > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; color: var(--blue-700); background: #fff; box-shadow: 0 5px 17px rgba(45,93,143,.09); font-weight: 700; }
.date-example i { width: 16px; border-top: 2px dotted #b7cce2; }
.date-example .holiday { color: #a3afbd; background: #f0f3f6; text-decoration: line-through; }
.date-example small { display: block; color: #acb5c0; font-size: .5rem; text-decoration: none; }
.warning-banner { display: flex; align-items: center; gap: 13px; margin: -8px 0 22px; padding: 14px 18px; border: 1px solid #f1d9dd; border-radius: 13px; background: #fff7f8; }
.warning-banner > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--danger); font-weight: 700; }
.warning-banner strong { font-size: .76rem; }
.warning-banner p { margin: 3px 0 0; color: #8e6f76; font-size: .68rem; }
.warning-banner.correction-banner { border-color: #d7e8f8; background: #f1f8ff; }
.warning-banner.correction-banner > span { background: var(--blue-600); }
.warning-banner.correction-banner p { color: #6f8198; }
.minus-badge { padding: 6px 9px; border-radius: 999px; color: var(--danger); background: #fff0f2; font-size: .65rem; font-weight: 700; }
.conversion { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 18px; }
.conversion span { padding: 12px 8px; border-radius: 10px; background: #fff; text-align: center; color: #8796aa; font-size: .62rem; line-height: 1.6; }
.conversion span:last-child b { color: var(--danger); }
.conversion em { color: #94a6ba; font-style: normal; }
.actions { display: flex; align-items: center; gap: 7px; }
.actions form { margin: 0; }
.action-edit, .action-delete { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid #d5e5f5; border-radius: 8px; cursor: pointer; font-size: .66rem; font-weight: 650; }
.action-edit { color: var(--blue-700); background: var(--blue-50); }
.action-delete { color: var(--danger); border-color: #f0d8dc; background: #fff6f7; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 18px 20px; border-top: 1px solid var(--line); }
.pagination a, .pagination span { min-width: 32px; height: 32px; display: grid; place-items: center; padding: 0 9px; border-radius: 8px; color: #71839a; background: #f4f7fa; font-size: .68rem; font-weight: 600; }
.pagination a:hover, .pagination .current { color: #fff; background: var(--blue-600); }
.pagination .disabled { opacity: .45; }
.pagination .dots { background: transparent; }
.recap-filter { display: grid; grid-template-columns: 190px 130px auto; align-items: end; gap: 12px; margin: -8px 0 20px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 7px 22px rgba(35,75,120,.045); }
.recap-filter select { min-height: 42px; padding: 9px 12px; cursor: pointer; }
.recap-filter .btn { align-self: end; width: max-content; }
.recap-legend { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: -8px 0 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); font-size: 11px; }
.recap-legend span { display: flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-ok { background: var(--success); }
.status-no { background: var(--danger); }
.status-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.status-match { color: #14715f; background: #e7f7f2; }
.status-mismatch { color: #bd4352; background: #fff0f2; }
.match-value { color: var(--success) !important; }
.recap-table th { padding: 5px 8px; line-height: 1.1; }
.recap-table td { padding: 5px 8px; line-height: 1.1; }
.recap-table tbody td:not(.merged-cell) { border-top: 0; border-bottom: 1px solid #d5e0ec; }
.recap-table .status-badge { padding: 3px 7px; }
.recap-table th:first-child, .recap-table td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--line); }
.recap-table thead th:first-child { z-index: 2; background: #f8fafc; }
.recap-table tfoot td:first-child { background: #f2f8ff; }
.recap-table .group-heading { color: var(--blue-700); background: var(--blue-50); text-align: center; border-bottom: 1px solid #dbe8f5; }
.recap-table .range-start > td { border-top: 2px solid #cbdbea; }
.recap-table tbody tr:first-child > td { border-top-width: 1px; }
.recap-table .merged-cell { vertical-align: middle; text-align: center; border-left: 1px solid #d9e4ef; border-right: 1px solid #d9e4ef; background: #fbfdff; }
.recap-table .bank-merged { color: var(--blue-800); background: #eef7ff; }
.recap-table .bank-merged strong, .recap-table .bank-merged small { display: block; }
.recap-table .bank-merged small { margin-top: 2px; color: #7f92a8; font-size: 9px; line-height: 1.05; font-weight: 500; }
.recap-table .no-input-cell { color: #93a2b5; background: repeating-linear-gradient(135deg, #fafbfd, #fafbfd 7px, #f2f5f8 7px, #f2f5f8 14px); text-align: center; font-size: 10px; font-style: italic; }
.annual-filter { display: flex; align-items: end; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 7px 22px rgba(35,75,120,.045); }
.annual-filter label { min-width: 120px; }
.annual-filter select { min-height: 40px; padding: 8px 11px; cursor: pointer; }
.annual-filter .btn { min-height: 40px; }
.annual-recap-table tbody tr:nth-child(even) td { background-color: #fafcff; }

/* Alerts */
.alert { position: relative; margin-bottom: 20px; padding: 13px 42px 13px 15px; border-radius: 11px; font-size: .76rem; line-height: 1.5; }
.alert-success { color: #146d5c; border: 1px solid #cceae3; background: #edf9f6; }
.alert-error { color: #a33e4b; border: 1px solid #f0d3d8; background: #fff3f5; }
.alert button { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); border: 0; color: inherit; background: none; cursor: pointer; }
.login-form-wrap .alert { margin-top: 22px; margin-bottom: 0; }
.sidebar-overlay { display: none; }

@media (max-width: 1120px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .quick-card { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 10px 10px; }
    .quick-card .card-head { grid-column: 1 / -1; }
    .quick-card > a { margin: 0; }
    .data-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .data-form .span-two { grid-column: span 2; }
}

@media (max-width: 860px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .login-panel { min-height: 100vh; padding: 28px; }
    .mobile-brand { display: flex; }
    .app-shell { display: block; }
    .sidebar { transform: translateX(-101%); transition: transform .25s ease; box-shadow: 20px 0 45px rgba(15,42,78,.12); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; z-index: 25; inset: 0; background: rgba(12,30,56,.35); backdrop-filter: blur(2px); }
    body.sidebar-open .sidebar-overlay { display: block; }
    .main-content { width: 100%; }
    .topbar { justify-content: space-between; }
    .menu-toggle { display: block; }
    .top-date { display: none; }
    .two-column { grid-template-columns: 1fr; }
    .info-panel { position: static; }
    .dashboard-insights { grid-template-columns: 1fr; }
    .quick-card { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    html { font-size: 14px; }
    .content { padding-top: 28px; }
    .heading-row { align-items: stretch; flex-direction: column; }
    .heading-row .btn { align-self: flex-start; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: auto; }
    .quick-card { display: block; }
    .data-form { grid-template-columns: 1fr; padding-inline: 17px; }
    .data-form > * { grid-column: 1 !important; }
    .date-compact { max-width: none; }
    .card-head { padding-inline: 17px; }
    .date-row { grid-template-columns: 28px 1fr 30px; }
    .date-row label:first-of-type, .date-row label:nth-of-type(2) { grid-column: 2; }
    .date-row .row-number { grid-row: 1; grid-column: 1; }
    .date-row .remove-row { grid-row: 1; grid-column: 3; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .date-items-head { align-items: flex-start; gap: 10px; }
    .topbar { height: 66px; padding-inline: 18px; }
    .user-chip span:last-child { display: none; }
    .recap-filter { grid-template-columns: 1fr 1fr; }
    .recap-filter .btn { grid-column: 1 / -1; width: 100%; }
    .annual-filter { width: 100%; }
    .annual-filter label { min-width: 0; flex: 1; }
    .report-row { grid-template-columns: 30px minmax(135px, 1fr) minmax(125px, .7fr); }
    .report-row > * { padding-inline: 8px; }
    .report-footer-info { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
