:root{
  --navy-950:#0b1f36;
  --navy-900:#102a47;
  --navy-800:#173a61;
  --blue-700:#255f9f;
  --blue-600:#2f71ba;
  --blue-100:#eaf2fb;
  --blue-50:#f5f9fe;
  --paper:#f3f6fa;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --ink:#182433;
  --muted:#64748b;
  --line:#dce4ee;
  --line-strong:#c8d4e2;
  --ok:#16714a;
  --ok-bg:#edf8f2;
  --ok-line:#b9dfca;
  --danger:#b32934;
  --danger-bg:#fff2f3;
  --danger-line:#efc2c6;
  --warning:#9a6414;
  --shadow-sm:0 1px 2px rgba(15,35,55,.04),0 4px 12px rgba(15,35,55,.04);
  --shadow-md:0 10px 30px rgba(15,35,55,.08),0 2px 6px rgba(15,35,55,.05);
  --shadow-lg:0 24px 70px rgba(8,25,45,.22);
  --radius-sm:8px;
  --radius-md:12px;
  --radius-lg:18px;
  --focus:0 0 0 3px rgba(47,113,186,.15);
}

*{box-sizing:border-box}
html{min-width:320px;background:var(--paper)}
body{
  margin:0;
  min-height:100vh;
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:
    radial-gradient(circle at 10% -10%,rgba(47,113,186,.10),transparent 30rem),
    linear-gradient(180deg,#f8fafc 0,#f3f6fa 26rem,var(--paper) 100%);
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button,input,select{font:inherit}
button{touch-action:manipulation}

/* Header */
.topbar{
  position:relative;
  overflow:hidden;
  background:linear-gradient(125deg,var(--navy-950) 0%,var(--navy-900) 48%,#1f527f 100%);
  color:#fff;
  padding:30px max(32px,calc((100vw - 1500px)/2 + 20px));
  display:flex;
  gap:28px;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid rgba(255,255,255,.08);
  box-shadow:0 12px 34px rgba(10,31,54,.16);
}
.topbar::before{
  content:"";
  position:absolute;
  inset:auto -110px -180px auto;
  width:410px;
  height:410px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:50%;
  box-shadow:0 0 0 70px rgba(255,255,255,.025),0 0 0 140px rgba(255,255,255,.018);
  pointer-events:none;
}
.topbar>div{position:relative;z-index:1}
.topbar h1{
  margin:5px 0 0;
  font-family:inherit;
  font-size:clamp(28px,3vw,38px);
  line-height:1.1;
  letter-spacing:-.035em;
  font-weight:760;
}
.eyebrow{
  letter-spacing:.18em;
  font-size:11px;
  line-height:1;
  font-weight:800;
  color:#bcd4ed;
}
.actions{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

/* Layout + navigation */
.shell{max-width:1500px;margin:26px auto 48px;padding:0 20px}
.tabs{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
  width:100%;
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(12px);
  padding:5px;
  border-radius:14px;
  border:1px solid rgba(200,212,226,.9);
  box-shadow:var(--shadow-sm);
}
.tab{
  position:relative;
  width:100%;
  border:0;
  background:transparent;
  padding:11px 16px;
  border-radius:10px;
  font-size:14px;
  font-weight:700;
  letter-spacing:.005em;
  text-align:center;
  color:#516176;
  cursor:pointer;
  transition:background-color .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease;
}
.tab:hover{background:#f2f6fa;color:var(--navy-800)}
.tab:focus-visible{outline:none;box-shadow:var(--focus)}
.tab.active{
  background:var(--navy-800);
  color:#fff;
  box-shadow:0 5px 14px rgba(23,58,97,.18);
}
.content{margin-top:16px}

/* Cards */
.card{
  background:rgba(255,255,255,.96);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-md);
  overflow:hidden;
}
.card-head{
  min-height:68px;
  padding:18px 22px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#fff 0%,#fbfcfe 100%);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}
.card-head h2,.card-head h3{
  margin:0;
  color:var(--navy-900);
  font-family:inherit;
  font-size:17px;
  line-height:1.25;
  letter-spacing:.025em;
  font-weight:780;
}
.card-body{padding:22px}
.section-title{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 0 13px;
  color:var(--navy-900);
  font-family:inherit;
  font-size:14px;
  letter-spacing:.08em;
  font-weight:800;
}
.section-title::before{content:"";width:4px;height:16px;border-radius:4px;background:var(--blue-600)}

/* Buttons */
.btn{
  min-height:38px;
  border:1px solid transparent;
  border-radius:10px;
  padding:9px 13px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:0;
  font-size:13px;
  line-height:1;
  font-weight:730;
  letter-spacing:.005em;
  cursor:pointer;
  transition:transform .08s ease,box-shadow .18s ease,background-color .18s ease,border-color .18s ease,color .18s ease;
}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn:focus-visible{outline:none;box-shadow:var(--focus)}
.btn.primary{
  background:linear-gradient(180deg,#3479c2,var(--blue-700));
  color:#fff;
  border-color:#24598f;
  box-shadow:0 4px 10px rgba(37,95,159,.18);
}
.btn.primary:hover{background:linear-gradient(180deg,#3c83cd,#2866a9);box-shadow:0 6px 16px rgba(37,95,159,.24)}
.btn.secondary{background:#fff;color:var(--navy-800);border-color:var(--line-strong);box-shadow:0 1px 2px rgba(15,35,55,.03)}
.btn.secondary:hover{background:#f7fafe;border-color:#afc1d4}
.btn.danger{background:#fff7f7;color:var(--danger);border-color:#edc5c8}
.btn.danger:hover{background:#fff0f1;border-color:#e7adb2}
.btn.small{min-height:31px;padding:6px 9px;border-radius:8px;font-size:11.5px}
.file-btn{display:inline-flex;align-items:center}
.btn-icon{width:16px;height:16px;margin-right:7px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.btn:disabled{opacity:.5;cursor:not-allowed;transform:none;box-shadow:none}
.topbar .btn.secondary{background:rgba(255,255,255,.10);color:#f6f9fc;border-color:rgba(255,255,255,.19);box-shadow:none;backdrop-filter:blur(6px)}
.topbar .btn.secondary:hover{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.30)}
.topbar .btn.danger{background:rgba(179,41,52,.18);color:#ffdadd;border-color:rgba(255,190,195,.28)}
.topbar .btn.danger:hover{background:rgba(179,41,52,.28);border-color:rgba(255,190,195,.42)}

/* Data tables */
.table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  scrollbar-color:#b7c5d4 transparent;
  scrollbar-width:thin;
}
.table-wrap::-webkit-scrollbar{height:10px;width:10px}
.table-wrap::-webkit-scrollbar-thumb{background:#bdc9d6;border:3px solid #fff;border-radius:99px}
.sheet{border-collapse:separate;border-spacing:0;width:100%;min-width:760px;font-size:13px}
.sheet th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f0f5fa;
  color:#38536f;
  text-align:left;
  padding:11px 10px;
  border:0;
  border-bottom:1px solid #ccd9e6;
  border-right:1px solid #dbe4ed;
  white-space:nowrap;
  font-size:11px;
  line-height:1.2;
  letter-spacing:.055em;
  text-transform:uppercase;
  font-weight:800;
}
.sheet th:last-child{border-right:0}
.sheet td{
  border:0;
  border-bottom:1px solid #e4eaf1;
  border-right:1px solid #edf1f5;
  padding:7px;
  background:#fff;
  vertical-align:middle;
  transition:background-color .12s ease;
}
.sheet td:last-child{border-right:0}
.sheet tbody tr:last-child td{border-bottom:0}
.sheet tr:hover td{background:#fbfdff}
.sheet input,.sheet select,.modal-number,.date-field input{
  width:100%;
  min-height:36px;
  border:1px solid #cdd8e4;
  border-radius:8px;
  padding:7px 9px;
  background:#fff;
  color:#172538;
  box-shadow:inset 0 1px 2px rgba(18,42,66,.025);
  transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease;
}
.sheet input:hover,.sheet select:hover,.modal-number:hover,.date-field input:hover{border-color:#b3c3d5}
.sheet input:focus,.sheet select:focus,.modal-number:focus,.date-field input:focus{outline:none;border-color:var(--blue-600);box-shadow:var(--focus);background:#fff}
.sheet input::placeholder{color:#9ba8b7}
.sheet select{cursor:pointer}
.sheet input.money{text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}
.sheet input.reg-input{text-align:center;font-weight:700;color:var(--navy-800)}
.col-reg{width:132px}.col-date{width:145px}.col-account{min-width:310px}.col-money{width:155px}.col-delete{width:92px;text-align:center}

.journal-table .registration-start td{border-top:2px solid #9eb3ca}
.journal-table .registration-start:first-child td{border-top:0}
.journal-table .registration-end td{border-bottom:1px solid #c6d2df}
.journal-table td{padding-top:6px;padding-bottom:6px}
.journal-table .delete-registration{vertical-align:middle;background:#f9fbfd}
.registration-label{font-size:11px;font-weight:800;color:#56708f}
.registration-shared{vertical-align:middle!important;background:#f7fafd!important}
.registration-shared input{background:#fff}

/* Actions + status */
.row-actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin-top:16px}
.row-actions.between{justify-content:space-between}
.status-box{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:35px;
  padding:8px 11px;
  border-radius:999px;
  border:1px solid;
  font-size:12px;
  line-height:1.2;
  font-weight:760;
}
.status-box::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;box-shadow:0 0 0 3px rgba(100,116,139,.10)}
.status-box.ok{background:var(--ok-bg);color:var(--ok);border-color:var(--ok-line)}
.status-box.bad{background:var(--danger-bg);color:var(--danger);border-color:var(--danger-line)}
.status-box.neutral{background:#f4f6f9;color:#536171;border-color:#d9dee7}

/* New journal entry */
.entry-box{
  margin-top:24px;
  border:1px solid #d8e4ef;
  border-radius:14px;
  padding:18px;
  background:linear-gradient(180deg,#f8fbfe 0%,#f5f8fc 100%);
}
.entry-head{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}
.entry-head h3{margin:0;color:var(--navy-900);font-family:inherit;font-size:15px;font-weight:780}
.date-field{display:flex;align-items:center;gap:9px;color:#526479;font-size:12px;font-weight:750}
.date-field input{width:auto;min-width:145px;background:#fff}
.draft-message{margin-top:12px}

/* Ledger */
.ledger-grid{display:grid;grid-template-columns:repeat(3,minmax(300px,1fr));gap:16px}
.ledger{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  box-shadow:var(--shadow-sm);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.ledger:hover{transform:translateY(-1px);box-shadow:0 9px 22px rgba(15,35,55,.08);border-color:#cad7e4}
.ledger h3{
  margin:0;
  padding:12px 14px;
  background:linear-gradient(180deg,#eff5fb,#e9f0f8);
  border-bottom:1px solid #ccdae7;
  font-size:12px;
  letter-spacing:.045em;
  text-transform:uppercase;
  text-align:center;
  color:var(--navy-800);
  font-weight:800;
}
.taccount{width:100%;border-collapse:collapse;font-size:12px}
.taccount th,.taccount td{border:1px solid #e3e9ef;padding:7px}
.taccount th{background:#f8fafc;color:#66768a;font-size:10px;letter-spacing:.08em}
.taccount td:first-child,.taccount td:last-child{width:42%;text-align:right;font-variant-numeric:tabular-nums}
.taccount td:nth-child(2){width:16%;text-align:center;color:#788698;font-size:11px}
.taccount .balance td{font-weight:800;background:#f2f6fa;color:var(--navy-800);border-top:2px solid #b9c8d6}
.empty-ledger{padding:44px 24px;border:1px dashed #bfcbd8;border-radius:12px;background:#fafcfe;color:var(--muted);text-align:center}

/* Statements */
.statement-block+.statement-block{margin-top:30px;padding-top:3px}
.statements{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.statement{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow:var(--shadow-sm);
}
.statement h3{
  margin:0;
  padding:13px 15px;
  background:linear-gradient(180deg,#eff5fb,#e9f1f9);
  border-bottom:1px solid #ccdae7;
  color:var(--navy-800);
  font-family:inherit;
  font-size:12px;
  letter-spacing:.075em;
  font-weight:820;
}
.statement-lines{min-height:74px;flex:1}
.statement .line{display:flex;justify-content:space-between;gap:18px;padding:9px 14px;border-bottom:1px solid #e8edf2;font-size:12.5px}
.statement .line:nth-child(even){background:#fcfdfe}
.statement .line span:last-child{white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:600}
.statement .line.total{font-weight:820;border-top:2px solid #9cadbe;border-bottom:0;background:#f5f8fb;color:#263b50}
.statement .line.difference{font-weight:760;background:#f1f6fc;color:#34597e}
.statement .line.equal{font-weight:850;border-top:1px solid #b8c6d4;background:#e9f0f7;color:var(--navy-900)}
.statement-placeholder{height:60px;background:repeating-linear-gradient(135deg,#fff,#fff 8px,#fbfcfd 8px,#fbfcfd 16px)}
.imbalance{margin-top:15px;padding:12px 14px;border-radius:10px;background:var(--danger-bg);border:1px solid var(--danger-line);color:var(--danger);font-size:12px;font-weight:800}

/* Modals */
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(8,25,45,.58);
  backdrop-filter:blur(5px);
  display:grid;
  place-items:center;
  padding:20px;
  z-index:1000;
  animation:backdropIn .16s ease-out;
}
.modal{
  width:min(520px,100%);
  background:#fff;
  border-radius:16px;
  box-shadow:var(--shadow-lg);
  overflow:hidden;
  border:1px solid rgba(203,214,226,.9);
  animation:modalIn .18s ease-out;
}
.modal-head{padding:18px 20px;background:linear-gradient(180deg,#fff,#f7f9fc);border-bottom:1px solid var(--line)}
.modal-head h3{margin:0;color:var(--navy-900);font-family:inherit;font-size:17px;font-weight:780}
.modal-body{padding:20px}
.modal-body p{margin:0 0 14px;line-height:1.55;color:#3d4c5f}
.modal-actions{display:flex;justify-content:flex-end;gap:9px;padding:14px 20px;border-top:1px solid var(--line);background:#fafbfd}
.modal-number{padding:9px 10px}
.modal-error{margin-top:10px;padding:9px 10px;border-radius:8px;background:var(--danger-bg);border:1px solid var(--danger-line);color:var(--danger);font-weight:750;font-size:12px;display:none}
.modal-error.show{display:block}
.modal-hint{margin:-4px 0 12px;color:var(--muted);font-size:12.5px;font-weight:650}

/* Feedback */
.toast{
  position:fixed;
  right:22px;
  bottom:22px;
  max-width:min(390px,calc(100vw - 44px));
  background:#102a47;
  color:#fff;
  padding:12px 15px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:11px;
  box-shadow:0 14px 34px rgba(8,25,45,.24);
  font-size:13px;
  font-weight:650;
  opacity:0;
  transform:translateY(12px) scale(.98);
  pointer-events:none;
  transition:opacity .18s ease,transform .18s ease;
  z-index:1100;
}
.toast.show{opacity:1;transform:translateY(0) scale(1)}
.account-errors{margin-top:6px;color:var(--danger);font-size:11.5px;font-weight:750;line-height:1.3}
.account-errors:empty{display:none}

#downloadXlsx{display:inline-flex;align-items:center;justify-content:center}
#downloadXlsx .btn-icon{display:block;margin-right:7px}

@keyframes backdropIn{from{opacity:0}to{opacity:1}}
@keyframes modalIn{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}

@media(max-width:1100px){
  .ledger-grid{grid-template-columns:repeat(2,minmax(280px,1fr))}
}
@media(max-width:900px){
  .topbar{padding:24px 20px;flex-direction:column;align-items:flex-start}
  .actions{justify-content:flex-start}
  .shell{margin-top:20px}
  .tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ledger-grid{grid-template-columns:1fr}
  .statements{grid-template-columns:1fr}
  .card-head{align-items:flex-start;flex-direction:column}
  .card-head .btn{align-self:flex-start}
  .col-account{min-width:240px}
}
@media(max-width:600px){
  .topbar{padding:22px 16px}
  .topbar h1{font-size:29px}
  .actions{width:100%}
  .actions .btn,.actions .file-btn{flex:1 1 calc(50% - 5px)}
  .shell{padding:0 12px;margin-bottom:30px}
  .tabs{padding:4px;border-radius:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
  .tab{padding:10px 9px;font-size:13px}
  .card{border-radius:14px}
  .card-head{min-height:0;padding:16px}
  .card-head h2{font-size:15px}
  .card-body{padding:14px}
  .row-actions.between{align-items:stretch;flex-direction:column}
  .row-actions.between .btn,.row-actions.between .status-box{width:100%;justify-content:center}
  .entry-box{padding:14px}
  .entry-head{align-items:flex-start;flex-direction:column}
  .date-field{width:100%;justify-content:space-between}
  .modal-actions .btn{flex:1}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}

/* ========================================================================== 
   PROFESSIONAL UI REFRESH — visual layer only
   No HTML / JavaScript structure or behavior changes required.
   ========================================================================== */

:root{
  --navy-950:#07182b;
  --navy-900:#0c2642;
  --navy-800:#133a61;
  --navy-700:#1d4f80;
  --blue-700:#2463a8;
  --blue-600:#3079c8;
  --blue-500:#4b91db;
  --blue-100:#e7f1fb;
  --blue-50:#f4f9fe;
  --paper:#eef3f8;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --ink:#152337;
  --muted:#66758a;
  --muted-2:#8b99aa;
  --line:#dbe4ee;
  --line-strong:#c8d5e3;
  --ok:#13724b;
  --ok-bg:#edf9f3;
  --ok-line:#b7e0ca;
  --danger:#b42333;
  --danger-bg:#fff1f3;
  --danger-line:#f0c2c8;
  --warning:#9a6414;
  --shadow-xs:0 1px 2px rgba(11,31,52,.04);
  --shadow-sm:0 2px 5px rgba(11,31,52,.04),0 8px 22px rgba(11,31,52,.05);
  --shadow-md:0 4px 10px rgba(11,31,52,.05),0 18px 48px rgba(11,31,52,.08);
  --shadow-lg:0 30px 90px rgba(4,18,33,.28);
  --radius-sm:9px;
  --radius-md:14px;
  --radius-lg:20px;
  --focus:0 0 0 4px rgba(48,121,200,.15);
}

html{scroll-behavior:smooth}
body{
  background:
    radial-gradient(circle at 0 0,rgba(48,121,200,.11),transparent 31rem),
    radial-gradient(circle at 100% 2%,rgba(76,145,219,.08),transparent 29rem),
    linear-gradient(180deg,#f7fafc 0,#f1f5f9 25rem,#edf2f7 100%);
  color:var(--ink);
  letter-spacing:-.005em;
}

::selection{background:#cfe5fb;color:var(--navy-950)}

/* Header ------------------------------------------------------------------ */
.topbar{
  min-height:128px;
  padding:27px max(32px,calc((100vw - 1500px)/2 + 20px));
  background:linear-gradient(118deg,#071a2e 0%,#0c2b4a 48%,#174c78 100%);
  border-bottom:1px solid rgba(255,255,255,.10);
  box-shadow:0 18px 48px rgba(7,24,43,.16);
}
.topbar::before{
  inset:auto -120px -210px auto;
  width:470px;
  height:470px;
  border-color:rgba(255,255,255,.075);
  box-shadow:0 0 0 72px rgba(255,255,255,.025),0 0 0 145px rgba(255,255,255,.016);
}
.topbar h1{
  margin-top:7px;
  font-size:clamp(29px,3vw,40px);
  line-height:1.04;
  letter-spacing:-.045em;
  font-weight:780;
  text-shadow:0 1px 1px rgba(0,0,0,.08);
}
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:0;
  color:#bdd8ef;
  font-size:10.5px;
  letter-spacing:.2em;
}
.actions{gap:10px}
.topbar .btn{
  min-height:40px;
  padding:9px 14px;
  border-radius:11px;
  font-size:12.5px;
}
.topbar .btn.secondary{
  background:rgba(255,255,255,.095);
  border-color:rgba(255,255,255,.17);
  color:#f8fbff;
  box-shadow:inset 0 1px rgba(255,255,255,.06),0 4px 12px rgba(0,0,0,.07);
}
.topbar .btn.secondary:hover{
  background:rgba(255,255,255,.15);
  border-color:rgba(255,255,255,.29);
  box-shadow:inset 0 1px rgba(255,255,255,.08),0 7px 18px rgba(0,0,0,.10);
}
.topbar .btn.danger{
  background:rgba(220,55,69,.14);
  color:#ffdce0;
  border-color:rgba(255,188,195,.26);
}
.topbar .btn.danger:hover{background:rgba(220,55,69,.24);color:#fff2f3}

/* Shell + tab navigation --------------------------------------------------- */
.shell{max-width:1500px;margin:25px auto 56px;padding:0 20px}
.tabs{
  gap:6px;
  padding:6px;
  border-radius:16px;
  border:1px solid rgba(199,211,224,.86);
  background:rgba(255,255,255,.82);
  box-shadow:0 3px 8px rgba(11,31,52,.035),0 13px 34px rgba(11,31,52,.055);
  -webkit-backdrop-filter:blur(14px) saturate(1.15);
  backdrop-filter:blur(14px) saturate(1.15);
}
.tab{
  min-height:43px;
  padding:10px 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0;
  border-radius:11px;
  color:#5d6d81;
  font-size:13.5px;
  font-weight:730;
  overflow:hidden;
}
.tab:hover{background:#f2f7fc;color:var(--navy-800)}
.tab.active{
  background:linear-gradient(135deg,#133a61,#1d527f);
  color:#fff;
  box-shadow:0 6px 16px rgba(19,58,97,.22),inset 0 1px rgba(255,255,255,.09);
}
.content{margin-top:18px}

/* Cards ------------------------------------------------------------------- */
.card{
  border-color:rgba(210,221,232,.95);
  border-radius:var(--radius-lg);
  background:rgba(255,255,255,.97);
  box-shadow:var(--shadow-md);
}
.card-head{
  min-height:70px;
  padding:18px 22px;
  border-bottom-color:#dfe7ef;
  background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);
}
.card-head h2,.card-head h3{
  position:relative;
  padding-left:0;
  color:var(--navy-900);
  font-size:16px;
  letter-spacing:.045em;
  font-weight:800;
}
.card-body{padding:22px}

/* Buttons ----------------------------------------------------------------- */
.btn{
  min-height:39px;
  gap:7px;
  padding:9px 13px;
  border-radius:10px;
  font-size:12.5px;
  font-weight:740;
  letter-spacing:0;
  box-shadow:var(--shadow-xs);
  transition:transform .12s ease,box-shadow .18s ease,background-color .18s ease,border-color .18s ease,color .18s ease,filter .18s ease;
}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0);filter:saturate(.96)}
.btn.primary{
  background:linear-gradient(180deg,#3c84ce 0%,#2869ae 100%);
  border-color:#245f9d;
  box-shadow:0 4px 10px rgba(36,99,168,.17),inset 0 1px rgba(255,255,255,.14);
}
.btn.primary:hover{
  background:linear-gradient(180deg,#468ed8 0%,#2b70b9 100%);
  box-shadow:0 7px 17px rgba(36,99,168,.23),inset 0 1px rgba(255,255,255,.16);
}
.btn.secondary{
  background:linear-gradient(180deg,#fff,#f9fbfd);
  border-color:#cbd7e3;
  color:#294866;
}
.btn.secondary:hover{background:#f4f8fc;border-color:#b6c8da;color:#183c60;box-shadow:0 4px 10px rgba(11,31,52,.07)}
.btn.danger{background:#fff8f8;border-color:#efc8cd;color:#af2634}
.btn.danger:hover{background:#fff0f2;border-color:#e8b3ba;color:#9f1e2c}
.btn.small{min-height:31px;padding:6px 9px;border-radius:8px;font-size:11.5px}
.btn-icon{width:15.5px;height:15.5px;margin-right:0;stroke-width:1.9}
#downloadXlsx .btn-icon{margin-right:0}

/* CSS-only icons for dynamically generated controls. */
#resetAll::before,#zeroBalances::before,#resetJournal::before,#addAccount::before,
#addDraft::before,#post::before,#generateStatement::before,.delete-account::before,
.delete-reg::before,.d-del::before,#modalYes::before,#modalNo::before,
#modalCancel::before,#modalGenerate::before{
  content:"";
  width:15px;
  height:15px;
  flex:0 0 15px;
  background-color:currentColor;
  -webkit-mask-repeat:no-repeat;
  -webkit-mask-position:center;
  -webkit-mask-size:contain;
  mask-repeat:no-repeat;
  mask-position:center;
  mask-size:contain;
}
#addAccount::before,#addDraft::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}
#post::before,#modalGenerate::before,#generateStatement::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4 4L19 6.5'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4 4L19 6.5'/%3E%3C/svg%3E");
}
#resetAll::before,#zeroBalances::before,#resetJournal::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7v5h5'/%3E%3Cpath d='M5.7 16a7 7 0 1 0 .5-8.6L4 12'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7v5h5'/%3E%3Cpath d='M5.7 16a7 7 0 1 0 .5-8.6L4 12'/%3E%3C/svg%3E");
}
.delete-account::before,.delete-reg::before,.d-del::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7h14M9 7V4h6v3M8 10v8M12 10v8M16 10v8M7 7l1 14h8l1-14'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7h14M9 7V4h6v3M8 10v8M12 10v8M16 10v8M7 7l1 14h8l1-14'/%3E%3C/svg%3E");
}
#modalYes::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4 4L19 6.5'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4 4L19 6.5'/%3E%3C/svg%3E");
}
#modalNo::before,#modalCancel::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E");
}

/* Tables + form controls --------------------------------------------------- */
.table-wrap{
  border-color:#d8e2ec;
  border-radius:14px;
  background:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7),0 2px 8px rgba(11,31,52,.035);
}
.sheet{font-size:12.75px}
.sheet th{
  background:linear-gradient(180deg,#f3f7fb 0%,#edf3f8 100%);
  color:#425f7c;
  padding:11px 10px;
  border-bottom-color:#cbd8e5;
  border-right-color:#d9e3ec;
  font-size:10.5px;
  letter-spacing:.065em;
}
.sheet td{
  border-bottom-color:#e5ebf1;
  border-right-color:#edf1f5;
  padding:7px;
}
.sheet tbody tr:nth-child(even) td{background:#fdfefe}
.sheet tbody tr:hover td{background:#f6faff}
.sheet input,.sheet select,.modal-number,.date-field input{
  min-height:37px;
  border-color:#ccd8e4;
  border-radius:9px;
  padding:7px 10px;
  color:#17283a;
  background:#fff;
  box-shadow:0 1px 2px rgba(13,36,58,.025),inset 0 1px 1px rgba(13,36,58,.015);
}
.sheet input:hover,.sheet select:hover,.modal-number:hover,.date-field input:hover{border-color:#aebfd1}
.sheet input:focus,.sheet select:focus,.modal-number:focus,.date-field input:focus{
  border-color:#4b91db;
  box-shadow:0 0 0 3px rgba(48,121,200,.12),0 1px 2px rgba(13,36,58,.04);
}
.sheet input::placeholder{color:#9aa8b7}
.sheet select{background-color:#fff}
.registration-shared{background:#f6f9fc!important}
.registration-label{color:#4b6682}
.journal-table .registration-start td{border-top-color:#95acc3}
.journal-table .registration-end td{border-bottom-color:#c4d2df}
.delete-registration{background:#f8fafc!important}

/* Action rows + states ----------------------------------------------------- */
.row-actions{gap:10px;margin-top:17px}
.status-box{
  min-height:35px;
  padding:8px 12px;
  gap:8px;
  border-radius:999px;
  font-size:11.75px;
  font-weight:750;
  box-shadow:0 1px 2px rgba(11,31,52,.025);
}
.status-box::before{width:7px;height:7px;box-shadow:0 0 0 4px rgba(100,116,139,.08)}
.status-box.ok{background:#effaf4;border-color:#b8e2ca}
.status-box.bad{background:#fff2f3;border-color:#efc5ca}
.status-box.neutral{background:#f4f7f9;border-color:#d9e1e8}

/* New journal entry ------------------------------------------------------- */
.entry-box{
  margin-top:25px;
  border-color:#cfdeec;
  border-radius:16px;
  padding:18px;
  background:
    linear-gradient(180deg,rgba(247,251,255,.98),rgba(243,248,252,.98));
  box-shadow:inset 0 1px 0 #fff;
}
.entry-head h3{font-size:14px;letter-spacing:.015em;color:#173a5d}
.date-field{color:#54687d}
.date-field input{font-variant-numeric:tabular-nums}

/* Ledger ------------------------------------------------------------------ */
.ledger-grid{gap:17px}
.ledger{
  border-color:#d8e2eb;
  border-radius:14px;
  box-shadow:0 2px 6px rgba(11,31,52,.035),0 10px 24px rgba(11,31,52,.04);
}
.ledger:hover{transform:translateY(-2px);border-color:#c3d4e4;box-shadow:0 4px 10px rgba(11,31,52,.05),0 16px 34px rgba(11,31,52,.075)}
.ledger h3{
  padding:13px 14px;
  background:linear-gradient(180deg,#f0f6fb,#e8f0f8);
  border-bottom-color:#ccdae7;
  color:#244d73;
  font-size:11px;
  letter-spacing:.07em;
}
.taccount th,.taccount td{border-color:#e3eaf1;padding:7.5px}
.taccount th{background:#fafbfd;color:#697a8d}
.taccount tbody tr:hover td{background:#f8fbfd}
.taccount .balance td{background:#eef4f9;color:#163a5c;border-top-color:#aebfd0}
.empty-ledger{
  padding:54px 24px;
  border-color:#bac9d7;
  border-radius:14px;
  background:linear-gradient(180deg,#fbfdff,#f8fafc);
}

/* Statements -------------------------------------------------------------- */
.statements{gap:19px}
.statement{
  border-color:#d8e2eb;
  border-radius:14px;
  box-shadow:0 2px 6px rgba(11,31,52,.035),0 10px 24px rgba(11,31,52,.04);
}
.statement h3{
  padding:13px 15px;
  background:linear-gradient(180deg,#f0f6fb,#e8f1f9);
  color:#254e74;
  border-bottom-color:#ccd9e6;
  font-size:11px;
  letter-spacing:.08em;
}
.statement .line{padding:9.5px 14px;border-bottom-color:#e8edf2}
.statement .line:nth-child(even){background:#fbfdff}
.statement .line.total{background:#f3f7fa;border-top-color:#9fb2c5}
.statement .line.difference{background:#edf5fc;color:#2f5981}
.statement .line.equal{background:#e7f0f8;border-top-color:#afc1d2}
.imbalance{border-radius:11px;box-shadow:inset 3px 0 var(--danger)}

/* Modals + notifications -------------------------------------------------- */
.modal-backdrop{
  background:rgba(5,20,36,.61);
  -webkit-backdrop-filter:blur(7px);
  backdrop-filter:blur(7px);
}
.modal{
  border-radius:19px;
  border-color:rgba(201,213,225,.94);
  box-shadow:var(--shadow-lg);
}
.modal-head{padding:19px 21px;background:linear-gradient(180deg,#fff,#f8fafc)}
.modal-head h3{font-size:16px;letter-spacing:-.01em}
.modal-body{padding:21px}
.modal-body p{color:#405268;line-height:1.6}
.modal-actions{padding:14px 20px;background:#f9fbfd}
.modal-error{border-radius:9px}
.toast{
  right:24px;
  bottom:24px;
  padding:13px 16px;
  border-radius:12px;
  background:linear-gradient(135deg,#0d2a47,#143d64);
  border-color:rgba(255,255,255,.11);
  box-shadow:0 18px 45px rgba(5,20,36,.27);
}

/* Responsive refinements -------------------------------------------------- */
@media(max-width:900px){
  .topbar{min-height:0;padding:24px 20px;gap:20px}
  .topbar h1{font-size:31px}
  .tabs{gap:5px}
  .tab{min-height:42px;padding:10px 12px}
  .card-head h2,.card-head h3{padding-left:12px}
}
@media(max-width:600px){
  .topbar{padding:21px 16px 23px}
  .topbar h1{font-size:28px}
  .eyebrow{font-size:9.5px}
  .actions{gap:8px}
  .actions .btn,.actions .file-btn{min-width:0}
  .shell{padding:0 11px;margin-top:15px}
  .tabs{padding:4px;border-radius:13px}
  .tab{min-height:41px;gap:7px;padding:9px 7px;font-size:12.2px}
  .card{border-radius:16px}
  .card-head{padding:15px}
  .card-head h2,.card-head h3{font-size:14px}
  .card-body{padding:13px}
  .entry-box{padding:13px;border-radius:13px}
  .toast{right:14px;bottom:14px;max-width:calc(100vw - 28px)}
}
@media(max-width:410px){
  .tab{font-size:11.5px}
  .topbar .btn{font-size:11.5px;padding-inline:10px}
}

/* Requested interaction refinements -------------------------------------- */
@keyframes statusAttentionPulse{
  0%,100%{transform:scale(1)}
  35%{transform:scale(1.045)}
  65%{transform:scale(.99)}
}
.status-box.attention-pulse,.journal-date-error.attention-pulse{
  animation:statusAttentionPulse .48s ease-in-out;
  transform-origin:center;
}
.sortable-th{cursor:pointer;user-select:none}
.sortable-th:hover{background:linear-gradient(180deg,#eef5fb 0%,#e7f0f8 100%)}
.sortable-th:focus-visible{outline:2px solid #4b91db;outline-offset:-2px}
.sort-indicator{display:inline-block;min-width:18px;margin-left:6px;font-size:9px;letter-spacing:-.5px;vertical-align:1px;opacity:.7;transition:opacity .15s ease,transform .15s ease}
.sortable-th:hover .sort-indicator{opacity:.92}
.sort-indicator.active{opacity:1;letter-spacing:0;font-size:10px}
.journal-status-row{align-items:center}
.journal-status-list{display:inline-flex;flex-direction:column;align-items:flex-start;gap:6px}
.journal-date-error{
  display:none;
  color:var(--danger);
  font-size:12px;
  font-weight:760;
  line-height:1.3;
}
.journal-date-error.show{display:inline-block}
.ledger-filter-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.ledger-filter-group{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.ledger-filter-group label{
  color:#425f7c;
  font-size:13px;
  font-weight:760;
  white-space:nowrap;
}
.ledger-nature-select{
  min-width:250px;
  min-height:33px;
  height:33px;
  font-size:13px;
  border:1px solid #ccd8e4;
  border-radius:9px;
  padding:5px 32px 5px 10px;
  background:#fff;
  color:#17283a;
  box-shadow:0 1px 2px rgba(13,36,58,.025),inset 0 1px 1px rgba(13,36,58,.015);
  cursor:pointer;
}
.ledger-nature-select:hover{border-color:#aebfd1}
.ledger-nature-select:focus{outline:none;border-color:#4b91db;box-shadow:0 0 0 3px rgba(48,121,200,.12),0 1px 2px rgba(13,36,58,.04)}
@media(max-width:720px){
  .ledger-filter-row,.ledger-filter-group{align-items:stretch;flex-direction:column}
  .ledger-filter-group{gap:7px}
  .ledger-filter-group label{white-space:normal}
  .ledger-nature-select,.ledger-filter-row .btn{width:100%;min-width:0}
}

/* Saldi iniziali mutuamente esclusivi */
.initial-balance-locked{opacity:.52;background:#f1f4f7!important;cursor:not-allowed}


/* Existing journal dates are mandatory: hide browser clear affordance where supported. */
.j-date::-webkit-clear-button{
  display:none;
  -webkit-appearance:none;
}
.j-date::-ms-clear{
  display:none;
  width:0;
  height:0;
}


/* v11: usability refinements */
.sticky-table-wrap{
  max-height:min(62vh,620px);
  overflow:auto;
}
.sticky-table-wrap .sheet th{
  z-index:4;
  box-shadow:0 1px 0 #cbd8e5;
}
@media(max-width:600px){
  .sticky-table-wrap{max-height:68vh}
}
