/* ═══════════════════════════════════════════════════════════════
   OTP Bot — Web Admin  (Premium Cyber: White, Blue, Red & Obsidian Black)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a101d;
  --bg-soft: #0f172a;
  --panel: #131f38;
  --panel-2: #182746;
  --border: #203250;
  --border-subtle: rgba(59, 130, 246, 0.2);
  --text: #f1f5f9;
  --text-pure: #ffffff;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --danger-2: #dc2626;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --radius: 12px;
  --shadow: 0 10px 30px -5px rgba(2, 6, 23, 0.5), 0 4px 12px -2px rgba(2, 6, 23, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(1300px 650px at 14% -5%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(1100px 550px at 92% 5%, rgba(239, 68, 68, 0.13), transparent 55%),
    radial-gradient(900px 900px at 50% 100%, rgba(30, 58, 138, 0.15), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  display: flex;
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}

h1 { font-size: 20px; margin: 0 0 16px; font-weight: 650; letter-spacing: .2px; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }

a { color: var(--accent); text-decoration: none; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex: 0 0 220px;
  background: linear-gradient(180deg, #0d1527, #0a101d);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 12px;
  border-bottom: 1px solid var(--border);
}

.btn-sidebar-close {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.btn-sidebar-close:hover,
.btn-sidebar-close:active {
  background: rgba(255, 255, 255, 0.2);
}

.brand strong { display: block; font-size: 15px; letter-spacing: 1px; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .6px; }

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 12px #3b82f6, 0 0 24px rgba(59, 130, 246, 0.6);
}

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav-link {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: all .15s ease;
}

.nav-link:hover { color: var(--text-pure); background: rgba(255, 255, 255, .05); }

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.22), rgba(239, 68, 68, 0.12));
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: inset 3px 0 0 #3b82f6;
  font-weight: 600;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 6px 0;
  border-top: 1px solid var(--border);
}

/* ── Main ────────────────────────────────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
  padding: 0 22px 40px;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 13, 20, .85);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clock { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  flex: 0 0 auto;
}

.status-dot.online { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

/* ── Sections ────────────────────────────────────────────────── */
.section { display: none; animation: fade .18s ease; }
.section.active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ── Cards ───────────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.cards.small { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.card {
  background: linear-gradient(160deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
  min-width: 0;
}

/* ── Full Details Grid ────────────────────────────────────────── */
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.detail-card {
  padding: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.detail-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.2px;
}

body.theme-light .detail-card {
  background: #ffffff;
  border-color: #e2e8f0;
}
body.theme-light .detail-card-title {
  border-bottom-color: #f1f5f9;
}

.card-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; }
.card strong {
  font-size: 22px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Panel box ───────────────────────────────────────────────── */
.panel-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.status-grid > div {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.status-grid strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.load-controls { display: flex; gap: 8px; flex-wrap: wrap; }

.muted { color: var(--muted); font-size: 12px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .5px;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-normal { color: #7ef0b0; background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .4); }
.badge-high { color: #fbd38d; background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .45); }
.badge-critical { color: #fca5a5; background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .5); }
.badge-off { color: var(--muted); background: rgba(255, 255, 255, .04); border-color: var(--border); }

/* Circuit breaker states */
.badge-closed { color: #7ef0b0; background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .4); }
.badge-half_open { color: #fbd38d; background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .45); }
.badge-open { color: #fca5a5; background: rgba(239, 68, 68, .16); border-color: rgba(239, 68, 68, .55); }

.badge-on { color: #7ef0b0; background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .4); }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(35, 43, 61, .6);
  vertical-align: middle;
}

tbody tr:hover { background: rgba(34, 211, 238, .035); }
tbody tr:last-child td { border-bottom: none; }

.live-wrap { max-height: 62vh; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.btn:hover { border-color: rgba(59, 130, 246, .55); color: #fff; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  font-weight: 650;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55);
}

.btn-danger {
  background: linear-gradient(135deg, #991b1b 0%, #dc2626 50%, #ef4444 100%);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  font-weight: 650;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #f87171 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.55);
}

.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); }

.btn-block { width: 100%; }

.btn-sm { padding: 5px 10px; font-size: 11.5px; }

button.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
}

/* ── Inputs ──────────────────────────────────────────────────── */
.input {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  min-width: 0;
}

.input:focus {
  border-color: rgba(34, 211, 238, .6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .12);
}

.input::placeholder { color: #55627a; }

select.input { cursor: pointer; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar .input { flex: 1 1 220px; max-width: 380px; }

.switch { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; cursor: pointer; }

.pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 14px; color: var(--muted); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.form-field {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; }

/* ── Logs ────────────────────────────────────────────────────── */
.logs-box {
  background: #070a10;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: #9fb2cc;
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all .22s ease;
  max-width: 340px;
  z-index: 100;
}

.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }

/* ── Login ───────────────────────────────────────────────────── */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}

.login-brand { border-bottom: none; padding: 0 0 18px; }
.login-brand strong { font-size: 17px; }

.login-card h1 { font-size: 19px; margin-bottom: 6px; }

.login-card form { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 14px; }

.token-input {
  font-family: "Cascadia Code", Consolas, monospace;
  letter-spacing: 1px;
  padding: 12px 14px;
}

.error-box {
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .45);
  color: #fca5a5;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-top: 12px;
}

.small-note { text-align: center; margin: 6px 0 0; }

/* ── Misc ────────────────────────────────────────────────────── */
.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }

.truncate {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.empty-row td { text-align: center; color: var(--muted); padding: 26px 12px; }

/* ── Service color coding (live OTP feed) ────────────────────── */
.svc {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .3px;
  border: 1px solid transparent;
}

.svc-a { color: #67e8f9; background: rgba(34, 211, 238, .12); border-color: rgba(34, 211, 238, .38); }
.svc-b { color: #c4b5fd; background: rgba(139, 92, 246, .14); border-color: rgba(139, 92, 246, .40); }
.svc-c { color: #86efac; background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .38); }
.svc-d { color: #fcd34d; background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .40); }
.svc-e { color: #f9a8d4; background: rgba(236, 72, 153, .12); border-color: rgba(236, 72, 153, .38); }
.svc-f { color: #93c5fd; background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .38); }

/* ═══════════════════════════════════════════════════════════════
   WEB ADMIN v2 — tabs, drawers, modals, charts, chips
   ═══════════════════════════════════════════════════════════════ */

.spacer { flex: 1 1 auto; }

/* ── quick action bar ─────────────────────────────────────────── */
.quick-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 16px;
}

/* ── two column layout ────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

/* ── 24h OTP chart ────────────────────────────────────────────── */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 160px;
  padding: 10px 4px 22px;
  border-bottom: 1px solid var(--border);
  overflow: visible;
}

.chart-col {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-width: 4px;
}

.chart-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--accent), rgba(99, 102, 241, .55));
  box-shadow: 0 0 10px rgba(34, 211, 238, .25);
  transition: height .25s ease;
}

.chart-col:hover .chart-bar { filter: brightness(1.3); }

.chart-val {
  position: absolute;
  top: -2px;
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s ease;
}

.chart-col:hover .chart-val { opacity: 1; }

.chart-x {
  position: absolute;
  bottom: -16px;
  font-size: 9.5px;
  color: #55627a;
  white-space: nowrap;
}

.chart + * { margin-top: 18px; }

/* ── rank lists ───────────────────────────────────────────────── */
.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rank-list li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .025);
  overflow: hidden;
}

.rank-list .rank-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(34, 211, 238, .16), rgba(99, 102, 241, .04));
  pointer-events: none;
}

.rank-list .rank-name {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-list b { position: relative; font-variant-numeric: tabular-nums; }

/* ── tabs ─────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}

.tab:hover { color: var(--text); border-color: rgba(34, 211, 238, .45); }

.tab.active {
  color: #04121a;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  border-color: transparent;
  font-weight: 650;
}

.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 20px;
  background: rgba(0, 0, 0, .25);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.tab:not(.active) .tab-count { background: rgba(255, 255, 255, .07); }

.stab { display: none; }
.stab.active { display: block; animation: fade .18s ease; }

/* ── small inline input ───────────────────────────────────────── */
.input-sm { padding: 5px 8px; font-size: 11.5px; width: 84px; min-width: 60px; }

/* ── service country expander ─────────────────────────────────── */
.sub-row td {
  background: rgba(34, 211, 238, .035);
  border-top: none;
  padding: 10px 14px 14px;
}

.chip-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
}

.chip input { margin: 0; cursor: pointer; }

.chip-on {
  color: #7ef0b0;
  border-color: rgba(34, 197, 94, .4);
  background: rgba(34, 197, 94, .1);
}

.chip-x {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
}

.chip-x:hover { color: var(--danger); }

/* ── key/value list ───────────────────────────────────────────── */
.kv {
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr;
  gap: 6px 12px;
  margin: 0 0 16px;
  font-size: 12.5px;
}

.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ── drawers ──────────────────────────────────────────────────── */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 10, .62);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 40;
}

.backdrop.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(720px, 94vw);
  background: linear-gradient(180deg, #121826, #0c111b);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 48px rgba(0, 0, 0, .6);
  transform: translateX(102%);
  transition: transform .22s ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.drawer.open { transform: none; }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-head h2 { font-size: 16px; }

.drawer-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-toolbar .input { flex: 1 1 130px; }

.drawer-body {
  padding: 16px 18px 40px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.drawer-h3 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin: 20px 0 8px;
}

/* ── modals ───────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
  background: rgba(2, 4, 10, .66);
}

.modal.open { display: flex; }

.modal-card {
  width: min(600px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #141a28, #0d1320);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: fade .16s ease;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-body { padding: 18px; }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

/* ── permissions matrix ───────────────────────────────────────── */
.perm-grid { display: flex; flex-direction: column; gap: 4px; }

.perm-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 16px;
  padding: 4px 0 10px;
}

#admin-perms-uid { max-width: 260px; }

/* ── token display ────────────────────────────────────────────── */
.token-box {
  margin-top: 1rem;
  padding: 1rem;
  background: #161b22;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.token-box code {
  color: #58a6ff;
  font-size: 1.05em;
  word-break: break-all;
  user-select: all;
}

/* ── live wrap keeps its scrollbar ────────────────────────────── */
.live-wrap { overflow-y: auto; }

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME (Web3 Clean Luxury White, Blue & Red Theme)
   ═══════════════════════════════════════════════════════════════ */
:root.theme-light,
body.theme-light {
  --bg: #f8fafc;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #cbd5e1;
  --text: #0f172a;
  --text-pure: #020617;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.25);
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --danger-2: #dc2626;
  --danger-glow: rgba(239, 68, 68, 0.25);
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
}

body.theme-light {
  background:
    radial-gradient(1300px 650px at 12% -5%, rgba(37, 99, 235, 0.08), transparent 60%),
    radial-gradient(1100px 550px at 92% 5%, rgba(239, 68, 68, 0.06), transparent 55%),
    radial-gradient(900px 900px at 50% 100%, rgba(241, 245, 249, 0.9), transparent 70%),
    #f8fafc;
  color: #0f172a;
}

body.theme-light .sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  box-shadow: 2px 0 14px rgba(0, 0, 0, 0.03);
}
body.theme-light .topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
body.theme-light .card,
body.theme-light .panel-box,
body.theme-light .modal-card,
body.theme-light .drawer,
body.theme-light .box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  color: #0f172a;
}
body.theme-light .status-grid > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}
body.theme-light .input,
body.theme-light select.input,
body.theme-light textarea.input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}
body.theme-light .input:focus,
body.theme-light select.input:focus,
body.theme-light textarea.input:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
body.theme-light .btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}
body.theme-light .btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
body.theme-light .btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
body.theme-light .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}
body.theme-light .btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}
body.theme-light .btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.45);
}
body.theme-light table th {
  background: #f8fafc;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}
body.theme-light table td {
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
body.theme-light table tr:hover td {
  background: rgba(37, 99, 235, 0.04);
}
body.theme-light .nav-link {
  color: #64748b;
}
body.theme-light .nav-link:hover {
  color: #0f172a;
  background: #f1f5f9;
}
body.theme-light .nav-link.active {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: inset 3px 0 0 #2563eb;
}
body.theme-light .quick-bar {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

/* ── Theme Switcher Button ────────────────────────────────────── */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  user-select: none;
}
.theme-toggle-btn:hover {
  border-color: var(--accent);
  background: var(--panel);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.theme-toggle-btn .theme-icon {
  font-size: 15px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.35s ease;
}
.theme-toggle-btn:hover .theme-icon {
  transform: rotate(25deg) scale(1.15);
}
.theme-toggle-btn .theme-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
body.theme-light .theme-toggle-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
body.theme-light .theme-toggle-btn:hover {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   WEB3 TOPBAR & CONTROLS
   ═══════════════════════════════════════════════════════════════ */
.web3-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 40;
}

.web3-brand-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text);
  user-select: none;
  font-family: inherit;
}

.web3-brand-title .header-bot-user {
  color: #38bdf8;
  font-weight: 700;
  text-decoration: none;
  font-size: 12.5px;
  letter-spacing: 0.2px;
  padding: 2px 9px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 9999px;
  transition: all 0.15s ease;
  vertical-align: middle;
}

.web3-brand-title .header-bot-user:hover {
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
}

.side-bot-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.side-bot-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.btn-icon-squircle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  font-size: 16px;
  outline: none;
}
.btn-icon-squircle:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.btn-icon-squircle:active {
  transform: translateY(0);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   WEB3 LIVE OTP CARDS FEED (Matching reference screenshot)
   ═══════════════════════════════════════════════════════════════ */
.live-head-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.5px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot-anim 1.5s infinite;
}

@keyframes pulse-dot-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.view-toggle-pills {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
}

.btn-pill {
  border-radius: 9999px !important;
  border: none !important;
  padding: 5px 14px !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  background: transparent !important;
  color: var(--muted) !important;
  transition: all 0.15s ease !important;
  cursor: pointer;
}

.btn-pill.active {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}

.web3-cards-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  max-height: 74vh;
  overflow-y: auto;
  padding: 4px 2px 24px 2px;
  scroll-behavior: smooth;
}

.web3-live-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  position: relative;
}

.web3-live-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.theme-light .web3-live-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

body.theme-light .web3-live-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.1);
}

.web3-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  user-select: none;
}

.web3-avatar-text {
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.web3-card-center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.web3-card-row-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.web3-user-name {
  font-weight: 750;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.web3-badge-vpn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 8px;
  border-radius: 9999px;
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f43f5e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.web3-card-row-service {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.web3-country-panel {
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.3px;
  font-size: 12.5px;
  text-transform: uppercase;
}

.web3-dot-sep {
  color: var(--muted);
  font-weight: bold;
}

.web3-service-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.web3-card-row-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #6366f1;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
  user-select: text;
  width: fit-content;
}

body.theme-light .web3-card-row-phone {
  color: #5b21b6;
}

.web3-card-row-phone:hover {
  color: #8b5cf6;
  text-decoration: underline;
  transform: translateX(2px);
}

.web3-phone-icon {
  font-size: 14px;
}

.web3-card-row-status {
  display: flex;
  align-items: center;
}

.web3-status-delivered {
  color: #10b981;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.web3-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  text-align: right;
  min-width: 80px;
}

.web3-payout {
  font-size: 15px;
  font-weight: 850;
  color: #0d9488;
  letter-spacing: 0.3px;
}

body.theme-light .web3-payout {
  color: #0f766e;
}

.web3-time {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════
   WEB3 FLOATING BOTTOM DOCK NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.web3-bottom-nav {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: rgba(16, 20, 31, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  border-radius: 28px;
  padding: 5px 10px;
  z-index: 950;
  width: min(440px, 95vw);
  max-width: 95vw;
  user-select: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.web3-nav-btn-action {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
}

body.theme-light .web3-bottom-nav {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.web3-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 10px;
  border-radius: 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
  cursor: pointer;
}

.web3-nav-item:hover {
  color: var(--text);
}

.web3-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  width: 20px;
}

.web3-indicator-dot {
  font-size: 16px;
  line-height: 1;
}

.web3-nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Active glowing purple pill matching reference screenshot */
.web3-nav-item.active {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45);
  transform: translateY(-1px);
}

.web3-nav-item.active .web3-nav-icon svg {
  stroke: #ffffff;
}

.web3-nav-item.active .web3-nav-label {
  color: #ffffff;
  font-weight: 750;
}

/* ── responsive tweaks (Mobile / Smartphone Optimized) ────────── */
@media (max-width: 860px) {
  body {
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: min(290px, 86vw);
    height: 100dvh;
    height: 100vh;
    z-index: 1000;
    transition: left 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 90px;
    background: #0f1422;
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .btn-sidebar-close {
    display: inline-flex;
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  .main {
    padding: 0 12px calc(80px + env(safe-area-inset-bottom, 0px));
    max-width: 100vw;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .topbar {
    padding: 8px 0 10px;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
  }
  .web3-brand-title {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-bot-user {
    display: none !important;
  }
  #bot-status-text, #load-badge, #bot-state-badge, #clock {
    display: none !important;
  }
  .topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .topbar-right .btn-ghost {
    padding: 5px 9px;
    font-size: 12px;
  }
  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin-bottom: 12px;
  }
  .table-wrap table {
    min-width: 560px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .cards.small {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .card {
    padding: 10px 12px;
  }
  .card-label {
    font-size: 11px;
  }
  .card strong {
    font-size: 17px;
  }
  input, select, textarea {
    font-size: 16px !important;
  }
  .drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  .modal-dialog, .modal-card {
    width: min(92vw, 480px) !important;
    max-width: 92vw !important;
    margin: 16px auto !important;
    padding: 16px !important;
  }
}

@media (min-width: 861px) {
  #btn-sidebar-toggle {
    display: none;
  }
  .main {
    padding-bottom: 95px;
  }
}

@media (max-width: 760px) {
  .chart { height: 120px; }
  .grid-2 { grid-template-columns: 1fr; }
  .drawer { width: 100vw; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 6px; }
}

@media (max-width: 600px) {
  .lb-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .lb-date-group {
    width: 100%;
  }
  .lb-input-wrap {
    width: 100%;
  }
  .lb-date-input {
    width: 100% !important;
  }
  .lb-btn-search {
    width: 100% !important;
    height: 42px;
  }
  .lb-worker-filter-wrap {
    width: 100%;
    margin-left: 0;
  }
  .dt-picker-popup {
    flex-direction: column !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: min(320px, 92vw) !important;
    max-width: 92vw !important;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8) !important;
    z-index: 10001 !important;
  }
  .dt-calendar-pane {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #e5e7eb;
  }
  .dt-time-pane {
    justify-content: center;
    padding: 8px 4px;
  }
}

/* =========================================================
   LEADERBOARD DATEPICKER TABLE & POPUP (Exact Screenshot 2)
   ========================================================= */
.lb-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  position: relative;
}

.lb-date-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-date-label {
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.2px;
}

.lb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.lb-date-input {
  background: #0d1424;
  border: 1.5px solid #23314d;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 38px 10px 14px;
  width: 245px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.lb-date-input.picker-active,
.lb-date-input:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.45) !important;
  outline: none;
}

.lb-cal-icon {
  position: absolute;
  right: 12px;
  font-size: 15px;
  pointer-events: none;
  opacity: 0.85;
}

.lb-btn-search {
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0 24px;
  height: 42px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, transform .05s ease;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.lb-btn-search:hover {
  background: #15803d;
}

.lb-btn-search:active {
  transform: scale(0.98);
}

.lb-search-spacer {
  flex: 1 1 auto;
}

.lb-worker-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* DateTime Picker Popup */
.dt-picker-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 10000;
  background: #ffffff;
  color: #111827;
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid #d1d5db;
  display: flex;
  flex-direction: row;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  animation: dtFadeIn .12s ease-out;
}

@keyframes dtFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dt-calendar-pane {
  width: 255px;
  padding: 14px 14px 10px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
}

.dt-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dt-cal-month-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 14px;
  color: #111827;
  cursor: default;
}

.dt-cal-caret {
  font-size: 11px;
  color: #6b7280;
}

.dt-cal-nav-arrows {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dt-nav-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: #4b5563;
  padding: 2px 7px;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  transition: background .12s, color .12s;
}

.dt-nav-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.dt-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
}

.dt-cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.dt-day {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  border-radius: 3px;
  cursor: pointer;
  transition: background .1s;
}

.dt-day:hover {
  background: #f1f5f9;
}

.dt-day.other-month {
  color: #9ca3af;
}

.dt-day.selected {
  background: #0070f3 !important;
  color: #ffffff !important;
  border: 2px solid #000000;
  font-weight: 700;
  border-radius: 3px;
}

.dt-cal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.dt-cal-footer-link {
  background: none;
  border: none;
  color: #0070f3;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}

.dt-cal-footer-link:hover {
  text-decoration: underline;
  background: rgba(0, 112, 243, 0.08);
}

.dt-time-pane {
  display: flex;
  flex-direction: row;
  background: #ffffff;
  padding: 10px 8px;
  gap: 4px;
}

.dt-time-col {
  height: 245px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dt-time-col::-webkit-scrollbar {
  width: 4px;
}

.dt-time-col::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.dt-col-hours {
  width: 44px;
}

.dt-col-minutes {
  width: 44px;
}

.dt-col-ampm {
  width: 48px;
}

.dt-time-item {
  height: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  border-radius: 4px;
  cursor: pointer;
  transition: background .1s, color .1s;
}

.dt-time-item:hover {
  background: #f3f4f6;
}

.dt-time-item.selected {
  background: #0070f3 !important;
  color: #ffffff !important;
  font-weight: 700;
}

/* Bulk User Delete Checkboxes & Rows */
.user-row-checkbox, .bulk-del-user-cb, #user-main-select-all, #bulk-del-master-cb {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #ef4444;
  vertical-align: middle;
}

#bulk-del-users-body tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* ── Live OTP Pagination Bar ──────────────────────────────────── */
.live-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
}

.live-pagination-info {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.live-pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-page-badge {
  padding: 5px 12px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #a78bfa;
  font-weight: 700;
  font-size: 12.5px;
  border-radius: 8px;
  min-width: 32px;
  text-align: center;
  user-select: none;
}

/* ── Live OTP Pill & Table Styling ────────────────────────────── */
.otp-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 6px;
  font-weight: 750;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: all;
  box-shadow: 0 1px 4px rgba(34, 197, 94, 0.1);
}

.otp-pill:hover {
  background: rgba(34, 197, 94, 0.28);
  border-color: rgba(34, 197, 94, 0.7);
  transform: scale(1.04);
  color: #86efac;
}

.otp-pill:active {
  transform: scale(0.97);
}

body.theme-light .otp-pill {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
}

.svc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.clickable {
  cursor: pointer;
  transition: color 0.15s ease;
}

.clickable:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.web3-card-row-otp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin-top: 4px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 8px;
  width: fit-content;
  cursor: pointer;
  transition: all 0.15s ease;
}

.web3-card-row-otp:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.7);
}

.web3-otp-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.web3-otp-val {
  font-size: 14px;
  font-weight: 800;
  color: #4ade80;
  letter-spacing: 1px;
  font-family: var(--font-mono, monospace);
}

@media (max-width: 600px) {
  .live-pagination-bar {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .live-pagination-actions {
    width: 100%;
    justify-content: center;
  }
}



