/* ── Number Lifecycle & Cost Optimization Hub Styles ── */

:root {
  --nh-bg-card: rgba(15, 23, 42, 0.75);
  --nh-border: rgba(255, 255, 255, 0.08);
  --nh-border-hover: rgba(255, 255, 255, 0.16);
  --nh-text-primary: #f8fafc;
  --nh-text-secondary: #94a3b8;
  --nh-text-muted: #64748b;
  --nh-cyan: #38bdf8;
  --nh-emerald: #10b981;
  --nh-rose: #f43f5e;
  --nh-amber: #f59e0b;
  --nh-purple: #a855f7;
  --nh-indigo: #6366f1;
}

body.numbers-hub-body {
  background-color: #080c14;
  color: #f8fafc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.hub-pill-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: 9999px;
  margin-left: 8px;
}

.btn-export-highlight {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(244, 63, 94, 0.4) !important;
  color: #fda4af !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-export-highlight:hover {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.35), rgba(239, 68, 68, 0.25));
  border-color: #f43f5e !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.nh-main-content {
  max-width: 1720px;
  margin: 0 auto;
  padding: 20px 24px 60px 24px;
}

/* ── 6 KPI Cards Grid ── */
.nh-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.nh-kpi-card {
  background: var(--nh-bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--nh-border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.nh-kpi-card:hover {
  border-color: var(--nh-border-hover);
  transform: translateY(-2px);
}

.nh-kpi-card-highlight {
  border-color: rgba(244, 63, 94, 0.3);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.85), rgba(30, 20, 30, 0.75));
}

.nh-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.nh-kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--nh-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.nh-kpi-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nh-kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 6px;
}

.nh-kpi-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--nh-text-muted);
}

.nh-kpi-meta {
  font-size: 12px;
  color: var(--nh-text-muted);
}

/* Colors */
.text-emerald { color: #10b981 !important; }
.text-rose { color: #f43f5e !important; }
.text-amber { color: #f59e0b !important; }
.text-purple { color: #c084fc !important; }
.text-cyan { color: #38bdf8 !important; }

/* ── Toolbar: Filter Pills & Search ── */
.nh-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--nh-bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--nh-border);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 18px;
}

.nh-filter-pills-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.nh-pill {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--nh-text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nh-pill:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.nh-pill.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.nh-pill-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}

.nh-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 480px;
  min-width: 260px;
}

.nh-search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--nh-text-muted);
  pointer-events: none;
}

.nh-search-input {
  width: 100%;
  background: rgba(11, 17, 32, 0.85);
  border: 1px solid var(--nh-border);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  font-size: 12.5px;
  color: #fff;
  outline: none;
  transition: border-color 0.15s ease;
}

.nh-search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.nh-showing-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--nh-text-muted);
  white-space: nowrap;
}

/* ── Main Table Card ── */
.nh-table-card {
  background: var(--nh-bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--nh-border);
  border-radius: 12px;
  overflow: hidden;
}

.nh-table-scroll-container {
  overflow-x: auto;
  max-height: 720px;
}

.nh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.nh-table thead th {
  position: sticky;
  top: 0;
  background: #0f172a;
  color: var(--nh-text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--nh-border);
  z-index: 10;
  white-space: nowrap;
}

.nh-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.nh-table thead th.sortable:hover {
  color: #38bdf8;
}

.sort-icon {
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.6;
}

.nh-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 0.12s ease;
}

.nh-table tbody tr:hover {
  background-color: rgba(56, 189, 248, 0.04);
}

.nh-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.nh-empty-row {
  text-align: center;
  color: var(--nh-text-muted);
  padding: 36px !important;
}

/* Cell Elements */
.nh-number-name {
  font-weight: 600;
  color: #fff;
}

.nh-call-group {
  font-size: 11px;
  color: var(--nh-text-muted);
  margin-top: 2px;
}

.nh-phone-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nh-phone-text {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #38bdf8;
}

.nh-copy-btn {
  background: transparent;
  border: none;
  color: var(--nh-text-muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.nh-copy-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nh-badge-market {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.nh-badge-market.market-nj {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

.nh-badge-market.market-md {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.nh-badge-market.market-va {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.nh-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.nh-badge-status.status-clean {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.nh-badge-status.status-spam {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

.nh-badge-status.status-decom {
  background: rgba(100, 116, 139, 0.2);
  border: 1px solid rgba(100, 116, 139, 0.35);
  color: #94a3b8;
}

.nh-badge-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}

.nh-badge-action.action-release {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

.nh-badge-action.action-remediation {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.nh-badge-action.action-keep {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* Carrier Tags */
.nh-carrier-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.nh-carrier-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.carrier-verizon {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.carrier-att {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.carrier-tmobile {
  background: rgba(236, 72, 153, 0.18);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.carrier-smartcall {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.carrier-fcc, .carrier-ftc {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.mono-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.nh-btn-row-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nh-btn-row-action:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* ── Side Detail Drawer ── */
.nh-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nh-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.nh-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 92vw;
  background: #0b1120;
  border-left: 1px solid var(--nh-border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  z-index: 99999;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.nh-drawer.open {
  transform: translateX(0);
}

.nh-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--nh-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
}

.nh-drawer-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.nh-drawer-title {
  margin: 4px 0 2px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.nh-drawer-sub {
  font-size: 13px;
  color: var(--nh-text-secondary);
}

.nh-drawer-close {
  background: transparent;
  border: none;
  color: var(--nh-text-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.nh-drawer-close:hover {
  color: #fff;
}

.nh-drawer-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.nh-drawer-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.nh-drawer-stat-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--nh-border);
  border-radius: 8px;
  padding: 10px 12px;
}

.nh-drawer-stat-label {
  font-size: 11px;
  color: var(--nh-text-muted);
  display: block;
  margin-bottom: 4px;
}

.nh-drawer-stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: #fff;
}

.nh-drawer-section {
  margin-bottom: 24px;
}

.nh-drawer-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--nh-text-secondary);
  margin: 0 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Carrier Grid in Drawer */
.nh-carrier-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.nh-carrier-card {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--nh-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nh-carrier-card.flagged {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.35);
}

.nh-carrier-card.clean {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.nh-carrier-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #f1f5f9;
}

.nh-carrier-status-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Timeline */
.nh-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 18px;
}

.nh-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.nh-timeline-item {
  position: relative;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--nh-border);
  border-radius: 8px;
  padding: 10px 12px;
}

.nh-timeline-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.nh-timeline-date {
  font-size: 11px;
  color: var(--nh-text-muted);
  margin-bottom: 4px;
}

.nh-timeline-content {
  font-size: 12.5px;
  color: #e2e8f0;
}

.nh-drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--nh-border);
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Toast Notifications ── */
.nh-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.nh-toast {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
}

.nh-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.nh-toast.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  background: #064e3b;
}

.nh-toast.toast-warning {
  border-color: rgba(245, 158, 11, 0.5);
  background: #78350f;
}

.nh-toast.toast-error {
  border-color: rgba(244, 63, 94, 0.5);
  background: #881337;
}

@media (max-width: 900px) {
  .nh-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nh-drawer-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nh-carrier-grid {
    grid-template-columns: 1fr;
  }
}
