:root{
  --bg:#f3f6fb;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#5b6b84;
  --primary:#1b86c8;
  --primary2:#1573ad;
  --border:rgba(15,23,42,.08);
  --shadow:0 18px 45px rgba(2,6,23,.12);
  --shadow-soft:0 10px 30px rgba(2,6,23,.08);
  --radius:16px;
  --radius2:12px;
  --font: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 800px at 80% -10%, rgba(27,134,200,.20), transparent 55%),
              radial-gradient(900px 700px at -10% 10%, rgba(124,92,255,.10), transparent 55%),
              var(--bg);
  color:var(--text);
  font-family:var(--font);
}

a{color:inherit; text-decoration:none}

.container{
  max-width:980px;
  margin:0 auto;
  padding:24px 16px 56px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter:saturate(180%) blur(10px);
  background: rgba(246,247,251,.75);
  border-bottom:1px solid var(--border);
}

.pagebar{
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter:saturate(180%) blur(10px);
  background: rgba(243,246,251,.80);
  border-bottom:1px solid var(--border);
}

.pagebar-inner{
  max-width:980px;
  margin:0 auto;
  padding:14px 16px;
  display:flex;
  align-items:center;
  gap:12px;
}

.back-btn{
  width:44px;
  height:44px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.82);
  cursor:pointer;
  display:grid;
  place-items:center;
}

.back-btn svg{width:18px;height:18px; fill: rgba(15,23,42,.75)}

.page-title{display:flex; flex-direction:column; gap:2px}
.page-title h1{margin:0; font-size:22px; font-weight:900; letter-spacing:-.2px}
.page-title .subtitle{color:var(--muted); font-weight:600; font-size:13px}

.topbar-inner{
  max-width:980px;
  margin:0 auto;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  font-weight:700;
  letter-spacing:.2px;
}

.brand-icon{
  width:40px;
  height:40px;
  border-radius:14px;
  background: linear-gradient(180deg, rgba(27,134,200,1), rgba(21,115,173,1));
  box-shadow: var(--shadow-soft);
  display:grid;
  place-items:center;
}

.brand-icon svg{width:22px;height:22px; fill:#fff}

.actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border:0;
  cursor:pointer;
  border-radius:999px;
  padding:10px 16px;
  font-weight:700;
  letter-spacing:.2px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-primary{
  color:#fff;
  background: #1b86c8;
  box-shadow: 0 14px 28px rgba(27,134,200,.28);
  padding:12px 22px;
}

.btn-primary:hover{transform: translateY(-1px); background: #197fbf; box-shadow: 0 16px 32px rgba(27,134,200,.32)}
.btn-primary:active{transform: translateY(0)}

.btn-plus{
  width:22px;
  height:22px;
  border-radius:7px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.14);
  font-size:18px;
  line-height:0;
}

.btn-ghost{
  color:var(--text);
  background: rgba(255,255,255,.7);
  border:1px solid var(--border);
}

.main{
  padding-top:20px;
}

.card{
  background:rgba(255,255,255,.88);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.surface{
  background: rgba(255,255,255,.88);
  border:1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(2,6,23,.08);
}

.surface-topline{
  height:4px;
  background: linear-gradient(90deg, rgba(56,189,248,1), rgba(244,63,94,1), rgba(249,115,22,1));
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

.summary{
  padding:14px 14px;
}

.summary-grid{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:6px;
  align-items:center;
}

.metric{
  text-align:center;
  padding:10px 6px;
}

.metric .value{font-weight:900; font-size:22px}
.metric .label{margin-top:6px; font-size:12px; color:var(--muted); font-weight:600}

.metric.primary .value{color: var(--primary)}

.section{
  padding:14px 14px;
}

.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.section-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
}

.section-title svg{width:20px;height:20px; fill: var(--primary)}

.btn-soft{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius: 12px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.80);
  cursor:pointer;
  font-weight:700;
}

.btn-soft svg{width:18px;height:18px; fill: rgba(15,23,42,.72)}

.section-empty{
  padding:26px 10px;
  text-align:center;
  color:var(--muted);
  font-weight:600;
}

.empty{
  padding:56px 20px;
  display:grid;
  place-items:center;
  text-align:center;
}

.empty-icon{
  width:64px;
  height:64px;
  border-radius:20px;
  background: rgba(15,23,42,.04);
  border:1px solid var(--border);
  display:grid;
  place-items:center;
  margin-bottom:14px;
}

.empty-icon svg{width:30px;height:30px; fill:rgba(15,23,42,.55)}

.empty h2{
  margin:0;
  font-size:20px;
}

.empty p{
  margin:10px 0 0;
  color:var(--muted);
  max-width:380px;
}

.grid{
  display:grid;
  gap:14px;
}

.project-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px;
  border-radius: var(--radius2);
  border:1px solid var(--border);
  background: rgba(255,255,255,.92);
}

.project-card{
  border-radius: 16px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 26px rgba(2,6,23,.10);
  overflow:hidden;
}

.project-card[role="link"]{cursor:pointer}
.project-card[role="link"]:focus{outline: 3px solid rgba(27,134,200,.25); outline-offset: 2px}

.project-topline{
  height:4px;
  background: linear-gradient(90deg, rgba(255,122,92,1), rgba(255,166,76,1));
}

.project-inner{padding:14px 14px 12px}

.project-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.project-name{font-weight:900; font-size:18px; margin:0}
.project-desc{margin:10px 0 0; color:var(--muted); font-size:14px}

.trash-btn{
  width:40px;
  height:40px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.85);
  cursor:pointer;
  display:grid;
  place-items:center;
  transition: transform .12s ease, box-shadow .12s ease;
}

.trash-btn:hover{transform: translateY(-1px); box-shadow: 0 10px 18px rgba(2,6,23,.10)}
.trash-btn svg{width:18px; height:18px; fill: rgba(15,23,42,.68)}

.project-foot{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-top:14px;
}

.stats{display:flex; align-items:center; gap:14px; color: rgba(15,23,42,.70)}

.stat{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:800;
  font-size:13px;
}

.stat svg{width:18px; height:18px; fill: rgba(15,23,42,.55)}

.amount{
  font-weight:900;
  font-size:16px;
  letter-spacing:.2px;
}

.project-meta{display:flex; flex-direction:column; gap:2px}
.project-title{font-weight:800}
.project-sub{color:var(--muted); font-size:13px}

.badge{
  font-size:12px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(29,155,240,.12);
  color: rgba(11,127,209,1);
  border:1px solid rgba(29,155,240,.18);
  white-space:nowrap;
}

.toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  background: rgba(2,6,23,.92);
  color:#fff;
  padding:10px 14px;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(2,6,23,.25);
  display:none;
  max-width:min(560px, calc(100% - 32px));
  font-size:14px;
}

.toast.show{display:block}

.modal-backdrop{
  position:fixed;
  inset:0;
  background: rgba(2,6,23,.52);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.modal-backdrop.open{display:flex}

.modal{
  width: min(560px, 100%);
  background: rgba(255,255,255,.96);
  border:1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow:hidden;
}

.modal-header{
  padding:16px 16px 10px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.modal-title{font-weight:900}

.icon-btn{
  width:40px;
  height:40px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.75);
  cursor:pointer;
  display:grid;
  place-items:center;
}

.icon-btn svg{width:18px;height:18px; fill:rgba(15,23,42,.7)}

.modal-body{padding:0 16px 16px}

.form{
  display:grid;
  gap:10px;
}

.field label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin:0 0 6px;
  font-weight:700;
}

.field input, .field textarea{
  width:100%;
  border:1px solid var(--border);
  background: rgba(255,255,255,.95);
  border-radius: 14px;
  padding:12px 12px;
  font: inherit;
  outline:none;
}

.field textarea{min-height:96px; resize:vertical}

.form-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:4px;
}

@media (max-width: 420px){
  .btn-primary{padding:12px 18px}
}
