/* R2 Manager Central Dashboard - Custom Styles */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #3b82f6;
  --sidebar-width: 240px;
  --content-bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-text: #0f172a;
  --card-radius: 16px;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.13);
  --transition: 0.22s ease;
  --font:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* ── Dark mode ──────────────────────────────────────────── */
[data-theme="dark"] {
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --content-bg: #1e293b;
  --card-bg: #0f172a;
  --card-border: #334155;
  --card-text: #f1f5f9;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] body {
  background: var(--content-bg);
  color: var(--card-text);
}
[data-theme="dark"] .r2m-stat-card,
[data-theme="dark"] .r2m-card,
[data-theme="dark"] .r2m-site-card {
  background: var(--card-bg);
  border-color: var(--card-border);
  color: var(--card-text);
}
[data-theme="dark"] .r2m-stat-value,
[data-theme="dark"] .r2m-card-title,
[data-theme="dark"] .r2m-page-title,
[data-theme="dark"] .r2m-site-card-title {
  color: var(--card-text);
}
[data-theme="dark"] .r2m-table th {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}
[data-theme="dark"] .r2m-table td {
  color: #cbd5e1;
  border-color: #1e293b;
}
[data-theme="dark"] .r2m-table tbody tr:hover td {
  background: #1e293b;
}
[data-theme="dark"] .r2m-card-header {
  border-color: #334155;
}
[data-theme="dark"] .r2m-health-bar-wrap {
  background: var(--card-bg);
  border-color: var(--card-border);
}
[data-theme="dark"] .r2m-progress-bar-outer {
  background: #334155;
}

/* ── Base ───────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--content-bg);
  margin: 0;
  min-height: 100vh;
}

/* ── Sidebar layout ─────────────────────────────────────── */
.r2m-wrapper {
  display: flex;
  min-height: 100vh;
}

.r2m-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.r2m-sidebar::-webkit-scrollbar {
  width: 4px;
}
.r2m-sidebar::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.r2m-sidebar-brand {
  padding: 1.25rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid #334155;
  letter-spacing: -0.01em;
}
.r2m-sidebar-brand i {
  font-size: 1.25rem;
  color: var(--sidebar-active);
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}
.r2m-sidebar-brand:hover {
  color: #fff;
}

.r2m-nav {
  flex: 1;
  padding: 1rem 0;
}

.r2m-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  transition:
    background var(--transition),
    color var(--transition);
  position: relative;
}
.r2m-nav-item i {
  font-size: 1.05rem;
  width: 1.1rem;
  text-align: center;
}
.r2m-nav-item:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}
.r2m-nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  font-weight: 600;
}
.r2m-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--sidebar-active);
  border-radius: 0 2px 2px 0;
}

.r2m-nav-section {
  padding: 1.2rem 1.5rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.r2m-sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #334155;
}
.r2m-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #64748b;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition);
}
.r2m-sidebar-footer a:hover {
  color: #e2e8f0;
}

/* Mobile toggle */
.r2m-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--sidebar-bg);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 999;
}
.r2m-mobile-header .brand {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.r2m-mobile-header .brand i {
  color: var(--sidebar-active);
}
.r2m-toggle-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* ── Main content area ─────────────────────────────────── */
.r2m-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.r2m-page {
  padding: 1.75rem 2rem;
  animation: r2m-fadeIn 0.3s ease;
}

@keyframes r2m-fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Page header ────────────────────────────────────────── */
.r2m-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.r2m-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.r2m-page-meta {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Stat cards ─────────────────────────────────────────── */
.r2m-stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition:
    box-shadow var(--transition),
    transform var(--transition),
    border-color var(--transition);
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
  height: 100%;
}
.r2m-stat-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}
.r2m-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.r2m-stat-icon.blue {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}
.r2m-stat-icon.green {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
.r2m-stat-icon.purple {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}
.r2m-stat-icon.orange {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
}
.r2m-stat-icon.pink {
  background: rgba(236, 72, 153, 0.12);
  color: #ec4899;
}
.r2m-stat-icon.red {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.r2m-stat-body {
  flex: 1;
  min-width: 0;
}
.r2m-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.2rem;
}
.r2m-stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.r2m-stat-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

/* ── Health bar ─────────────────────────────────────────── */
.r2m-health-bar-wrap {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid #e2e8f0;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.r2m-health-bar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.r2m-health-bar {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: #e2e8f0;
  overflow: hidden;
  display: flex;
  min-width: 120px;
}
.r2m-health-bar-green {
  background: #10b981;
}
.r2m-health-bar-yellow {
  background: #f59e0b;
}
.r2m-health-bar-red {
  background: #ef4444;
}
.r2m-health-legend {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #475569;
  flex-wrap: wrap;
}
.r2m-health-legend span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.r2m-health-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green {
  background: #10b981;
}
.dot-yellow {
  background: #f59e0b;
}
.dot-red {
  background: #ef4444;
  animation: r2m-pulse-red 2s infinite;
}
.dot-gray {
  background: #94a3b8;
}

@keyframes r2m-pulse-red {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

/* ── Generic cards ──────────────────────────────────────── */
.r2m-card {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid #e2e8f0;
  transition:
    box-shadow var(--transition),
    transform var(--transition),
    border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.r2m-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}
.r2m-card-header {
  padding: 1rem 1.25rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.r2m-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.r2m-card-title i {
  color: #64748b;
}
.r2m-card-body {
  padding: 1.1rem 1.25rem;
  flex: 1;
}

/* ── Site cards ─────────────────────────────────────────── */
.r2m-site-card {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid #e2e8f0;
  transition:
    box-shadow var(--transition),
    transform var(--transition),
    border-color var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.r2m-site-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-3px);
  border-color: #cbd5e1;
}
.r2m-site-card .status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.r2m-site-card .status-bar.green {
  background: #10b981;
}
.r2m-site-card .status-bar.yellow {
  background: #f59e0b;
}
.r2m-site-card .status-bar.red {
  background: #ef4444;
}

.r2m-site-card-body {
  padding: 1.25rem;
  padding-top: 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.r2m-site-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.15rem;
}
.r2m-site-card-url {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 0 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r2m-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}
.r2m-status-dot.green {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}
.r2m-status-dot.yellow {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}
.r2m-status-dot.red {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
.r2m-status-dot .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.r2m-site-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: #475569;
  margin-bottom: 0.75rem;
}
.r2m-site-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.r2m-site-meta i {
  color: #94a3b8;
  font-size: 0.8rem;
}

.r2m-progress-wrap {
  margin-bottom: 0.75rem;
}
.r2m-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 0.3rem;
}
.r2m-progress-bar-outer {
  background: #f1f5f9;
  border-radius: 6px;
  height: 7px;
  overflow: hidden;
}
.r2m-progress-bar-inner {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}
.r2m-progress-bar-inner.green {
  background: linear-gradient(90deg, #10b981, #34d399);
}
.r2m-progress-bar-inner.yellow {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.r2m-progress-bar-inner.red {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* ── Section titles ─────────────────────────────────────── */
.r2m-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.r2m-section-title i {
  color: #64748b;
}

/* ── Recent errors feed ─────────────────────────────────── */
.r2m-error-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.r2m-error-item:last-child {
  border-bottom: none;
}
.r2m-error-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.r2m-error-icon.critical {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.r2m-error-icon.error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.r2m-error-icon.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.r2m-error-icon.info {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}
.r2m-error-body {
  flex: 1;
  min-width: 0;
}
.r2m-error-type {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.1rem;
}
.r2m-error-msg {
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r2m-error-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

/* ── Activity timeline ──────────────────────────────────── */
.r2m-timeline-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.r2m-timeline-item:last-child {
  border-bottom: none;
}
.r2m-timeline-icon {
  width: 32px;
  height: 32px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.r2m-timeline-body {
  flex: 1;
  min-width: 0;
}
.r2m-timeline-site {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
}
.r2m-timeline-info {
  font-size: 0.75rem;
  color: #64748b;
}
.r2m-timeline-time {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  font-weight: 500;
}
.r2m-badge-critical {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.r2m-badge-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.r2m-badge-warning {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
.r2m-badge-info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* ── Tables ─────────────────────────────────────────────── */
.table td,
.table th {
  vertical-align: middle;
}
.r2m-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.r2m-table thead {
  background: #f8fafc;
}
.r2m-table th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}
.r2m-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: middle;
}
.r2m-table tbody tr:last-child td {
  border-bottom: none;
}
.r2m-table tbody tr:hover td {
  background: #f8fafc;
}

/* ── Progress (Bootstrap override) ─────────────────────── */
.progress {
  border-radius: 6px;
}

/* ── Code ───────────────────────────────────────────────── */
code {
  font-size: 0.85em;
}

.user-select-all {
  cursor: pointer;
  word-break: break-all;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all var(--transition);
}
.btn:active {
  transform: scale(0.97);
}
.btn:focus-visible,
.form-control:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ── Form controls ──────────────────────────────────────── */
.form-control,
.form-select {
  border-radius: 8px;
  border-color: #cbd5e1;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.form-control:focus,
.form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ── Login page ─────────────────────────────────────────── */
/* ── Login page ──────────────────────────────────────────── */
.cd-login-body {
  background: linear-gradient(
    135deg,
    #ede9fe 0%,
    #ddd6fe 30%,
    #c4b5fd 60%,
    #a78bfa 100%
  );
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  padding: 1rem;
}
.cd-login-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 420px;
}
.cd-login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.cd-login-logo-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}
.cd-login-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e1b4b;
  margin: 0 0 0.25rem;
}
.cd-login-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}
.cd-login-field {
  margin-bottom: 1.15rem;
}
.cd-login-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}
.cd-login-input-wrap {
  position: relative;
}
.cd-login-input-wrap i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: #94a3b8;
  pointer-events: none;
}
.cd-login-input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  font-size: 0.88rem;
  font-family: var(--font);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: #1e1b4b;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.cd-login-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.cd-login-input::placeholder {
  color: #94a3b8;
}
.cd-login-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font);
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition:
    opacity 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
  margin-top: 0.5rem;
}
.cd-login-btn:hover {
  opacity: 0.92;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}
.cd-login-footer {
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 1.5rem;
}

/* Dark mode login */
[data-theme="dark"] .cd-login-body {
  background: linear-gradient(135deg, #0f0a1e 0%, #1a1145 50%, #2e1065 100%);
}
[data-theme="dark"] .cd-login-card {
  background: rgba(30, 27, 75, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .cd-login-title {
  color: #e2e8f0;
}
[data-theme="dark"] .cd-login-subtitle,
[data-theme="dark"] .cd-login-footer {
  color: rgba(255, 255, 255, 0.35);
}
[data-theme="dark"] .cd-login-label {
  color: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .cd-login-input {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}
[data-theme="dark"] .cd-login-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}
[data-theme="dark"] .cd-login-input-wrap i {
  color: rgba(255, 255, 255, 0.3);
}

/* ── Overlay (mobile sidebar) ───────────────────────────── */
.r2m-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .r2m-mobile-header {
    display: flex;
  }
  .r2m-sidebar {
    transform: translateX(-100%);
    top: 0;
  }
  .r2m-sidebar.open {
    transform: translateX(0);
  }
  .r2m-overlay.open {
    display: block;
  }
  .r2m-content {
    margin-left: 0;
  }
  .r2m-page {
    padding: 1.25rem 1rem;
  }
  .r2m-stat-value {
    font-size: 1.35rem;
  }
}

/* ── Overlay for print/charts ───────────────────────────── */
canvas {
  border-radius: 8px;
}

/* ── Dark mode toggle button ────────────────────────────── */
.r2m-dark-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  transition: color var(--transition);
  font-family: var(--font);
  font-size: 0.85rem;
  width: 100%;
}
.r2m-dark-toggle:hover {
  color: #e2e8f0;
}

/* ── Toast notification ─────────────────────────────────── */
.r2m-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.r2m-toast {
  background: #1e293b;
  color: #f1f5f9;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: r2m-fadeIn 0.25s ease;
  max-width: 320px;
}
.r2m-toast.success {
  border-left: 3px solid #10b981;
}
.r2m-toast.error {
  border-left: 3px solid #ef4444;
}

/* ── Error detail row ───────────────────────────────────── */
.r2m-detail-row td {
  background: #f8fafc;
  font-size: 0.82rem;
  padding: 0.75rem 1rem !important;
}
[data-theme="dark"] .r2m-detail-row td {
  background: #1e293b;
  color: #cbd5e1;
}
.r2m-detail-row pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.78rem;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* ── Auto-refresh toggle ────────────────────────────────── */
.r2m-autorefresh-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════
   Glassmorphism Dashboard Layout — index.php only
   All classes prefixed with cd- to avoid conflicts
═══════════════════════════════════════════════════════════ */

/* Background */
body.cd-body {
  background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 40%, #e8eaf6 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
body.cd-body::before,
body.cd-body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
body.cd-body::before {
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(167, 139, 250, 0.28) 0%,
    transparent 70%
  );
  top: -100px;
  right: 10%;
}
body.cd-body::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(252, 196, 168, 0.28) 0%,
    transparent 70%
  );
  bottom: -100px;
  left: 5%;
}

/* ── Top navigation ─────────────────────────────────────── */
.cd-topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}
.cd-logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
  flex-shrink: 0;
}
.cd-topnav-center {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50px;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.cd-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.cd-nav-pill:hover {
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
}
.cd-nav-pill.active {
  background: #1e1b4b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 27, 75, 0.3);
}
.cd-nav-badge {
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  font-size: 0.65rem;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.cd-topnav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cd-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  position: relative;
}
.cd-icon-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #7c3aed;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.cd-notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid #fff;
}
.cd-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
  text-transform: uppercase;
}

/* ── Main content ───────────────────────────────────────── */
.cd-main {
  position: relative;
  z-index: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}
.cd-greeting h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0 0 0.25rem;
}
.cd-greeting-sub {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0;
}

/* ── Two-column layout ──────────────────────────────────── */
.cd-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

/* ── Stat cards row ─────────────────────────────────────── */
.cd-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.cd-stat-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
}
.cd-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}
.cd-stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.cd-stat-icon-outline {
  color: #64748b;
  line-height: 0;
}
.cd-three-dot {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #94a3b8;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}
.cd-three-dot:hover {
  color: #7c3aed;
}
.cd-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e1b4b;
  line-height: 1.2;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-stat-danger {
  color: #ef4444;
}
.cd-stat-label {
  font-size: 0.78rem;
  color: #64748b;
}
.cd-stat-sublabel {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

/* ── Chart card ─────────────────────────────────────────── */
.cd-chart-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}
.cd-chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.cd-chart-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0 0 0.2rem;
}
.cd-chart-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0;
}
.cd-month-select {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  color: #64748b;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  outline: none;
  font-family: var(--font);
}
.cd-chart-metrics {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
}
.cd-metric-label {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}
.cd-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e1b4b;
}
.cd-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}
.cd-badge-red {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.cd-badge-green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.cd-chart-wrap {
  height: var(--cd-chart-height, 200px);
  position: relative;
}
.cd-chart-wrap canvas {
  border-radius: 0;
}

/* ── Activity table ─────────────────────────────────────── */
.cd-activity-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}
.cd-activity-header {
  margin-bottom: 1rem;
}
.cd-activity-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0;
}
.cd-activity-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.cd-activity-row:last-child {
  border-bottom: none;
}
.cd-activity-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.cd-activity-info {
  flex: 1;
  min-width: 0;
}
.cd-activity-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e1b4b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-activity-name a {
  color: inherit;
  text-decoration: none;
}
.cd-activity-name a:hover {
  color: #7c3aed;
}
.cd-activity-desc {
  font-size: 0.75rem;
  color: #94a3b8;
}
.cd-activity-uploads {
  font-size: 0.8rem;
  color: #475569;
  white-space: nowrap;
}
.cd-status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.cd-status-green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.cd-status-red {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.cd-status-yellow {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.cd-activity-time {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
}
.cd-no-data {
  color: #94a3b8;
  font-size: 0.875rem;
  padding: 1rem 0;
  margin: 0;
}

/* ── Right sidebar cards ────────────────────────────────── */
.cd-sidebar-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}
.cd-sidebar-card:last-child {
  margin-bottom: 0;
}
.cd-sidebar-dark {
  background: #1e1b4b;
  border-color: rgba(255, 255, 255, 0.1);
}
.cd-sidebar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.cd-sidebar-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0;
}
.cd-sidebar-card-title.cd-light {
  color: #fff;
}
.cd-icon-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.cd-icon-link:hover {
  color: #7c3aed;
}
.cd-icon-link.cd-light {
  color: rgba(255, 255, 255, 0.5);
}
.cd-icon-link.cd-light:hover {
  color: #fff;
}
.cd-status-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: #7c3aed;
  margin-bottom: 0.5rem;
}
.cd-progress-bar-outer {
  background: #e2e8f0;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}
.cd-progress-bar-inner {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  transition: width 0.5s ease;
}
.cd-status-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}
.cd-status-meta-value {
  font-weight: 600;
  color: #7c3aed;
}
.cd-status-detail {
  margin-bottom: 1rem;
}
.cd-status-detail-label {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.cd-status-detail-value {
  font-size: 0.82rem;
  color: #475569;
  font-weight: 500;
}
.cd-view-status-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.5rem;
  border: 1.5px solid #7c3aed;
  border-radius: 20px;
  color: #7c3aed;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.cd-view-status-btn:hover {
  background: #7c3aed;
  color: #fff;
}

/* ── Gauge ──────────────────────────────────────────────── */
.cd-gauge-wrap {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0;
}
.cd-gauge {
  position: relative;
  width: 160px;
}
.cd-gauge svg {
  width: 100%;
  height: auto;
}
.cd-gauge-value {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  white-space: nowrap;
}
.cd-gauge-indicator {
  position: absolute;
  top: 10px;
  right: 0;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
}
.cd-success-desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 0.75rem;
}
.cd-success-msg {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
  margin: 0 0 1rem;
}
.cd-success-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.cd-success-stat {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem;
}
.cd-success-stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.2rem;
}
.cd-success-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

/* ── Health bar ─────────────────────────────────────────── */
.cd-health-bar-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 1rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.cd-health-bar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.cd-health-bar {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: #e2e8f0;
  overflow: hidden;
  display: flex;
  min-width: 120px;
}
.cd-health-bar-green {
  background: #10b981;
}
.cd-health-bar-yellow {
  background: #f59e0b;
}
.cd-health-bar-red {
  background: #ef4444;
}
.cd-health-legend {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #475569;
  flex-wrap: wrap;
}
.cd-health-legend span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Health detail rows (critical / warning site list) ── */
.cd-health-detail {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cd-health-detail-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.82rem;
  transition: filter 0.15s;
}
.cd-health-detail-item:hover {
  filter: brightness(0.94);
}
.cd-health-detail-red {
  background: rgba(239, 68, 68, 0.07);
  color: #dc2626;
}
.cd-health-detail-yellow {
  background: rgba(245, 158, 11, 0.07);
  color: #b45309;
}
.cd-health-detail-name {
  font-weight: 600;
  flex-shrink: 0;
}
.cd-health-detail-reason {
  flex: 1;
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-health-detail-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.45;
  flex-shrink: 0;
}

.cd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.cd-dot-green {
  background: #10b981;
}
.cd-dot-yellow {
  background: #f59e0b;
}
.cd-dot-red {
  background: #ef4444;
  animation: cd-pulse-red 2s infinite;
}

@keyframes cd-pulse-red {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
  }
}

/* ── Recent errors panel ────────────────────────────────── */
.cd-errors-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

/* ── Bootstrap dropdown override (glassmorphism stacking-context fix) ── */
.dropdown-menu {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
  padding: 0.4rem 0.3rem;
  z-index: 1060;
}
.dropdown-item {
  border-radius: 8px;
  font-size: 0.875rem;
  color: #1e1b4b;
  padding: 0.45rem 0.85rem;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(124, 58, 237, 0.07);
  color: #7c3aed;
}
[data-theme="dark"] .dropdown-menu {
  background: #1e1a3a;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .dropdown-item {
  color: #e2e8f0;
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background: rgba(167, 139, 250, 0.1);
  color: #a78bfa;
}
.cd-errors-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.cd-errors-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cd-errors-title i {
  color: #ef4444;
}
.cd-errors-viewall {
  font-size: 0.8rem;
  font-weight: 600;
  color: #7c3aed;
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border: 1.5px solid #7c3aed;
  border-radius: 20px;
  transition: all 0.2s ease;
}
.cd-errors-viewall:hover {
  background: #7c3aed;
  color: #fff;
}
.cd-error-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.cd-error-item:last-child {
  border-bottom: none;
}
.cd-error-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.cd-error-icon-error,
.cd-error-icon-critical {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.cd-error-icon-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.cd-error-icon-info {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}
.cd-error-body {
  flex: 1;
  min-width: 0;
}
.cd-error-type {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e1b4b;
  margin-bottom: 0.1rem;
}
.cd-error-type a {
  color: inherit;
  text-decoration: none;
}
.cd-error-type a:hover {
  color: #7c3aed;
}
.cd-error-msg {
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-error-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}
.cd-error-meta a {
  color: #7c3aed;
  text-decoration: none;
}

/* ── Site cards grid ────────────────────────────────────── */
.cd-sites-section {
  margin-bottom: 1.5rem;
}
.cd-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cd-section-title i {
  color: #64748b;
}
.cd-site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.cd-site-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
  position: relative;
}
.cd-site-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}
.cd-site-status-bar {
  height: 4px;
}
.cd-site-bar-green {
  background: #10b981;
}
.cd-site-bar-yellow {
  background: #f59e0b;
}
.cd-site-bar-red {
  background: #ef4444;
}
.cd-site-card-body {
  padding: 1.25rem;
}
.cd-site-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.cd-site-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 0.15rem;
  line-height: 1.3;
}
.cd-site-url {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cd-site-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cd-site-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
  font-size: 0.73rem;
  color: #475569;
  margin-bottom: 0.75rem;
}
.cd-site-meta span {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.cd-site-meta i {
  color: #94a3b8;
}
.cd-site-storage {
  margin-bottom: 0.75rem;
}
.cd-site-storage-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 0.3rem;
}
.cd-site-progress-outer {
  background: rgba(0, 0, 0, 0.07);
  border-radius: 6px;
  height: 7px;
  overflow: hidden;
}
.cd-site-progress-inner {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}
.cd-progress-green {
  background: linear-gradient(90deg, #10b981, #34d399);
}
.cd-progress-yellow {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.cd-progress-red {
  background: linear-gradient(90deg, #ef4444, #f87171);
}
.cd-site-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.cd-site-stat {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
}
.cd-site-stat-label {
  font-size: 0.68rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}
.cd-site-stat-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e1b4b;
}
.cd-site-ok {
  color: #059669;
}
.cd-site-fail {
  color: #ef4444;
}
.cd-site-actions {
  text-align: right;
}
.cd-site-action-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  border: 1.5px solid rgba(124, 58, 237, 0.2);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cd-site-action-btn:hover {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}

/* ── Dark mode for new layout ───────────────────────────── */
[data-theme="dark"] body.cd-body {
  background: linear-gradient(135deg, #0f0e1a 0%, #1a1535 40%, #1e1b4b 100%);
}
[data-theme="dark"] .cd-topnav {
  background: rgba(15, 14, 26, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .cd-topnav-center {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .cd-nav-pill {
  color: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .cd-nav-pill.active {
  background: #7c3aed;
  color: #fff;
}
[data-theme="dark"] .cd-icon-btn {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] .cd-stat-card,
[data-theme="dark"] .cd-chart-card,
[data-theme="dark"] .cd-activity-card,
[data-theme="dark"] .cd-health-bar-card,
[data-theme="dark"] .cd-errors-card,
[data-theme="dark"] .cd-site-card,
[data-theme="dark"] .cd-sidebar-card:not(.cd-sidebar-dark) {
  background: rgba(30, 27, 75, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .cd-stat-value,
[data-theme="dark"] .cd-chart-title,
[data-theme="dark"] .cd-metric-value,
[data-theme="dark"] .cd-activity-title,
[data-theme="dark"] .cd-activity-name,
[data-theme="dark"] .cd-greeting h1,
[data-theme="dark"] .cd-sidebar-card-title,
[data-theme="dark"] .cd-errors-title,
[data-theme="dark"] .cd-section-title,
[data-theme="dark"] .cd-site-name,
[data-theme="dark"] .cd-site-stat-value {
  color: #e2e8f0;
}
[data-theme="dark"] .cd-stat-label,
[data-theme="dark"] .cd-stat-sublabel,
[data-theme="dark"] .cd-chart-subtitle,
[data-theme="dark"] .cd-greeting-sub,
[data-theme="dark"] .cd-activity-desc,
[data-theme="dark"] .cd-health-bar-label,
[data-theme="dark"] .cd-health-legend,
[data-theme="dark"] .cd-error-msg,
[data-theme="dark"] .cd-site-url,
[data-theme="dark"] .cd-site-meta,
[data-theme="dark"] .cd-site-storage-label {
  color: rgba(255, 255, 255, 0.4);
}
[data-theme="dark"] .cd-progress-bar-outer {
  background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .cd-status-detail-value {
  color: #94a3b8;
}
[data-theme="dark"] .cd-health-bar {
  background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .cd-health-detail {
  border-top-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .cd-health-detail-red {
  background: rgba(239, 68, 68, 0.13);
  color: #f87171;
}
[data-theme="dark"] .cd-health-detail-yellow {
  background: rgba(245, 158, 11, 0.13);
  color: #fbbf24;
}
[data-theme="dark"] .cd-site-stat {
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .cd-site-progress-outer {
  background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .cd-error-type {
  color: #e2e8f0;
}
[data-theme="dark"] .cd-error-meta {
  color: rgba(255, 255, 255, 0.35);
}

/* ── Responsive for new layout ──────────────────────────── */
@media (max-width: 1200px) {
  .cd-layout {
    grid-template-columns: 1fr 280px;
  }
  .cd-stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 1024px) {
  .cd-layout {
    grid-template-columns: 1fr;
  }
  .cd-col-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .cd-sidebar-card {
    margin-bottom: 0;
  }
}
@media (max-width: 768px) {
  .cd-topnav {
    padding: 0.75rem 1rem;
  }
  .cd-topnav-center {
    display: none;
  }
  .cd-main {
    padding: 1.25rem 1rem;
  }
  .cd-col-sidebar {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .cd-stat-row {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   Shared cd- styles for Settings, Errors, and Site pages
═══════════════════════════════════════════════════════════ */

/* ── Page header ────────────────────────────────────────── */
.cd-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.cd-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0;
  display: flex;
  align-items: center;
}

/* ── Breadcrumb ─────────────────────────────────────────── */
.cd-breadcrumb {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 0.3rem;
}
.cd-breadcrumb a {
  color: #7c3aed;
  text-decoration: none;
}
.cd-breadcrumb a:hover {
  text-decoration: underline;
}
.cd-breadcrumb-sep {
  margin: 0 0.35rem;
  color: #cbd5e1;
}

/* ── Meta pills ─────────────────────────────────────────── */
.cd-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.cd-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  color: #475569;
  font-weight: 500;
}

/* ── Progress label ─────────────────────────────────────── */
.cd-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 0.3rem;
}

/* ── Alerts ─────────────────────────────────────────────── */
.cd-alert {
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 500;
}
.cd-alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.cd-alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.cd-alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ── Content cards (settings, errors, site) ─────────────── */
.cd-content-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.cd-content-card-header {
  padding: 1rem 1.5rem 0.6rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cd-content-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e1b4b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cd-content-card-body {
  padding: 1.25rem 1.5rem;
}

/* ── Filter card (errors page) ──────────────────────────── */
.cd-filter-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 1rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

/* ── Form controls ──────────────────────────────────────── */
.cd-form-control {
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: #1e1b4b;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.cd-form-control:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.cd-form-select {
  font-family: var(--font);
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  padding-right: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: #1e1b4b;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 01.708 0L8 10.293l5.646-5.647a.5.5 0 01.708.708l-6 6a.5.5 0 01-.708 0l-6-6a.5.5 0 010-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.cd-form-select:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

/* ── Buttons ────────────────────────────────────────────── */
.cd-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font);
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.3;
}
.cd-btn:active {
  transform: scale(0.97);
}
.cd-btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 8px;
}
.cd-btn-primary {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}
.cd-btn-primary:hover {
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
  filter: brightness(1.05);
}
.cd-btn-outline {
  background: transparent;
  color: #7c3aed;
  border: 1.5px solid #7c3aed;
}
.cd-btn-outline:hover {
  background: #7c3aed;
  color: #fff;
}
.cd-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1.5px solid rgba(239, 68, 68, 0.25);
}
.cd-btn-danger:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}
.cd-btn-success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1.5px solid rgba(16, 185, 129, 0.25);
}
.cd-btn-success:hover {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.cd-btn-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1.5px solid rgba(245, 158, 11, 0.25);
}
.cd-btn-warning:hover {
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}
.cd-btn-amber {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #78350f;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.cd-btn-amber:hover {
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  filter: brightness(1.05);
}

/* ── Tables ─────────────────────────────────────────────── */
.cd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.cd-table thead {
  background: rgba(0, 0, 0, 0.02);
}
.cd-table th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  padding: 0.65rem 1rem;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
  text-align: left;
}
.cd-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: #374151;
  vertical-align: middle;
}
.cd-table tbody tr:last-child td {
  border-bottom: none;
}
.cd-table tbody tr:hover td {
  background: rgba(124, 58, 237, 0.03);
}
.cd-table-clickable tbody tr {
  cursor: pointer;
}
.cd-table-clickable tbody tr:hover td {
  background: rgba(124, 58, 237, 0.05);
}

/* ── Badges ─────────────────────────────────────────────── */
.cd-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.cd-badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.cd-badge-secondary {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}
.cd-badge-error {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.cd-badge-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}
.cd-badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}
.cd-badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

/* ── Detail expansion row ───────────────────────────────── */
.cd-detail-row td {
  background: rgba(248, 250, 252, 0.6);
  font-size: 0.82rem;
  padding: 0.85rem 1.25rem !important;
  color: #475569;
}
.cd-detail-row pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.78rem;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0.3rem 0 0;
}

/* ── Pagination ─────────────────────────────────────────── */
.cd-pagination {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  justify-content: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.cd-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}
.cd-page-link:hover {
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.2);
}
.cd-page-link.active {
  background: #1e1b4b;
  color: #fff;
  border-color: #1e1b4b;
  box-shadow: 0 2px 8px rgba(30, 27, 75, 0.3);
}

/* ── Charts grid (site page) ────────────────────────────── */
.cd-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ── Dark mode for subpage elements ─────────────────────── */
[data-theme="dark"] .cd-page-title {
  color: #e2e8f0;
}
[data-theme="dark"] .cd-breadcrumb {
  color: rgba(255, 255, 255, 0.4);
}
[data-theme="dark"] .cd-breadcrumb a {
  color: #a78bfa;
}
[data-theme="dark"] .cd-breadcrumb-sep {
  color: rgba(255, 255, 255, 0.2);
}
[data-theme="dark"] .cd-meta-pill {
  background: rgba(30, 27, 75, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .cd-content-card {
  background: rgba(30, 27, 75, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .cd-content-card-header {
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .cd-content-card-title {
  color: #e2e8f0;
}
[data-theme="dark"] .cd-content-card-body {
  color: #cbd5e1;
}

[data-theme="dark"] .cd-filter-card {
  background: rgba(30, 27, 75, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cd-form-control,
[data-theme="dark"] .cd-form-select {
  background: #1e1a3a;
  border-color: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}
[data-theme="dark"] .cd-form-select option {
  background: #1e1a3a;
  color: #e2e8f0;
}
[data-theme="dark"] .cd-form-control:focus,
[data-theme="dark"] .cd-form-select:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

[data-theme="dark"] .cd-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .cd-table td {
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .cd-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .cd-table-clickable tbody tr:hover td {
  background: rgba(124, 58, 237, 0.08);
}

[data-theme="dark"] .cd-detail-row td {
  background: rgba(15, 14, 26, 0.6);
  color: #cbd5e1;
}

[data-theme="dark"] .cd-alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
}
[data-theme="dark"] .cd-alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
[data-theme="dark"] .cd-alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

[data-theme="dark"] .cd-page-link {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .cd-page-link:hover {
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
}
[data-theme="dark"] .cd-page-link.active {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}

[data-theme="dark"] .cd-btn-outline {
  color: #a78bfa;
  border-color: #a78bfa;
}
[data-theme="dark"] .cd-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}
[data-theme="dark"] .cd-btn-success {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}
[data-theme="dark"] .cd-btn-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}

/* ── Responsive for subpages ────────────────────────────── */
@media (max-width: 768px) {
  .cd-page-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  .cd-charts-grid {
    grid-template-columns: 1fr;
  }
  .cd-meta-pills {
    gap: 0.35rem;
  }
  .cd-filter-card form {
    flex-direction: column;
    align-items: stretch !important;
  }
  .cd-filter-card .cd-form-select,
  .cd-filter-card .cd-form-control {
    width: 100%;
  }
  .cd-table {
    font-size: 0.78rem;
  }
  .cd-table th,
  .cd-table td {
    padding: 0.5rem 0.65rem;
  }
}
@media (max-width: 480px) {
  .cd-meta-pills {
    flex-direction: column;
  }
}
