/* Kashi Digital - Admin Dashboard Styles */
:root {
  --admin-bg: #0b0f19;
  --admin-surface: #111827;
  --admin-card: #1e293b;
  --admin-card-hover: #26354a;
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-focus: rgba(235, 94, 40, 0.5);
  --admin-text: #f3f4f6;
  --admin-muted: #9ca3af;
  --admin-orange: #eb5e28;
  --admin-orange-light: rgba(235, 94, 40, 0.15);
  --admin-green: #10b981;
  --admin-green-bg: rgba(16, 185, 129, 0.15);
  --admin-blue: #3b82f6;
  --admin-blue-bg: rgba(59, 130, 246, 0.15);
  --admin-amber: #f59e0b;
  --admin-amber-bg: rgba(245, 158, 11, 0.15);
  --admin-red: #ef4444;
  --admin-red-bg: rgba(239, 68, 68, 0.15);
  --admin-purple: #8b5cf6;
  --admin-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

body {
  font-family: var(--admin-font);
  background-color: var(--admin-bg);
  color: var(--admin-text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--admin-bg);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

/* Header */
.admin-header {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand-badge {
  background: var(--admin-orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
}
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--admin-orange);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
}
.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-green);
  box-shadow: 0 0 8px var(--admin-green);
}

/* Layout */
.admin-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* Auth Screens */
.auth-wrapper {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
}
.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.auth-subtitle {
  color: var(--admin-muted);
  font-size: 14px;
  margin-bottom: 28px;
}
.btn-google {
  width: 100%;
  background: #fff;
  color: #1f2937;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.btn-google:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--admin-muted);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--admin-border);
}
.auth-form {
  text-align: left;
}
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #d1d5db;
}
.form-input {
  width: 100%;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.form-input:focus {
  border-color: var(--admin-orange);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}
.kpi-label {
  font-size: 13px;
  color: var(--admin-muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
}
.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.kpi-icon.orange { background: var(--admin-orange-light); color: var(--admin-orange); }
.kpi-icon.amber { background: var(--admin-amber-bg); color: var(--admin-amber); }
.kpi-icon.blue { background: var(--admin-blue-bg); color: var(--admin-blue); }
.kpi-icon.green { background: var(--admin-green-bg); color: var(--admin-green); }

/* Controls Toolbar */
.toolbar {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.toolbar-left, .toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.search-wrapper {
  position: relative;
  min-width: 260px;
}
.search-input {
  width: 100%;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: #fff;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  outline: none;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-muted);
  font-size: 14px;
  pointer-events: none;
}
.filter-select {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--admin-orange);
  color: white;
}
.btn-primary:hover {
  background: #d44d18;
}
.btn-secondary {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  color: #d1d5db;
}
.btn-secondary:hover {
  background: var(--admin-card-hover);
  color: #fff;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
}
.btn-whatsapp {
  background: #25d366;
  color: white;
}
.btn-whatsapp:hover {
  background: #1eb857;
}

/* Table */
.table-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  overflow: hidden;
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.leads-table th {
  background: rgba(30, 41, 59, 0.6);
  padding: 14px 18px;
  font-weight: 600;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}
.leads-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}
.leads-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-new { background: var(--admin-amber-bg); color: var(--admin-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-contacted { background: var(--admin-blue-bg); color: var(--admin-blue); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-won { background: var(--admin-green-bg); color: var(--admin-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-lost { background: var(--admin-red-bg); color: var(--admin-red); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-archived { background: rgba(156, 163, 175, 0.15); color: #9ca3af; border: 1px solid rgba(156, 163, 175, 0.2); }

.source-tag {
  background: #1e293b;
  border: 1px solid var(--admin-border);
  color: #cbd5e1;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-overlay.active .modal-box {
  transform: scale(1);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.2s ease-out;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ================= NAVIGATION TABS ================= */
.admin-nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
}
.nav-tab {
  background: transparent;
  border: none;
  color: var(--admin-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.nav-tab.active {
  background: var(--admin-card);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.tab-badge {
  background: var(--admin-orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}
.tab-live-pulse {
  width: 8px;
  height: 8px;
  background: var(--admin-green);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.8s infinite;
}
@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Subviews */
.dashboard-subview {
  display: none;
}
.dashboard-subview.active {
  display: block;
}

/* ================= ANALYTICS DASHBOARD ================= */
.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  padding: 14px 20px;
  border-radius: 14px;
  margin-bottom: 24px;
}
.analytics-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.analytics-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.live-status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 14px;
  border-radius: 20px;
}
.live-dot-pulse {
  width: 10px;
  height: 10px;
  background: var(--admin-green);
  border-radius: 50%;
  animation: pulseGreen 1.5s infinite;
}
.live-count {
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  margin-right: 4px;
}
.live-label {
  font-size: 10px;
  font-weight: 700;
  color: #a7f3d0;
  letter-spacing: 0.5px;
}

.date-pills-group {
  display: flex;
  align-items: center;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.date-pill {
  background: transparent;
  border: none;
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}
.date-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.date-pill.active {
  background: var(--admin-orange);
  color: #fff;
  box-shadow: 0 2px 6px rgba(235, 94, 40, 0.3);
}

.custom-date-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--admin-card);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
}
.date-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12px;
  outline: none;
  font-family: inherit;
  color-scheme: dark;
}

.analytics-kpis .kpi-sub {
  font-size: 11px;
  color: var(--admin-muted);
  margin-top: 4px;
}

/* Chart Card */
.analytics-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 22px;
}
.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-heading {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
}
.legend-item {
  font-size: 12px;
  color: var(--admin-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.legend-dot.orange { background: var(--admin-orange); }
.legend-dot.blue { background: var(--admin-blue); }

.chart-wrapper {
  position: relative;
  width: 100%;
}
.svg-chart-box {
  width: 100%;
  height: 240px;
  position: relative;
}
.chart-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #fff;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 30;
  transform: translate(-50%, -100%);
  white-space: nowrap;
}

/* Two Column Grid */
.analytics-grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
@media (max-width: 992px) {
  .analytics-grid-two {
    grid-template-columns: 1fr;
  }
}

/* Metric Tables & Progress Bars */
.metric-list-table-wrap {
  overflow-x: auto;
}
.metric-table {
  width: 100%;
  border-collapse: collapse;
}
.metric-table th {
  font-size: 11px;
  color: var(--admin-muted);
  text-transform: uppercase;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--admin-border);
  text-align: left;
}
.metric-table td {
  padding: 10px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}
.metric-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.metric-progress-bg {
  flex: 1;
  max-width: 100px;
  height: 6px;
  background: var(--admin-card);
  border-radius: 4px;
  overflow: hidden;
}
.metric-progress-bar {
  height: 100%;
  background: var(--admin-orange);
  border-radius: 4px;
}
.metric-progress-bar.blue { background: var(--admin-blue); }
.metric-progress-bar.green { background: var(--admin-green); }

/* Tech Breakdown */
.tech-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tech-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--admin-card);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
}
.tech-name {
  color: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tech-val {
  color: var(--admin-muted);
  font-family: monospace;
}

/* ================= BREADCRUMBS & SECTION HEADINGS ================= */
.admin-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  color: var(--admin-muted);
}
.breadcrumb-link {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.breadcrumb-link:hover {
  color: #fff;
}
.breadcrumb-separator {
  color: #475569;
  font-size: 14px;
}
.breadcrumb-current {
  color: #f8fafc;
  font-weight: 600;
}

.view-header-title {
  margin-bottom: 20px;
}
.view-main-heading {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.view-sub-heading {
  font-size: 13px;
  color: var(--admin-muted);
  margin-top: 4px;
}

/* ================= DEDICATED LEAD DETAIL VIEW ================= */
.lead-detail-back-bar {
  margin-bottom: 16px;
}
.btn-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px 6px 0;
  transition: all 0.15s ease;
}
.btn-back-link:hover {
  color: #fff;
  transform: translateX(-2px);
}
.back-arrow {
  font-size: 16px;
}

/* Lead Hero Banner Card */
.lead-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(17, 24, 39, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}
.lead-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
}
.lead-hero-avatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  flex-shrink: 0;
}
.lead-hero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.lead-hero-name {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.badge-verified {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.lead-hero-subtitle {
  font-size: 13px;
  color: #34d399;
  font-weight: 500;
  margin-top: 4px;
}
.lead-hero-meta-tags {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.status-dropdown-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-select-label {
  font-size: 12px;
  color: var(--admin-muted);
  font-weight: 600;
  text-transform: uppercase;
}
.detail-status-select {
  background: #0f172a;
  border: 1px solid var(--admin-border);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.detail-status-select:focus {
  border-color: var(--admin-orange);
}

/* Detail Stat Metric Cards */
.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.detail-stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 16px 20px;
}
.detail-stat-label {
  font-size: 11px;
  color: var(--admin-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.detail-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-top: 6px;
}
.detail-stat-sub {
  font-size: 12px;
  color: var(--admin-muted);
  margin-top: 2px;
}

/* Detail Subtabs */
.detail-subtabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--admin-border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.detail-subtab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--admin-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.detail-subtab-btn:hover {
  color: #fff;
}
.detail-subtab-btn.active {
  color: var(--admin-orange);
  border-bottom-color: var(--admin-orange);
}

.detail-subtab-pane {
  display: none;
}
.detail-subtab-pane.active {
  display: block;
}

/* Detail Grid & Sections */
.detail-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .detail-grid-two {
    grid-template-columns: 1fr;
  }
}
.detail-section-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 20px;
}
.detail-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}
.detail-field-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}
.detail-field-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.detail-field-label {
  color: var(--admin-muted);
  font-weight: 500;
}
.detail-field-value {
  color: #fff;
  font-weight: 600;
  text-align: right;
}
.detail-message-box {
  background: #0f172a;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.6;
  white-space: pre-wrap;
  min-height: 90px;
}
.detail-tag-cluster {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* WhatsApp Template Cards */
.wa-templates-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wa-template-card {
  background: #0f172a;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}
.wa-template-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
}
.wa-tpl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.wa-tpl-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.wa-tpl-body {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
  line-height: 1.5;
}
.telemetry-code-block {
  background: #000;
  border: 1px solid var(--admin-border);
  padding: 14px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #60a5fa;
  overflow-x: auto;
  line-height: 1.4;
}

/* ================= LINK PERFORMANCE SUMMARY & BADGES ================= */
.link-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 8px;
}
.link-kpi-pill {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.link-kpi-num {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.link-kpi-lbl {
  font-size: 11px;
  color: var(--admin-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.metric-badge-click {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.metric-badge-lead {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.metric-badge-conv {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

/* ================= CARD PILL TABS ================= */
.card-pill-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
}
.card-pill-tab {
  background: transparent;
  border: none;
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.card-pill-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.card-pill-tab.active {
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

/* ================= 24/7 TRAFFIC PUNCHCARD HEATMAP ================= */
.punchcard-heatmap-wrap {
  margin-top: 14px;
  overflow-x: auto;
}
.punchcard-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 320px;
}
.punchcard-row {
  display: grid;
  grid-template-columns: 45px repeat(24, 1fr);
  align-items: center;
  gap: 4px;
}
.punchcard-day-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--admin-muted);
  text-transform: uppercase;
}
.punchcard-cell {
  height: 14px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
  position: relative;
}
.punchcard-cell:hover {
  transform: scale(1.3);
  z-index: 10;
  filter: brightness(1.3);
}
.dot-l0 {
  background: rgba(255, 255, 255, 0.05);
}
.dot-l1 {
  background: rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.2);
}
.dot-l2 {
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}
.dot-l3 {
  background: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
}
.punchcard-hours-header {
  display: grid;
  grid-template-columns: 45px repeat(24, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.punchcard-hour-lbl {
  font-size: 9px;
  color: var(--admin-muted);
  text-align: center;
}
.punchcard-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
}
.punchcard-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}



