:root{
  --bg:#f7f9ff;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#7c86a5;
  --blue:#3b5bff;
  --blue2:#2563eb;
  --green:#16a34a;
  --greenBg:#e9fbea;
  --red:#ef4444;
  --redBg:#feecec;
  --orange:#f97316;
  --orangeBg:#fff3e5;
  --line:#e9edf7;
  --shadow:0 14px 36px rgba(15,23,42,.08);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif}
button,input,select,textarea{font:inherit}
button{border:0;background:none;color:inherit}
.app{max-width:740px;margin:0 auto;padding:24px 16px 98px}
.top{display:flex;justify-content:space-between;align-items:flex-start;padding-top:env(safe-area-inset-top)}
.eyebrow{margin:0 0 6px;color:var(--blue);text-transform:uppercase;letter-spacing:.12em;font-weight:800;font-size:12px}
h1{margin:0;font-size:34px;letter-spacing:-.04em}
.subtitle{margin:6px 0 0;color:var(--muted);font-size:16px}
.iconBtn{width:46px;height:46px;border-radius:18px;background:#fff;box-shadow:var(--shadow);font-size:32px;line-height:1}
.segmented{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:18px;background:#fff;border:1px solid var(--line);padding:6px;border-radius:24px;box-shadow:0 10px 28px rgba(15,23,42,.05)}
.segmented.big{grid-template-columns:1fr 1fr;background:transparent;border:0;box-shadow:none;padding:0}
.segmented button{border-radius:18px;padding:13px 10px;color:#7c86a5;font-weight:800}
.segmented.big button{background:#fff;border:1px solid var(--line);box-shadow:0 10px 24px rgba(15,23,42,.06);font-size:17px}
.segmented button.active{background:linear-gradient(135deg,#536dfe,#3154f4);color:white;box-shadow:0 10px 24px rgba(59,91,255,.28)}
.monthRow{display:grid;grid-template-columns:48px 1fr 48px;gap:8px;margin:14px 0}
.monthRow button,.monthRow input{height:46px;border-radius:16px;background:#fff;border:1px solid var(--line);box-shadow:0 8px 20px rgba(15,23,42,.04);text-align:center;font-weight:900;color:var(--text)}
.monthRow button{font-size:28px}
.summary{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:18px 0 24px;overflow:auto;padding-bottom:4px}
.summary article{min-width:150px;background:#fff;border:1px solid var(--line);border-radius:24px;padding:16px;box-shadow:var(--shadow)}
.summary span{display:block;color:#737d9e;font-weight:700;font-size:14px}
.summary strong{display:block;margin-top:12px;font-size:22px;letter-spacing:-.04em}
.summary small{display:block;color:var(--muted);font-weight:700;margin-top:8px}
.summary article:nth-child(3) strong{color:var(--green)}
.summary article:nth-child(4) strong{color:var(--red)}
.sectionTitle{display:flex;align-items:center;justify-content:space-between;margin:12px 0}
.sectionTitle h2{margin:0;font-size:24px;letter-spacing:-.04em}
.sectionTitle button{color:var(--blue);font-weight:900}
.list{display:flex;flex-direction:column;gap:12px}
.bill{display:grid;grid-template-columns:84px 1fr auto;gap:14px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:24px;padding:10px 12px 10px 0;box-shadow:0 12px 30px rgba(15,23,42,.06);overflow:hidden}
.dateBox{align-self:stretch;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:92px;border-radius:0 20px 20px 0;background:var(--greenBg);color:var(--green);border-left:4px solid var(--green);font-weight:900}
.dateBox .day{font-size:27px;line-height:1}
.dateBox .mon{font-size:13px;text-transform:uppercase;margin-top:2px}
.dateBox .left{font-size:13px;margin-top:9px}
.dateBox.orange{background:var(--orangeBg);color:var(--orange);border-left-color:var(--orange)}
.dateBox.red{background:var(--redBg);color:var(--red);border-left-color:var(--red)}
.billMain{min-width:0}
.billTitle{font-size:18px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.billMeta{color:var(--muted);font-weight:700;margin-top:4px;font-size:14px}
.billDate{color:var(--blue);font-weight:800;margin-top:7px;font-size:14px}
.badges{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.badge{border-radius:999px;padding:5px 9px;font-size:12px;font-weight:900}
.badge.green{background:var(--greenBg);color:var(--green)}
.badge.blue{background:#eef2ff;color:var(--blue)}
.badge.orange{background:var(--orangeBg);color:var(--orange)}
.badge.red{background:var(--redBg);color:var(--red)}
.billSide{text-align:right;min-width:88px}
.amount{font-size:18px;font-weight:950;color:var(--green)}
.amount.orange{color:var(--orange)}
.amount.red{color:var(--red)}
.repeat{color:var(--muted);font-weight:800;font-size:13px;margin-top:8px}
.billActions{display:flex;gap:6px;justify-content:flex-end;margin-top:10px}
.billActions button{background:#f3f6ff;border-radius:12px;padding:8px;color:var(--blue);font-weight:900}
.empty{text-align:center;background:#fff;border:1px dashed #dbe2f3;border-radius:24px;padding:42px 16px;color:var(--muted);font-weight:700}
.fab{position:fixed;right:22px;bottom:92px;width:66px;height:66px;border-radius:50%;background:linear-gradient(135deg,#536dfe,#3154f4);color:#fff;font-size:42px;box-shadow:0 16px 36px rgba(59,91,255,.38);z-index:5}
.bottomNav{position:fixed;left:0;right:0;bottom:0;background:rgba(255,255,255,.92);backdrop-filter:blur(18px);border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(5,1fr);padding:10px 8px calc(10px + env(safe-area-inset-bottom));z-index:4}
.bottomNav button{display:flex;flex-direction:column;align-items:center;gap:4px;color:#6f7895;font-weight:800;font-size:21px}
.bottomNav span{font-size:11px}
.bottomNav button.active{color:var(--blue)}
dialog{border:0;border-radius:28px;width:min(560px,calc(100% - 22px));padding:0;background:#fff;color:var(--text);box-shadow:0 24px 80px rgba(15,23,42,.24)}
dialog::backdrop{background:rgba(15,23,42,.42);backdrop-filter:blur(4px)}
.sheet{padding:18px}
.sheetHead{display:flex;justify-content:space-between;align-items:center;gap:10px}
.sheet h2{margin:0;font-size:24px;letter-spacing:-.04em}
.ghost{background:#f2f5fb;border-radius:14px;padding:10px 12px;color:#64708d;font-weight:900}
label{display:block;margin-top:13px;color:#6f7895;font-size:13px;font-weight:800}
input,select,textarea{width:100%;margin-top:7px;border:1px solid var(--line);border-radius:16px;padding:13px;background:#fbfcff;color:var(--text);outline:none}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.primary{background:linear-gradient(135deg,#536dfe,#3154f4);color:white;font-weight:950;border-radius:18px;padding:14px 16px}
.full{width:100%;margin-top:18px}
.hint{color:var(--muted);font-weight:700;line-height:1.4}
.check{display:flex;align-items:center;gap:10px;color:var(--text);font-size:16px}
.check input{width:24px;height:24px;margin:0}
.importBox{display:block;text-align:center;background:#f3f6ff;border:1px dashed #c9d4f5;border-radius:18px;padding:16px;color:var(--blue);font-weight:950}
.importBox input{display:none}
@media(max-width:540px){
  .app{padding-left:14px;padding-right:14px}
  .summary{grid-template-columns:repeat(4,150px)}
  .bill{grid-template-columns:78px 1fr;gap:10px}
  .billSide{grid-column:2;text-align:left;display:flex;align-items:center;justify-content:space-between;gap:12px}
  .billActions{margin-top:0}
  .grid2{grid-template-columns:1fr}
}


/* ULTRA COMPACT MODE */
.app{padding:10px 8px 70px;}
.top{padding-top:calc(2px + env(safe-area-inset-top));}
.eyebrow{font-size:9px;margin-bottom:2px;}
h1{font-size:24px;}
.subtitle{font-size:12px;margin-top:2px;}
.iconBtn{width:34px;height:34px;border-radius:12px;font-size:22px;}

.segmented{margin-top:7px;padding:3px;border-radius:15px;gap:4px;}
.segmented button{padding:7px 6px;border-radius:12px;font-size:12px;}
.segmented.big button{font-size:13px;padding:8px 6px;}

.monthRow{grid-template-columns:34px 1fr 34px;gap:5px;margin:7px 0;}
.monthRow button,.monthRow input{height:32px;border-radius:11px;font-size:12px;}
.monthRow button{font-size:20px;}

.summary{gap:6px;margin:8px 0 10px;}
.summary article{min-width:102px;border-radius:15px;padding:8px;}
.summary span{font-size:10px;}
.summary strong{font-size:15px;margin-top:4px;}
.summary small{font-size:10px;margin-top:2px;}

.sectionTitle{margin:6px 0;}
.sectionTitle h2{font-size:18px;}
.sectionTitle button{font-size:12px;}

.list{gap:5px;}
.bill{grid-template-columns:52px 1fr auto;gap:6px;border-radius:13px;padding:5px 6px 5px 0;}
.dateBox{min-height:58px;border-radius:0 11px 11px 0;border-left-width:3px;}
.dateBox .day{font-size:18px;}
.dateBox .mon{font-size:9px;margin-top:0;}
.dateBox .left{font-size:9px;margin-top:3px;}

.billTitle{font-size:13px;}
.billMeta{font-size:10px;margin-top:1px;}
.billDate{font-size:10px;margin-top:2px;}
.badges{gap:3px;margin-top:3px;}
.badge{font-size:9px;padding:2px 5px;}

.billSide{min-width:64px;}
.amount{font-size:13px;}
.repeat{font-size:9px;margin-top:2px;}
.billActions{gap:3px;margin-top:4px;}
.billActions button{padding:4px 5px;border-radius:8px;font-size:9px;}

.fab{width:48px;height:48px;right:12px;bottom:62px;font-size:30px;}
.bottomNav{padding:5px 4px calc(5px + env(safe-area-inset-bottom));}
.bottomNav button{font-size:16px;gap:1px;}
.bottomNav span{font-size:9px;}

.sheet{padding:14px;}
.sheet h2{font-size:20px;}
.ghost{padding:8px 10px;border-radius:12px;font-size:12px;}
label{margin-top:9px;font-size:12px;}
input,select,textarea{padding:10px;border-radius:12px;font-size:14px;}
.primary{padding:11px 12px;border-radius:14px;}

@media(max-width:540px){
  .summary{grid-template-columns:repeat(4,102px);}
  .bill{grid-template-columns:52px 1fr;}
  .billSide{grid-column:2;display:flex;align-items:center;justify-content:space-between;min-width:0;}
  .billActions{margin-top:0;}
}

@media(max-width:380px){
  .billTitle{font-size:12.5px;}
  .amount{font-size:12.5px;}
  .billActions button{font-size:8.5px;padding:4px;}
}


/* FIX 2026-04: baza tab, bigger buttons, month nav */
.segmented{
  grid-template-columns:repeat(4,1fr);
}
.segmented.big{
  grid-template-columns:1fr 1fr;
}
.segmented button{
  padding:9px 7px !important;
  font-size:13px !important;
}
.segmented.big button{
  padding:10px 8px !important;
  font-size:14px !important;
}
.monthRow button,
.monthRow input{
  height:38px !important;
  font-size:14px !important;
}
.monthRow button{
  font-size:24px !important;
  font-weight:900;
}
.billActions button{
  padding:6px 8px !important;
  font-size:10.5px !important;
}
.bottomNav button{
  font-size:18px !important;
}
.bottomNav span{
  font-size:10px !important;
}
.blueBox{
  background:#eef2ff !important;
  color:#3154f4 !important;
  border-left-color:#3154f4 !important;
}
.databaseBill .dateBox .day{
  font-size:20px !important;
}
.noteLine{
  margin-top:5px;
  white-space:normal;
}
@media(max-width:540px){
  .segmented:not(.big){
    grid-template-columns:repeat(4,1fr);
  }
}
@media(max-width:390px){
  .segmented button{
    font-size:12px !important;
    padding:8px 5px !important;
  }
}


/* PRO MAX v1 */
.billActions{
  flex-wrap:wrap;
}
.billActions button{
  padding:6px 7px !important;
  font-size:10px !important;
}
.secondary{
  background:#eef2ff;
  color:#3154f4;
  font-weight:950;
  border-radius:14px;
  padding:11px 12px;
}
.syncBox{
  margin-top:12px;
  padding:12px;
  border-radius:16px;
  background:#f7f9ff;
  border:1px solid #e3e9fb;
}
.syncBox strong{
  display:block;
  color:#0f172a;
  font-size:14px;
}
.syncBox span{
  display:block;
  color:#7c86a5;
  margin-top:4px;
  font-size:12px;
  line-height:1.35;
}
@media(max-width:540px){
  .billActions{
    max-width:150px;
    justify-content:flex-end;
  }
}


/* PRO MAX v3 - delete from base */
.dangerBtn{
  background:#feecec !important;
  color:#ef4444 !important;
  font-weight:950 !important;
}
