/* ================================================================
   EZ SEO AI — Premium Dark Theme v2
   ================================================================ */

:root {
  /* ── Palette ── */
  --primary:        #F5D300;
  --primary-dark:   #E0C200;
  --primary-light:  rgba(245, 211, 0, 0.12);
  --primary-glow:   rgba(245, 211, 0, 0.30);
  --lime:           #9AE600;

  /* ── Backgrounds ── */
  --bg-main:        #08090A;
  --bg-secondary:   #17181C;
  --bg-card:        #121316;
  --bg-card-end:    #0E0F12;
  --bg-hover:       #1E1F24;

  /* ── Text ── */
  --text-primary:   #F4F5F6;
  --text-secondary: #A7A9AE;
  --text-muted:     #6B6D73;

  /* ── Borders ── */
  --border:         rgba(255, 255, 255, 0.07);
  --border-light:   rgba(255, 255, 255, 0.07);
  --border-hover:   rgba(255, 255, 255, 0.12);

  /* ── State colours ── */
  --success:  #34D399;
  --danger:   #F26D6D;
  --warning:  #F5D300;
  --info:     #3DBDF5;

  /* ── Icon tints ── */
  --ic-blue:   #3DBDF5;
  --ic-green:  #34D399;
  --ic-red:    #F26D6D;
  --ic-purple: #A98BFB;
  --ic-yellow: #F5D300;

  /* ── Layout ── */
  --sidebar-width:  264px;
  --topbar-height:  62px;

  /* ── Shape ── */
  --radius:    20px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* ── Shadows ── */
  --shadow:      0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(245, 211, 0, 0.12);
  --shadow-card: 0 18px 40px -22px rgba(0, 0, 0, 0.9);

  /* ── Motion ── */
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ─── Base ───────────────────────────────────────────────── */
body {
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Radial background glow */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 80% at 80% -10%, rgba(245,211,0,.05) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.app-wrapper  { display: flex; }
.main-content { position: relative; }
.content-area { position: relative; }

/* Mono for numbers */
.mono,
.kpi-value,
.stat-number {
  font-family: 'JetBrains Mono', monospace;
  font-feature-settings: "tnum";
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ─── App Layout ─────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

.content-area {
  flex: 1;
  padding: 28px;
  padding-top: calc(var(--topbar-height) + 28px);
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 0; }

.sidebar-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.sidebar-logo:hover { opacity: 0.9; }

.logo-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #F5D300, #E0C200);
  display: flex; align-items: center; justify-content: center;
  color: #08090A;
  flex-shrink: 0;
  box-shadow: 0 0 22px rgba(245,211,0,.40);
}
.logo-mark i {
  font-size: 20px;
  color: #08090A;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.logo-name {
  font-weight: 800;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  font-family: 'Outfit', sans-serif;
}
.logo-ai {
  color: var(--primary);
  font-style: italic;
  margin-left: 2px;
}
.logo-tag {
  font-size: 9.5px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: .04em;
}

/* keep img fallback hidden */
.logo-img { display: none; }

/* User section (below header) */
.sidebar-user {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.user-avatar { position: relative; flex-shrink: 0; }
.user-avatar img, .avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-placeholder {
  background: linear-gradient(135deg, var(--ic-purple), var(--ic-blue));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.status-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}
.status-dot.online { background: var(--lime); box-shadow: 0 0 6px var(--lime); }

.user-info .user-name { font-weight: 600; font-size: 12.5px; line-height: 1.3; color: var(--text-primary); }
.user-info .user-role { font-size: 11px; color: var(--primary); font-weight: 500; }

/* Nav */
.sidebar-nav { flex: 1; padding: 10px 0 8px; list-style: none; }

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px 5px;
}

.nav-item { margin: 2px 8px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.5px;
  transition: var(--transition);
  position: relative;
  border: none;
}
.nav-link i { font-size: 18px; flex-shrink: 0; }
.nav-link span:not(.badge-new) { flex: 1; }

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

/* ── Active nav item: yellow gradient pill ── */
.nav-item.active .nav-link {
  background: linear-gradient(100deg, #F5D300, #E0C200);
  color: #08090A;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 20px -6px rgba(245,211,0,.45);
}
.nav-item.active .nav-link i,
.nav-item.active .nav-link .badge-new { color: #08090A; }
.nav-item.active .nav-link::before { display: none; }

.badge-new {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(245,211,0,.18);
  color: var(--primary);
  letter-spacing: .5px;
  font-family: 'Outfit', sans-serif;
}
.nav-item.active .nav-link .badge-new {
  background: rgba(8,9,10,.2);
  color: #08090A;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.footer-link {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 12px;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}
.footer-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.footer-link.text-danger { color: var(--danger) !important; }
.sidebar-toggle {
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 22px; cursor: pointer; padding: 4px;
}

/* ─── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: rgba(8, 9, 10, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  z-index: 999;
  gap: 14px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Breadcrumb */
.breadcrumb { font-size: 13px; margin: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 500; }

/* API status pills — lime LED dots */
.api-status-bar { align-items: center; }
.api-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 9px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: var(--transition);
}
.api-pill:hover { border-color: var(--border-hover); color: var(--text-primary); }
.api-pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.api-pill.connected .dot {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime), 0 0 3px var(--lime);
}
.api-pill.disconnected .dot { background: var(--text-muted); }
.api-pill.disconnected { color: var(--text-muted); }

/* Topbar buttons */
.topbar-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.topbar-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--danger);
  color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 17px; height: 17px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg-main);
}

.user-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px; font-weight: 500;
  font-family: 'Outfit', sans-serif;
}
.user-btn:hover { border-color: var(--primary); }
.user-avatar-sm { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.avatar-initials {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ic-purple), var(--ic-blue));
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Notification Dropdown ──────────────────────────────── */
.notif-dropdown {
  width: 340px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px;
}
.btn-text { background: none; border: none; color: var(--primary); font-size: 12px; cursor: pointer; font-family: 'Outfit', sans-serif; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--primary-light); }
.notif-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.notif-title { font-size: 13px; font-weight: 600; }
.notif-msg { font-size: 12px; color: var(--text-secondary); }
.notif-time { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notif-footer { padding: 10px 16px; text-align: center; border-top: 1px solid var(--border); }

/* ─── User Menu ──────────────────────────────────────────── */
.user-menu {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 200px;
}
.user-menu .menu-header { padding: 8px 12px 10px; }
.user-menu .dropdown-item {
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 13px;
  padding: 8px 12px;
}
.user-menu .dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.user-menu .dropdown-divider { border-color: var(--border); }

/* ─── Cards ──────────────────────────────────────────────── */
.glass-card {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-end));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-end));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,211,0,.32), transparent);
  transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-card); }
.card:hover::before {
  left: 0%; right: 0%;
  background: linear-gradient(90deg, transparent, rgba(245,211,0,.55), transparent);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-weight: 600;
  font-size: 14px;
}
.card-body { padding: 20px; }

/* ─── KPI / Stat Cards ───────────────────────────────────── */
.kpi-card {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-end));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

/* Glow line at top */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,211,0,.35), transparent);
  transition: left .3s, right .3s, background .3s;
}
.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: var(--border-hover);
}
.kpi-card:hover::before {
  left: 0%; right: 0%;
  background: linear-gradient(90deg, transparent, rgba(245,211,0,.62), transparent);
}

/* Icon — 54×54, 15px radius, tinted bg + inset border */
.kpi-icon {
  width: 54px; height: 54px;
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

/* Icon colour variants */
.ic-blue   { background: rgba(61,189,245,.12); box-shadow: inset 0 0 0 1px rgba(61,189,245,.4); }
.ic-blue   i { color: var(--ic-blue) !important; }
.ic-green  { background: rgba(52,211,153,.12); box-shadow: inset 0 0 0 1px rgba(52,211,153,.4); }
.ic-green  i { color: var(--ic-green) !important; }
.ic-red    { background: rgba(242,109,109,.12); box-shadow: inset 0 0 0 1px rgba(242,109,109,.4); }
.ic-red    i { color: var(--ic-red) !important; }
.ic-purple { background: rgba(169,139,251,.12); box-shadow: inset 0 0 0 1px rgba(169,139,251,.4); }
.ic-purple i { color: var(--ic-purple) !important; }
.ic-yellow { background: rgba(245,211,0,.12); box-shadow: inset 0 0 0 1px rgba(245,211,0,.4); }
.ic-yellow i { color: var(--ic-yellow) !important; }

/* Big mono number */
.kpi-value {
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 5px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.kpi-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* Footer trend line */
.kpi-change {
  font-size: 11.5px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
}
.kpi-change.up   { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* Score Cards */
.score-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  position: relative; flex-shrink: 0;
}

/* ─── Forms ──────────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-text { font-size: 12px; color: var(--text-muted); }
.form-check-input { background-color: var(--bg-hover); border-color: var(--border); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none; color: #08090A; font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-family: 'Outfit', sans-serif;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #c8b000);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--primary-glow);
  color: #08090A;
}
.btn-outline-primary {
  border: 1px solid var(--primary);
  color: var(--primary);
  background: transparent;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.btn-outline-primary:hover { background: var(--primary-light); color: var(--primary); }

.btn-glass {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Outfit', sans-serif;
}
.btn-glass:hover { border-color: var(--border-hover); color: var(--text-primary); }

.btn-danger  { background: var(--danger); border: none; color: #fff; }
.btn-success { background: var(--success); border: none; color: #08090A; font-weight: 700; }

/* ─── Tables ─────────────────────────────────────────────── */
.table {
  color: var(--text-primary);
  border-collapse: separate;
  border-spacing: 0;
}
.table thead th {
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 12px 16px;
}
.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.table tbody td { padding: 12px 16px; vertical-align: middle; }
.table-bordered { border: 1px solid var(--border); }
.table-bordered td, .table-bordered th { border: 1px solid var(--border); }

/* DataTables overrides */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info { color: var(--text-secondary); font-size: 13px; }
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: var(--bg-hover); border-color: var(--border);
  color: var(--text-primary); border-radius: var(--radius-xs); padding: 6px 10px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: var(--bg-hover); border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important; border-radius: var(--radius-xs); margin: 2px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important; color: #08090A !important; border-color: var(--primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--primary-light) !important; color: var(--primary) !important; border-color: var(--border-hover) !important;
}

/* ─── Badges & Pills ─────────────────────────────────────── */
.badge { border-radius: 6px; font-weight: 600; font-size: 11px; padding: 4px 8px; }
.badge-success  { background: rgba(52,211,153,.12); color: var(--success); }
.badge-danger   { background: rgba(242,109,109,.12); color: var(--danger); }
.badge-warning  { background: rgba(245,211,0,.12); color: var(--primary); }
.badge-info     { background: rgba(61,189,245,.12); color: var(--info); }
.badge-primary  { background: var(--primary-light); color: var(--primary); }
.badge-secondary{ background: var(--bg-hover); color: var(--text-secondary); }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active    { color: var(--success); background: rgba(52,211,153,.1); }
.status-inactive  { color: var(--text-muted); background: var(--bg-hover); }
.status-pending   { color: var(--primary); background: var(--primary-light); }
.status-completed { color: var(--success); background: rgba(52,211,153,.1); }
.status-running   { color: var(--info); background: rgba(61,189,245,.1); }

/* ─── Progress Bars ──────────────────────────────────────── */
.progress { background: var(--bg-hover); border-radius: 10px; height: 6px; }
.progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
}
.progress-bar.bg-success { background: var(--success); }
.progress-bar.bg-danger  { background: var(--danger); }
.progress-bar.bg-warning { background: var(--primary); }
.progress-bar.bg-info    { background: var(--info); }

/* ─── Score Circles ──────────────────────────────────────── */
.score-circle {
  width: 70px; height: 70px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.score-excellent { background: rgba(52,211,153,.12); color: var(--success); border: 2px solid var(--success); }
.score-good      { background: rgba(245,211,0,.12); color: var(--primary); border: 2px solid var(--primary); }
.score-poor      { background: rgba(242,109,109,.12); color: var(--danger); border: 2px solid var(--danger); }

/* ─── Page Headers ───────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title    { font-size: 22px; font-weight: 700; margin: 0; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.page-actions  { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── Modals ─────────────────────────────────────────────── */
.modal-backdrop { z-index: 1050 !important; }
.modal          { z-index: 1055 !important; padding-top: var(--topbar-height); }
.modal-dialog   { z-index: 1056 !important; }

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.modal-header { border-bottom: 1px solid var(--border); padding: 20px 24px; }
.modal-title { font-weight: 700; }
.modal-footer { border-top: 1px solid var(--border); padding: 16px 24px; }
.btn-close { filter: invert(1) opacity(.5); }
.btn-close:hover { filter: invert(1); }

/* ─── Search Modal ───────────────────────────────────────── */
.search-box {
  display: flex; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.search-icon { font-size: 20px; color: var(--text-muted); }
.search-input {
  flex: 1; background: none; border: none;
  color: var(--text-primary); font-size: 16px;
  font-family: 'Outfit', sans-serif;
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }
.shortcut-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-secondary);
  font-size: 13px; transition: var(--transition);
}
.shortcut-item:hover { border-color: var(--primary); color: var(--primary); }

/* ─── Agent Cards ────────────────────────────────────────── */
.agent-card {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-end));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.agent-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--agent-color, var(--primary));
  transform: scaleX(0);
  transition: var(--transition);
}
.agent-card:hover::after { transform: scaleX(1); }
.agent-card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.agent-icon { font-size: 36px; margin-bottom: 12px; }
.agent-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.agent-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; }
.agent-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-muted); }
.agent-status { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; }
.agent-status.idle    { color: var(--text-muted); }
.agent-status.running { color: var(--info); }
.agent-status.done    { color: var(--success); }

/* ─── Platform Cards (GEO) ───────────────────────────────── */
.platform-card {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px; transition: var(--transition);
}
.platform-card:hover { border-color: var(--border-hover); }
.platform-icon  { font-size: 28px; margin-bottom: 8px; }
.platform-name  { font-weight: 700; font-size: 13px; }
.platform-score { font-size: 28px; font-weight: 700; color: var(--primary); font-family: 'JetBrains Mono', monospace; }
.platform-label { font-size: 11px; color: var(--text-muted); }

/* ─── Audit Results ──────────────────────────────────────── */
.audit-score-big { font-size: 64px; font-weight: 800; line-height: 1; font-family: 'JetBrains Mono', monospace; }
.audit-metric {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.audit-metric:last-child { border-bottom: none; }
.audit-metric-label { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.audit-metric-value { font-weight: 600; }
.issue-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.issue-icon-wrap { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; }
.issue-pass { background: rgba(52,211,153,.12); color: var(--success); }
.issue-fail { background: rgba(242,109,109,.12); color: var(--danger); }
.issue-warn { background: rgba(245,211,0,.12); color: var(--primary); }

/* ─── Content Editor ─────────────────────────────────────── */
.content-output {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px; min-height: 300px;
  font-size: 14px; line-height: 1.8; color: var(--text-primary);
  white-space: pre-wrap; word-break: break-word;
  max-height: 600px; overflow-y: auto;
}

/* ─── Loading States ─────────────────────────────────────── */
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(8,9,10,.85);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 10; border-radius: var(--radius);
}
.ai-loader { display: flex; gap: 8px; margin-bottom: 12px; }
.ai-loader span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary);
  animation: aiPulse 1.4s ease-in-out infinite;
}
.ai-loader span:nth-child(2) { animation-delay: .2s; }
.ai-loader span:nth-child(3) { animation-delay: .4s; }
@keyframes aiPulse { 0%,80%,100% { transform: scale(0); opacity: .3; } 40% { transform: scale(1); opacity: 1; } }
.loading-text { font-size: 13px; color: var(--text-secondary); }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-border { color: var(--primary); }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Charts ─────────────────────────────────────────────── */
.chart-container { position: relative; }
.apexcharts-tooltip { background: var(--bg-secondary) !important; border-color: var(--border) !important; border-radius: var(--radius-sm) !important; }
.apexcharts-tooltip-title { background: var(--bg-hover) !important; border-color: var(--border) !important; }
.apexcharts-xaxistooltip { background: var(--bg-secondary) !important; border-color: var(--border) !important; }
.apexcharts-menu { background: var(--bg-secondary) !important; border-color: var(--border) !important; }

/* ─── Auth Pages ─────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-main);
  position: relative; overflow: hidden;
}
.auth-wrapper::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(245,211,0,.04) 0%, transparent 60%);
  animation: bgPulse 8s ease-in-out infinite;
}
@keyframes bgPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: .7; } }
.auth-card {
  width: 100%; max-width: 420px; padding: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius);
  position: relative; z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo img { height: 44px; }
.auth-title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--text-secondary); font-size: 14px; margin-bottom: 28px; }
.auth-grid { display: grid; gap: 12px; }
.input-group-icon { position: relative; }
.input-group-icon i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; z-index: 1; }
.input-group-icon .form-control { padding-left: 40px; }
.input-group-icon .toggle-pass { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; }
.btn-full { width: 100%; padding: 12px; font-size: 15px; }
.auth-divider { text-align: center; position: relative; color: var(--text-muted); font-size: 12px; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: calc(50% - 40px); height: 1px; background: var(--border); }
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }

/* OTP */
.otp-inputs { display: flex; gap: 10px; justify-content: center; }
.otp-input {
  width: 52px; height: 56px;
  text-align: center; font-size: 22px; font-weight: 700;
  background: var(--bg-hover); border: 2px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-primary); transition: var(--transition);
}
.otp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); outline: none; }

/* ─── Keyword Research ───────────────────────────────────── */
.keyword-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 20px; font-size: 12px; color: var(--text-secondary);
  margin: 3px; cursor: pointer; transition: var(--transition);
}
.keyword-chip:hover { border-color: var(--primary); color: var(--primary); }
.kw-vol { color: var(--primary); font-weight: 600; }
.kw-diff { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.diff-easy   { background: rgba(52,211,153,.12); color: var(--success); }
.diff-medium { background: rgba(245,211,0,.12); color: var(--primary); }
.diff-hard   { background: rgba(242,109,109,.12); color: var(--danger); }

/* ─── Empty States ───────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 64px; opacity: .25; display: block; margin-bottom: 16px; }
.empty-state h5 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; }

/* ─── API Not Connected Banner ───────────────────────────── */
.api-not-connected {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: rgba(245,211,0,.1); border: 1px solid rgba(245,211,0,.25);
  border-radius: 20px; font-size: 11px; color: var(--primary); font-weight: 600;
}
.api-not-connected::before { content: '●'; }

/* ─── Tag Input ──────────────────────────────────────────── */
.tag-container {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 12px; min-height: 42px;
  background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius-xs);
}
.tag-container:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-light); color: var(--primary); border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.tag button { background: none; border: none; color: inherit; cursor: pointer; font-size: 14px; padding: 0; line-height: 1; }

/* ─── FAB ────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 52px; height: 52px;
  background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #08090A;
  box-shadow: 0 4px 20px var(--primary-glow);
  cursor: pointer; transition: var(--transition); z-index: 100; border: none;
}
.fab:hover { transform: scale(1.1); }

/* ─── Steps / Wizard ─────────────────────────────────────── */
.steps { display: flex; gap: 0; margin-bottom: 28px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; font-size: 12px; color: var(--text-muted); }
.step::after { content: ''; position: absolute; top: 15px; left: 50%; width: 100%; height: 1px; background: var(--border); z-index: 0; }
.step:last-child::after { display: none; }
.step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-hover); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; z-index: 1; margin-bottom: 6px; }
.step.active .step-num { background: var(--primary); border-color: var(--primary); color: #08090A; }
.step.done   .step-num { background: var(--success); border-color: var(--success); color: #08090A; }

/* ─── Utility ────────────────────────────────────────────── */
.text-primary  { color: var(--primary) !important; }
.text-success  { color: var(--success) !important; }
.text-danger   { color: var(--danger) !important; }
.text-warning  { color: var(--primary) !important; }
.text-info     { color: var(--info) !important; }
.text-muted    { color: var(--text-muted) !important; }
.bg-card       { background: var(--bg-card) !important; }
.bg-hover      { background: var(--bg-hover) !important; }
.rounded-custom { border-radius: var(--radius) !important; }

/* ─── Animations ─────────────────────────────────────────── */
.fade-in  { animation: fadeIn .4s ease-out; }
@keyframes fadeIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.slide-up { animation: slideUp .3s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.pulse    { animation: pulse 2s infinite; }
@keyframes pulse   { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

/* ─── Code Blocks ────────────────────────────────────────── */
pre, code { background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--primary); font-size: 13px; padding: 2px 6px; }
pre { padding: 16px; overflow-x: auto; white-space: pre-wrap; }
pre code { background: none; border: none; padding: 0; }
table.dataTable { border-collapse: collapse !important; }

/* ─── SweetAlert2 ────────────────────────────────────────── */
.swal2-popup { background: var(--bg-secondary) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; color: var(--text-primary) !important; }
.swal2-title, .swal2-html-container { color: var(--text-primary) !important; }
.swal2-confirm { background: var(--primary) !important; color: #08090A !important; font-weight: 700 !important; border-radius: var(--radius-sm) !important; }
.swal2-cancel  { background: var(--bg-hover) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; }

/* ─── Mobile Overlay ─────────────────────────────────────── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 999; }
.sidebar-overlay.active { display: block; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,.6); }
  .main-content { margin-left: 0; }
  .topbar { left: 0; }
  .content-area { padding: 16px; padding-top: calc(var(--topbar-height) + 16px); }
}
@media (max-width: 767px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .kpi-value { font-size: 28px; }
  .api-status-bar { display: none !important; }
  .auth-card { padding: 24px; margin: 16px; }
  .audit-score-big { font-size: 48px; }
}
