:root{
  --bg:#0b1020;
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.62);
  --line:rgba(255,255,255,.12);
  --card:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.09);
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --r:18px;
  --r2:14px;

  --primary:#7c5cff;
  --danger:#ff4d6d;
  --ok:#22c55e;
  --warn:#f59e0b;
  --info:#60a5fa;

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

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(900px 520px at 12% 15%, rgba(124,92,255,.28), transparent 55%),
    radial-gradient(900px 520px at 88% 0%, rgba(96,165,250,.18), transparent 55%),
    radial-gradient(900px 640px at 80% 96%, rgba(34,197,94,.14), transparent 55%),
    var(--bg);
}

.app{
  max-width: 1150px;
  margin: 0 auto;
  padding: 28px 16px 42px;
}

.top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom: 16px;
}

.brand{display:flex; align-items:center; gap:14px}
.logo{
  width:44px;height:44px;display:grid;place-items:center;
  border-radius:14px;
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(96,165,250,.88));
  box-shadow: var(--shadow);
  font-weight: 900;
  letter-spacing: .5px;
}
h1{margin:0;font-size:22px;line-height:1.1}
.brand p{margin:4px 0 0; color:var(--muted); font-size:14px}

.top-actions{display:flex; gap:10px; flex-wrap:wrap}

.grid{
  display:grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 16px;
}
@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
}

.card{
  background: linear-gradient(180deg, var(--card), rgba(255,255,255,.04));
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow:hidden;
}

.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 12px;
}
.card-head h2{margin:0; font-size:16px; letter-spacing:.2px}

.pill{
  font-size:12px;
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.08);
  border:1px solid var(--line);
  padding:6px 10px;
  border-radius:999px;
}

.form{display:flex; flex-direction:column; gap:12px}

.field{display:flex; flex-direction:column; gap:6px}
label{font-size:12px; color: rgba(255,255,255,.72)}

input,select,textarea{
  width:100%;
  padding:12px 12px;
  border-radius: var(--r2);
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  color: var(--text);
  outline:none;
  transition:.15s ease;
}
textarea{resize:vertical; min-height:78px}
input:focus,select:focus,textarea:focus{
  border-color: rgba(124,92,255,.7);
  box-shadow: 0 0 0 4px rgba(124,92,255,.15);
}

.field-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px){
  .field-row{grid-template-columns:1fr}
}

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

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor:pointer;
  user-select:none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  font-weight: 700;
  font-size: 13px;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.11);
  border-color: rgba(255,255,255,.18);
}
.btn:active{transform: translateY(0px)}
.btn.primary{
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(96,165,250,.9));
  border-color: rgba(124,92,255,.55);
}
.btn.danger{
  background: rgba(255,77,109,.12);
  border-color: rgba(255,77,109,.35);
}
.btn.ghost{ background: rgba(255,255,255,.06); }
.file-btn{ position:relative; overflow:hidden; }

.divider{
  margin: 14px 0;
  border-top: 1px dashed rgba(255,255,255,.18);
}

.budget-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  margin-bottom: 8px;
}
.budget-head h3{margin:0; font-size:14px}
.muted{color:var(--muted)}
.tiny{font-size:12px}

.progress-wrap{ margin-top: 8px; }
.progress-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size: 12px;
  color: rgba(255,255,255,.75);
  margin-bottom: 8px;
}
.progress-bar{
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  overflow:hidden;
}
.progress-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(34,197,94,.95), rgba(245,158,11,.9), rgba(255,77,109,.9));
  transition: width .25s ease;
}

.dash-head{ align-items:flex-start; }
.controls{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.controls input, .controls select{
  padding: 10px 10px;
  border-radius: 12px;
  font-size: 13px;
}

.stats{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 10px 0 12px;
}
@media (max-width: 720px){
  .stats{grid-template-columns:1fr}
}
.stat{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  border-radius: 16px;
  padding: 12px;
}
.stat-label{ display:block; color: rgba(255,255,255,.68); font-size: 12px; }
.stat-value{ display:block; font-size: 18px; font-weight: 900; margin-top: 6px; }

.mini-card{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  border-radius: 16px;
  padding: 12px;
  margin-top: 12px;
}
.mini-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  margin-bottom: 10px;
}
.mini-head h3{ margin:0; font-size: 14px; }

.breakdown{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.bar-row{
  display:grid;
  grid-template-columns: 120px 1fr 90px;
  gap: 10px;
  align-items:center;
}
@media (max-width: 560px){
  .bar-row{ grid-template-columns: 1fr; }
}
.bar-label{ font-size: 12px; color: rgba(255,255,255,.78); }
.bar{
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  overflow:hidden;
}
.bar > span{
  display:block;
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(124,92,255,.95), rgba(96,165,250,.9));
  transition: width .25s ease;
}
.bar-val{ font-size: 12px; color: rgba(255,255,255,.72); text-align:right; }

.table-wrap{
  overflow:auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
}
.table{
  width:100%;
  border-collapse:collapse;
  min-width: 720px;
  background: rgba(0,0,0,.14);
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  text-align:left;
  font-size: 13px;
}
.table th{
  font-size: 12px;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.06);
}
.th-actions{ width: 180px; }

.cell-sub{ color: rgba(255,255,255,.55); font-size: 12px; margin-top: 2px; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  font-weight: 800;
  font-size: 12px;
}
.dot{ width:8px;height:8px;border-radius:999px; background: rgba(255,255,255,.6); }
.badge.cash{ background: rgba(96,165,250,.10); border-color: rgba(96,165,250,.25); }
.badge.cash .dot{ background: var(--info); }
.badge.card{ background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.25); }
.badge.card .dot{ background: var(--warn); }
.badge.online{ background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.25); }
.badge.online .dot{ background: var(--ok); }

.row-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.icon-btn{ padding: 8px 10px; border-radius: 12px; font-size: 12px; }

.empty{
  padding: 16px 14px;
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  margin-bottom: 12px;
}
.empty.small{ margin: 0; }
.empty h4{ margin: 0 0 6px; font-size: 14px; }
.empty p{ margin: 0; color: var(--muted); font-size: 13px; }

.footer{
  margin-top: 14px;
  text-align:center;
  color: rgba(255,255,255,.58);
  font-size: 13px;
}

.toast{
  position:fixed;
  left:50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.78);
  border: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.92);
  padding: 10px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity:0;
  pointer-events:none;
  transition: opacity .2s ease, transform .2s ease;
  font-size: 13px;
}
.toast.show{
  opacity:1;
  transform: translateX(-50%) translateY(-4px);
}
