/* ============================================================================
   CLIENT PORTAL DASHBOARD — COMPLETE CSS
   Design: Vercel + Cloudflare + Stripe dark-mode SaaS aesthetic
   ============================================================================ */

/* ── RESET & ROOT ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: dark; }

:root {
  /* Backgrounds */
  --bg: #0a0a0a;
  --sidebar-bg: #0f0f0f;
  --card-bg: #141414;
  --surface-raised: #1a1a1a;
  --input-bg: #141414;

  /* Borders */
  --border: rgba(255,255,255,0.08);
  --border-subtle: rgba(255,255,255,0.04);

  /* Text */
  --text: #ffffff;
  --text-secondary: rgba(255,255,255,0.55);
  --text-muted: rgba(255,255,255,0.35);

  /* Brand */
  --yellow: #3a5cff;
  --yellow-hover: #2a48d4;
  --yellow-glow: rgba(58,92,255,0.12);

  /* Status */
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;

  /* Chart palette — unified blue */
  --blue: #3a5cff;
  --teal: rgba(58,92,255,0.6);
  --purple: rgba(58,92,255,0.35);
  --pink: rgba(58,92,255,0.2);

  /* Layout */
  --sidebar-w: 240px;
  --page-padding: 36px;
  --card-radius: 14px;
  --card-padding: 24px;
  --card-gap: 16px;

  /* Transitions */
  --ease: 0.2s ease;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Utility */
.hidden { display: none !important; }

/* ── CUSTOM SCROLLBAR ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.14);
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}


/* ============================================================================
   1. LOGIN SCREEN
   ============================================================================ */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px 36px;
  text-align: center;
}

.login-logo {
  height: 52px;
  width: auto;
  display: block;
  margin: 0 auto 8px;
  filter: brightness(0) invert(1);
}

.login-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 32px;
}

.login-box input {
  width: 100%;
  padding: 13px 16px;
  margin-bottom: 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.login-box input::placeholder {
  color: var(--text-muted);
}

.login-box input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow-glow);
}

.login-box button {
  width: 100%;
  padding: 13px;
  background: var(--yellow);
  color: #000000;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--ease), transform var(--ease);
  margin-top: 10px;
}

.login-box button:hover {
  background: var(--yellow-hover);
}

.login-box button:active {
  transform: scale(0.98);
}

.login-box button span {
  position: relative;
  z-index: 1;
}

.error-msg {
  background: rgba(239,68,68,0.08);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(239,68,68,0.12);
}


/* ============================================================================
   2. SIDEBAR
   ============================================================================ */
#app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease, width 0.2s ease;
}

.sidebar-top {
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-logo-img {
  height: 48px;
  width: auto;
  display: block;
  margin-bottom: 8px;
  filter: brightness(0) invert(1);
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

/* Nav section label */
.sidebar-nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 16px 16px 6px;
}

/* Nav items */
.sidebar-nav {
  flex: 1;
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  transition: all var(--ease);
  text-align: left;
  white-space: nowrap;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.45;
  transition: opacity var(--ease);
  flex-shrink: 0;
}

.nav-item:hover {
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.04);
}

.nav-item:hover svg {
  opacity: 0.7;
}

.nav-item.active {
  color: var(--text);
  background: rgba(255,255,255,0.07);
}

.nav-item.active svg {
  opacity: 1;
  color: var(--yellow);
}

/* Locked nav items (standard package) */
.nav-item.nav-locked {
  opacity: 0.25;
  pointer-events: none;
}

/* Sidebar bottom */
.sidebar-bottom {
  padding: 16px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-site {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 4px;
}

.sidebar-site-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-site-dot.online {
  background: var(--green);
  box-shadow: 0 0 6px rgba(16,185,129,0.4);
}

.sidebar-site-dot.offline {
  background: var(--red);
  box-shadow: 0 0 6px rgba(239,68,68,0.3);
}

.btn-logout {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  padding: 9px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--ease);
  width: 100%;
  text-align: center;
}

.btn-logout:hover {
  border-color: rgba(239,68,68,0.3);
  color: var(--red);
  background: rgba(239,68,68,0.04);
}


/* ============================================================================
   3. MOBILE HEADER
   ============================================================================ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  align-items: center;
  gap: 12px;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger svg {
  width: 20px;
  height: 20px;
}

.mobile-logo-img {
  height: 36px;
  width: auto;
}

/* Overlay behind sidebar on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}


/* ============================================================================
   4. PAGE CONTAINERS & TRANSITIONS
   ============================================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: var(--page-padding) 48px;
  min-height: 100vh;
  max-width: 100%;
}

.page {
  display: none;
  animation: pageFadeIn 0.3s ease forwards;
}

.page.active {
  display: block;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text);
}


/* ============================================================================
   5. STAT / METRIC CARDS
   ============================================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--card-gap);
  margin-bottom: var(--card-gap);
}

.stats-row.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stats-row.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 22px var(--card-padding);
  transition: border-color var(--ease), box-shadow var(--ease);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,230,66,0.15), transparent);
  opacity: 0;
  transition: opacity var(--ease);
}

.stat-card:hover {
  border-color: rgba(255,255,255,0.12);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1.2px;
  line-height: 1.1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Metric trend indicators */
.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.metric-trend.up {
  color: var(--green);
}

.metric-trend.down {
  color: var(--red);
}

.metric-trend.neutral {
  color: var(--text-muted);
}

.metric-trend svg {
  width: 12px;
  height: 12px;
}


/* ============================================================================
   6. CARDS
   ============================================================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  margin-bottom: var(--card-gap);
  transition: border-color var(--ease);
}

.card:hover {
  border-color: rgba(255,255,255,0.1);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-head h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

.card-head .card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ============================================================================
   7. TWO-COLUMN GRID
   ============================================================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--card-gap);
  margin-bottom: 0;
}

.two-col .card {
  margin-bottom: var(--card-gap);
}


/* ============================================================================
   8. THREE-COLUMN GRID
   ============================================================================ */
.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--card-gap);
  margin-bottom: 0;
}

.three-col .card {
  margin-bottom: var(--card-gap);
}


/* ============================================================================
   9. TAB BAR
   ============================================================================ */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn,
.tab-item {
  padding: 8px 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
  position: relative;
  border-radius: 8px;
}

.tab-btn:hover,
.tab-item:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
}

.tab-btn.active,
.tab-item.active {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: pageFadeIn 0.2s ease forwards;
}


/* ============================================================================
   10. DATA TABLES
   ============================================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--ease);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: rgba(255,255,255,0.02);
}

.data-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.01);
}

.data-table tbody tr:nth-child(even):hover td {
  background: rgba(255,255,255,0.03);
}

.data-table .mono {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.data-table .text-right {
  text-align: right;
}

.data-table .text-center {
  text-align: center;
}

/* Legacy table aliases */
.pages-table { width: 100%; border-collapse: collapse; }
.pages-table th { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.pages-table td { font-size: 12px; color: var(--text-secondary); padding: 9px 10px; border-bottom: 1px solid var(--border-subtle); }
.pages-table tr:last-child td { border-bottom: none; }
.pages-table tr:hover td { background: rgba(255,255,255,0.02); }
.pages-table .path,
.data-table .path { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; color: var(--text-muted); font-size: 11px; }

.visitor-table { width: 100%; border-collapse: collapse; }
.visitor-table th { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.visitor-table td { font-size: 12px; color: var(--text-secondary); padding: 9px 10px; border-bottom: 1px solid var(--border-subtle); }
.visitor-table tr:last-child td { border-bottom: none; }
.visitor-table tr:hover td { background: rgba(255,255,255,0.02); }
.visitor-ip { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; color: var(--text-muted); font-size: 11px; }


/* ============================================================================
   11. DONUT CHART WRAPPER
   ============================================================================ */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 160px;
}

.donut-chart {
  flex-shrink: 0;
}

.donut-chart svg {
  display: block;
}

.donut-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.donut-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.donut-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.donut-flag {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.donut-name {
  flex: 1;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-count {
  color: var(--text);
  font-weight: 600;
  min-width: 28px;
  text-align: right;
}

.donut-pct {
  color: var(--text-muted);
  font-size: 11px;
  min-width: 36px;
  text-align: right;
}


/* ============================================================================
   12. AREA CHART WRAPPER
   ============================================================================ */
.area-chart-wrap {
  min-height: 200px;
  position: relative;
}

.area-chart-wrap svg {
  width: 100%;
  display: block;
}

.area-chart-wrap canvas {
  width: 100% !important;
  height: auto !important;
}


/* ============================================================================
   13. BAR CHART (horizontal)
   ============================================================================ */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--blue);
  transition: width 0.6s ease;
}

.bar-fill.accent { background: var(--yellow); }
.bar-fill.blue { background: var(--blue); }
.bar-fill.teal { background: var(--teal); }
.bar-fill.purple { background: var(--purple); }
.bar-fill.green { background: var(--green); }
.bar-fill.orange { background: var(--orange); }
.bar-fill.red { background: var(--red); }
.bar-fill.pink { background: var(--pink); }

.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  min-width: 40px;
  text-align: right;
}


/* ============================================================================
   14. PROGRESS BARS (Web Vitals, scroll depth, SSL expiry)
   ============================================================================ */
.progress-wrap {
  margin-bottom: 14px;
}

.progress-wrap:last-child {
  margin-bottom: 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.progress-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.progress-bar-fill.green { background: var(--green); }
.progress-bar-fill.orange { background: var(--orange); }
.progress-bar-fill.red { background: var(--red); }
.progress-bar-fill.blue { background: var(--blue); }
.progress-bar-fill.yellow { background: var(--yellow); }
.progress-bar-fill.teal { background: var(--teal); }
.progress-bar-fill.purple { background: var(--purple); }


/* ============================================================================
   15. BADGES
   ============================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge-good,
.badge.good,
.badge.online {
  color: var(--green);
  background: rgba(16,185,129,0.07);
  border-color: rgba(16,185,129,0.15);
}

.badge-warning,
.badge.warning {
  color: var(--orange);
  background: rgba(245,158,11,0.07);
  border-color: rgba(245,158,11,0.15);
}

.badge-poor,
.badge.poor,
.badge.offline {
  color: var(--red);
  background: rgba(239,68,68,0.07);
  border-color: rgba(239,68,68,0.15);
}

.badge-neutral,
.badge.neutral {
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
}

.badge.ssl {
  color: var(--green);
  background: rgba(16,185,129,0.07);
  border-color: rgba(16,185,129,0.12);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge.blue {
  color: var(--yellow);
  background: rgba(245,230,66,0.06);
  border-color: rgba(245,230,66,0.12);
}

.badge.purple {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}


/* ============================================================================
   16. UPTIME TIMELINE
   ============================================================================ */
.uptime-timeline-wrap {
  min-height: 60px;
}

.uptime-bar {
  display: flex;
  gap: 2px;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
}

.uptime-bar .tick {
  flex: 1;
  min-width: 2px;
  border-radius: 2px;
  transition: opacity var(--ease);
  cursor: default;
}

.uptime-bar .tick:hover {
  opacity: 0.7;
}

.uptime-bar .tick.up {
  background: var(--green);
}

.uptime-bar .tick.down {
  background: var(--red);
}

.uptime-bar .tick.degraded {
  background: var(--orange);
}

.uptime-bar .tick.unknown {
  background: rgba(255,255,255,0.06);
}

.uptime-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-muted);
}

.uptime-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.uptime-summary strong {
  color: var(--text);
  font-weight: 600;
}


/* ============================================================================
   17. ACTIVITY LIST
   ============================================================================ */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.activity-item:first-child {
  border-top: none;
}

.activity-type {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.activity-type.deploy {
  background: rgba(16,185,129,0.1);
  color: var(--green);
}

.activity-type.redeploy {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.activity-type.restore {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.activity-type.update {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.activity-type.security {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.activity-type.error {
  background: rgba(239,68,68,0.1);
  color: var(--red);
}

.activity-msg {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}


/* ============================================================================
   18. SETTINGS ROWS
   ============================================================================ */
/* ============================================================================
   18b. SETTINGS — TABS
   ============================================================================ */
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 4px;
}

.set-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.set-tab {
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  border-radius: 8px;
}

.set-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.set-tab.active {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

/* ============================================================================
   18c. SETTINGS — PANELS & SECTIONS
   ============================================================================ */
.set-panel {
  display: none;
}

.set-panel.active {
  display: block;
}

.set-section {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  padding: 28px 0;
}

.set-section-left h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.set-section-left p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.set-section-left .text-danger {
  color: var(--red);
}

.set-divider {
  height: 1px;
  background: var(--border);
}

/* Profile row */
.set-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--yellow);
  color: #000;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.set-profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.set-profile-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.set-profile-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Detail rows */
.set-detail-rows {
  display: flex;
  flex-direction: column;
}

.set-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.set-detail-row:last-child {
  border-bottom: none;
}

.set-detail-label {
  font-size: 13px;
  color: var(--text-muted);
}

.set-detail-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* ============================================================================
   19. SETTINGS FORMS
   ============================================================================ */
.settings-input {
  padding: 11px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  width: 100%;
  box-sizing: border-box;
}

.settings-input::placeholder { color: var(--text-muted); }
.settings-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow-glow);
}

.set-form-inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

.set-form-inline .settings-input {
  flex: 1;
  min-width: 0;
}

.set-form-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.set-form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.btn-compact {
  padding: 10px 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pw-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.pw-form input {
  padding: 11px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.pw-form input::placeholder { color: var(--text-muted); }
.pw-form input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow-glow);
}

.verified-email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.12);
  border-radius: 12px;
}

.verified-email-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.verified-email-addr {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.btn-primary {
  padding: 10px 24px;
  background: var(--yellow);
  color: #000000;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--ease), transform var(--ease);
  width: fit-content;
}

.btn-primary:hover {
  background: var(--yellow-hover);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-sm { padding: 5px 14px; font-size: 12px; border-radius: 6px; cursor: pointer; border: none; font-weight: 500; }
.btn-danger { background: rgba(239,68,68,0.12); color: #ef4444; }
.btn-danger:hover { background: rgba(239,68,68,0.22); }

.btn-secondary {
  padding: 10px 24px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
  width: fit-content;
}

.btn-secondary:hover {
  border-color: rgba(255,255,255,0.12);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

/* Generic form inputs */
.form-input {
  padding: 11px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  width: 100%;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow-glow);
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}


/* ============================================================================
   20. PLACEHOLDER CARD (coming soon)
   ============================================================================ */
.placeholder-card {
  border: 2px dashed rgba(255,255,255,0.06);
  border-radius: var(--card-radius);
  padding: 40px var(--card-padding);
  text-align: center;
  margin-bottom: var(--card-gap);
}

.placeholder-card p {
  font-size: 13px;
  color: var(--text-muted);
}

.placeholder-card .placeholder-icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.3;
}

.placeholder-card .placeholder-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}


/* ============================================================================
   21. SKELETON LOADER
   ============================================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-text.medium {
  width: 65%;
}

.skeleton-text.long {
  width: 90%;
}

.skeleton-heading {
  height: 24px;
  width: 50%;
  margin-bottom: 16px;
  border-radius: 6px;
}

.skeleton-stat {
  height: 28px;
  width: 80px;
  border-radius: 6px;
}

.skeleton-chart {
  height: 200px;
  border-radius: var(--card-radius);
}

.skeleton-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  margin-bottom: var(--card-gap);
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}


/* ============================================================================
   22. CHART TOOLTIP
   ============================================================================ */
.chart-tooltip {
  position: absolute;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text);
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.chart-tooltip-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.chart-tooltip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ============================================================================
   23. RANGE SELECTOR (7d / 30d / 90d)
   ============================================================================ */
.range-selector {
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.range-btn {
  padding: 6px 16px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--ease);
  white-space: nowrap;
}

.range-btn:hover {
  color: var(--text-secondary);
}

.range-btn.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 600;
}


/* ============================================================================
   24. TOAST NOTIFICATIONS
   ============================================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  animation: toastIn 0.3s ease forwards;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast.success {
  background: var(--yellow);
  color: #000000;
}

.toast.error {
  background: var(--surface-raised);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}

.toast.info {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
}

.toast.warning {
  background: var(--surface-raised);
  color: var(--orange);
  border: 1px solid rgba(245,158,11,0.2);
}

@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}


/* ============================================================================
   25. SITE STATUS BAR
   ============================================================================ */
.ov-top-row {
  display: flex;
  gap: var(--card-gap);
  margin-bottom: var(--card-gap);
  align-items: stretch;
}

.site-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--card-padding);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  flex: 1;
  min-width: 0;
}

.date-range-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  min-width: 180px;
}

.date-range-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
}

.custom-select {
  position: relative;
}

.custom-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 9px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.custom-select-btn:hover {
  border-color: rgba(255,255,255,0.15);
}

.custom-select-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.custom-select.open .custom-select-btn {
  border-color: var(--yellow);
}

.custom-select.open .custom-select-btn svg {
  transform: rotate(180deg);
}

.custom-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.custom-select.open .custom-select-menu {
  display: block;
}

.custom-select-opt {
  padding: 8px 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.custom-select-opt:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.custom-select-opt.selected {
  color: var(--yellow);
}

.site-status-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.site-dot.online {
  background: var(--green);
  box-shadow: 0 0 8px rgba(16,185,129,0.4);
  animation: pulse 2.5s ease-in-out infinite;
}

.site-dot.offline {
  background: var(--red);
  box-shadow: 0 0 8px rgba(239,68,68,0.3);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.75);
  }
}

.site-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.site-domain {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.site-status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ============================================================================
   26. PAYMENT / BILLING
   ============================================================================ */
.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.payment-label {
  font-size: 13px;
  color: var(--text-muted);
}

.payment-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.payment-value.highlight {
  color: var(--yellow);
}

.payment-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* Invoice table */
.invoice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.invoice-row:last-child {
  border-bottom: none;
}

.invoice-date {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 90px;
}

.invoice-desc {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 0 12px;
}

.invoice-amount {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 70px;
  text-align: right;
}

.invoice-status {
  margin-left: 12px;
}


/* ============================================================================
   ADDITIONAL COMPONENTS
   ============================================================================ */

/* Muted text */
.muted-text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 30px;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
  border: none;
}

/* Inline code / monospace */
.mono {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 11px;
}

/* Flex helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

/* Text colors */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-blue { color: var(--blue); }
.text-yellow { color: var(--yellow); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* Font weight */
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Tag / chip */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* KPI / highlight number */
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1.1;
}

/* Compact table (12px body) */
.compact-table {
  width: 100%;
  border-collapse: collapse;
}

.compact-table th {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.compact-table td {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.compact-table tbody tr:last-child td {
  border-bottom: none;
}

.compact-table tbody tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  opacity: 0.2;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 13px;
}

/* Section heading */
.section-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  margin-top: 20px;
}

.section-heading:first-child {
  margin-top: 0;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  transition: background var(--ease);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: transform var(--ease);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* Notification dot */
.notification-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

/* Stat change / delta */
.stat-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
}

.stat-delta.positive { color: var(--green); }
.stat-delta.negative { color: var(--red); }
.stat-delta.flat { color: var(--text-muted); }

/* Security score ring */
.score-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  position: relative;
}

.score-ring svg {
  transform: rotate(-90deg);
}

.score-ring-value {
  position: absolute;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

/* Conversion funnel */
.funnel-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.funnel-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.funnel-label {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.funnel-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.funnel-pct {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 50px;
  text-align: right;
}


/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* 1200px: Sidebar slightly narrower */
@media (max-width: 1200px) {
  :root {
    --sidebar-w: 220px;
  }

  .main-content {
    padding: 28px 32px;
  }
}

/* 900px: Sidebar collapses, two-col -> one-col */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 260px;
    z-index: 101;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  :root {
    --sidebar-w: 0px;
  }

  .mobile-header {
    display: flex;
  }

  .sidebar-overlay {
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 68px 24px 32px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-row.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .three-col {
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .ov-donuts-row {
    flex-direction: column;
  }

  .ov-donut-sep {
    width: 100%;
    height: 1px;
    margin: 16px 0;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .ov-top-row {
    flex-direction: column;
  }

  .site-status-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .date-range-card {
    min-width: 0;
  }

  .bar-label {
    min-width: 80px;
  }

  .set-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .set-tabs {
    overflow-x: auto;
  }

  .set-detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .set-detail-val {
    text-align: left;
  }
}

/* 640px: Full mobile */
@media (max-width: 640px) {
  :root {
    --page-padding: 16px;
    --card-padding: 16px;
    --card-gap: 12px;
  }

  .main-content {
    padding: 64px 16px 32px;
  }

  .page-header h2 {
    font-size: 22px;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .stats-row.cols-3 {
    grid-template-columns: 1fr;
  }

  .stats-row.cols-2 {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 24px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .three-col {
    grid-template-columns: 1fr;
  }

  .range-selector {
    width: 100%;
    justify-content: center;
  }

  .range-btn {
    flex: 1;
    text-align: center;
  }

  .donut-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .donut-chart {
    align-self: center;
  }

  .tab-bar {
    gap: 0;
  }

  .tab-btn,
  .tab-item {
    padding: 10px 12px;
    font-size: 12px;
  }

  .bar-label {
    min-width: 60px;
    font-size: 11px;
  }

  .data-table,
  .pages-table,
  .visitor-table,
  .compact-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .login-box {
    padding: 32px 20px;
  }

  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    max-width: 100%;
  }

  .activity-item {
    flex-wrap: wrap;
    gap: 6px;
  }

  .activity-time {
    width: 100%;
    padding-left: 0;
  }

  .payment-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .invoice-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .invoice-desc {
    padding: 0;
  }

  .invoice-amount {
    text-align: left;
  }

  .invoice-status {
    margin-left: 0;
  }

  .pw-form {
    max-width: 100%;
  }

  .uptime-bar {
    height: 24px;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 14px;
  }

  .page-header h2 {
    font-size: 20px;
  }
}


/* ============================================================================
   26b. OVERVIEW ROW (Traffic + Sources/Countries)
   ============================================================================ */
.area-chart-sm {
  min-height: 140px;
  max-height: 160px;
}

.area-chart-sm svg {
  max-height: 140px;
}

.ov-donuts-row {
  display: flex;
  gap: 0;
  height: 100%;
}

.ov-donut-col {
  flex: 1;
  min-width: 0;
}

.ov-donut-sep {
  width: 1px;
  background: var(--border);
  margin: 0 16px;
  align-self: stretch;
}

.ov-donut-head h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 12px;
}

.donut-compact {
  min-height: auto;
}

.donut-compact .donut-chart svg {
  width: 80px;
  height: 80px;
}

.donut-compact .donut-wrap {
  gap: 14px;
}

.donut-compact .donut-row {
  font-size: 11px;
}

.donut-compact .donut-list {
  gap: 4px;
}


/* ============================================================================
   27b. EXPANDABLE SECTIONS
   ============================================================================ */
.expandable.collapsed {
  max-height: 280px;
  overflow: hidden;
  position: relative;
}

.expandable.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--card-bg));
  pointer-events: none;
}

.expandable.expanded {
  max-height: none;
  overflow: visible;
}

.expand-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
}

.expand-btn:hover {
  border-color: rgba(255,255,255,0.12);
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
}


/* ============================================================================
   27. INFO TOOLTIP
   ============================================================================ */
.info-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: var(--text-muted);
  cursor: help;
  position: relative;
  vertical-align: middle;
}

.info-tooltip svg {
  width: 14px;
  height: 14px;
  opacity: 0.4;
  transition: opacity var(--ease);
}

.info-tooltip:hover svg {
  opacity: 0.8;
}

.info-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: pre-line;
  line-height: 1.6;
  width: max-content;
  max-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 100;
}

.info-tooltip:hover::after {
  opacity: 1;
}


/* ============================================================================
   SECURITY SCORE
   ============================================================================ */
.security-score-card {
  margin-bottom: var(--card-gap);
}

.security-score-row {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 8px 0;
}

.score-gauge {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.score-ring {
  width: 100%;
  height: 100%;
}

.score-ring-fill {
  transition: stroke-dashoffset 1s ease, stroke 0.5s ease;
}

.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.score-number span:first-child {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.score-percent {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

.score-info {
  flex: 1;
}

.score-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.score-rating {
  margin-bottom: 10px;
}

.score-issues {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-issue {
  font-size: 12px;
  line-height: 1.5;
}

.score-ok {
  font-size: 12px;
  color: var(--green);
}

.issue-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.issue-dot.bg-red { background: var(--red); }
.issue-dot.bg-orange { background: var(--orange); }
.issue-dot.bg-muted { background: var(--text-muted); }

/* ── Ban / Unban ── */
.btn-ban {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 8px;
  transition: all var(--ease);
  white-space: nowrap;
}

.btn-ban:hover {
  background: var(--red);
  color: #fff;
}

.btn-unban {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: auto;
  transition: all var(--ease);
}

.btn-unban:hover {
  border-color: var(--text-secondary);
  color: var(--text);
}

.banned-ip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.banned-ip-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.banned-ip-row:last-child {
  border-bottom: none;
}

.bar-row {
  align-items: center;
}


/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
  .sidebar,
  .mobile-header,
  .toast-container,
  .btn-logout,
  .range-selector {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}
