/* ============================================================
   WP Scanner - Complete Design System
   Inspired by Coinest finance dashboard
   ============================================================ */

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ============================================================
   THEME VARIABLES - LIGHT (default)
   ============================================================ */
:root {
  /* Backgrounds */
  --bg: #f5f7fa;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8faf8;

  /* Primary (green) */
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --primary-light: #dcfce7;
  --primary-bg: rgba(34, 197, 94, 0.08);

  /* Severity Colors */
  --critical: #ef4444;
  --critical-bg: rgba(239, 68, 68, 0.08);
  --high: #f97316;
  --high-bg: rgba(249, 115, 22, 0.08);
  --medium: #eab308;
  --medium-bg: rgba(234, 179, 8, 0.08);
  --low: #22c55e;
  --low-bg: rgba(34, 197, 94, 0.06);
  --safe: #10b981;
  --safe-bg: rgba(16, 185, 129, 0.06);

  /* Text */
  --text: #111827;
  --text2: #6b7280;
  --text3: #9ca3af;

  /* Borders */
  --border: #e5e7eb;
  --border-hover: #d1d4de;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);

  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Transition */
  --transition: 0.2s ease;

  /* Fonts */
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;

  /* Toggle */
  --toggle-bg: #d1d5db;
  --toggle-knob: #ffffff;
}

/* ============================================================
   THEME VARIABLES - DARK
   ============================================================ */
[data-theme="dark"] {
  --bg: #0f1117;
  --bg-sidebar: #161823;
  --bg-card: #1c1e2a;
  --bg-card-hover: #22253a;

  --primary: #22c55e;
  --primary-dark: #4ade80;
  --primary-light: rgba(34, 197, 94, 0.12);
  --primary-bg: rgba(34, 197, 94, 0.1);

  --critical-bg: rgba(239, 68, 68, 0.12);
  --high-bg: rgba(249, 115, 22, 0.12);
  --medium-bg: rgba(234, 179, 8, 0.1);
  --low-bg: rgba(34, 197, 94, 0.08);
  --safe-bg: rgba(16, 185, 129, 0.08);

  --text: #e5e7eb;
  --text2: #9ca3af;
  --text3: #6b7280;

  --border: #2d3044;
  --border-hover: #3d4060;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.35);

  --toggle-bg: #4b5563;
  --toggle-knob: #ffffff;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  margin-left: 260px;
  flex: 1;
  min-width: 0;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex-shrink: 0;
}

.sidebar-logo span {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

[data-theme="dark"] .nav-item.active {
  background: rgba(34, 197, 94, 0.12);
  color: var(--primary);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--bg-card);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.topbar-search {
  position: relative;
}

.topbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text3);
  pointer-events: none;
}

.topbar-search input {
  width: 220px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  transition: all var(--transition);
}

.topbar-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  outline: none;
}

.topbar-search input::placeholder {
  color: var(--text3);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
  border-radius: var(--radius-xs);
}

.mobile-menu-btn:hover {
  background: var(--bg);
}

.mobile-menu-btn svg {
  width: 22px;
  height: 22px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  cursor: pointer;
  transition: box-shadow var(--transition);
  flex-shrink: 0;
}

.user-avatar:hover {
  box-shadow: 0 0 0 3px var(--primary-bg);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  padding: 24px 28px;
  min-height: calc(100vh - 64px);
  overflow-y: auto;
}

#content {
  max-width: 1400px;
  width: 100%;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Stat Cards */
.stat-card {
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text);
}

.stat-card .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  margin-top: 4px;
  font-weight: 500;
}

.stat-card .stat-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card .stat-icon svg {
  width: 18px;
  height: 18px;
}

.stat-card.critical::before { background: var(--critical); }
.stat-card.critical .stat-value { color: var(--critical); }
.stat-card.critical .stat-icon { background: var(--critical-bg); color: var(--critical); }

.stat-card.high::before { background: var(--high); }
.stat-card.high .stat-value { color: var(--high); }
.stat-card.high .stat-icon { background: var(--high-bg); color: var(--high); }

.stat-card.medium::before { background: var(--medium); }
.stat-card.medium .stat-value { color: var(--medium); }
.stat-card.medium .stat-icon { background: var(--medium-bg); color: var(--medium); }

.stat-card.low::before { background: var(--low); }
.stat-card.low .stat-value { color: var(--low); }

.stat-card.safe::before { background: var(--safe); }
.stat-card.safe .stat-value { color: var(--safe); }
.stat-card.safe .stat-icon { background: var(--safe-bg); color: var(--safe); }

/* ============================================================
   GRIDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge-critical {
  background: var(--critical-bg);
  color: var(--critical);
}

.badge-high {
  background: var(--high-bg);
  color: var(--high);
}

.badge-medium {
  background: var(--medium-bg);
  color: var(--medium);
}

.badge-low {
  background: var(--low-bg);
  color: var(--low);
}

.badge-safe {
  background: var(--safe-bg);
  color: var(--safe);
}

.badge-wp {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.badge-static {
  background: var(--bg);
  color: var(--text3);
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg-card-hover);
}

td a {
  color: var(--primary);
  font-weight: 500;
}

td a:hover {
  text-decoration: underline;
}

/* ============================================================
   FORMS
   ============================================================ */
.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text);
  transition: all var(--transition);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  outline: none;
}

.input::placeholder {
  color: var(--text3);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text3);
  pointer-events: none;
}

.input-with-icon .input {
  padding-left: 38px;
}

.input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.input-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}

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

.textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--bg-card);
  color: var(--text);
  transition: all var(--transition);
  min-height: 200px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.6;
}

.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  outline: none;
}

.textarea::placeholder {
  color: var(--text3);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  white-space: nowrap;
  text-decoration: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-outline {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
}

.btn-danger {
  background: var(--critical);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-xs);
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-fill.critical { background: var(--critical); }
.progress-fill.high { background: var(--high); }
.progress-fill.medium { background: var(--medium); }
.progress-fill.low { background: var(--low); }
.progress-fill.safe { background: var(--safe); }

.progress-thin {
  height: 4px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}

.progress-label .label-text { color: var(--text2); font-weight: 500; }
.progress-label .label-value { color: var(--text); font-weight: 600; }

/* ============================================================
   SCAN PROGRESS STEPS
   ============================================================ */
.scan-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scan-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.scan-step.active {
  background: var(--primary-bg);
}

.scan-step.done {
  opacity: 0.6;
}

.scan-step.error {
  background: var(--critical-bg);
}

.scan-step .step-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scan-step .step-icon svg {
  width: 18px;
  height: 18px;
}

.scan-step.active .step-icon { color: var(--primary); }
.scan-step.done .step-icon { color: var(--safe); }
.scan-step.error .step-icon { color: var(--critical); }

.scan-step .step-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.scan-step .step-sub {
  font-size: 11px;
  color: var(--text3);
  margin-left: auto;
}

/* Spinner animation */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   DOMAIN CARDS (Scan Results)
   ============================================================ */
.domain-card {
  border-left: 3px solid transparent;
}

.domain-card.severity-critical { border-left-color: var(--critical); }
.domain-card.severity-high { border-left-color: var(--high); }
.domain-card.severity-medium { border-left-color: var(--medium); }
.domain-card.severity-low { border-left-color: var(--low); }
.domain-card.severity-safe { border-left-color: var(--safe); }

.domain-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background var(--transition);
}

.domain-header:hover {
  background: var(--bg-card-hover);
}

.domain-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.domain-name a {
  color: inherit;
  text-decoration: none;
}

.domain-name a:hover {
  color: var(--primary);
}

.domain-name .chevron {
  width: 16px;
  height: 16px;
  color: var(--text3);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.domain-card.open .domain-name .chevron {
  transform: rotate(90deg);
}

.domain-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.domain-tag {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--bg);
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--text3);
  white-space: nowrap;
}

.domain-severity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.domain-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.domain-card.open .domain-detail {
  max-height: 2000px;
}

.domain-detail-inner {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.detail-block {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.detail-block h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text3);
  margin-bottom: 8px;
  font-weight: 600;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-top: 1px solid var(--border);
}

.detail-row:first-child {
  border-top: none;
}

.detail-row .row-label {
  color: var(--text2);
  font-weight: 500;
}

.detail-row .row-value {
  color: var(--text);
  font-weight: 600;
}

/* Version Badges */
.version-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.version-outdated {
  background: var(--critical-bg);
  color: var(--critical);
}

.version-warning {
  background: var(--medium-bg);
  color: var(--medium);
}

.version-ok {
  background: var(--low-bg);
  color: var(--safe);
}

.version-unknown {
  background: var(--bg);
  color: var(--text3);
}

/* ============================================================
   ISSUE ITEMS
   ============================================================ */
.issue-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.issue-item {
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  border-left: 3px solid transparent;
  line-height: 1.5;
}

.issue-item.issue-critical {
  background: var(--critical-bg);
  border-color: var(--critical);
  color: var(--critical);
}

.issue-item.issue-high {
  background: var(--high-bg);
  border-color: var(--high);
  color: var(--high);
}

.issue-item.issue-medium {
  background: var(--medium-bg);
  border-color: var(--medium);
  color: var(--medium);
}

.issue-item.issue-low {
  background: var(--low-bg);
  border-color: var(--low);
  color: var(--low);
}

/* --- Issue item top row (flex layout) --- */
.issue-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Fix toggle button --- */
.btn-fix-toggle {
  margin-left: auto;
  padding: 3px 10px;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-fix-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- Fix steps panel --- */
.issue-fix {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.issue-fix-title {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 8px;
}

.issue-fix-steps {
  margin: 0;
  padding-left: 20px;
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.8;
}
.issue-fix-steps li {
  margin-bottom: 4px;
}
.issue-fix-steps li::marker {
  color: var(--primary);
  font-weight: 700;
}

/* ============================================================
   FILTER BUTTONS
   ============================================================ */
.filter-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text2);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.filter-count {
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  opacity: 0.7;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 24px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  color: var(--text2);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

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

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 12px;
  color: var(--text3);
  margin: 0 8px;
}

.per-page-select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  margin-left: 12px;
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  width: 48px;
  height: 26px;
  background: var(--toggle-bg);
  border-radius: 13px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--toggle-knob);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle {
  background: var(--primary);
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(22px);
}

/* Theme toggle icons */
.theme-toggle-icons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  position: relative;
  height: 100%;
  pointer-events: none;
}

.theme-toggle-icons svg {
  width: 12px;
  height: 12px;
}

.theme-toggle .sun-icon { color: #f59e0b; }
.theme-toggle .moon-icon { color: #94a3b8; }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-container {
  position: relative;
  width: 100%;
}

.chart-container canvas {
  width: 100% !important;
  height: auto !important;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  justify-content: center;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text2);
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   ALERTS / NOTICES
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-critical {
  background: var(--critical-bg);
  color: var(--critical);
  border-left: 3px solid var(--critical);
}

.alert-high {
  background: var(--high-bg);
  color: var(--high);
  border-left: 3px solid var(--high);
}

.alert-warning {
  background: var(--medium-bg);
  color: var(--medium);
  border-left: 3px solid var(--medium);
}

.alert-success {
  background: var(--safe-bg);
  color: var(--safe);
  border-left: 3px solid var(--safe);
}

.alert-info {
  background: var(--primary-bg);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text3);
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-state p {
  color: var(--text3);
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto;
}

.empty-state .btn {
  margin-top: 20px;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-header:first-child {
  margin-top: 0;
}

.section-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.section-dot.critical { background: var(--critical); }
.section-dot.high { background: var(--high); }
.section-dot.medium { background: var(--medium); }
.section-dot.low { background: var(--low); }
.section-dot.safe { background: var(--safe); }

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.section-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text2);
  margin-left: auto;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================================
   TOOLTIP
   ============================================================ */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--text);
  color: var(--bg-card);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 50;
}

.tooltip:hover::after {
  opacity: 1;
}

/* ============================================================
   MODAL / OVERLAY
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: calc(100% - 40px);
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal-overlay.visible .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

.sidebar-overlay.visible {
  display: block;
}

/* ============================================================
   TAG LIST
   ============================================================ */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg);
  color: var(--text2);
}

.tag-remove {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  font-size: 10px;
  color: var(--text3);
}

.tag-remove:hover {
  background: var(--critical-bg);
  color: var(--critical);
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}

.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-card {
  height: 100px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
  animation: toast-in 0.3s ease;
}

.toast.toast-out {
  animation: toast-out 0.3s ease forwards;
}

.toast-success { border-left: 3px solid var(--safe); }
.toast-error { border-left: 3px solid var(--critical); }
.toast-warning { border-left: 3px solid var(--medium); }
.toast-info { border-left: 3px solid var(--primary); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

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

.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text3);
  font-size: 12px;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   COPY BUTTON
   ============================================================ */
.copy-btn {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 11px;
  color: var(--text3);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.copy-btn svg {
  width: 12px;
  height: 12px;
}

/* ============================================================
   SCORE RING
   ============================================================ */
.score-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.score-ring svg {
  transform: rotate(-90deg);
}

.score-ring .score-value {
  position: absolute;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.score-ring .score-label {
  position: absolute;
  bottom: -4px;
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ============================================================
   ANIMATIONS (for GSAP supplement)
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(10px);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-20px);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(20px);
}

.scale-in {
  opacity: 0;
  transform: scale(0.95);
}

/* ============================================================
   DASHBOARD - FinSet-inspired layout
   ============================================================ */

/* Welcome Header */
.fd-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.fd-welcome-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.fd-welcome-sub {
  font-size: 13px;
  color: var(--text2);
  margin-top: 2px;
}
.fd-welcome-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 4 Stat Cards Row */
.fd-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.fd-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.fd-stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}
.fd-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.fd-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
}
.fd-stat-arrow {
  color: var(--text3);
  opacity: 0.5;
}
.fd-stat-big {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 6px;
}
.fd-stat-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fd-stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.fd-stat-trend.up {
  color: #16a34a;
  background: rgba(34,197,94,0.1);
}
.fd-stat-trend.down {
  color: #ef4444;
  background: rgba(239,68,68,0.08);
}
.fd-stat-vs {
  font-size: 11px;
  color: var(--text3);
}

/* Shared card */
.fd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.fd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.fd-card-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.fd-card-head-right {
  display: flex;
  gap: 6px;
  align-items: center;
}
.fd-card-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.fd-leg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}
.fd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Middle row: chart + donut */
.fd-mid-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}
.fd-chart-body {
  padding: 16px 18px;
  min-height: 200px;
  display: flex;
  align-items: center;
}
.fd-chart-body canvas {
  max-width: 100%;
}

/* Donut body */
.fd-donut-body {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  gap: 16px;
}
.fd-donut-legend-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fd-donut-leg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}
.fd-donut-leg-val {
  margin-left: auto;
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
}
.fd-donut-canvas {
  flex-shrink: 0;
  width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Hide the auto-generated chart legend inside the donut card (we use our own side legend) */
.fd-donut-canvas .chart-legend {
  display: none !important;
}

/* Bottom row: table + sidebar */
.fd-bottom-row {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 14px;
  align-items: start;
}
.fd-card-table {
  min-height: 0;
}

/* Table */
.fd-table-body { padding: 0; }
.fd-table {
  width: 100%;
  border-collapse: collapse;
}
.fd-table thead th {
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.fd-table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.fd-table tbody tr:last-child { border-bottom: none; }
.fd-table tbody tr:hover { background: var(--bg-card-hover); }
.fd-table td {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}
.fd-domain-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fd-domain-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.fd-domain-nm {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

/* Non-WP badge */
.badge-nonwp {
  background: rgba(107,114,128,0.1);
  color: #6b7280;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Table footer */
.fd-table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}
.fd-page-row {
  display: flex;
  gap: 3px;
  align-items: center;
}
.fd-pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.fd-pg:hover {
  background: var(--bg);
  color: var(--text);
}
.fd-pg.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.fd-pg-dots {
  font-size: 11px;
  color: var(--text3);
  padding: 0 3px;
}

/* Right sidebar stats */
.fd-sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fd-mini-stats { }
.fd-mini-list {
  padding: 6px 0;
}
.fd-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.fd-mini-row:last-child { border-bottom: none; }
.fd-mini-row:hover { background: var(--bg); }
.fd-mini-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}
.fd-mini-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* Schedule card */
.fd-schedule-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fd-schedule-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fd-sched-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.fd-sched-select,
.fd-sched-input {
  font-size: 13px;
  padding: 7px 10px;
}

/* Dashboard empty state */
.fd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

/* --- Report section tables (Critical, Plugins, All Issues, WP Versions) --- */
.fd-report-section {
  border: 1px solid var(--border);
}
.fd-table-report {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.fd-table-report th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.fd-table-report td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.fd-table-report .fd-trow:last-child td {
  border-bottom: none;
}
.fd-table-report .fd-trow:hover {
  background: var(--bg-card-hover);
  cursor: pointer;
}
.fd-issue-msg {
  max-width: 420px;
  word-break: break-word;
  color: var(--text);
  line-height: 1.4;
}

/* Card head color accents */
.fd-card-head-critical {
  border-bottom: 2px solid var(--critical);
}
.fd-card-head-high {
  border-bottom: 2px solid var(--high);
}
.fd-card-head-medium {
  border-bottom: 2px solid var(--medium);
}
.fd-head-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.fd-head-badge.badge-critical {
  background: var(--critical-bg);
  color: var(--critical);
}
.fd-head-badge.badge-high {
  background: var(--high-bg);
  color: var(--high);
}
.fd-head-badge.badge-medium {
  background: var(--medium-bg);
  color: var(--medium);
}

/* Collapsible body */
.fd-collapsible {
  transition: max-height 0.3s ease;
}

/* --- Recommendations section --- */
.fd-rec-list {
  padding: 6px 0;
}
.fd-rec-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.fd-rec-item:last-child {
  border-bottom: none;
}
.fd-rec-item:hover {
  background: var(--bg);
}
.fd-rec-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg);
}
.fd-rec-body {
  flex: 1;
  min-width: 0;
}
.fd-rec-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.fd-rec-desc {
  font-size: 11.5px;
  color: var(--text2);
  line-height: 1.5;
}

/* All Plugins per Domain - Accordion */
.fd-plugin-accordion {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fd-plugin-domain-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
}
.fd-plugin-domain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}
.fd-plugin-domain-head:hover {
  background: var(--bg);
}
.fd-plugin-count {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}
.fd-plugin-chevron {
  transition: transform .2s ease;
}
.fd-plugin-domain-block.open .fd-plugin-chevron {
  transform: rotate(180deg);
}
.fd-plugin-domain-body {
  display: none;
  border-top: 1px solid var(--border);
}
.fd-plugin-domain-block.open .fd-plugin-domain-body {
  display: block;
}

/* ============================================================
   RESPONSIVE - TABLET (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar-search input {
    width: 180px;
  }

  .fd-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .fd-mid-row {
    grid-template-columns: 1fr;
  }
  .fd-bottom-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
  .app-main {
    margin-left: 0;
  }

  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 1000;
    width: 260px;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-search {
    display: none;
  }

  .main-content {
    padding: 14px;
  }

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

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .domain-tags {
    display: none;
  }

  .domain-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 14px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .fd-stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .fd-stat-big {
    font-size: 22px;
  }
  .fd-welcome-title {
    font-size: 18px;
  }
  .fd-welcome-actions {
    width: 100%;
  }
  .fd-donut-body {
    flex-direction: column;
  }
  .fd-donut-canvas {
    width: 140px;
  }
  .fd-col-issues {
    display: none;
  }
  .fd-table-report {
    font-size: 11px;
  }
  .fd-table-report th,
  .fd-table-report td {
    padding: 7px 10px;
  }
  .fd-issue-msg {
    max-width: 200px;
    font-size: 10.5px;
  }
  .fd-rec-item {
    padding: 10px 14px;
    gap: 10px;
  }
  .fd-rec-desc {
    font-size: 10.5px;
  }
  .fd-plugin-domain-head {
    padding: 8px 10px;
    font-size: 12px;
  }
  .fd-plugin-domain-head strong {
    font-size: 11px;
  }

  .filter-group {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .filter-btn {
    flex-shrink: 0;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .stat-card .stat-value {
    font-size: 24px;
  }

  .modal {
    max-width: calc(100% - 24px);
    max-height: 90vh;
  }

  .toast-container {
    left: 14px;
    right: 14px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* ============================================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar-right .user-avatar {
    display: none;
  }

  .stat-card {
    padding: 16px 18px;
  }

  .card-body {
    padding: 14px;
  }

  .fd-stats-row {
    grid-template-columns: 1fr;
  }
  .fd-stat-big {
    font-size: 20px;
  }
  .fd-welcome-actions {
    flex-direction: column;
    width: 100%;
  }
  .fd-welcome-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Margin Bottom */
.mb-xs { margin-bottom: 4px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }

/* Margin Top */
.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }

/* Padding */
.p-sm { padding: 8px; }
.p-md { padding: 16px; }
.p-lg { padding: 24px; }

/* Gap */
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text3); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 16px; }
.text-mono { font-family: var(--font-mono); }
.text-bold { font-weight: 700; }
.text-semibold { font-weight: 600; }
.text-primary { color: var(--primary); }
.text-critical { color: var(--critical); }
.text-high { color: var(--high); }
.text-medium { color: var(--medium); }
.text-safe { color: var(--safe); }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.inline-flex { display: inline-flex; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Border */
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.no-border { border: none; }

/* Print */
@media print {
  .sidebar,
  .topbar,
  .theme-toggle,
  .mobile-menu-btn,
  .filter-group,
  .pagination {
    display: none !important;
  }

  .app-main {
    margin-left: 0;
  }

  .main-content {
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  transition: background 0.3s ease;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .login-card {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.login-logo svg {
  width: 36px;
  height: 36px;
  color: var(--primary);
}

.login-logo h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text1);
  margin: 0;
}

.login-subtitle {
  text-align: center;
  color: var(--text3);
  font-size: 14px;
  margin: 0 0 28px;
}

.login-field {
  margin-bottom: 20px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-main);
  color: var(--text1);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.login-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.login-field input::placeholder {
  color: var(--text3);
  opacity: 0.7;
}

.login-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  margin-top: 4px;
}

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

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  text-align: center;
}

[data-theme="dark"] .login-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  color: var(--text3);
  font-size: 11px;
}

@media (max-width: 480px) {
  .login-container {
    padding: 16px;
  }

  .login-card {
    padding: 32px 24px 24px;
    border-radius: 12px;
  }
}
