:root{
  --bg: #f7fbff;
  --panel: rgba(255,255,255,.72);
  --panel-strong: rgba(255,255,255,.9);
  --text: #0b1220;
  --muted: rgba(11,18,32,.65);
  --border: rgba(11,18,32,.10);
  --shadow: 0 20px 55px rgba(12, 72, 160, .16);
  --shadow-soft: 0 10px 30px rgba(12, 72, 160, .12);
  --blue: #1d4ed8;
  --blue2: #2563eb;
  --cyan: #06b6d4;
  --danger: #ef4444;
  --ok: #16a34a;
  --warn: #f59e0b;
  --radius: 18px;
  --radius2: 24px;
  --blur: 18px;
}

body[data-theme="dark"]{
  --bg: #070b16;
  --panel: rgba(16, 24, 44, .56);
  --panel-strong: rgba(16, 24, 44, .82);
  --text: #e9f1ff;
  --muted: rgba(233,241,255,.65);
  --border: rgba(233,241,255,.12);
  --shadow: 0 22px 70px rgba(0,0,0,.55);
  --shadow-soft: 0 10px 26px rgba(0,0,0,.45);
  --blue: #60a5fa;
  --blue2: #93c5fd;
  --cyan: #22d3ee;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 900px at 20% 0%, rgba(29, 78, 216,.14), transparent 60%),
              radial-gradient(900px 700px at 80% 10%, rgba(6,182,212,.12), transparent 55%),
              var(--bg);
  color: var(--text);
}

.bg-blob{
  position: fixed;
  width: 540px;
  height: 540px;
  filter: blur(60px);
  opacity: .55;
  z-index:-1;
  border-radius: 999px;
  transform: translateZ(0);
}
.bg-blob.b1{ left:-140px; top:-160px; background: rgba(37,99,235,.35); }
.bg-blob.b2{ right:-160px; top:120px; background: rgba(6,182,212,.30); }

.topbar{
  position: sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(var(--blur));
  background: rgba(255,255,255,.58);
  border-bottom: 1px solid var(--border);
}
body[data-theme="dark"] .topbar{ background: rgba(7,11,22,.55); }
.topbar-inner{
  max-width: 1180px;
  margin:0 auto;
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.brand{ display:flex; align-items:center; gap:12px; }
.logo-dot{
  width: 30px; height:20px; border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--cyan)); 
  box-shadow: 0 0 0 6px rgba(29,78,216,.12);
}
.brand-title{ font-weight: 700; letter-spacing: .2px; }
.brand-sub{ font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar-actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

.container{
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 52px;
}

.grid{
  display:grid;
  gap: 16px;
}
.grid.two{
  grid-template-columns: 1.2fr .8fr;
}
@media (max-width: 980px){
  .grid.two{ grid-template-columns: 1fr; }
  .topbar-inner{ flex-direction: column; align-items: flex-start; }
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(var(--blur));
  overflow:hidden;
}
.card .card-hd{
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.card .card-hd h2{
  margin:0;
  font-size: 16px;
  letter-spacing: .2px;
}
.card .card-bd{ padding: 18px; }

.kpis{
  display:flex; gap: 10px; flex-wrap:wrap;
}
.kpi{
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.35);
  color: var(--muted);
  font-size: 12px;
}
body[data-theme="dark"] .kpi{ background: rgba(255,255,255,.06); }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.55));
  color: var(--text);
  text-decoration:none;
  font-weight: 600;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
body[data-theme="dark"] .btn{ background: rgba(255,255,255,.08); }
.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow-soft); border-color: rgba(29,78,216,.35); }
.btn:active{ transform: translateY(0); box-shadow:none; }
.btn-primary{
  border-color: rgba(29,78,216,.35);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
}
.btn-ghost{
  background: transparent;
}
.btn-danger{
  border-color: rgba(239, 68, 68, .35);
  background: rgba(239, 68, 68, .10);
  color: var(--text);
}
.chip{
  padding: 9px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.35);
  cursor:pointer;
}
body[data-theme="dark"] .chip{ background: rgba(255,255,255,.06); color: var(--text); }

.user-pill{
  display:inline-flex; align-items:center; gap:8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.35);
}
body[data-theme="dark"] .user-pill{ background: rgba(255,255,255,.06); }
.user-dot{
  width: 8px; height:8px; border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.field{
  display:flex; flex-direction:column; gap:6px;
  margin-bottom: 12px;
}
.label{ font-size: 12px; color: var(--muted); }
.input{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.7);
  outline:none;
  color: var(--text);
}
body[data-theme="dark"] .input{ background: rgba(255,255,255,.06); }
.input:focus{ border-color: rgba(29,78,216,.45); box-shadow: 0 0 0 4px rgba(29,78,216,.14); }

.inline{ display:inline; }
.row{
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
}
.row.between{ justify-content: space-between; }
.hint{ font-size: 13px; color: var(--muted); margin-top: 6px; }
a.link{ color: var(--blue); text-decoration:none; font-weight:600; }
a.link:hover{ text-decoration: underline; }

.table-wrap{
  overflow:auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.45);
}
body[data-theme="dark"] .table-wrap{ background: rgba(255,255,255,.04); }
table{
  width:100%;
  border-collapse: collapse;
  min-width: 640px;
}
th, td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
th{ text-align:left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
tr:hover td{ background: rgba(29,78,216,.05); }
body[data-theme="dark"] tr:hover td{ background: rgba(147,197,253,.06); }

.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
}
.badge.ok{ border-color: rgba(22,163,74,.35); background: rgba(22,163,74,.10); }
.badge.warn{ border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.10); }
.badge.danger{ border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10); }

.toast{
  position: fixed;
  right: 18px; top: 88px;
  z-index: 100;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  max-width: min(420px, calc(100vw - 36px));
  animation: pop .22s ease both;
}
.toast-success{ border-color: rgba(22,163,74,.35); }
.toast-error{ border-color: rgba(239,68,68,.35); }
@keyframes pop{
  from{ transform: translateY(-6px); opacity:0; }
  to{ transform: translateY(0); opacity:1; }
}

.modal-backdrop{
  position: fixed; inset:0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
  display:none;
  align-items:center;
  justify-content:center;
  z-index: 200;
  padding: 16px;
}
.modal{
  width: min(560px, 100%);
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal .modal-hd{
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.modal .modal-hd h3{ margin:0; font-size: 15px; }
.modal .modal-bd{ padding: 16px; }
.modal .modal-ft{
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap;
}

.footer{
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.45);
  backdrop-filter: blur(var(--blur));
}
body[data-theme="dark"] .footer{ background: rgba(7,11,22,.35); }
.footer-inner{
  max-width: 1180px;
  margin:0 auto;
  padding: 12px 18px;
  color: var(--muted);
  display:flex; gap: 10px; align-items:center; justify-content:center;
  flex-wrap:wrap;
  font-size: 12px;
}
.sep{ opacity:.6; }
