/* ==========================================================================
   Super Fast SaaS — Admin Panel Stylesheet (White Background Theme)
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-page: #f8fafc;
  --panel: #ffffff;
  --panel-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-text: #ffffff;
  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;
  --rose: #e11d48;
  --rose-bg: #fff1f2;
  --rose-border: #fecdd3;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

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

/* Header */
.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  width: 100%;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topbar-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.brand-name span {
  color: var(--primary);
}

.admin-pill {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f0f9ff;
  color: var(--primary);
  border: 1px solid #bae6fd;
  white-space: nowrap;
}

.topbar-auth-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-nav-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 2px 0 4px;
}

.topbar-nav-strip::-webkit-scrollbar {
  height: 3px;
}

.topbar-nav-strip::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.btn-topbar-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.btn-topbar-link:hover {
  color: var(--text);
  background: var(--panel-hover);
}

.btn-client-login {
  background: #f8fafc;
  color: #475569;
}

.nav-btn-create { color: #16a34a !important; background: #f0fdf4 !important; border-color: #bbf7d0 !important; font-weight: 600 !important; }
.nav-btn-api { color: #7e22ce !important; background: #faf5ff !important; border-color: #e9d5ff !important; font-weight: 600 !important; }
.nav-btn-gsc { color: #0284c7 !important; background: #f0f9ff !important; border-color: #bae6fd !important; font-weight: 600 !important; }
.nav-btn-ns { color: #c2410c !important; background: #fff7ed !important; border-color: #fed7aa !important; font-weight: 600 !important; }
.nav-btn-bulk { color: #0284c7 !important; background: #f0f9ff !important; border-color: #bae6fd !important; font-weight: 600 !important; }
.nav-btn-pdf { color: #2563eb !important; background: #eff6ff !important; border-color: #bfdbfe !important; font-weight: 600 !important; }
.nav-btn-2fa { color: #4361ee !important; background: #eef2ff !important; border-color: #c7d2fe !important; font-weight: 600 !important; }
.nav-btn-seo { color: #0284c7 !important; background: #f0f9ff !important; border-color: #bae6fd !important; font-weight: 600 !important; cursor: pointer; }

.admin-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-signout {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-signout:hover {
  color: var(--rose);
  border-color: var(--rose-border);
  background: var(--rose-bg);
}

/* Container */
.admin-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 60px;
  box-sizing: border-box;
  transition: max-width 0.3s ease;
}

/* Responsive Viewport Simulator Strip */
.device-simulator-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.device-simulator-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.device-pill-indicator {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.device-selector-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.device-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.device-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

/* Mobile Table Scroll Prompt */
.table-scroll-hint {
  display: none;
  font-size: 0.74rem;
  font-weight: 600;
  color: #0284c7;
  background: #f0f9ff;
  border-bottom: 1px solid #bae6fd;
  padding: 7px 14px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.btn-add-user {
  background: var(--primary);
  color: var(--primary-text);
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
}

.btn-add-user:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(2, 132, 199, 0.3);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.icon-total {
  background: #f1f5f9;
  color: #475569;
}

.icon-allowed {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.icon-disallowed {
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.icon-pending {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.icon-gate {
  background: #f0f9ff;
  color: var(--primary);
  border: 1px solid #bae6fd;
}

.icon-sub {
  background: #f0fdf4;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 2px;
  color: var(--text);
}

.text-green { color: var(--emerald); }
.text-rose { color: var(--rose); }
.text-cyan { color: var(--primary); }
.text-amber { color: #d97706; }

/* Management Card */
.management-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
}

/* Toolbar */
.table-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: #ffffff;
}

.search-box {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.15s;
}

.search-box input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 13px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-refresh:hover {
  background: #f8fafc;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-refresh.spinning .refresh-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.filter-tabs {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.filter-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-tab:hover {
  color: var(--text);
}

.filter-tab.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  position: relative;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.users-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  text-align: left;
}

.users-table th {
  padding: 12px 20px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.users-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: middle;
  background: #ffffff;
}

.users-table tbody tr:hover td {
  background: #f8fafc;
}

.users-table tbody tr:last-child td {
  border-bottom: none;
}

.table-loading {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
}

/* User Column */
.user-info-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: #1e293b;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-weight: 700;
  color: var(--text);
}

.user-email-text {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #334155;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-pill.allowed {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.status-pill.disallowed {
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.status-pill.pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.role-pill {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border);
  font-family: var(--mono);
}

.role-pill.admin {
  background: #f0f9ff;
  color: var(--primary);
  border-color: #bae6fd;
}

.role-pill.child-role {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* Authorization Action Buttons */
.btn-toggle-auth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.btn-toggle-auth.allow-action {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.btn-toggle-auth.allow-action:hover {
  background: var(--emerald);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-toggle-auth.approve-action {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.btn-toggle-auth.approve-action:hover {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.btn-toggle-auth.disallow-action {
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.btn-toggle-auth.disallow-action:hover {
  background: var(--rose);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.25);
}

.btn-delete-user {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  margin-left: 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-delete-user:hover {
  color: var(--rose);
  background: var(--rose-bg);
}

/* Subscription Badges in Table */
.sub-cell-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  width: fit-content;
}

.sub-pill.active {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.sub-pill.expiring {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.sub-pill.expired {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.sub-pill.banked {
  background: #f8fafc;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.sub-pill.lifetime {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

.sub-meta-small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-renew-sub {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  margin-right: 6px;
}

.btn-renew-sub:hover {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  width: 440px;
  max-width: 92vw;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-label);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  user-select: none;
  margin-top: 8px;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  height: 18px;
  width: 18px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  margin-right: 9px;
  display: inline-block;
  position: relative;
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark:after {
  content: "";
  position: absolute;
  display: block;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.btn-ghost {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-ghost:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.field-error {
  color: var(--rose);
  font-size: 0.78rem;
  margin-top: 6px;
  min-height: 1.2em;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
}

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

.toast.success {
  border-left-color: var(--emerald);
}

.toast.warn {
  border-left-color: var(--rose);
}

/* ==========================================================================
   Activity Audit Logs & Section Navigation Tabs (White Theme)
   ========================================================================== */

/* Main Section Tabs */
.admin-nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  white-space: nowrap;
}

.admin-nav-tabs::-webkit-scrollbar {
  height: 3px;
}

.admin-nav-tabs::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
  margin-bottom: -4px;
  border-radius: 6px 6px 0 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.admin-tab-btn:hover {
  color: var(--text);
  background: #f1f5f9;
}

.admin-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #ffffff;
}

.tab-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Range Pill Selector */
.header-range-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-pill-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.range-pill {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.range-pill:hover {
  color: var(--text);
}

.range-pill.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Session Status Badges & Dot Pulse */
.session-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.session-status-badge.active {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.session-status-badge.completed {
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid #cbd5e1;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(5, 150, 105, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0);
  }
}

.time-timestamp {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  display: block;
}

.time-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.duration-pill {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text);
  display: inline-block;
}

.duration-pill.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.device-chip {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
}

.btn-refresh {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-refresh:hover {
  background: #f8fafc;
  border-color: var(--primary);
  color: var(--primary);
}

.table-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   User Notification Dispatch System Styles (White Theme)
   ========================================================================== */

/* Notification Badges & Pills */
.notif-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.notif-type-pill.info {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.notif-type-pill.warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.notif-type-pill.urgent {
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.notif-type-pill.success {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.target-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-label);
}

.target-badge.broadcast {
  background: #fdf4ff;
  border-color: #f5d0fe;
  color: #86198f;
}

.target-badge.targeted {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

/* Notification Preview Box */
.notif-preview-box {
  margin-top: 14px;
  margin-bottom: 6px;
}

.notif-preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.notif-card-preview {
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.notif-card-preview.warning {
  border-left-color: #f59e0b;
}

.notif-card-preview.urgent {
  border-left-color: var(--rose);
}

.notif-card-preview.success {
  border-left-color: var(--emerald);
}

.notif-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.preview-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
}

.preview-type-badge.warning { background: #fef3c7; color: #b45309; }
.preview-type-badge.urgent { background: #ffe4e6; color: #e11d48; }
.preview-type-badge.success { background: #d1fae5; color: #059669; }

.preview-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.preview-title {
  display: block;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 4px;
}

.preview-body {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* ==========================================================================
   SEO Audits Monitor & Inspection Modal Styles (White Theme)
   ========================================================================== */

.seo-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.seo-grade-badge.a {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.seo-grade-badge.b {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.seo-grade-badge.c {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.seo-grade-badge.f {
  background: #ffe4e6;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.btn-inspect-audit {
  transition: all 0.15s ease;
}

.btn-inspect-audit:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.2);
}

.audit-modal-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.audit-modal-cat-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.audit-modal-cat-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.audit-modal-cat-score {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.audit-modal-bar-bg {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.audit-modal-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.4s ease;
}

.audit-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: #ffffff;
}

.audit-check-item.passed {
  border-left: 4px solid var(--emerald);
}

.audit-check-item.warning {
  border-left: 4px solid #f59e0b;
  background: #fffdfa;
}

.audit-check-item.failed {
  border-left: 4px solid var(--rose);
  background: #fff8f8;
}

.audit-check-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.audit-check-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.audit-check-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.audit-code-snippet-box {
  background: #0f172a;
  color: #f1f5f9;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.76rem;
  margin-top: 8px;
  position: relative;
  overflow-x: auto;
}

/* Direct Audit Form */
.admin-audit-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.admin-audit-input {
  flex: 1;
  min-width: 240px;
  height: 40px;
  padding: 0 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
}

.admin-audit-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-admin-run-audit {
  height: 40px;
  padding: 0 18px;
}

/* ==========================================================================
   Comprehensive Mobile-First & Responsive Breakpoints
   ========================================================================== */

/* 1. Large Screen / Laptops (<= 1200px) */
@media (max-width: 1200px) {
  .admin-container {
    max-width: 100%;
    padding: 20px 16px 50px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
  }
}

/* 2. Tablets & Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .topbar-inner {
    padding: 8px 16px;
  }

  .page-header {
    gap: 12px;
  }

  .page-title {
    font-size: 1.45rem;
  }

  .table-scroll-hint {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 3. Phablets & Small Tablets (<= 768px) */
@media (max-width: 768px) {
  .topbar-main-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .topbar-auth-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
  }

  .admin-email {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-container {
    padding: 16px 12px 40px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 20px;
  }

  .page-title {
    font-size: 1.3rem;
    line-height: 1.25;
  }

  .page-subtitle {
    font-size: 0.84rem;
  }

  .btn-add-user {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 14px 16px;
    gap: 12px;
  }

  .stat-icon-wrap {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .table-toolbar > div:first-child {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .search-box {
    width: 100%;
    max-width: 100%;
    flex: 1;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    white-space: nowrap;
    padding: 4px;
  }

  .filter-tab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 0.76rem;
  }

  .header-range-controls {
    width: 100%;
  }

  .range-pill-group {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 4px;
  }

  .range-pill {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .admin-audit-form {
    flex-direction: column;
  }

  .admin-audit-input {
    width: 100%;
    min-width: 100%;
  }

  .btn-admin-run-audit {
    width: 100%;
    justify-content: center;
  }

  .modal-box {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 20px 14px !important;
    margin: 10px !important;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-actions button {
    width: 100%;
    justify-content: center;
  }
}

/* 4. Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .admin-container {
    padding: 12px 8px 36px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .device-simulator-strip {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
  }

  .device-selector-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 4px;
  }

  .device-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 4px;
    font-size: 0.72rem;
  }

  .table-toolbar > div:first-child {
    flex-direction: column;
  }

  .btn-refresh {
    width: 100%;
    justify-content: center;
  }
}



