:root {
  --blue: #001689;
  --blue-2: #0d2bb6;
  --blue-soft: #eef1ff;
  --green: #00953b;
  --green-soft: #e9f8ef;
  --red: #b42318;
  --red-soft: #fff0ee;
  --amber: #d68715;
  --amber-soft: #fff6e6;
  --teal: #187b68;
  --ink: #172033;
  --muted: #6f7a84;
  --line: #dfe7e4;
  --canvas: #f1f4f3;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --sidebar: 252px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 5px 18px rgba(0, 22, 137, .07);
  --shadow-md: 0 18px 48px rgba(0, 22, 137, .12);
  --shadow-lg: 0 28px 80px rgba(0, 22, 137, .2);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.boot-view {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 18px;
  text-align: center;
  color: var(--muted);
}
.boot-mark { height: 42px; display: flex; align-items: end; justify-content: center; gap: 6px; }
.boot-mark span { width: 8px; height: 18px; border-radius: 8px; background: var(--blue); animation: bounce 1s infinite ease-in-out; }
.boot-mark span:nth-child(2) { height: 32px; background: var(--green); animation-delay: .12s; }
.boot-mark span:nth-child(3) { height: 24px; background: #7b868c; animation-delay: .24s; }
@keyframes bounce { 0%, 100% { transform: scaleY(.65); opacity: .55; } 50% { transform: scaleY(1); opacity: 1; } }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(460px, .95fr); }
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 56px clamp(44px, 6vw, 92px);
  color: #fff;
  background:
    radial-gradient(circle at 78% 22%, rgba(0,149,59,.58), transparent 31%),
    radial-gradient(circle at 20% 82%, rgba(37,69,213,.72), transparent 34%),
    linear-gradient(142deg, #001066 0%, #001689 52%, #02114c 100%);
}
.auth-brand::after { content: ""; position: absolute; right: -130px; bottom: -160px; width: 460px; height: 460px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.035), 0 0 0 140px rgba(255,255,255,.025); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand > img { width: min(270px, 58%); height: auto; }
.auth-brand h1 { margin: 12px 0 22px; font-size: clamp(42px, 5vw, 72px); line-height: .98; letter-spacing: -.055em; max-width: 760px; }
.auth-brand p:not(.eyebrow) { max-width: 640px; margin: 0; color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.65; }
.auth-security { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.78); font-size: 13px; }
.security-dot { width: 9px; height: 9px; border-radius: 50%; background: #48dc85; box-shadow: 0 0 0 6px rgba(72,220,133,.12); }
.auth-panel { min-height: 100vh; padding: 40px; display: grid; place-items: center; background: #f8faf9; }
.auth-card { width: min(460px, 100%); padding: 44px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.auth-card h2 { margin: 7px 0 10px; color: var(--ink); font-size: 34px; letter-spacing: -.035em; }
.auth-copy { margin: 0 0 30px; color: var(--muted); line-height: 1.6; }
.mobile-auth-logo { display: none; margin: -12px -12px 26px; padding: 22px; border-radius: 16px; background: var(--blue); }
.mobile-auth-logo img { width: 180px; display: block; }
.eyebrow { margin: 0; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: rgba(255,255,255,.65); }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > span { color: #475164; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea, .input, .select {
  width: 100%; min-height: 46px; padding: 10px 13px; color: var(--ink); background: #fff; border: 1px solid #cfd9d5; border-radius: 10px; outline: none; transition: border-color .18s, box-shadow .18s;
}
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,22,137,.09); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.icon-button { border: 0; background: transparent; color: var(--muted); }
.password-toggle { position: absolute; top: 5px; right: 5px; width: 36px; height: 36px; border-radius: 8px; }
.password-toggle:hover { background: var(--canvas); color: var(--blue); }
.form-error { min-height: 18px; margin: 14px 0 0; color: var(--red); font-size: 12px; font-weight: 650; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; transition: transform .16s, box-shadow .16s, background .16s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 8px 20px rgba(0,22,137,.18); }
.button-primary:hover { background: var(--blue-2); box-shadow: 0 12px 24px rgba(0,22,137,.24); }
.button-success { color: #fff; background: var(--green); }
.button-danger { color: #fff; background: var(--red); }
.button-secondary { color: var(--blue); background: #fff; border-color: #cdd7e8; }
.button-secondary:hover { background: var(--blue-soft); }
.button-ghost { color: var(--blue); background: transparent; border-color: var(--line); }
.button-full { width: 100%; min-height: 48px; }
.button-compact { min-height: 38px; padding: 7px 13px; font-size: 13px; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar); display: flex; flex-direction: column; color: #fff;
  background: linear-gradient(180deg, #001689 0%, #00106d 58%, #000b46 100%); box-shadow: 8px 0 34px rgba(0,22,137,.12);
}
.sidebar-brand { height: 92px; padding: 26px 25px 20px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand img { width: 122px; height: auto; }
.sidebar-brand span { padding: 4px 8px; color: #b8ffcf; background: rgba(0,149,59,.28); border: 1px solid rgba(83,220,134,.36); border-radius: 999px; font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.side-nav { padding: 18px 12px; display: grid; gap: 5px; }
.nav-button { position: relative; width: 100%; min-height: 48px; padding: 9px 13px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; color: rgba(255,255,255,.72); background: transparent; border: 0; border-radius: 11px; text-align: left; font-size: 13px; font-weight: 670; }
.nav-button:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-button.active { color: #fff; background: rgba(255,255,255,.15); box-shadow: inset 3px 0 0 #42db80; }
.nav-icon { width: 27px; height: 27px; display: grid; place-items: center; color: currentColor; font-size: 20px; }
.nav-count { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; color: #052713; background: #78eaa1; border-radius: 999px; font-size: 10px; }
.sidebar-foot { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; color: #001689; background: #e9fff0; border-radius: 50%; font-weight: 850; }
.sidebar-user strong, .sidebar-user span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user strong { font-size: 12px; }
.sidebar-user span { margin-top: 3px; color: rgba(255,255,255,.58); font-size: 10px; text-transform: capitalize; }
.logout-button { width: 100%; padding: 8px; color: rgba(255,255,255,.6); background: transparent; border: 0; border-radius: 8px; font-size: 11px; text-align: left; }
.logout-button:hover { color: #fff; background: rgba(255,255,255,.07); }

.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 25; height: 92px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.035em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.sync-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 650; }
.sync-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.mobile-menu-button { display: none; width: 38px; height: 38px; padding: 0; color: var(--blue); background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.main-content { max-width: 1680px; margin: 0 auto; padding: 30px 32px 56px; outline: none; }

.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-intro h2 { margin: 0 0 7px; font-size: 29px; letter-spacing: -.04em; }
.page-intro p { max-width: 750px; margin: 0; color: var(--muted); line-height: 1.55; }
.intro-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { position: relative; min-height: 138px; padding: 21px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.stat-card::after { content: ""; position: absolute; right: -34px; bottom: -54px; width: 118px; height: 118px; border-radius: 50%; background: color-mix(in srgb, var(--accent, var(--blue)) 11%, transparent); }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; }
.stat-glyph { width: 34px; height: 34px; display: grid; place-items: center; color: var(--accent, var(--blue)); background: color-mix(in srgb, var(--accent, var(--blue)) 10%, white); border-radius: 10px; font-size: 18px; }
.stat-value { position: relative; z-index: 1; display: block; margin-top: 18px; color: var(--ink); font-size: clamp(23px, 2.2vw, 34px); letter-spacing: -.045em; }
.stat-note { position: relative; z-index: 1; display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.stat-note.alert { color: var(--red); font-weight: 700; }

.content-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(330px,.55fr); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.panel-header { min-height: 74px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-title { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.panel-description { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.panel-body { padding: 20px; }
.panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quick-grid { display: grid; gap: 11px; }
.quick-card { width: 100%; padding: 15px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 13px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 13px; text-align: left; }
.quick-card:hover { border-color: #bcc9df; box-shadow: 0 8px 22px rgba(0,22,137,.08); transform: translateY(-1px); }
.quick-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 12px; font-size: 21px; }
.quick-card strong, .quick-card span { display: block; }
.quick-card strong { font-size: 13px; }
.quick-card span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.quick-arrow { color: #a2adb8; font-size: 20px; }

.filter-panel { margin-bottom: 18px; padding: 16px; display: flex; align-items: end; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.filter-field { min-width: 170px; flex: 1; display: grid; gap: 6px; }
.filter-field.wide { min-width: 240px; flex: 1.6; }
.filter-field label { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.filter-field input, .filter-field select { min-height: 40px; width: 100%; padding: 8px 11px; color: var(--ink); background: #fff; border: 1px solid #ced9d5; border-radius: 9px; outline: none; }
.filter-field input:focus, .filter-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,22,137,.08); }
.filter-actions { display: flex; gap: 8px; }

.account-grid { display: grid; grid-template-columns: repeat(4, minmax(210px,1fr)); gap: 13px; margin-bottom: 20px; }
.account-card { position: relative; overflow: hidden; min-height: 128px; padding: 18px; color: #fff; background: linear-gradient(135deg, var(--account-color,#001689), color-mix(in srgb, var(--account-color,#001689) 72%, #00102f)); border: 0; border-radius: 15px; text-align: left; box-shadow: 0 12px 26px color-mix(in srgb, var(--account-color,#001689) 22%, transparent); }
.account-card::after { content: ""; position: absolute; width: 130px; height: 130px; right: -50px; top: -50px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; box-shadow: 0 0 0 25px rgba(255,255,255,.06); }
.account-card.active { outline: 3px solid #fff; box-shadow: 0 0 0 4px var(--green), 0 15px 32px rgba(0,22,137,.22); }
.account-bank { position: relative; z-index: 1; display: block; color: rgba(255,255,255,.72); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.account-alias { position: relative; z-index: 1; display: block; margin-top: 7px; font-size: 14px; font-weight: 750; }
.account-balance { position: relative; z-index: 1; display: block; margin-top: 18px; font-size: 23px; letter-spacing: -.035em; }
.account-date { position: relative; z-index: 1; display: block; margin-top: 4px; color: rgba(255,255,255,.66); font-size: 9px; }

.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; color: #596575; background: #f7f9f8; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #edf1ef; color: #354052; font-size: 11px; vertical-align: middle; }
tbody tr:hover { background: #fafcfc; }
tbody tr:last-child td { border-bottom: 0; }
.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.credit { color: var(--green); font-weight: 750; }
.money.debit { color: var(--red); font-weight: 750; }
.money.balance { color: var(--blue); font-weight: 760; }
.name-cell strong, .name-cell span { display: block; }
.name-cell strong { color: var(--ink); font-size: 11px; }
.name-cell span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.row-action { padding: 6px 9px; color: var(--blue); background: var(--blue-soft); border: 0; border-radius: 7px; font-size: 10px; font-weight: 750; }
.row-action:hover { background: #e1e7ff; }
.row-action.danger { color: var(--red); background: var(--red-soft); }
.status-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-chip.overdue { color: var(--red); background: var(--red-soft); }
.status-chip.current { color: var(--green); background: var(--green-soft); }
.status-chip.pending { color: var(--amber); background: var(--amber-soft); }
.status-chip.paid { color: var(--blue); background: var(--blue-soft); }
.status-chip.neutral { color: var(--muted); background: #eff2f1; }
.empty-state { min-height: 240px; padding: 40px; display: grid; place-content: center; gap: 10px; text-align: center; color: var(--muted); }
.empty-state-icon { margin: 0 auto; width: 52px; height: 52px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 16px; font-size: 26px; }
.empty-state h3 { margin: 4px 0 0; color: var(--ink); font-size: 16px; }
.empty-state p { max-width: 420px; margin: 0; font-size: 11px; line-height: 1.55; }

.bar-list { display: grid; gap: 17px; }
.bar-row-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 10px; }
.bar-row-head strong { color: var(--ink); }
.bar-row-head span { color: var(--muted); }
.bar-track { height: 8px; display: flex; overflow: hidden; background: #edf1ef; border-radius: 999px; }
.bar-track i { display: block; min-width: 2px; height: 100%; }
.bar-overdue { background: var(--red); }
.bar-current { background: var(--green); }
.activity-list { display: grid; }
.activity-item { padding: 13px 0; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; border-bottom: 1px solid #edf1ef; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 10px; }
.activity-item strong, .activity-item span { display: block; }
.activity-item strong { font-size: 11px; }
.activity-item span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.activity-item time { color: var(--muted); font-size: 9px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: #e9eeec; border-radius: 11px; }
.tab-button { min-height: 34px; padding: 7px 12px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; font-size: 10px; font-weight: 760; }
.tab-button.active { color: var(--blue); background: #fff; box-shadow: 0 2px 8px rgba(0,22,137,.08); }
.selection-bar { position: sticky; bottom: 18px; z-index: 15; margin: 18px auto 0; max-width: 780px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; background: #101d3d; border-radius: 14px; box-shadow: 0 14px 40px rgba(16,29,61,.28); }
.selection-bar strong { font-size: 12px; }
.selection-bar span { color: rgba(255,255,255,.68); font-size: 10px; }
.selection-actions { display: flex; gap: 8px; }
.check { width: 17px; height: 17px; accent-color: var(--blue); }
.bank-select { min-width: 170px; padding: 7px 9px; border: 1px solid #ccd7d2; border-radius: 8px; background: #fff; font-size: 10px; }

.import-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.import-card { padding: 22px; display: grid; grid-template-columns: 52px 1fr; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.import-icon { width: 52px; height: 52px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 15px; font-size: 25px; }
.import-card h3 { margin: 2px 0 6px; font-size: 15px; }
.import-card p { margin: 0 0 15px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.import-card input[type="file"] { display: none; }
.drop-zone { padding: 16px; color: var(--muted); background: #fafcfc; border: 1px dashed #bdcbc5; border-radius: 11px; font-size: 10px; text-align: center; }
.drop-zone.dragover { color: var(--blue); background: var(--blue-soft); border-color: var(--blue); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 24px; display: grid; place-items: center; background: rgba(7,16,38,.55); backdrop-filter: blur(5px); }
.modal { width: min(980px, 100%); max-height: min(86vh, 900px); overflow: hidden; display: flex; flex-direction: column; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header { min-height: 82px; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.035em; }
.modal-close { width: 38px; height: 38px; color: var(--muted); background: #f2f5f4; border: 0; border-radius: 10px; font-size: 24px; line-height: 1; }
.modal-close:hover { color: var(--red); background: var(--red-soft); }
.modal-body { padding: 22px 24px 28px; overflow: auto; }
.modal-form { display: grid; gap: 16px; }
.modal-actions { padding-top: 4px; display: flex; justify-content: flex-end; gap: 8px; }
.detail-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 18px; }
.detail-kpi { padding: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.detail-kpi span, .detail-kpi strong { display: block; }
.detail-kpi span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.detail-kpi strong { margin-top: 7px; font-size: 16px; }
.payment-detail { margin-bottom: 13px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.payment-detail summary { padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px; cursor: pointer; background: #fafcfc; }
.payment-detail summary strong { display: block; font-size: 12px; }
.payment-detail summary div > span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 600; }
.payment-detail summary > span { color: var(--blue); font-size: 12px; font-weight: 800; }

.loading-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(247,250,249,.78); backdrop-filter: blur(4px); }
.loading-card { min-width: 210px; padding: 28px; display: grid; justify-items: center; gap: 15px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-md); }
.loading-card strong { font-size: 12px; }
.spinner { width: 34px; height: 34px; border: 3px solid #e0e6f6; border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 250; width: min(360px, calc(100vw - 44px)); display: grid; gap: 10px; }
.toast { padding: 14px 16px; display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: start; color: #fff; background: #101d3d; border-radius: 12px; box-shadow: 0 16px 40px rgba(7,16,38,.26); animation: toastIn .24s ease-out; }
.toast.success { background: #075b2d; }
.toast.error { background: #8c1d18; }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 11px; }
.toast span { margin-top: 3px; color: rgba(255,255,255,.72); font-size: 9px; line-height: 1.4; }
.toast button { padding: 0; color: rgba(255,255,255,.7); background: transparent; border: 0; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }

@media (max-width: 1240px) {
  :root { --sidebar: 218px; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .account-grid { grid-template-columns: repeat(2,1fr); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { padding: 22px; background: linear-gradient(145deg, #001689, #00104f); }
  .mobile-auth-logo { display: block; }
  .sidebar { transform: translateX(-120%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-scrim { position: fixed; inset: 0; z-index: 35; display: none; background: rgba(7,16,38,.44); }
  .mobile-scrim.open { display: block; }
  .workspace { margin-left: 0; }
  .mobile-menu-button { display: block; }
  .topbar { height: 80px; padding: 0 18px; }
  .topbar-right .sync-state { display: none; }
  .main-content { padding: 22px 18px 42px; }
  .import-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .auth-card { padding: 28px 22px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .topbar h1 { font-size: 20px; }
  .topbar-right .button { display: none; }
  .page-intro { align-items: stretch; flex-direction: column; }
  .intro-actions { justify-content: flex-start; }
  .stat-grid, .account-grid, .detail-kpis { grid-template-columns: 1fr; }
  .stat-card { min-height: 120px; }
  .filter-panel { align-items: stretch; flex-direction: column; }
  .filter-field, .filter-field.wide { width: 100%; min-width: 0; }
  .filter-actions { width: 100%; }
  .filter-actions .button { flex: 1; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .import-card { grid-template-columns: 1fr; }
  .selection-bar { align-items: stretch; flex-direction: column; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .sync-state { display: none; }
}

@media print {
  .sidebar, .topbar, .filter-panel, .intro-actions, .panel-actions, .selection-bar { display: none !important; }
  .workspace { margin: 0; }
  .main-content { max-width: none; padding: 0; }
  .panel, .stat-card { box-shadow: none; break-inside: avoid; }
}
