/* Budget App UI v12 - iOS-like light dashboard */

:root{
  --bg:#f3f6ff;
  --bg2:#f7f9ff;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#6b768d;
  --border:rgba(11,18,32,.08);
  --shadow:0 16px 34px rgba(11,18,32,.08);
  --shadow2:0 10px 22px rgba(11,18,32,.06);
  --radius:18px;
  --radius2:24px;

  --primary:#4f6cff;      /* blue */
  --primary2:#2ad1c3;     /* teal */
  --danger:#ff4d6d;
  --ring:0 0 0 4px rgba(79,108,255,.18);

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(900px 520px at 10% -15%, rgba(79,108,255,.14), transparent 60%),
    radial-gradient(900px 520px at 95% 0%, rgba(42,209,195,.12), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

a{color:inherit}
.small{color:var(--muted); font-size:13px}
.muted{color:var(--muted)}
.page{padding:14px; padding-bottom:104px;}
.container{max-width:980px; margin:0 auto;}

h1{margin:0; font-size:22px; letter-spacing:-.03em}
h2{margin:0; font-size:14px; letter-spacing:-.01em; color:var(--muted); font-weight:900}
hr{border:none; border-top:1px solid var(--border); margin:14px 0}

/* Header (like screenshot) */
.appHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:4px 2px 14px 2px;
}
.headerLeft .title{font-weight:1200; font-size:24px; letter-spacing:-.03em}
.headerLeft .sub{margin-top:4px; color:var(--muted); font-size:13px}
.headerRight{display:flex; align-items:center; gap:10px}
.iconBtn{
  width:38px; height:38px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.78);
  box-shadow:var(--shadow2);
  display:flex; align-items:center; justify-content:center;
}
.avatar{
  width:38px; height:38px;
  border-radius:14px;
  border:1px solid var(--border);
  background:linear-gradient(135deg, rgba(79,108,255,.18), rgba(42,209,195,.16));
  display:flex; align-items:center; justify-content:center;
  font-weight:1200;
}

/* Cards */
.card{
  border-radius:var(--radius2);
  border:1px solid var(--border);
  background:rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  padding:16px;
}
.cardFlat{
  border-radius:var(--radius2);
  border:1px solid var(--border);
  background:rgba(255,255,255,.92);
  box-shadow: var(--shadow2);
  padding:16px;
}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.grid3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px}
@media(max-width:720px){.grid3{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.grid2,.grid3{grid-template-columns:1fr}}

.kpi{
  border-radius:18px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.86);
  box-shadow: var(--shadow2);
  padding:14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.kpi .l{color:var(--muted); font-size:12px; font-weight:900}
.kpi .v{margin-top:6px; font-size:20px; font-weight:1200; letter-spacing:-.02em}
.kpi .ico{
  width:36px;height:36px;border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(79,108,255,.18);
  background:linear-gradient(135deg, rgba(79,108,255,.12), rgba(42,209,195,.10));
}

/* Section heading row */
.sectionRow{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin:14px 2px 10px 2px;
}
.sectionRow .label{font-weight:1200; letter-spacing:-.02em}
.pill{
  display:inline-flex; align-items:center; justify-content:center;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(11,18,32,.03);
  color:var(--muted);
  font-size:12px;
  font-weight:1000;
  text-decoration:none;
}

/* Simple chart (bars/line placeholder) */
.chart{
  border-radius:18px;
  border:1px solid var(--border);
  background:rgba(11,18,32,.02);
  padding:12px;
}
.bars{
  display:flex; align-items:flex-end; gap:10px; height:120px;
  padding:10px 6px 2px 6px;
}
.bar{
  flex:1;
  border-radius:12px;
  background:rgba(79,108,255,.22);
}
.bar.strong{background:rgba(79,108,255,.78)}
.xlab{display:flex; gap:10px; margin-top:8px; color:var(--muted); font-size:11px; justify-content:space-between; padding:0 6px}

/* Lists */
.list{display:grid; gap:10px}
.item{
  border-radius:18px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.88);
  box-shadow:var(--shadow2);
  padding:12px;
}
.itemRow{display:flex; align-items:center; justify-content:space-between; gap:12px}
.itemLeft{display:flex; gap:10px; align-items:center}
.itemAvatar{
  width:38px;height:38px;border-radius:14px;
  border:1px solid var(--border);
  background:linear-gradient(135deg, rgba(79,108,255,.12), rgba(42,209,195,.10));
  display:flex; align-items:center; justify-content:center;
  font-weight:1100;
}
.itemTitle{font-weight:1100}
.itemSub{color:var(--muted); font-size:12px; margin-top:2px}
.amount{font-weight:1200; letter-spacing:-.01em}

/* Forms */
.form{display:grid; gap:12px}
label{display:grid; gap:8px; font-weight:1000}
input, select, textarea{
  width:100%;
  border-radius:16px;
  padding:12px 12px;
  background:rgba(11,18,32,.03);
  border:1px solid var(--border);
  color:var(--text);
  outline:none;
}
textarea{min-height:90px; resize:vertical}
input:focus, select:focus, textarea:focus{box-shadow:var(--ring); border-color:rgba(79,108,255,.45)}
::placeholder{color:rgba(107,118,141,.70)}
input[type="file"]{padding:10px}

/* Buttons */
button, .btn{
  cursor:pointer;
  border:none;
  border-radius:16px;
  padding:12px 14px;
  font-weight:1100;
  color:#fff;
  background: linear-gradient(135deg, rgba(79,108,255,1), rgba(42,209,195,.95));
  box-shadow: 0 14px 26px rgba(79,108,255,.16);
}
button.secondary, .btn.secondary{
  color:var(--text);
  background:rgba(11,18,32,.04);
  border:1px solid var(--border);
  box-shadow:none;
}
button:active, .btn:active{transform:translateY(1px)}

/* Alerts */
.alert{
  border-radius:18px;
  padding:12px 14px;
  border:1px solid rgba(79,108,255,.22);
  background:rgba(79,108,255,.10);
}
.alert.danger{border-color:rgba(255,77,109,.35); background:rgba(255,77,109,.10)}

/* Bottom tab bar (like screenshot) */
.bottomNav{
  position:fixed;
  left:12px; right:12px; bottom:12px;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:6px;
  padding:10px;
  border-radius:22px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.86);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--shadow);
  z-index:50;
}
.bottomNav a{
  text-decoration:none;
  color:var(--muted);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:8px 6px;
  border-radius:16px;
}
.bottomNav a .ico{display:flex; align-items:center; justify-content:center}
.bottomNav a .ico svg{display:block}
.bottomNav a .lbl{font-size:11px; margin-top:6px; font-weight:1000; letter-spacing:-.01em}
.bottomNav a.active{
  color:var(--primary);
  background:rgba(79,108,255,.10);
  border:1px solid rgba(79,108,255,.14);
}

.fab{
  width:48px; height:48px;
  border-radius:18px;
  border:none;
  background:linear-gradient(135deg, rgba(79,108,255,1), rgba(42,209,195,.98));
  color:#fff;
  font-size:22px;
  font-weight:1200;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 18px 30px rgba(79,108,255,.18);
  margin:0 auto;
}
.sheet{position:fixed; inset:0; z-index:80;}
.sheetBackdrop{position:absolute; inset:0; background:rgba(11,18,32,.22);}
.sheetCard{
  position:absolute; left:12px; right:12px; bottom:110px;
  border-radius:22px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  padding:14px;
}
.sheetGrid{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.sheetGrid .pill,.sheetGrid .btn{display:block; text-align:center; padding:14px;}
.sheetOpen{overflow:hidden;}

@media(min-width:900px){
  .bottomNav{max-width:560px; left:50%; right:auto; transform:translateX(-50%);}
  .sheetCard{max-width:560px; left:50%; right:auto; transform:translateX(-50%);}
}

/* Category dot */
.catDot{display:inline-block;width:10px;height:10px;border-radius:999px;margin-right:8px;vertical-align:middle;border:1px solid rgba(11,18,32,.14)}

/* tables default */
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:18px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.92);
}
th, td{
  padding:12px 10px;
  text-align:left;
  font-size:13px;
  border-bottom:1px solid rgba(11,18,32,.06);
}
th{
  color:var(--muted);
  font-weight:1100;
  background:rgba(11,18,32,.02);
  position:sticky;
  top:0;
  z-index:2;
}
tr:last-child td{border-bottom:none}
td:last-child, th:last-child{text-align:right}

/* motion */
@media (prefers-reduced-motion: no-preference){
  .card,.kpi,.item,.nav a, button, input, select { transition: transform .14s ease, filter .14s ease, background .14s ease, box-shadow .14s ease, border-color .14s ease; }
  .card:active,.kpi:active,.item:active{transform:translateY(1px)}
}



/* v13 components */
.seg{
  display:inline-flex;
  gap:6px;
  padding:6px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(11,18,32,.02);
}
.seg a{
  text-decoration:none;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:1100;
  color:var(--muted);
}
.seg a.active{
  color:var(--primary);
  background:rgba(79,108,255,.10);
  border:1px solid rgba(79,108,255,.14);
}
.chipCat{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(11,18,32,.02);
  font-size:12px;
  font-weight:1000;
  color:var(--text);
}
.chipCat .dot{
  width:10px;height:10px;border-radius:999px;border:1px solid rgba(11,18,32,.14);
  background:rgba(79,108,255,.25);
}
.miniBars{display:flex; gap:8px; height:118px; align-items:flex-end; padding:10px 6px 2px 6px}
.miniBars .b{flex:1; border-radius:12px; background:rgba(79,108,255,.18)}
.miniBars .b.strong{background:rgba(79,108,255,.70)}


/* v14: skeleton + touch */
.skel{background:rgba(255,255,255,.78)!important}
.skelRow{display:flex;align-items:center;justify-content:space-between;gap:12px}
.skelAv{width:38px;height:38px;border-radius:14px;background:rgba(11,18,32,.06)}
.skelTxt{flex:1}
.skelL{height:12px;width:60%;border-radius:999px;background:rgba(11,18,32,.06)}
.skelS{height:10px;width:35%;margin-top:8px;border-radius:999px;background:rgba(11,18,32,.05)}
.skelAmt{height:12px;width:64px;border-radius:999px;background:rgba(11,18,32,.06)}
.bottomNav a{min-height:54px}
.item{touch-action:manipulation}


/* v15: premium command palette + quick actions */
.cmdk{
  position:fixed; inset:0; z-index:120;
  display:none;
}
.cmdk.open{display:block}
.cmdkBackdrop{position:absolute; inset:0; background:rgba(11,18,32,.22); backdrop-filter: blur(6px);}
.cmdkCard{
  position:absolute;
  left:12px; right:12px; top:10%;
  max-width:720px; margin:0 auto;
  border-radius:24px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.cmdkTop{
  padding:14px;
  border-bottom:1px solid rgba(11,18,32,.06);
  display:flex; gap:10px; align-items:center;
}
.cmdkTop input{
  flex:1;
  border-radius:16px;
  padding:12px 12px;
  background:rgba(11,18,32,.03);
  border:1px solid rgba(11,18,32,.10);
  outline:none;
}
.cmdkTop input:focus{box-shadow:var(--ring); border-color:rgba(79,108,255,.45)}
.cmdkHint{font-size:12px; color:var(--muted); font-weight:900}
.cmdkBody{padding:12px}
.cmdkSectionTitle{margin:10px 4px 8px 4px; color:var(--muted); font-size:12px; font-weight:1100; text-transform:uppercase; letter-spacing:.06em}
.cmdkGrid{display:grid; grid-template-columns:1fr 1fr; gap:10px}
@media(min-width:620px){.cmdkGrid{grid-template-columns:1fr 1fr 1fr}}
.cmdkAction{
  text-decoration:none;
  border-radius:18px;
  border:1px solid rgba(11,18,32,.08);
  background:rgba(11,18,32,.02);
  padding:12px;
  display:flex; gap:10px; align-items:center;
}
.cmdkAction:hover{background:rgba(11,18,32,.04)}
.cmdkAction .ico{
  width:38px; height:38px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(79,108,255,.18);
  background:linear-gradient(135deg, rgba(79,108,255,.12), rgba(42,209,195,.10));
  font-size:18px;
}
.cmdkAction .t{font-weight:1100}
.cmdkAction .s{font-size:12px; color:var(--muted); margin-top:2px; font-weight:900}

.cmdkList{display:grid; gap:10px; margin-top:10px; max-height:44vh; overflow:auto; padding-right:4px}
.cmdkRow{
  border-radius:18px;
  border:1px solid rgba(11,18,32,.08);
  background:rgba(255,255,255,.92);
  box-shadow: var(--shadow2);
  padding:12px;
  text-decoration:none;
  display:flex; justify-content:space-between; align-items:center; gap:12px;
}
.cmdkRow:hover{background:#fff}
.cmdkRow .left{display:flex; align-items:center; gap:10px}
.cmdkRow .av{
  width:38px;height:38px;border-radius:14px;
  border:1px solid rgba(11,18,32,.08);
  background:linear-gradient(135deg, rgba(79,108,255,.12), rgba(42,209,195,.10));
  display:flex; align-items:center; justify-content:center;
  font-weight:1100;
}
.cmdkRow .title{font-weight:1100}
.cmdkRow .sub{font-size:12px; color:var(--muted); margin-top:2px; font-weight:900}
.kbd{
  border:1px solid rgba(11,18,32,.10);
  background:rgba(11,18,32,.03);
  color:var(--muted);
  border-radius:10px;
  padding:6px 8px;
  font-size:12px;
  font-weight:1100;
}

/* v15: make headers more "premium" */
.iconBtn{cursor:pointer}
.iconBtn:active{transform:translateY(1px)}


/* v16: Lavender premium mobile theme (inspired by reference UI) */
:root{
  --bg:#f2f2f7;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#6b768d;
  --border:rgba(11,18,32,.08);
  --shadow:0 16px 34px rgba(11,18,32,.08);
  --shadow2:0 10px 22px rgba(11,18,32,.06);

  --lav1:#b7a6ff;
  --lav2:#d6c9ff;
  --lav3:#efe9ff;

  --income:#6ad9b3;
  --expense:#7b61ff;

  --radius:20px;
  --radius2:28px;
  --ring:0 0 0 4px rgba(123,97,255,.18);
}

body{
  background: var(--bg) !important;
}
.page{
  padding:0 !important;
  padding-bottom:104px !important;
}
.container{padding:14px !important;}

.hero{
  background: radial-gradient(900px 520px at 20% 0%, rgba(183,166,255,.95), rgba(214,201,255,.55) 55%, rgba(239,233,255,.0) 80%),
              linear-gradient(180deg, rgba(214,201,255,.65), rgba(242,242,247,0));
  padding:18px 18px 80px 18px;
  border-bottom-left-radius: 34px;
  border-bottom-right-radius: 34px;
  position:relative;
  overflow:hidden;
}
.hero:after{
  content:"";
  position:absolute;
  inset:-60px;
  background: radial-gradient(500px 260px at 15% 30%, rgba(255,255,255,.25), transparent 60%),
              radial-gradient(520px 260px at 85% 20%, rgba(255,255,255,.18), transparent 60%);
  pointer-events:none;
}

.heroTop{
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.heroTop .iconBtn{
  width:44px;height:44px;border-radius:16px;
  background:rgba(255,255,255,.80);
  border:1px solid rgba(255,255,255,.55);
  box-shadow: var(--shadow2);
  display:flex;align-items:center;justify-content:center;
  text-decoration:none;
}
.heroDate{
  display:flex; align-items:center; gap:8px;
  color:rgba(11,18,32,.70);
  font-weight:1000;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(255,255,255,.55);
  border:1px solid rgba(255,255,255,.55);
}

.heroStat{
  position:relative; z-index:2;
  text-align:center;
  margin-top:22px;
}
.heroStat .label{color:rgba(11,18,32,.65); font-weight:900; font-size:13px}
.heroStat .value{font-size:40px; font-weight:1300; letter-spacing:-.04em; margin-top:8px}
.heroStat .sub{color:rgba(11,18,32,.60); font-weight:900; font-size:12px; margin-top:6px}

.sheetCard, .cmdkCard{
  border-radius:28px !important;
}

.mainCard{
  margin-top:-62px;
  position:relative;
  z-index:3;
}
.card{
  border-radius:28px !important;
  box-shadow: var(--shadow) !important;
}
.item{
  border-radius:20px !important;
  box-shadow: var(--shadow2) !important;
  border:1px solid rgba(11,18,32,.06) !important;
  background:rgba(255,255,255,.92) !important;
}
.sectionRow .label{font-size:16px !important}

.walletRow{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.walletPill{
  display:flex; align-items:center; gap:10px;
  padding:14px;
  border-radius:22px;
  border:1px solid rgba(11,18,32,.06);
  background:rgba(255,255,255,.92);
  box-shadow: var(--shadow2);
  text-decoration:none;
}
.walletPill .wIco{
  width:42px;height:42px;border-radius:16px;
  background:linear-gradient(135deg, rgba(123,97,255,.18), rgba(106,217,179,.14));
  border:1px solid rgba(123,97,255,.18);
  display:flex;align-items:center;justify-content:center;
  font-size:18px;
}
.walletPill .wTitle{font-weight:1100}
.walletPill .wSub{font-size:12px;color:var(--muted);font-weight:900;margin-top:2px}

.txnLine{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.txnLeft{display:flex; align-items:center; gap:12px}
.txnLogo{
  width:44px;height:44px;border-radius:16px;
  border:1px solid rgba(11,18,32,.06);
  background:linear-gradient(135deg, rgba(123,97,255,.12), rgba(106,217,179,.10));
  display:flex;align-items:center;justify-content:center;
  font-weight:1200;
}
.txnAmtNeg{color:#ff3b30;font-weight:1200}
.txnAmtPos{color:#22b573;font-weight:1200}

.bottomNav{
  grid-template-columns:repeat(4,1fr) !important;
  gap:10px !important;
  border-radius:26px !important;
  padding:12px !important;
}
.bottomNav a.active{
  color: var(--expense) !important;
  background: rgba(123,97,255,.10) !important;
  border:1px solid rgba(123,97,255,.12) !important;
}
.fab{
  width:56px;height:56px;border-radius:22px !important;
  background: #11111a !important;
  box-shadow:0 18px 30px rgba(11,18,32,.18) !important;
}
.fab span{font-size:26px}

.catGrid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}
@media(max-width:420px){.catGrid{grid-template-columns:repeat(3,1fr)}}
.catTile{
  text-decoration:none;
  display:flex; flex-direction:column; align-items:center; gap:10px;
}
.catIcon{
  width:56px;height:56px;border-radius:18px;
  background:rgba(255,255,255,.88);
  border:1px solid rgba(11,18,32,.06);
  box-shadow: var(--shadow2);
  display:flex; align-items:center; justify-content:center;
  font-size:22px;
}
.catName{font-size:12px; color:rgba(11,18,32,.72); font-weight:1000; text-align:center}




/* v17: Professional polish + navigation */
:root{
  --text:#0a0f1f;
  --muted:#667085;
  --border:rgba(16,24,40,.08);
  --shadow:0 18px 46px rgba(16,24,40,.10);
  --shadow2:0 10px 22px rgba(16,24,40,.07);
}
.itemTitle, .label, .wTitle{letter-spacing:-.02em}
.itemSub, .muted, .small{letter-spacing:-.01em}
.sectionRow{margin:18px 2px 12px 2px}
.pill{background:rgba(16,24,40,.03); border:1px solid rgba(16,24,40,.08)}
.heroDate{background:rgba(255,255,255,.62)}
.heroTop .iconBtn{font-size:16px}

.subnav{
  position:sticky; top:10px; z-index:40;
  display:flex; gap:10px; align-items:center; justify-content:space-between;
  margin:0 14px 10px 14px;
}
.subnav .seg{background:rgba(255,255,255,.72); backdrop-filter: blur(14px) saturate(150%)}
.subnav .seg a{padding:9px 12px}

.tiles{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}
@media(min-width:720px){.tiles{grid-template-columns:repeat(4,1fr)}}
.tile{
  text-decoration:none;
  border-radius:22px;
  border:1px solid rgba(16,24,40,.08);
  background:rgba(255,255,255,.92);
  box-shadow: var(--shadow2);
  padding:14px;
  display:flex; gap:12px; align-items:center;
}
.tile:hover{background:#fff}
.tile .ico{
  width:44px;height:44px;border-radius:16px;
  border:1px solid rgba(123,97,255,.14);
  background:linear-gradient(135deg, rgba(123,97,255,.12), rgba(106,217,179,.10));
  display:flex;align-items:center;justify-content:center;
  font-weight:1200;
}
.tile .t{font-weight:1200}
.tile .s{font-size:12px;color:var(--muted);font-weight:900;margin-top:2px}

.bottomNav a .lbl{font-size:11px}
.bottomNav a{padding:10px 6px}
.bottomNav{background:rgba(255,255,255,.92)}



/* v18: native-like PWA feel */
html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body{
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}
.page{
  padding-bottom: calc(110px + env(safe-area-inset-bottom)) !important;
}
.bottomNav{
  padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
}
input, select, textarea{
  font-size:16px; /* prevents iOS zoom */
}
.hero{
  padding-top: calc(18px + env(safe-area-inset-top));
}
.sheetCard, .cmdkCard{
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
