:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #16233c;
  background: #eef2f8;
  font-synthesis: none;
  --ink: #16233c;
  --muted: #54637b;
  --line: #dce3ee;
  --accent: #2749cd;
  --accent-hover: #1f3bac;
  --dark: #13213e;
  --tint: #edf2ff;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, button, input, select, textarea { text-transform: uppercase; }
input[type=password] { text-transform: none; }
.head-actions, .row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.panel-stack { display: grid; gap: 16px; }
.statement { width: min(900px, calc(100% - 24px)); }
.statement-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.statement-controls .field { flex: 1 1 145px; }
.statement-period { color: var(--muted); margin: 16px 0 0; font-size: .8rem; }
.report-controls { padding: 16px; margin-bottom: 14px; }
.report-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 174px), 1fr)); gap: 12px; }
.report-buttons { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.report-check { display: inline-flex; align-items: center; gap: 4px; margin-right: auto; font-size: .75rem; color: var(--muted); }
.report-output .panel-head { align-items: flex-start; }
.report-output .panel-head p { overflow-wrap: anywhere; }
.report-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; margin: 0 16px 14px; }
.report-totals > div { min-width: 0; background: var(--tint); border-radius: 6px; padding: 9px 10px; }
.report-totals dt { color: var(--muted); font-size: .72rem; }
.report-totals dd { font-size: .92rem; font-weight: 670; margin: 4px 0 0; overflow-wrap: anywhere; }
.report-output td { white-space: pre-line; overflow-wrap: anywhere; }
.report-output td.report-number, .report-output th.report-number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-message { padding: 6px 16px 18px; color: var(--muted); }
.details.statement-totals { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 8px; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .63; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #526dd2; outline-offset: 2px; }
button svg { flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.boot { margin: 3rem auto; max-width: 25rem; padding: 0 1rem; }
.btn { min-height: 40px; padding: 9px 14px; border: 1px solid transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: .82rem; line-height: 1.25; font-weight: 700; white-space: nowrap; transition: background .15s, border-color .15s; }
.primary { background: var(--accent); color: white; box-shadow: 0 2px 4px #13213e22; }
.primary:hover { background: var(--accent-hover); }
.secondary { color: var(--ink); background: #fff; border-color: #ccd6e6; }
.secondary:hover { background: var(--tint); border-color: #bac9ec; }
.plain { color: #29469d; background: transparent; }
.plain:hover { background: var(--tint); }
.danger { color: #8b302b; background: #fbeeea; border-color: #f5ded8; }
.danger:hover { background: #f8e0da; }
.btn.small { min-height: 32px; font-size: .8rem; padding: 6px 9px; }
.icon-btn { display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 6px; color: #455879; background: #fff; }
.icon-btn:hover { background: var(--tint); }

.brand { display: flex; gap: 12px; align-items: center; color: #fff; }
.brand-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; color: #fff; background: #3457db; border-radius: 7px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; font-weight: 720; letter-spacing: -.014em; }
.brand small { font-size: .67rem; color: #b4c4e4; letter-spacing: .075em; margin-top: 3px; }
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(360px, .95fr) minmax(420px, 1.05fr); }
.auth-side { display: flex; flex-direction: column; min-height: 100%; color: #fff; padding: clamp(30px, 5vw, 76px); background: radial-gradient(ellipse at 90% 85%, #263e82 0%, transparent 67%), var(--dark); }
.auth-intro { margin: auto 0; padding: 68px 0 56px; max-width: 530px; }
.auth-kicker { display: flex; align-items: center; gap: 10px; color: #bfcaff; font-size: .75rem; letter-spacing: .13em; font-weight: 750; }
.auth-kicker span { width: 7px; height: 7px; background: #9daeff; border-radius: 50%; box-shadow: 0 0 0 5px #9daeff30; }
.auth-intro h1 { font-size: clamp(2.65rem, 5.5vw, 5.6rem); line-height: .99; font-weight: 690; letter-spacing: -.067em; margin: 23px 0; }
.auth-intro p { font-size: clamp(1rem, 1.6vw, 1.18rem); max-width: 420px; color: #cfdbf2; line-height: 1.6; }
.auth-features { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: #cfdbf2; }
.auth-features span { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 600; padding: 8px 10px; border: 1px solid #ffffff38; border-radius: 8px; background: #ffffff0a; }
.auth-foot { display: flex; align-items: center; gap: 8px; color: #bdcce9; font-size: .83rem; }
.auth-main { display: grid; place-items: center; padding: 28px; }
.auth-card { width: min(100%, 450px); background: #fff; border: 1px solid var(--line); padding: clamp(25px, 4vw, 42px); border-radius: 10px; box-shadow: 0 12px 36px #18274812; }
.eyebrow { color: #3c5397; font-size: .72rem; letter-spacing: .105em; text-transform: uppercase; font-weight: 760; }
.auth-card h2 { margin: 12px 0 8px; font-size: clamp(1.55rem, 2.6vw, 2.08rem); line-height: 1.14; letter-spacing: -.045em; }
.auth-card > p { color: var(--muted); font-size: .92rem; line-height: 1.5; margin: 0 0 24px; }
.auth-card form { display: grid; gap: 15px; }
.auth-card form .primary { justify-content: space-between; min-height: 44px; }

.shell { display: grid; grid-template-columns: 222px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; overflow: auto; padding: 23px 14px 16px; background: var(--dark); color: #fff; }
.sidebar .brand { padding: 0 8px; }
.sidebar nav { margin-top: 29px; display: grid; gap: 3px; }
.nav-label { color: #a3b6dc; font-size: .64rem; font-weight: 760; letter-spacing: .12em; padding: 0 10px; margin: 0 0 6px; }
.nav-item + .nav-label { margin-top: 18px; }
.nav-item { border: 1px solid transparent; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 6px; background: transparent; color: #d9e4fa; text-align: left; font-size: .79rem; font-weight: 650; }
.nav-item svg { flex: 0 0 auto; color: #9db5e9; }
.nav-item:hover { background: #ffffff13; color: #fff; }
.nav-item.selected { background: #284999; border-color: #5b7bd5; color: white; }
.nav-item.selected svg { color: #d7e3ff; }
.sidebar-bottom { margin-top: auto; padding-top: 26px; }
.profile { border-top: 1px solid #ffffff26; display: flex; align-items: center; gap: 9px; padding: 13px 5px 8px; overflow-wrap: anywhere; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 7px; background: #dae4ff; color: #233d85; font-weight: 800; }
.profile strong { display: block; font-size: .84rem; }
.profile small { display: block; color: #b9c9e8; font-size: .72rem; margin-top: 2px; }
.profile-actions { display: flex; gap: 4px; }
.profile-actions .plain { color: #d7e1f7; padding: 6px; min-height: 34px; font-size: .76rem; }
.profile-actions .plain:hover { background: #ffffff16; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 9px clamp(16px, 3vw, 40px); min-height: 58px; border-bottom: 1px solid var(--line); background: #fff; }
.topbar > div { display: flex; align-items: center; gap: 9px; font-size: .82rem; }
.topbar .crumb, .topbar svg { color: var(--muted); }
.menu { display: none; }
.content { max-width: 1530px; margin: auto; padding: 26px clamp(16px, 3vw, 40px) 42px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { margin: 6px 0 6px; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.035em; line-height: 1.12; }
.page-head p { margin: 0; color: var(--muted); font-size: .91rem; line-height: 1.45; }
.head-actions { padding-bottom: 1px; }
.home-shortcuts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { min-width: 0; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.metric-label { color: #3c4f71; display: flex; align-items: center; gap: 8px; font-weight: 680; font-size: .78rem; }
.metric-icon { display: inline-grid; place-items: center; width: 33px; height: 33px; flex: 0 0 33px; border-radius: 6px; }
.gold { background: #fbf1d8; color: #76570e; }
.blue { background: #e6edff; color: #2949ad; }
.green { background: #e2f1e6; color: #2c6744; }
.rose { background: #f9eae5; color: #904839; }
.metric > strong { display: block; font-size: clamp(1.15rem, 1.8vw, 1.58rem); letter-spacing: -.035em; margin-top: 10px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric > small { display: block; margin-top: 4px; font-size: .75rem; color: var(--muted); }
.panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 2px #16233c0a; overflow: hidden; }
.plan-views { display: flex; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.plan-view { min-height: 48px; display: inline-flex; gap: 6px; align-items: center; flex-shrink: 0; padding: 0 2px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.plan-view:hover { color: var(--accent); }
.plan-view[aria-pressed=true] { color: var(--accent); border-color: var(--accent); }
.plan-view:focus-visible { outline-offset: -3px; }
.plan-view span { padding: 2px 6px; border-radius: 4px; background: #edf1f7; font-size: .7rem; font-variant-numeric: tabular-nums; }
.plan-view[aria-pressed=true] span { background: #e4ebff; }
.plan-total { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); background: #f4f7fd; color: var(--muted); font-size: .75rem; font-weight: 650; }
.plan-total strong { margin-left: 5px; color: var(--ink); font-size: .87rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 17px 17px 14px; }
.panel-head h2 { margin: 0; font-size: 1.02rem; letter-spacing: -.018em; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.income { color: #216545; }
.empty { padding: 36px 14px 44px; min-height: 175px; text-align: center; border-top: 1px solid var(--line); }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 11px; color: #3553af; background: var(--tint); border-radius: 8px; }
.empty strong { font-size: .93rem; }
.empty p { margin: 5px 0 0; color: var(--muted); font-size: .82rem; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 15px 16px; }
.search { display: flex; align-items: center; flex: 1 1 240px; gap: 8px; color: var(--muted); padding: 0 10px; border: 1px solid #cdd7e8; border-radius: 6px; background: #fbfcff; }
.search:focus-within { outline: 2px solid #526dd2; outline-offset: 1px; }
.search input { border: 0; outline: 0; width: 100%; min-height: 38px; background: transparent; font-size: .86rem; }
.search input:focus-visible { outline: none; }
.filter-select select { min-height: 40px; border: 1px solid #cdd7e8; border-radius: 6px; color: var(--ink); background: #fbfcff; font-size: .79rem; padding: 0 10px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .83rem; }
thead { color: #445578; background: #edf2fa; }
th { font-weight: 660; font-size: .75rem; white-space: nowrap; }
th, td { padding: 11px 12px; border-top: 1px solid #e3e9f3; vertical-align: middle; }
tbody tr:nth-child(even) { background: #fafcff; }
tbody tr:hover { background: #f2f6ff; }
th:first-child, td:first-child { padding-left: 16px; }
td:last-child { text-align: right; }
th[scope]:last-child:not(:empty) { text-align: left; }
td strong { font-weight: 670; }
td strong, td small { overflow-wrap: anywhere; }
td small { display: block; margin-top: 4px; color: var(--muted); font-size: .73rem; }
td .inline { display: inline; }
td .late { color: #8f4637; }
td .iban, .iban { font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; }
.amount { white-space: nowrap; font-weight: 690; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 99px; white-space: nowrap; font-weight: 660; font-size: .71rem; }
.badge i { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.pending { background: #fbf1d8; color: #6d4c05; }
.approved { background: #e6eef9; color: #2d547e; }
.rejected { background: #fbe9e4; color: #8a372d; }
.paid { background: #e3f2e6; color: #23643e; }
.neutral, .draft, .cancelled { background: #eaf0f8; color: #475976; }

dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); box-shadow: 0 20px 85px #13213e44; }
dialog::backdrop { background: #101c3577; }
.dialog-head { padding: 18px 20px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 1.26rem; letter-spacing: -.025em; overflow-wrap: anywhere; }
.dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.45; overflow-wrap: anywhere; }
.dialog-form, .dialog-body { padding: 16px 20px 20px; }
.dialog-form { display: grid; gap: 13px; }
.field { display: grid; gap: 5px; min-width: 0; font-weight: 620; font-size: .84rem; }
.field small { color: var(--muted); font-size: .72rem; font-weight: 500; }
.field input, .field select, .field textarea { min-height: 40px; width: 100%; min-width: 0; border: 1px solid #cdd7e8; border-radius: 6px; padding: 8px 10px; background: #fbfcff; color: var(--ink); font-weight: 480; }
.field textarea { resize: vertical; }
.field input::placeholder { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
[data-bank], [data-cash] { display: grid; gap: 13px; }
.form-error { margin: 0; color: #8c302a; background: #fcefe9; border-radius: 7px; padding: 9px 11px; font-size: .84rem; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.detail-lead { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-radius: 7px; padding: 12px; background: var(--tint); }
.detail-lead strong { font-size: 1.58rem; letter-spacing: -.035em; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.details div { min-width: 0; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.details dt { color: var(--muted); font-size: .76rem; font-weight: 600; }
.details dd { margin: 4px 0 0; font-weight: 570; font-size: .9rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.details dd small { display: block; color: var(--muted); margin-top: 3px; }
.hint { margin: 0; padding: 10px; background: var(--tint); color: #334a7b; border-radius: 6px; font-size: .84rem; line-height: 1.45; }
.dialog-body .hint { margin: 0 0 12px; }
#toast { position: fixed; bottom: 16px; right: 16px; padding: 11px 14px; background: var(--dark); color: white; max-width: min(390px, calc(100% - 32px)); border-radius: 6px; font-size: .88rem; opacity: 0; pointer-events: none; transition: opacity .16s; }
#toast.show { opacity: 1; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 196px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { min-height: auto; padding: 22px; }
  .auth-intro { padding: 24px 0 0; }
  .auth-intro h1 { font-size: 2.6rem; margin: 12px 0; }
  .auth-intro h1 br, .auth-features, .auth-foot { display: none; }
  .auth-intro p { margin: 0; font-size: .9rem; }
  .auth-main { padding: 18px; }
  .shell { display: block; }
  .menu { display: inline-grid; }
  .sidebar { position: fixed; display: none; inset: 58px auto 0 0; width: min(270px, 86vw); height: auto; z-index: 2; box-shadow: 0 0 0 100vmax #101c3570; }
  .shell.menu-open .sidebar { display: flex; }
  .topbar { position: sticky; top: 0; z-index: 3; }
  .topbar .crumb, .topbar .crumb + svg { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 11px; }
  .content { padding-top: 17px; }
  .metric { padding: 11px; }
  .plan-views { flex-wrap: wrap; gap: 0 12px; padding: 0 12px; }
  .plan-view { min-height: 41px; }
  .panel-head { padding: 13px; }
  .panel-head .btn { white-space: normal; }
}
@media (max-width: 370px) {
  .form-grid, .details { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
@media print {
  @page odeme-report { size: A4 landscape; margin: 12mm; }
  body:has(.report-output) { background: white; }
  body:has(.report-output) .shell { display: block; }
  body:has(.report-output) .content { max-width: none; padding: 0; }
  body:has(.report-output) :is(.sidebar, .topbar, .page-head, .report-controls, #toast) { display: none; }
  .report-output { page: odeme-report; overflow: visible; border: 0; box-shadow: none; }
  .report-output .table-wrap { overflow: visible; }
  .report-output thead { display: table-header-group; }
  .report-output tr, .report-totals { break-inside: avoid; }
  .report-output th, .report-output td { padding: 6px 8px; font-size: 9pt; }
  body:has(dialog.statement[open]) { background: white; }
  body:has(dialog.statement[open]) > :not(dialog) { display: none; }
  dialog.statement[open] {
    position: static;
    inset: auto;
    display: block;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    margin: 0;
    border: 0;
    box-shadow: none;
  }
  dialog.statement::backdrop { display: none; }
  .statement .dialog-head button, .statement-controls,
  .statement .statement-link, .statement th:last-child { display: none; }
  .statement .table-wrap { overflow: visible; }
  .statement tr { break-inside: avoid; }
}
