/* HostDesk v5 — Main Stylesheet */
*{box-sizing:border-box;margin:0;padding:0}

:root{
  --blue:#2563eb;--blue-lt:#eff6ff;--blue-dk:#1d4ed8;
  --green:#16a34a;--green-lt:#f0fdf4;
  --red:#dc2626;--red-lt:#fef2f2;
  --orange:#d97706;--orange-lt:#fffbeb;
  --purple:#7c3aed;--purple-lt:#f5f3ff;
  --teal:#0891b2;--teal-lt:#ecfeff;
  --gray:#64748b;--gray-lt:#f8fafc;
  --border:#e2e8f0;
  --sidebar-w:220px;
  --topbar-h:56px;
  --shadow-sm:0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.05);
  --shadow-md:0 4px 12px rgba(0,0,0,.1);
  --radius:12px;
  --radius-sm:8px;
}

body{
  font-family:'Inter',sans-serif;
  background:#f1f5f9;
  color:#1e293b;
  min-height:100vh;
  display:grid;
  grid-template-columns:var(--sidebar-w) 1fr;
  grid-template-rows:var(--topbar-h) 1fr;
}

/* ── Top Bar ───────────────────────────────────────────────── */
.topbar{
  grid-column:1/-1;
  background:#fff;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  padding:0 20px 0 0;
  height:var(--topbar-h);
  position:sticky;
  top:0;
  z-index:100;
  box-shadow:var(--shadow-sm);
}
.topbar-brand{
  width:var(--sidebar-w);
  flex-shrink:0;
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 20px;
  border-right:1px solid var(--border);
  height:100%;
}
.logo-icon{
  width:34px;height:34px;border-radius:10px;
  background:linear-gradient(135deg,#2563eb,#7c3aed);
  display:flex;align-items:center;justify-content:center;
  font-size:16px;font-weight:800;color:#fff;letter-spacing:-1px;flex-shrink:0;
}
.logo-text{font-size:16px;font-weight:700;color:#1e293b;letter-spacing:-.3px}
.logo-text span{color:#2563eb}
.topbar-center{flex:1;padding:0 20px}
#dbStatus{font-size:11px;color:#94a3b8;transition:opacity .5s}
.topbar-right{display:flex;gap:8px;align-items:center;flex-shrink:0}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar{
  background:#fff;
  border-right:1px solid var(--border);
  padding:16px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
  overflow-y:auto;
  position:sticky;
  top:var(--topbar-h);
  height:calc(100vh - var(--topbar-h));
}
.sidebar-group-label{
  font-size:10px;font-weight:700;color:#94a3b8;
  text-transform:uppercase;letter-spacing:.08em;
  padding:12px 10px 4px;
}
.nav-tab{
  display:flex;align-items:center;gap:10px;
  padding:8px 12px;border-radius:var(--radius-sm);
  cursor:pointer;font-size:13px;font-weight:500;
  color:#64748b;transition:all .12s;white-space:nowrap;
  position:relative;
}
.nav-tab:hover{background:#f8fafc;color:#1e293b}
.nav-tab.active{background:var(--blue-lt);color:var(--blue);font-weight:600}
.nav-tab.active::before{
  content:'';position:absolute;left:0;top:50%;transform:translateY(-50%);
  height:60%;width:3px;background:var(--blue);border-radius:0 3px 3px 0;
}
.nav-tab .nt-icon{font-size:15px;width:20px;text-align:center;flex-shrink:0}
#reminderDot{
  background:#dc2626;color:#fff;border-radius:50%;
  width:16px;height:16px;font-size:9px;font-weight:700;
  display:none;align-items:center;justify-content:center;margin-left:auto;
}

/* ── Main Content ──────────────────────────────────────────── */
.main{padding:20px;overflow-y:auto;min-height:0}

/* ── Page Header ───────────────────────────────────────────── */
.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}
.page-header h1{font-size:20px;font-weight:700;color:#0f172a;display:flex;align-items:center;gap:8px}
.page-header p{font-size:13px;color:#64748b;margin-top:2px}

/* ── Card ──────────────────────────────────────────────────── */
.card{
  background:#fff;border-radius:var(--radius);
  box-shadow:var(--shadow-sm);border:1px solid var(--border);
  padding:20px;margin-bottom:16px;
}
.card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.card-title{font-size:15px;font-weight:600;color:#0f172a;display:flex;align-items:center;gap:8px}
.card h2{font-size:15px;font-weight:600;margin-bottom:16px;display:flex;align-items:center;gap:8px;color:#0f172a}

/* ── Stats Grid ────────────────────────────────────────────── */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-bottom:20px}
.stat-card{
  background:#fff;border-radius:var(--radius);border:1px solid var(--border);
  padding:18px 20px;display:flex;flex-direction:column;gap:4px;
  box-shadow:var(--shadow-sm);
}
.stat-card .sv{font-size:30px;font-weight:800;color:#0f172a;line-height:1}
.stat-card .sl{font-size:12px;color:#64748b;font-weight:500;margin-top:2px}
.stat-card .si{font-size:22px;margin-bottom:6px}

/* ── Toolbar ───────────────────────────────────────────────── */
.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.search-box{position:relative;flex:1;min-width:200px}
.search-box input{
  width:100%;padding:8px 12px 8px 36px;
  border:1px solid var(--border);border-radius:var(--radius-sm);
  font-size:13px;outline:none;transition:all .15s;background:#f8fafc;
  font-family:inherit;color:#1e293b;
}
.search-box input:focus{border-color:#93c5fd;background:#fff;box-shadow:0 0 0 3px #dbeafe}
.search-box input::placeholder{color:#94a3b8}
.search-box .si{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:#94a3b8;pointer-events:none}
select.filter{
  padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);
  font-size:13px;outline:none;background:#f8fafc;cursor:pointer;color:#374151;
  font-family:inherit;transition:all .15s;
}
select.filter:focus{border-color:#93c5fd;background:#fff;box-shadow:0 0 0 3px #dbeafe}

/* ── Table ─────────────────────────────────────────────────── */
.tbl-wrap{overflow-x:auto;border-radius:var(--radius-sm);border:1px solid var(--border)}
table{width:100%;border-collapse:collapse;font-size:13px}
thead{position:sticky;top:0;z-index:1}
th{
  background:#f8fafc;padding:10px 14px;text-align:left;
  font-weight:600;color:#475569;font-size:11px;
  text-transform:uppercase;letter-spacing:.06em;
  border-bottom:1px solid var(--border);white-space:nowrap;
}
td{padding:10px 14px;border-bottom:1px solid #f1f5f9;color:#374151;vertical-align:middle}
tr:last-child td{border-bottom:none}
tr.dom-row:hover{background:#f8fafc;cursor:pointer}
tr.dom-row.expanded{background:#eff6ff}
tr.exp-row td{padding:0;background:#f8fafc}
.exp-inner{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;padding:16px}

/* ── Expanded Row Boxes ────────────────────────────────────── */
.exp-box{background:#fff;border-radius:var(--radius-sm);border:1px solid var(--border);overflow:hidden}
.exp-box-head{padding:9px 14px;font-weight:600;font-size:11px;display:flex;align-items:center;gap:6px;text-transform:uppercase;letter-spacing:.05em}
.exp-box-body{padding:10px 14px;font-size:12px;line-height:1.7;color:#475569}
.exp-box-body .row{display:flex;gap:6px;margin-bottom:2px}
.exp-row2{display:flex;gap:8px;margin-bottom:4px;align-items:flex-start}
.box-live .exp-box-head{background:#fef2f2;color:#dc2626}
.box-demo .exp-box-head{background:#f5f3ff;color:#7c3aed}
.box-park .exp-box-head{background:#eff6ff;color:#2563eb}
.box-dns  .exp-box-head{background:#f0fdf4;color:#16a34a}
.box-whois .exp-box-head{background:#fffbeb;color:#d97706}
.box-hist .exp-box-head{background:#f8fafc;color:#475569}
.box-bkp{border-top:3px solid #f59e0b}
.box-bkp .exp-box-head{background:linear-gradient(135deg,#78350f,#d97706);color:#fff}
.exp-actions{
  padding:10px 16px;display:flex;gap:8px;flex-wrap:wrap;
  border-top:1px solid var(--border);background:#fff;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:600;white-space:nowrap}
.badge-green{background:#dcfce7;color:#16a34a}
.badge-red{background:#fee2e2;color:#dc2626}
.badge-orange{background:#ffedd5;color:#d97706}
.badge-blue{background:#dbeafe;color:#1d4ed8}
.badge-gray{background:#f1f5f9;color:#64748b}
.badge-purple{background:#ede9fe;color:#7c3aed}
.badge-teal{background:#cffafe;color:#0891b2}

/* ── Buttons ───────────────────────────────────────────────── */
.btn{
  display:inline-flex;align-items:center;gap:6px;
  padding:7px 16px;border-radius:var(--radius-sm);font-size:13px;
  font-weight:500;cursor:pointer;border:none;transition:all .12s;
  white-space:nowrap;font-family:inherit;line-height:1;
}
.btn-primary{background:#2563eb;color:#fff}
.btn-primary:hover{background:#1d4ed8}
.btn-green{background:#16a34a;color:#fff}
.btn-green:hover{background:#15803d}
.btn-red{background:#dc2626;color:#fff}
.btn-red:hover{background:#b91c1c}
.btn-outline{background:#fff;color:#374151;border:1px solid var(--border)}
.btn-outline:hover{background:#f9fafb;border-color:#cbd5e1}
.btn-ghost{background:transparent;color:#64748b;padding:6px 10px}
.btn-ghost:hover{background:#f1f5f9;color:#374151}
.btn-sm{padding:5px 10px;font-size:12px;border-radius:6px}
.btn-icon{padding:6px;border-radius:6px}
button:disabled{opacity:.5;cursor:not-allowed}

/* ── Form ──────────────────────────────────────────────────── */
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
.form-row.full{grid-template-columns:1fr}
.form-group{display:flex;flex-direction:column;gap:4px}
label.fl{font-size:12px;font-weight:600;color:#475569}
input.fi,select.fi,textarea.fi{
  padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);
  font-size:13px;outline:none;transition:all .15s;font-family:inherit;
  color:#1e293b;background:#fff;
}
input.fi:focus,select.fi:focus,textarea.fi:focus{border-color:#93c5fd;box-shadow:0 0 0 3px #dbeafe}
input.fi.fa{animation:flashgreen .5s}
@keyframes flashgreen{0%{background:#dcfce7;border-color:#86efac}100%{background:#fff;border-color:#e2e8f0}}
.fstat{padding:8px 12px;border-radius:8px;font-size:12px;margin-top:8px;display:none}
.fstat.show{display:flex;align-items:center;gap:8px}
.fstat.fok{background:#f0fdf4;color:#15803d;border:1px solid #bbf7d0}
.fstat.fwarn{background:#fffbeb;color:#92400e;border:1px solid #fde68a}
.fstat.ferr{background:#fef2f2;color:#991b1b;border:1px solid #fecaca}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-bg{
  position:fixed;inset:0;background:rgba(0,0,0,.4);backdrop-filter:blur(2px);
  display:flex;align-items:center;justify-content:center;z-index:200;padding:20px;
}
.modal{
  background:#fff;border-radius:16px;width:100%;max-width:780px;
  max-height:90vh;overflow:hidden;display:flex;flex-direction:column;
  box-shadow:0 24px 48px rgba(0,0,0,.2);border:1px solid var(--border);
}
.modal-head{
  padding:18px 22px;border-bottom:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;flex-shrink:0;
}
.modal-head h3{font-size:16px;font-weight:700;color:#0f172a}
.modal-body{overflow-y:auto;flex:1;padding:22px}
.modal-foot{
  padding:12px 20px;background:#f8fafc;border-top:1px solid var(--border);
  display:flex;gap:8px;justify-content:flex-end;flex-shrink:0;
}

/* ── Step Bar ──────────────────────────────────────────────── */
.step-bar{display:flex;align-items:center;padding:10px 20px;background:#f8fafc;border-bottom:1px solid var(--border);gap:0;flex-shrink:0}
.step-bar-item{display:flex;align-items:center;gap:6px;cursor:pointer;padding:6px 10px;border-radius:var(--radius-sm);transition:.15s;flex:1;justify-content:center}
.step-bar-item:hover{background:#e2e8f0}
.step-bar-item.active{background:var(--blue-lt)}
.step-bar-item.done{opacity:.7}
.sb-num{width:20px;height:20px;border-radius:50%;background:#e2e8f0;color:#64748b;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.step-bar-item.active .sb-num{background:#2563eb;color:#fff}
.step-bar-item.done .sb-num{background:#16a34a;color:#fff}
.sb-lbl{font-size:11px;font-weight:600;color:#64748b;white-space:nowrap}
.step-bar-item.active .sb-lbl{color:#2563eb}
.step-bar-sep{width:20px;height:1px;background:#e2e8f0;flex-shrink:0}
.step-pane{display:none}.step-pane.active{display:block}
.step-section-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#64748b;margin:14px 0 8px;padding-bottom:4px;border-bottom:1px solid var(--border)}

/* ── Fetch Panel ───────────────────────────────────────────── */
.fetch-panel{background:#f0f7ff;border:1px solid #bfdbfe;border-radius:var(--radius-sm);padding:12px 14px}

/* ── Site Type Buttons ─────────────────────────────────────── */
.site-type-btn{background:#f8fafc;border:1px solid var(--border);border-radius:var(--radius-sm);padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer;color:#64748b;transition:.12s}
.site-type-btn:hover{background:#eff6ff;border-color:#bfdbfe;color:#2563eb}
.site-type-btn.active{background:#eff6ff;border-color:#3b82f6;color:#2563eb}

/* ── Spinner & Overlay ─────────────────────────────────────── */
.ov{position:absolute;inset:0;background:rgba(255,255,255,.92);display:none;align-items:center;justify-content:center;flex-direction:column;gap:12px;border-radius:16px;z-index:10}
.spinner{width:32px;height:32px;border:3px solid #dbeafe;border-top-color:#2563eb;border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── DNS Cards ─────────────────────────────────────────────── */
.dns-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:12px;margin-top:12px}
.dns-card{background:#fff;border-radius:var(--radius-sm);border:1px solid var(--border);overflow:hidden}
.dns-card-head{padding:10px 14px;font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.05em;display:flex;align-items:center;justify-content:space-between}
.dns-card-body{padding:10px 14px}
.dns-row{display:flex;padding:5px 0;border-bottom:1px solid #f1f5f9;font-size:12px;gap:8px}
.dns-row:last-child{border-bottom:none}
.dns-type{background:#dbeafe;color:#1d4ed8;padding:1px 6px;border-radius:4px;font-size:10px;font-weight:700;flex-shrink:0;height:fit-content;margin-top:2px}
.dns-val{color:#1e293b;word-break:break-all;flex:1}
.dns-ip{color:#64748b;font-size:11px}
.dns-ttl{color:#94a3b8;font-size:10px;margin-left:auto;flex-shrink:0}
.c-A{background:#dbeafe;color:#1d4ed8}.c-AAAA{background:#ede9fe;color:#6d28d9}
.c-NS{background:#dcfce7;color:#15803d}.c-MX{background:#ffedd5;color:#c2410c}
.c-TXT{background:#f1f5f9;color:#475569}.c-CNAME{background:#fce7f3;color:#9d174d}
.c-SRV{background:#7e22ce;color:#fff}.c-SOA{background:#0369a1;color:#fff}
.c-SPF{background:#0891b2;color:#fff}.c-DKIM{background:#0d9488;color:#fff}.c-DMARC{background:#7c3aed;color:#fff}

/* ── WHOIS / SSL Info Cards ────────────────────────────────── */
.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.info-card{background:#fff;border-radius:var(--radius-sm);border:1px solid var(--border);overflow:hidden}
.info-card-head{padding:10px 14px;font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.05em}
.info-card-body{padding:12px 14px}
.lookup-section{background:#fff;border:1px solid var(--border);border-radius:var(--radius-sm);margin-top:12px;overflow:hidden}
.lookup-section-head{padding:10px 16px;font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:#fff}
.wh-head{background:linear-gradient(135deg,#1e40af,#3b82f6)}
.ssl-head{background:linear-gradient(135deg,#065f46,#10b981)}
.lookup-section-body{padding:10px 16px}
.info-row{display:flex;gap:12px;padding:6px 0;border-bottom:1px solid #f8fafc;align-items:flex-start}
.info-row:last-child{border-bottom:none}
.info-lbl{min-width:110px;font-size:11px;color:#64748b;font-weight:600;text-transform:uppercase;letter-spacing:.04em;padding-top:1px;flex-shrink:0}
.info-val{flex:1;font-size:13px;color:#1e293b;word-break:break-word}

/* ── Parking Entries ───────────────────────────────────────── */
.park-entry{border:1px solid var(--border);border-radius:var(--radius-sm);padding:12px;margin-bottom:8px;background:#fafafa}
.park-entry-head{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.parking-dns-mini{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;margin-top:8px}
.mini-dns-card{background:#f8fafc;border-radius:6px;padding:6px 8px;font-size:11px}
.mini-dns-card .mt{font-weight:700;color:#475569;font-size:10px;text-transform:uppercase}
.mini-dns-card .mv{color:#1e293b;word-break:break-all;margin-top:2px}

/* ── Monitor ───────────────────────────────────────────────── */
.mon-dot{width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:6px;flex-shrink:0}
.mon-up{background:#16a34a}.mon-down{background:#dc2626}.mon-unknown{background:#94a3b8}

/* ── History ───────────────────────────────────────────────── */
.hist-domain-block{background:#fff;border:1px solid var(--border);border-radius:var(--radius-sm);margin-bottom:12px;overflow:hidden}
.hist-domain-head{background:#f8fafc;padding:10px 16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border)}
.hist-domain-name{font-weight:700;color:#1e40af;font-size:14px}
.hist-entries{padding:8px 16px}
.hist-entry{padding:8px 0;border-bottom:1px solid #f1f5f9}
.hist-entry:last-child{border-bottom:none}

/* ── Expiry ────────────────────────────────────────────────── */
.exp-ok{background:#dcfce7;color:#15803d}
.exp-warn{background:#ffedd5;color:#c2410c}
.exp-danger{background:#fee2e2;color:#991b1b}

/* ── Toast ─────────────────────────────────────────────────── */
#toast-wrap{position:fixed;bottom:20px;right:20px;display:flex;flex-direction:column;gap:8px;z-index:999}
.toast{
  padding:10px 16px;border-radius:var(--radius-sm);font-size:13px;font-weight:500;
  box-shadow:var(--shadow-md);animation:slideUp .25s;pointer-events:none;max-width:320px;
}
.toast-ok{background:#16a34a;color:#fff}
.toast-err{background:#dc2626;color:#fff}
.toast-warn{background:#d97706;color:#fff}
.toast-info{background:#2563eb;color:#fff}
@keyframes slideUp{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}

/* ── Misc ──────────────────────────────────────────────────── */
.src-tag{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:600;background:#dbeafe;color:#1d4ed8}
.divider{height:1px;background:var(--border);margin:8px 0}

/* ── Responsive ────────────────────────────────────────────── */
@media(max-width:900px){
  body{grid-template-columns:1fr;grid-template-rows:var(--topbar-h) auto 1fr}
  .sidebar{display:none}
  .topbar-brand{border-right:none}
}
@media(max-width:640px){
  .form-row{grid-template-columns:1fr}
  .info-grid{grid-template-columns:1fr}
  .exp-inner{grid-template-columns:1fr}
  .main{padding:12px}
}
