/* ═══════════════════════════════════════
   Spredio — Premium Dark Dashboard Theme
   Rounded cards, purple/orange accents, glassmorphism
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:    #0a0a0f;
  --bg2:   #12121a;
  --bg3:   #16161f;
  --bg4:   #1c1c28;
  --card:  #16161f;
  --card2: #1a1a26;
  --brd:   #252533;
  --brd2:  #1f1f2e;
  --tx:    #f0f0f5;
  --tx2:   #b8b8cc;
  --tx3:   #8888a0;
  --dm:    #555566;
  --ac:    #7c5cfc;
  --ac2:   #6a4ce0;
  --ac3:   #9b7eff;
  --gn:    #2dd4a0;
  --gn2:   #064e3b;
  --rd:    #f87171;
  --rd2:   #7f1d1d;
  --yl:    #f0a030;
  --yl2:   #78350f;
  --bl:    #60a5fa;
  --cr:    #f97316;
  --pr:    #a78bfa;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.2);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--tx2);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
input, button, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--dm); }

/* ── Inputs ── */
.inp {
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: var(--radius-xs);
  color: var(--tx);
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.inp:focus { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(124,92,252,.15); }
.inp::placeholder { color: var(--dm); }
textarea.inp { resize: vertical; min-height: 80px; line-height: 1.6; }

/* ── Buttons ── */
.btn {
  padding: 10px 20px;
  background: var(--ac);
  border: none;
  border-radius: var(--radius-xs);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 12px rgba(124,92,252,.25);
}
.btn:hover { background: var(--ac2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124,92,252,.35); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.bs {
  padding: 5px 12px;
  font-size: 11px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
}
.bs:hover { opacity: .85; }

.bg0 {
  background: transparent;
  border: 1px solid var(--brd);
  color: var(--tx3);
  cursor: pointer;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  transition: all .2s;
}
.bg0:hover { border-color: var(--ac); color: var(--ac); background: rgba(124,92,252,.06); }

.br0 { background: var(--rd2); color: #fca5a5; }
.bgn0 { background: var(--gn2); color: #6ee7b7; }
.b-disc { background: rgba(124,92,252,.15); color: var(--ac3); border: 1px solid rgba(124,92,252,.25); }
.b-disc:hover { background: rgba(124,92,252,.25); }
.b-sell { background: rgba(249,115,22,.12); color: var(--cr); border: 1px solid rgba(249,115,22,.2); }
.b-sell:hover { background: rgba(249,115,22,.2); }
.bw { width: 100%; }

/* ── Layout helpers ── */
.fx { display: flex; align-items: center; }
.g1 { gap: 6px; }
.g2 { gap: 10px; }
.fw { flex-wrap: wrap; }

/* ── Common ── */
.err { color: var(--rd); font-size: 12px; margin-top: 8px; }
.suc { color: var(--gn); font-size: 12px; margin-top: 8px; }
.fr { margin-bottom: 12px; }
.fl { font-size: 11px; color: var(--tx3); margin-bottom: 4px; display: block; font-weight: 600; letter-spacing: .3px; }
.empty { text-align: center; padding: 32px; color: var(--dm); font-size: 13px; }

/* ── Spinner ── */
.ld { text-align: center; padding: 40px; color: var(--tx3); }
.sp {
  display: inline-block;
  width: 24px; height: 24px;
  border: 2.5px solid var(--brd);
  border-top-color: var(--ac);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════
   LOGIN
   ═══════════════════════════ */
.login-w {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,92,252,.08) 0%, transparent 60%);
}
.login-b {
  width: 380px;
  background: var(--card);
  border: 1px solid var(--brd);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
}
.login-logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--ac), var(--cr));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 800;
  box-shadow: 0 4px 20px rgba(124,92,252,.3);
}
.login-b h2 { font-size: 22px; font-weight: 800; color: var(--tx); margin: 16px 0 4px; }
.login-b p { font-size: 13px; color: var(--tx3); margin-bottom: 24px; }
.login-r { display: flex; gap: 8px; }

/* ═══════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════ */
.lay { display: flex; min-height: 100vh; }

/* Sidebar */
.sb {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--brd2);
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 50;
  display: flex; flex-direction: column;
}
.sb-h {
  padding: 20px 18px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--brd2);
}
.sb-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--ac), var(--cr));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 800;
  box-shadow: 0 2px 12px rgba(124,92,252,.25);
}
.sb-label { font-size: 11px; color: var(--dm); font-weight: 700; letter-spacing: 1.5px; padding: 20px 18px 8px; text-transform: uppercase; }
.sb nav { flex: 1; padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }

.nb {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--tx3);
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  width: 100%; text-align: left;
  transition: all .15s;
}
.nb.on { background: rgba(124,92,252,.1); color: var(--ac3); font-weight: 600; }
.nb:hover:not(.on) { background: rgba(255,255,255,.03); color: var(--tx2); }

.nb-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

/* Main area */
.ma { margin-left: 220px; flex: 1; min-width: 0; }

.hd {
  padding: 16px 28px;
  border-bottom: 1px solid var(--brd2);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg2);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
}
.hd h1 { font-size: 18px; font-weight: 700; color: var(--tx); }

.ct { padding: 24px 28px; }

/* ═══════════════════════════
   STAT CARDS
   ═══════════════════════════ */
.sg { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.sc {
  background: var(--card);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .2s, transform .2s;
}
.sc:hover { border-color: var(--brd); transform: translateY(-1px); }
.sl { font-size: 11px; font-weight: 600; color: var(--tx3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.sv { font-size: 26px; font-weight: 800; color: var(--tx); font-feature-settings: 'tnum'; }
.ssu { font-size: 11px; color: var(--dm); margin-top: 2px; }

/* ═══════════════════════════
   TABLES
   ═══════════════════════════ */
.tw { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--brd); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 10px 14px; text-align: left;
  color: var(--tx3); font-weight: 600; font-size: 11px;
  letter-spacing: .4px; text-transform: uppercase;
  border-bottom: 1px solid var(--brd);
  background: var(--bg3); white-space: nowrap;
}
td { padding: 10px 14px; color: var(--tx2); border-bottom: 1px solid var(--brd2); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr.ck { cursor: pointer; transition: background .1s; }
tr.ck:hover td { background: rgba(124,92,252,.04); }

/* ═══════════════════════════
   BADGES
   ═══════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.badge .dt { width: 5px; height: 5px; border-radius: 50%; }
.b-confirmed { background: rgba(45,212,160,.1); color: var(--gn); }
.b-confirmed .dt { background: var(--gn); }
.b-pending { background: rgba(240,160,48,.1); color: var(--yl); }
.b-pending .dt { background: var(--yl); }
.b-expired, .b-rejected { background: rgba(248,113,113,.1); color: var(--rd); }
.b-expired .dt, .b-rejected .dt { background: var(--rd); }
.b-force_expired { background: rgba(167,139,250,.1); color: var(--pr); }
.b-force_expired .dt { background: var(--pr); }

/* ═══════════════════════════
   PILLS / FILTERS
   ═══════════════════════════ */
.pill {
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--brd); background: transparent;
  color: var(--tx3); font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.pill:hover { border-color: var(--ac); color: var(--ac); }
.pill.on { border-color: var(--ac); background: rgba(124,92,252,.1); color: var(--ac3); }

/* ═══════════════════════════
   PROGRESS BAR
   ═══════════════════════════ */
.prog { width: 100%; height: 4px; border-radius: 2px; background: var(--brd); overflow: hidden; }
.pf { height: 100%; border-radius: 2px; transition: width .3s ease; }

/* Status dots */
.bd { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.bd.on { background: var(--gn); box-shadow: 0 0 6px rgba(45,212,160,.5); }
.bd.off { background: var(--dm); }

/* ═══════════════════════════
   MODAL
   ═══════════════════════════ */
.mo-bg {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}
.mo {
  background: var(--card);
  border: 1px solid var(--brd);
  border-radius: 18px;
  width: 92%; max-width: 560px; max-height: 85vh;
  overflow: auto; padding: 24px;
  box-shadow: var(--shadow);
  animation: modal-in .2s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.mo-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.mo-h h3 { font-size: 17px; font-weight: 700; color: var(--tx); }
.mo-x { background: var(--bg4); border: none; color: var(--tx3); cursor: pointer; font-size: 14px; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.mo-x:hover { background: var(--brd); color: var(--tx); }

/* ═══════════════════════════
   DETAIL GRID
   ═══════════════════════════ */
.dg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.db { background: var(--bg3); border-radius: var(--radius-sm); padding: 12px; }
.dl { font-size: 10px; color: var(--tx3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; font-weight: 600; }
.dv { font-size: 14px; color: var(--tx); font-weight: 700; }

/* ═══════════════════════════
   PANELS
   ═══════════════════════════ */
.pn { background: var(--card); border: 1px solid var(--brd); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.pn-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pn-h h4 { font-size: 13px; font-weight: 700; color: var(--tx); }
.pn-r {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--brd2);
}
.pn-r:last-child { border-bottom: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tb { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }

/* ═══════════════════════════
   SCANNER ITEMS
   ═══════════════════════════ */
.srv {
  background: var(--bg3); border: 1px solid var(--brd);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 6px;
  display: flex; justify-content: space-between; align-items: center;
  transition: all .15s;
}
.srv:hover { border-color: var(--ac); background: rgba(124,92,252,.03); }

.ch-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--brd2);
  cursor: pointer; font-size: 13px;
  transition: background .1s;
}
.ch-item:hover { background: rgba(124,92,252,.03); }
.ch-item:last-child { border-bottom: none; }
.ch-added { color: var(--gn) !important; font-weight: 700; }

/* Scanner steps */
.step-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 12px; }
.step { padding: 6px 14px; border-radius: 20px; font-weight: 600; transition: all .15s; }
.step.active { background: var(--ac); color: #fff; box-shadow: 0 2px 8px rgba(124,92,252,.3); }
.step.done { background: var(--gn2); color: #6ee7b7; cursor: pointer; }
.step.wait { background: var(--bg4); color: var(--dm); }
.step-arr { color: var(--dm); }

.back {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--ac3); font-size: 12px; cursor: pointer;
  background: none; border: none; font-weight: 600; margin-bottom: 12px;
}
.back:hover { text-decoration: underline; }
.crumb { font-size: 13px; margin-bottom: 12px; }

/* ═══════════════════════════
   TOAST
   ═══════════════════════════ */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in .25s ease-out;
  max-width: 360px;
  backdrop-filter: blur(12px);
}
.toast.success { background: rgba(45,212,160,.12); color: var(--gn); border: 1px solid rgba(45,212,160,.2); }
.toast.error   { background: rgba(248,113,113,.12); color: var(--rd); border: 1px solid rgba(248,113,113,.2); }
.toast.info    { background: rgba(124,92,252,.12); color: var(--ac3); border: 1px solid rgba(124,92,252,.2); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ═══════════════════════════
   TEST PANEL
   ═══════════════════════════ */
.test-panel {
  background: var(--bg3);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 12px;
}
.test-panel h5 {
  font-size: 11px; font-weight: 700; color: var(--yl);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 10px;
}
.test-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.test-result {
  font-size: 11px; padding: 8px 12px;
  border-radius: var(--radius-xs); margin-top: 4px;
  white-space: pre-wrap; word-break: break-all;
  font-family: 'JetBrains Mono', monospace;
}
.test-result.ok  { background: rgba(45,212,160,.08); color: var(--gn); }
.test-result.err { background: rgba(248,113,113,.08); color: var(--rd); }

/* ═══════════════════════════
   CUSTOMER DASHBOARD
   ═══════════════════════════ */
.cust-header {
  padding: 32px 28px 24px;
  border-bottom: 1px solid var(--brd2);
  background: linear-gradient(180deg, rgba(124,92,252,.06) 0%, transparent 100%);
}
.cust-header h2 { font-size: 24px; font-weight: 800; color: var(--tx); margin-bottom: 4px; }
.cust-header p { font-size: 14px; color: var(--tx3); }

.cust-plan-card {
  background: linear-gradient(135deg, rgba(124,92,252,.12), rgba(249,115,22,.08));
  border: 1px solid rgba(124,92,252,.2);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

/* ═══════════════════════════
   RESPONSIVE
   ═══════════════════════════ */
@media (max-width: 768px) {
  .sb { display: none; }
  .ma { margin-left: 0; }
  .two { grid-template-columns: 1fr; }
  .ct { padding: 16px; }
  .hd { padding: 12px 16px; }
}

/* ═══════════════════════════
   AUDIT LOG
   ═══════════════════════════ */
.audit-timeline { display: flex; flex-direction: column; gap: 0; }
.audit-entry {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--brd2);
}
.audit-entry:last-child { border-bottom: none; }
.audit-icon {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  background: var(--bg2); border-radius: 50%; font-size: 10px; flex-shrink: 0;
}

/* ═══════════════════════════
   AD PREVIEW
   ═══════════════════════════ */
.ad-preview {
  margin-top: 4px; padding: 8px 10px; background: #36393f; border-radius: 5px;
  font-size: 11px; color: #dcddde; line-height: 1.4; font-family: 'Segoe UI', sans-serif;
  min-height: 20px; word-break: break-word;
}
.ad-preview a { color: #00aff4; }
.ad-preview strong { color: #fff; }
.av-row {
  padding: 8px; background: var(--bg2); border-radius: 5px; margin-bottom: 6px;
  border: 1px solid var(--brd);
}
