/* ============================================================
   SEO Audit Tool v4 — Modern Light UI
   2025 Design: Clean, Professional, Friendly
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --primary:      #4f46e5;
  --primary-light:#ede9fe;
  --primary-dark: #3730a3;
  --secondary:    #7c3aed;
  --bg:           #f8fafc;
  --bg2:          #f1f5f9;
  --white:        #ffffff;
  --border:       #e2e8f0;
  --border2:      #cbd5e1;

  /* Text */
  --text:         #0f172a;
  --text2:        #475569;
  --text3:        #94a3b8;
  --text4:        #cbd5e1;

  /* Status Colors */
  --green:        #10b981;
  --green-bg:     #ecfdf5;
  --green-border: #a7f3d0;
  --red:          #ef4444;
  --red-bg:       #fef2f2;
  --red-border:   #fecaca;
  --yellow:       #f59e0b;
  --yellow-bg:    #fffbeb;
  --yellow-border:#fde68a;
  --blue:         #3b82f6;
  --blue-bg:      #eff6ff;
  --blue-border:  #bfdbfe;
  --purple:       #8b5cf6;
  --purple-bg:    #f5f3ff;
  --purple-border:#ddd6fe;
  --pink:         #ec4899;
  --pink-bg:      #fdf2f8;
  --orange:       #f97316;
  --orange-bg:    #fff7ed;
  --cyan:         #06b6d4;
  --cyan-bg:      #ecfeff;
  --indigo:       #6366f1;

  /* Layout */
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --radius:       14px;
  --radius-sm:    10px;
  --radius-xs:    7px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.05);
  --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 6px rgba(0,0,0,0.05), 0 10px 30px rgba(0,0,0,0.08);
  --shadow-lg:    0 10px 40px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  display: flex;
  align-items: center;
  gap: 11px;
}
.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  box-shadow: 0 4px 12px rgba(79,70,229,0.35);
  flex-shrink: 0;
}
.logo-text { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); }
.logo-sub  { font-size: 10.5px; color: var(--text3); margin-top: 1px; }
.version-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  margin-top: 10px;
  background: var(--primary-light);
  border: 1px solid var(--purple-border);
  font-size: 10px;
  color: var(--primary);
  font-weight: 600;
}

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text3);
  padding: 10px 18px 4px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  margin: 1px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(79,70,229,0.15);
  font-weight: 600;
}
.nav-icon { width: 17px; text-align: center; font-size: 13px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  border-radius: 20px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  display: none;
}
.nav-badge.show { display: inline-flex; }

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulseAnim 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulseAnim {
  0%,100% { opacity:1; transform:scale(1); box-shadow:0 0 0 0 rgba(16,185,129,0.4); }
  50%      { opacity:0.8; transform:scale(1.1); box-shadow:0 0 0 5px rgba(16,185,129,0); }
}

/* ── MAIN ────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

.status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid;
}
.status-badge.idle    { background:#f8fafc; border-color:var(--border2); color:var(--text2); }
.status-badge.running { background:var(--blue-bg); border-color:var(--blue-border); color:var(--blue); }
.status-badge.paused  { background:var(--yellow-bg); border-color:var(--yellow-border); color:var(--yellow); }
.status-badge.done    { background:var(--green-bg); border-color:var(--green-border); color:var(--green); }
.status-dot { width:7px; height:7px; border-radius:50%; background:currentColor; }
.status-badge.running .status-dot { animation:pulseAnim 1.2s ease-in-out infinite; }

/* ── PAGE CONTENT ────────────────────────────────────────── */
.page-content { padding: 28px; flex: 1; }

/* ── SECTIONS ────────────────────────────────────────────── */
.section { display: none; animation: fadeUp 0.3s ease; }
.section.active { display: block; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.section-table { display:none; flex-direction:column; height:calc(100vh - var(--topbar-h)); overflow:hidden; min-height:0; }
.section-table.active { display:flex; }
.section-table .page-content { overflow:hidden; display:flex; flex-direction:column; padding-bottom:0; min-height:0; flex:1; }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.page-header p { font-size: 13.5px; color: var(--text2); line-height: 1.6; }

/* ── CARDS ───────────────────────────────────────────────── */
.card-dark {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card-dark:hover { box-shadow: var(--shadow-md); }
.card-dark .card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}
.card-dark .card-body { padding: 20px; }
.card-title { font-size: 13.5px; font-weight: 700; color: var(--text); }

.card-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.card-icon.blue   { background:var(--blue-bg);   color:var(--blue);   }
.card-icon.purple { background:var(--purple-bg);  color:var(--purple); }
.card-icon.green  { background:var(--green-bg);   color:var(--green);  }
.card-icon.red    { background:var(--red-bg);     color:var(--red);    }
.card-icon.yellow { background:var(--yellow-bg);  color:var(--yellow); }
.card-icon.orange { background:var(--orange-bg);  color:var(--orange); }
.card-icon.cyan   { background:var(--cyan-bg);    color:var(--cyan);   }
.card-icon.indigo { background:var(--primary-light);color:var(--primary);}

/* ── STAT CARDS ──────────────────────────────────────────── */
.stat-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  transition: all 0.25s ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,0.1); transform: translateY(-3px); }

/* Colored left border accent */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  border-radius: 18px 0 0 18px;
}
/* Soft color tint background per card */
.stat-card.blue   { background: linear-gradient(135deg,#fff 55%,#eff6ff 100%); }
.stat-card.blue::before   { background: var(--blue);   }
.stat-card.red    { background: linear-gradient(135deg,#fff 55%,#fef2f2 100%); }
.stat-card.red::before    { background: var(--red);    }
.stat-card.cyan   { background: linear-gradient(135deg,#fff 55%,#ecfeff 100%); }
.stat-card.cyan::before   { background: var(--cyan);   }
.stat-card.yellow { background: linear-gradient(135deg,#fff 55%,#fffbeb 100%); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.purple { background: linear-gradient(135deg,#fff 55%,#f5f3ff 100%); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.pink   { background: linear-gradient(135deg,#fff 55%,#fdf2f8 100%); }
.stat-card.pink::before   { background: var(--pink);   }
.stat-card.orange { background: linear-gradient(135deg,#fff 55%,#fff7ed 100%); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.emerald{ background: linear-gradient(135deg,#fff 55%,#ecfdf5 100%); }
.stat-card.emerald::before{ background: #10b981;       }
.stat-card.green  { background: linear-gradient(135deg,#fff 55%,#f0fdf4 100%); }
.stat-card.green::before  { background: var(--green);  }

/* Inner row layout: icon left, value+label right */
.stat-card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.stat-info { flex: 1; min-width: 0; }

.stat-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-card.blue   .stat-chip { background:rgba(59,130,246,0.12);  color:var(--blue);   }
.stat-card.red    .stat-chip { background:rgba(239,68,68,0.12);   color:var(--red);    }
.stat-card.cyan   .stat-chip { background:rgba(6,182,212,0.12);   color:var(--cyan);   }
.stat-card.yellow .stat-chip { background:rgba(245,158,11,0.12);  color:var(--yellow); }
.stat-card.purple .stat-chip { background:rgba(139,92,246,0.12);  color:var(--purple); }
.stat-card.pink   .stat-chip { background:rgba(236,72,153,0.12);  color:var(--pink);   }
.stat-card.orange .stat-chip { background:rgba(249,115,22,0.12);  color:var(--orange); }
.stat-card.emerald .stat-chip { background:rgba(16,185,129,0.12); color:#10b981;       }
.stat-card.green  .stat-chip { background:rgba(16,185,129,0.12);  color:var(--green);  }

.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 3px;
}
.stat-label {
  font-size: 12.5px;
  color: var(--text2);
  font-weight: 600;
  letter-spacing: 0.1px;
}
.stat-sub {
  font-size: 11px;
  color: var(--text3);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 2px;
}

/* ── PROGRESS ────────────────────────────────────────────── */
.progress-track { height: 6px; background: var(--bg2); border-radius: 4px; overflow: hidden; margin-top: 14px; }
.progress-fill  { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }
.progress-meta  { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--text2); }

/* ── FORM CONTROLS ───────────────────────────────────────── */
.input-dark {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: all 0.18s;
  font-family: 'Inter', sans-serif;
  box-shadow: var(--shadow-sm);
}
.input-dark::placeholder { color: var(--text3); }
.input-dark:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
textarea.input-dark { resize: vertical; min-height: 80px; }

.select-dark {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 34px 10px 14px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234f46e5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s;
}
.select-dark:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-app {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.1px;
  text-decoration: none;
}
.btn-app:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-app:not(:disabled):hover { transform: translateY(-1px); }
.btn-app:not(:disabled):active { transform: translateY(0); }

.btn-primary-app {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}
.btn-primary-app:not(:disabled):hover { background: var(--primary-dark); box-shadow: 0 6px 20px rgba(79,70,229,0.4); }

.btn-success-app {
  background: var(--green);
  color: white;
  box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}
.btn-success-app:not(:disabled):hover { background: #059669; }

.btn-warning-app {
  background: var(--yellow);
  color: white;
  box-shadow: 0 4px 12px rgba(245,158,11,0.25);
}
.btn-warning-app:not(:disabled):hover { background: #d97706; }

.btn-ghost-app {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text2);
  box-shadow: var(--shadow-sm);
}
.btn-ghost-app:not(:disabled):hover { background: var(--bg); color: var(--text); border-color: var(--border2); }

.btn-danger-app {
  background: var(--red-bg);
  border: 1.5px solid var(--red-border);
  color: var(--red);
}
.btn-danger-app:not(:disabled):hover { background: #fee2e2; }

.btn-sm-app { padding: 7px 13px; font-size: 12.5px; }

/* ── TABLE ───────────────────────────────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.search-wrap { position: relative; flex: 1; min-width: 160px; }
.search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 13px;
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px 8px 36px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: all 0.18s;
  font-family: 'Inter', sans-serif;
}
.search-wrap input::placeholder { color: var(--text3); }
.search-wrap input:focus { border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 3px rgba(79,70,229,0.08); }

/* Scroll wrapper — the key to horizontal scroll working */
.table-scroll-outer {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: scroll !important;   /* always show horizontal scrollbar */
  overflow-y: auto !important;
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 240px); /* hard bound so overflow triggers */
  background: var(--white);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
  display: block;                  /* ensure block formatting context */
}

/* Bigger, always-visible scrollbar for the table */
.table-wrap::-webkit-scrollbar        { width: 10px; height: 10px; }
.table-wrap::-webkit-scrollbar-track  { background: var(--bg2); border-radius: 5px; }
.table-wrap::-webkit-scrollbar-thumb  { background: var(--border2); border-radius: 5px; border: 2px solid var(--bg2); }
.table-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.table-wrap::-webkit-scrollbar-corner { background: var(--bg2); }

/* Right-edge fade hint — shows there's more to scroll */
.table-scroll-outer::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 10px;
  width: 40px;
  background: linear-gradient(to right, transparent, rgba(248,250,252,0.85));
  pointer-events: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  z-index: 30;
  transition: opacity 0.3s;
}
.table-scroll-outer.scrolled-right::after { opacity: 0; }

/* Table itself — as wide as content needs */
.data-table {
  width: max-content !important;
  min-width: 100% !important;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
  table-layout: auto !important;
}

/* Column widths — compact but readable */
.data-table thead th {
  background: var(--bg2);
  padding: 10px 12px;
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  font-weight: 700;
  border-bottom: 2px solid var(--border2);
  position: sticky;
  top: 0;
  z-index: 10;
  user-select: none;
  white-space: nowrap;
  min-width: 80px;
}
/* Specific column widths by type */
.data-table thead th:nth-child(1)  { min-width: 220px; max-width: 260px; } /* URL */
.data-table thead th:nth-child(4)  { min-width: 180px; } /* Title Tag */
.data-table thead th:nth-child(6)  { min-width: 200px; } /* Meta Desc */
.data-table thead th:nth-child(11) { min-width: 180px; } /* H1 Text */
.data-table thead th:nth-child(15) { min-width: 160px; } /* Canonical */
.data-table thead th:nth-child(27) { min-width: 160px; } /* Redir URL */
.data-table thead th:nth-child(28) { min-width: 160px; } /* Final URL */
.data-table thead th:nth-child(32) { min-width: 150px; } /* Schema Types */

.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #f8faff; }
.data-table tbody td {
  padding: 9px 12px;
  color: var(--text2);
  vertical-align: middle;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sticky first column (URL) */
.data-table tbody td:first-child {
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 5;
  border-right: 2px solid var(--border2);
  max-width: 260px;
  min-width: 220px;
  box-shadow: 2px 0 6px rgba(0,0,0,0.04);
}
.data-table tbody tr:hover td:first-child { background: #f8faff; }

/* Sticky first header */
.data-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 20;
  background: var(--bg2);
  border-right: 2px solid var(--border2);
  box-shadow: 2px 0 6px rgba(0,0,0,0.04);
}

/* Row number column if added */
.col-num { min-width: 44px; width: 44px; text-align: center; color: var(--text3); font-size: 11px; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge-app {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  border: 1px solid;
}
.b-200   { background:var(--green-bg);   color:#065f46; border-color:var(--green-border); }
.b-3xx   { background:var(--blue-bg);    color:#1e40af; border-color:var(--blue-border);  }
.b-4xx,
.b-5xx,
.b-err   { background:var(--red-bg);     color:#991b1b; border-color:var(--red-border);   }
.b-yes   { background:var(--red-bg);     color:#991b1b; border-color:var(--red-border);   }
.b-no    { background:var(--green-bg);   color:#065f46; border-color:var(--green-border); }
.b-noindex{ background:var(--yellow-bg); color:#92400e; border-color:var(--yellow-border);}
.b-index { background:var(--green-bg);   color:#065f46; border-color:var(--green-border); }
.b-redir { background:var(--blue-bg);    color:#1e40af; border-color:var(--blue-border);  }
.b-https { background:var(--green-bg);   color:#065f46; border-color:var(--green-border); }
.b-http  { background:var(--red-bg);     color:#991b1b; border-color:var(--red-border);   }
.b-crit  { background:#fef2f2;           color:#991b1b; border-color:#fca5a5; }
.b-high  { background:var(--red-bg);     color:#991b1b; border-color:var(--red-border);   }
.b-med   { background:var(--yellow-bg);  color:#92400e; border-color:var(--yellow-border);}
.b-low   { background:var(--blue-bg);    color:#1e40af; border-color:var(--blue-border);  }

.speed-good,
.speed-avg,
.speed-bad {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
}
.speed-good { background:var(--green-bg);  color:#065f46; border-color:var(--green-border); }
.speed-avg  { background:var(--yellow-bg); color:#92400e; border-color:var(--yellow-border);}
.speed-bad  { background:var(--red-bg);    color:#991b1b; border-color:var(--red-border);   }

.url-link { color: var(--primary); text-decoration: none; font-size: 13px; max-width: 260px; display: inline-block; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; font-weight: 500; }
.url-link:hover { color: var(--primary-dark); text-decoration: underline; }

.no-data { text-align: center; padding: 60px 20px; color: var(--text3); }
.no-icon { font-size: 42px; margin-bottom: 14px; opacity: 0.3; display: block; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast-msg {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 340px;
  border: 1px solid;
}
@keyframes toastIn { from { opacity:0; transform:translateX(20px) scale(0.9); } to { opacity:1; transform:translateX(0) scale(1); } }
.toast-msg.success { background:var(--white); border-color:var(--green-border); color:#065f46; }
.toast-msg.error   { background:var(--white); border-color:var(--red-border);   color:#991b1b; }
.toast-msg.info    { background:var(--white); border-color:var(--blue-border);  color:#1e40af; }
.toast-msg.success i { color: var(--green); }
.toast-msg.error   i { color: var(--red);   }
.toast-msg.info    i { color: var(--blue);  }

/* ── SPINNER ─────────────────────────────────────────────── */
.spinner { display:inline-block; width:14px; height:14px; border:2px solid rgba(255,255,255,0.3); border-top-color:#fff; border-radius:50%; animation:spin 0.65s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-dark { --bs-modal-bg: var(--white); --bs-modal-border-color: var(--border); --bs-modal-color: var(--text); --bs-modal-border-radius: var(--radius); }
.modal-dark .modal-header { border-bottom: 1px solid var(--border); padding: 18px 24px; }
.modal-dark .modal-body   { padding: 24px; }
.modal-dark .modal-footer { border-top: 1px solid var(--border); padding: 16px 24px; }
.modal-dark .modal-title  { font-family:'Plus Jakarta Sans',sans-serif; font-size:17px; font-weight:700; color:var(--text); }

/* ── ISSUE ITEMS ─────────────────────────────────────────── */
.issue-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.18s;
  box-shadow: var(--shadow-sm);
}
.issue-item:hover { border-color: var(--border2); box-shadow: var(--shadow); }
.issue-ic { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.issue-count { font-family:'Plus Jakarta Sans',sans-serif; font-size:20px; font-weight:800; line-height:1; color:var(--text); }
.issue-label { font-size:11px; color:var(--text2); margin-top:2px; font-weight:500; }

/* ── API INFO ────────────────────────────────────────────── */
.api-info-box { background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm); padding:16px 18px; }
.api-row { display:flex; align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid var(--border); }
.api-row:last-child { border-bottom:none; }
.api-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.api-dot.on  { background:var(--green); box-shadow:0 0 0 3px var(--green-bg); }
.api-dot.off { background:var(--text4); }
.api-name { font-size:13px; color:var(--text); font-weight:600; flex:1; }
.api-desc { font-size:12px; color:var(--text3); }

/* ── LOG TERMINAL ────────────────────────────────────────── */
.log-terminal {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'JetBrains Mono','Fira Code','Courier New',monospace;
  font-size: 12px;
  color: var(--text2);
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.8;
}
.log-err     { color: var(--red);    }
.log-success { color: var(--green);  }
.log-info    { color: var(--blue);   }
.log-warn    { color: var(--yellow); }

/* ── EXPORT CARDS ────────────────────────────────────────── */
.export-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  height: 100%;
}
.export-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.export-icon { font-size: 32px; margin-bottom: 16px; }

/* ── CLIENT CARD ─────────────────────────────────────────── */
.client-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  height: 100%;
}
.client-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border2); }
.client-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── AUDIT BANNER ────────────────────────────────────────── */
.audit-banner {
  display: none;
  background: var(--blue-bg);
  border: 1.5px solid var(--blue-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 16px;
}
.audit-banner.show { display: block; }

/* ── FORM LABELS ─────────────────────────────────────────── */
.form-label-dark {
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider { height:1px; background:var(--border); margin:16px 0; }

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--bg2); border-radius: 3px; }
::-webkit-scrollbar-thumb  { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── MENU BTN (MOBILE) ───────────────────────────────────── */
.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  font-size: 14px;
}
.overlay { display:none; position:fixed; inset:0; background:rgba(15,23,42,0.4); z-index:150; backdrop-filter:blur(4px); }
.overlay.open { display:block; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text3);
  margin: 0 auto 20px;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .menu-btn { display: flex; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
}
@media (max-width: 576px) {
  .stat-value { font-size: 24px; }
  .page-header h2 { font-size: 20px; }
}

/* ── UTILITY ─────────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.text-muted   { color: var(--text2) !important; }
.fw-700       { font-weight: 700; }
.gap-2        { gap: 8px; }
