/* CryptoSec Labs — global theme system */
:root{
  --th-bg:#0a0e1a;--th-bg2:#0d1524;--th-panel:#131c31;--th-panel2:#0f172a;
  --th-border:#1e293b;--th-border2:#334155;
  --th-text:#e2e8f0;--th-text2:#cbd5e1;--th-muted:#94a3b8;--th-dim:#64748b;
  --th-primary:#3b82f6;--th-primary-h:#2563eb;--th-accent:#8b5cf6;
  --th-success:#22c55e;--th-warn:#fbbf24;--th-danger:#f87171;
}
html[data-theme="light"]{
  --th-bg:#f8fafc;--th-bg2:#ffffff;--th-panel:#ffffff;--th-panel2:#f1f5f9;
  --th-border:#e2e8f0;--th-border2:#cbd5e1;
  --th-text:#0f172a;--th-text2:#1e293b;--th-muted:#475569;--th-dim:#64748b;
  --th-primary:#2563eb;--th-primary-h:#1d4ed8;--th-accent:#7c3aed;
  --th-success:#16a34a;--th-warn:#ca8a04;--th-danger:#dc2626;
}

html,body{background:var(--th-bg) !important;color:var(--th-text) !important}
a{color:var(--th-primary)}

.site-header,.topbar,header.site-header{
  background:var(--th-panel) !important;
  border-bottom-color:var(--th-border) !important;
}
html[data-theme="light"] .site-header{background:rgba(255,255,255,.95) !important}
.site-header .brand span,.topbar .topbar-brand{color:var(--th-text) !important}
.main-nav a{color:var(--th-muted) !important}
.main-nav a:hover{color:var(--th-text) !important}

.sidebar,.admin-sidebar{
  background:var(--th-panel) !important;
  border-right-color:var(--th-border) !important;
}
.sidebar a,.admin-sidebar a,.nav-link,.group-links a{color:var(--th-muted) !important}
.sidebar a:hover,.admin-sidebar a:hover,.nav-link:hover,.group-links a:hover{
  background:var(--th-panel2) !important;color:var(--th-text) !important;
}
.sidebar .brand,.admin-sidebar .brand{
  color:var(--th-text) !important;
  border-bottom-color:var(--th-border) !important;
}

.card,.panel,.admin-card,.pricing-card,.form-card{
  background:var(--th-panel) !important;
  border-color:var(--th-border) !important;
  color:var(--th-text) !important;
}
table.data,.pay-table,.tr-table{
  background:var(--th-panel) !important;
  border-color:var(--th-border) !important;
}
table.data th,.pay-table th,.tr-table th{
  background:var(--th-bg2) !important;
  color:var(--th-muted) !important;
  border-bottom-color:var(--th-border) !important;
}
table.data td,.pay-table td,.tr-table td{
  color:var(--th-text2) !important;
  border-bottom-color:var(--th-border) !important;
}
tr:hover{background:var(--th-panel2) !important}

input[type=text],input[type=email],input[type=password],input[type=url],
input[type=number],input[type=search],textarea,select{
  background:var(--th-bg) !important;
  color:var(--th-text) !important;
  border-color:var(--th-border) !important;
}
input:focus,textarea:focus,select:focus{border-color:var(--th-primary) !important}

.btn.ghost{
  background:var(--th-panel) !important;
  border-color:var(--th-border2) !important;
  color:var(--th-text) !important;
}
.btn.ghost:hover{background:var(--th-panel2) !important}
.btn.primary{background:linear-gradient(135deg,var(--th-primary),var(--th-accent)) !important;color:#fff !important}

h1,h2,h3,h4,h5,h6{color:var(--th-text) !important}
p,li,span,label{color:var(--th-text2) !important}
.muted,.lead{color:var(--th-muted) !important}
small{color:var(--th-dim) !important}

.result,.try-result,.scan-results,.job-row{
  background:var(--th-bg) !important;
  color:var(--th-text2) !important;
  border-color:var(--th-border) !important;
}

.badge{background:var(--th-panel2) !important;color:var(--th-muted) !important}

/* Theme switcher */
.theme-switch{position:relative;display:inline-block;line-height:1}
.theme-btn{display:inline-flex;align-items:center;gap:.35rem;background:rgba(15,23,42,.6);border:1px solid rgba(148,163,184,.25);color:#cbd5e1;padding:.5rem .75rem;border-radius:8px;cursor:pointer;font-size:.82rem;font-family:inherit;font-weight:600}
.theme-btn:hover{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.4);color:#fff}
html[data-theme="light"] .theme-btn{background:#ffffff;border-color:#e2e8f0;color:#334155}
html[data-theme="light"] .theme-btn:hover{background:#f1f5f9;color:#0f172a}
.theme-menu{position:absolute;top:calc(100% + 8px);right:0;min-width:160px;background:var(--th-panel);border:1px solid var(--th-border);border-radius:12px;box-shadow:0 20px 50px rgba(0,0,0,.3);padding:.4rem;z-index:99999;display:none}
.theme-switch.open .theme-menu{display:block}
.theme-item{display:flex;align-items:center;gap:.6rem;padding:.6rem .75rem;border-radius:8px;color:var(--th-text);font-size:.88rem;white-space:nowrap;cursor:pointer;background:transparent;border:0;width:100%;text-align:left;font-family:inherit}
.theme-item:hover{background:var(--th-panel2)}
.theme-item.active{background:rgba(59,130,246,.15);color:var(--th-primary);font-weight:600}