@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  --bg0: #070b16;
  --bg1: #0d1428;
  --bg2: #121c38;
  --card: rgba(22, 32, 64, 0.72);
  --card-solid: #162040;
  --glass: rgba(255,255,255,0.04);
  --line: rgba(140, 170, 255, 0.14);
  --line2: rgba(140, 170, 255, 0.28);
  --text: #eef2ff;
  --muted: #93a0c7;
  --teal: #2dd4bf;
  --teal2: #14b8a6;
  --violet: #8b5cf6;
  --violet2: #a78bfa;
  --blue: #60a5fa;
  --pink: #f472b6;
  --amber: #fbbf24;
  --rose: #fb7185;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --radius: 20px;
  --radius-sm: 14px;
  --font: "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  --grad: linear-gradient(135deg, #2dd4bf 0%, #60a5fa 45%, #8b5cf6 100%);
  --grad-soft: linear-gradient(160deg, rgba(45,212,191,.18), rgba(139,92,246,.12));
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: var(--font); color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139,92,246,.28), transparent 60%),
    radial-gradient(800px 480px at -5% 20%, rgba(45,212,191,.18), transparent 55%),
    radial-gradient(600px 400px at 50% 110%, rgba(96,165,250,.12), transparent 50%),
    var(--bg0);
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: .5;
}
a { color: var(--teal); text-decoration: none; }
button, input, select { font: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; color: var(--violet2); }

.btn {
  border: 0; border-radius: 14px; padding: 11px 18px; cursor: pointer;
  font-weight: 700; color: #041018;
  background: var(--grad); box-shadow: 0 10px 28px rgba(45,212,191,.25);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line2); box-shadow: none;
}
.btn.ghost:hover { background: var(--glass); border-color: var(--teal); color: var(--teal); }
.btn.ok { background: linear-gradient(135deg, #34d399, #2dd4bf); color: #042016; }
.btn.danger { background: linear-gradient(135deg, #fb7185, #f472b6); color: #2a0610; }
.btn.sm { padding: 7px 12px; font-size: 12px; border-radius: 10px; }

.input {
  width: 100%; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(7,11,22,.65);
  color: var(--text); outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus {
  border-color: rgba(45,212,191,.55);
  box-shadow: 0 0 0 4px rgba(45,212,191,.12);
}
.label { display:block; margin: 0 0 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* login */
.login-wrap {
  min-height: 100vh; display:grid; place-items:center; padding: 24px; position: relative; z-index: 1;
}
.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(22,32,64,.9), rgba(13,20,40,.95));
  border: 1px solid var(--line2); border-radius: 28px; padding: 36px 32px;
  box-shadow: var(--shadow); backdrop-filter: blur(18px);
  position: relative; overflow: hidden;
}
.login-card::before {
  content:""; position:absolute; inset:-1px auto auto -1px; width:140%; height:120px;
  background: var(--grad-soft); pointer-events:none;
}
.brand { display:flex; gap:14px; align-items:center; margin-bottom: 26px; position: relative; }
.logo {
  width:52px; height:52px; border-radius:16px; display:grid; place-items:center;
  background: var(--grad); color:#041018; font-weight:900; font-size:22px;
  box-shadow: 0 12px 30px rgba(96,165,250,.35);
}
.brand h1 { margin:0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.brand p { margin:3px 0 0; color: var(--muted); font-size: 13px; }
.err { color: var(--rose); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* shell */
.shell {
  display:grid; grid-template-columns: 250px 1fr; min-height: 100vh; position: relative; z-index: 1;
}
.side {
  background: linear-gradient(180deg, rgba(10,16,34,.92), rgba(7,11,22,.96));
  border-inline-end: 1px solid var(--line); padding: 22px 14px;
  position: sticky; top:0; height:100vh; display:flex; flex-direction:column;
  backdrop-filter: blur(16px);
}
.side .brand { padding: 2px 8px 20px; }
.nav { display:flex; flex-direction:column; gap:4px; flex:1; }
.nav button {
  width:100%; text-align:start; background: transparent; border:0;
  color: var(--muted); padding: 12px 14px; border-radius: 14px; cursor:pointer;
  font-weight: 600; font-size: 13.5px; transition: .15s ease;
  display:flex; align-items:center; gap:10px;
}
.nav button .ico { width:22px; text-align:center; opacity:.85; }
.nav button.active, .nav button:hover {
  background: linear-gradient(90deg, rgba(45,212,191,.14), rgba(139,92,246,.10));
  color: var(--text); box-shadow: inset 3px 0 0 var(--teal);
}
.side-foot { padding: 10px 4px 4px; }
.main { padding: 24px 28px 48px; max-width: 1280px; }

.topbar {
  display:flex; justify-content:space-between; align-items:flex-start; gap:16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.topbar h2 {
  margin:0; font-size: 26px; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(90deg, #fff, #a5b4fc); -webkit-background-clip:text; background-clip:text;
  color: transparent;
}
.topbar .sub { margin:6px 0 0; color: var(--muted); font-size: 13px; }
.chips { display:flex; gap:8px; flex-wrap:wrap; }
.chip {
  background: var(--card); border:1px solid var(--line); border-radius:999px;
  padding:7px 13px; font-size:12px; color: var(--muted); backdrop-filter: blur(8px);
}
.chip b { color: var(--text); font-weight: 700; }
.chip.glow { border-color: rgba(45,212,191,.35); box-shadow: 0 0 20px rgba(45,212,191,.12); }

.grid { display:grid; gap: 14px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.grid.two { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 980px) { .grid.two { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(165deg, rgba(28,40,78,.78), rgba(14,20,42,.88));
  border:1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); backdrop-filter: blur(10px); position: relative; overflow: hidden;
}
.card::after {
  content:""; position:absolute; top:0; inset-inline:0; height:1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
}
.card h3 {
  margin:0 0 14px; font-size: 13px; color: var(--muted); font-weight:700;
  letter-spacing: .04em; text-transform: uppercase; display:flex; align-items:center; gap:8px;
}
.card h3 .dot {
  width:8px; height:8px; border-radius:50%; background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
}

.stat {
  min-height: 118px; display:flex; flex-direction:column; justify-content:space-between;
}
.stat .icon-bubble {
  width:40px; height:40px; border-radius:14px; display:grid; place-items:center;
  background: var(--grad-soft); border: 1px solid var(--line); font-size:18px;
}
.stat .v { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 10px; }
.stat .k { color: var(--muted); font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.stat.teal .v { color: var(--teal); }
.stat.violet .v { color: var(--violet2); }
.stat.blue .v { color: var(--blue); }
.stat.pink .v { color: var(--pink); }
.stat.ok-pulse .icon-bubble { animation: pulse 2s infinite; }

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(45,212,191,.35); }
  50% { box-shadow: 0 0 0 10px rgba(45,212,191,0); }
}

.table-wrap {
  overflow:auto; border-radius: 16px; border:1px solid var(--line);
  background: rgba(7,11,22,.35);
}
table { width:100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
th {
  color: var(--muted); font-weight: 700; font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; background: rgba(10,16,34,.85); position: sticky; top:0;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(96,165,250,.06); }

.badge {
  display:inline-flex; align-items:center; gap:6px; border-radius:999px;
  padding:4px 11px; font-size:11px; font-weight:700; border:1px solid var(--line);
}
.badge::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.badge.ok { color: var(--ok); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.1); }
.badge.warn { color: var(--warn); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.1); }
.badge.bad { color: var(--danger); border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.1); }
.badge.neutral { color: var(--muted); background: rgba(255,255,255,.04); }

.row { display:flex; gap:10px; flex-wrap:wrap; align-items:end; }
.row > * { flex: 1; min-width: 140px; }
.toolbar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom: 14px; align-items:center; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.sortable { list-style:none; margin:0; padding:0; }
.sortable li {
  display:flex; align-items:center; gap:12px; padding:13px 14px; margin-bottom:8px;
  background: rgba(12,18,38,.7); border:1px solid var(--line); border-radius: 16px; cursor: grab;
  transition: border .15s, transform .15s;
}
.sortable li:hover { border-color: var(--line2); }
.sortable li.ghost { opacity:.35; }
.handle { color: var(--muted); letter-spacing: 2px; user-select:none; }
.weight-bar { flex:1; height: 10px; background:rgba(7,11,22,.8); border-radius:999px; overflow:hidden; border:1px solid var(--line); }
.weight-bar > i {
  display:block; height:100%;
  background: var(--grad); width: var(--w, 50%);
  box-shadow: 0 0 12px rgba(45,212,191,.45);
}
.weight-val { width: 72px; }

.form-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.toggle {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:13px 14px; background: rgba(12,18,38,.7); border-radius:16px; border:1px solid var(--line);
}
.toggle input { width:44px; height:24px; accent-color: var(--teal); }

/* progress wizard */
.wizard-progress {
  margin-top: 18px; border-radius: 18px; border: 1px solid var(--line);
  background: rgba(7,11,22,.55); padding: 8px; overflow: hidden;
}
.step-list { list-style: none; margin: 0; padding: 8px 10px; }
.step-item {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start;
  padding: 12px 10px; border-radius: 14px; position: relative;
  animation: fadeIn .35s ease;
}
.step-item + .step-item { margin-top: 2px; }
.step-item.run { background: rgba(96,165,250,.08); }
.step-item.ok { background: rgba(52,211,153,.06); }
.step-item.fail { background: rgba(251,113,133,.08); }
.step-ico {
  width: 36px; height: 36px; border-radius: 12px; display:grid; place-items:center;
  font-size: 16px; font-weight: 800; border: 1px solid var(--line); background: var(--bg2);
}
.step-item.run .step-ico {
  border-color: rgba(96,165,250,.45); color: var(--blue);
  animation: spinPulse 1.2s ease infinite;
}
.step-item.ok .step-ico { border-color: rgba(52,211,153,.45); color: var(--ok); background: rgba(52,211,153,.12); }
.step-item.fail .step-ico { border-color: rgba(251,113,133,.45); color: var(--danger); background: rgba(251,113,133,.12); }
.step-item.queued .step-ico { color: var(--muted); }
.step-title { font-weight: 700; font-size: 14px; }
.step-detail { color: var(--muted); font-size: 12.5px; margin-top: 3px; word-break: break-word; }
.step-time { color: var(--muted); font-size: 11px; padding-top: 8px; }

@keyframes fadeIn { from { opacity:0; transform: translateY(6px);} to { opacity:1; transform:none;} }
@keyframes spinPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(96,165,250,.35); }
  50% { box-shadow: 0 0 0 8px rgba(96,165,250,0); }
}

.banner {
  margin-top: 16px; border-radius: 18px; padding: 20px 22px; border: 1px solid var(--line);
  display:flex; gap:16px; align-items:flex-start; animation: fadeIn .4s ease;
}
.banner.success {
  background: linear-gradient(135deg, rgba(52,211,153,.16), rgba(45,212,191,.08));
  border-color: rgba(52,211,153,.4);
}
.banner.fail {
  background: linear-gradient(135deg, rgba(251,113,133,.16), rgba(244,114,182,.08));
  border-color: rgba(251,113,133,.4);
}
.banner .big { font-size: 28px; line-height:1; }
.banner h4 { margin:0 0 6px; font-size: 18px; font-weight: 800; }
.banner p { margin:0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.banner .meta { margin-top: 10px; display:flex; flex-wrap:wrap; gap:8px; }

.progress-track {
  height: 8px; border-radius: 999px; background: rgba(7,11,22,.8);
  border: 1px solid var(--line); overflow: hidden; margin: 12px 12px 4px;
}
.progress-track > i {
  display:block; height:100%; width:0%;
  background: var(--grad); transition: width .4s ease;
  box-shadow: 0 0 16px rgba(45,212,191,.5);
}

.usage-bars { display:flex; flex-direction:column; gap:10px; }
.usage-row { display:grid; grid-template-columns: 1fr 90px; gap:10px; align-items:center; }
.usage-row .bar {
  height: 10px; border-radius:999px; background: rgba(7,11,22,.7); overflow:hidden; border:1px solid var(--line);
}
.usage-row .bar > i { display:block; height:100%; background: var(--grad); border-radius:999px; }
.usage-row .lbl { font-size: 12.5px; color: var(--muted); display:flex; justify-content:space-between; margin-bottom:4px; }
.usage-row .lbl b { color: var(--text); }

.chart-box { height: 180px; position: relative; }

.hidden { display:none !important; }
.empty {
  padding: 28px; text-align:center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 16px;
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; border-inline-end:0; border-bottom:1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav button { width: auto; }
  .side-foot { position: static; }
  .main { padding: 18px 14px 40px; }
}
