    /* Global reset */
    *, *::before, *::after {
      box-sizing: border-box;
    }

    /* Auth Guard */
    .auth-guard {
      position: fixed;
      inset: 0;
      z-index: 10000;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(15, 23, 42, 0.97);
      backdrop-filter: blur(20px);
      animation: authFadeIn 0.3s ease;
    }

    .auth-guard.hidden {
      display: none !important;
    }

    @keyframes authFadeIn {
      from {
        opacity: 0;
      }

      to {
        opacity: 1;
      }
    }

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

    .auth-guard-card {
      width: 360px;
      padding: 40px 32px;
      background: rgba(30, 41, 59, 0.7);
      border: 1px solid rgba(148, 163, 184, 0.1);
      border-radius: 16px;
      text-align: center;
      overflow: hidden;
      animation: authCardIn 0.4s ease 0.1s both;
    }

    @keyframes authCardIn {
      from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
      }

      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .auth-guard-icon {
      width: 48px;
      height: 48px;
      margin: 0 auto 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--accent);
      opacity: 0.8;
    }

    .auth-guard-icon svg {
      width: 32px;
      height: 32px;
    }

    .auth-guard-title {
      font-family: 'Inter', sans-serif;
      font-size: 18px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 4px;
    }

    .auth-guard-subtitle {
      font-size: 13px;
      color: var(--text-secondary);
      margin-bottom: 24px;
    }

    .auth-guard-card form {
      width: 100%;
      max-width: 100%;
    }

    .auth-guard-field {
      width: 100%;
      max-width: 100%;
    }

    .auth-guard-field input {
      box-sizing: border-box;
      width: 100%;
      max-width: 100%;
      padding: 12px 14px;
      height: 44px;
      background: rgba(15, 23, 42, 0.8);
      border: 1px solid rgba(148, 163, 184, 0.18);
      border-radius: 10px;
      color: var(--text-primary);
      font-family: 'Inter', -apple-system, sans-serif;
      font-size: 14px;
      letter-spacing: 0.01em;
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
      -webkit-appearance: none;
      appearance: none;
    }

    /* Fix autofill styling for dark theme */
    .auth-guard-field input:-webkit-autofill,
    .auth-guard-field input:-webkit-autofill:hover,
    .auth-guard-field input:-webkit-autofill:focus {
      -webkit-text-fill-color: var(--text-primary) !important;
      -webkit-box-shadow: 0 0 0 30px rgba(15, 23, 42, 0.95) inset !important;
      border-color: rgba(148, 163, 184, 0.25) !important;
      font-family: 'Inter', -apple-system, sans-serif !important;
      font-size: 14px !important;
      transition: background-color 5000s ease-in-out 0s;
    }

    .auth-guard-field input[type="password"],
    .auth-guard-field input[type="text"] {
      padding-right: 38px;
    }

    .auth-guard-field input:focus {
      border-color: rgba(99, 102, 241, 0.5);
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    .auth-guard-field input::placeholder {
      color: rgba(148, 163, 184, 0.5);
      font-family: 'Inter', -apple-system, sans-serif;
      font-weight: 400;
    }

    .auth-guard-error {
      margin-top: 10px;
      font-size: 12px;
      color: #ef4444;
      opacity: 0.9;
    }

    .auth-guard-error.hidden {
      display: none;
    }

    .auth-guard-btn {
      margin-top: 20px;
      width: 100%;
      padding: 12px;
      height: 44px;
      background: rgba(99, 102, 241, 0.15);
      border: 1px solid rgba(99, 102, 241, 0.35);
      border-radius: 10px;
      color: #c7d2fe;
      font-family: 'Inter', -apple-system, sans-serif;
      font-size: 14px;
      font-weight: 600;
      letter-spacing: 0.02em;
      cursor: pointer;
      transition: all 0.25s var(--ease-antigravity);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .auth-guard-btn:hover {
      background: rgba(99, 102, 241, 0.3);
      border-color: rgba(99, 102, 241, 0.5);
      box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
      transform: translateY(-1px);
    }

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

    .auth-guard-btn-loading.hidden {
      display: none;
    }

    .auth-pwd-toggle {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      background: transparent !important;
      background-color: transparent !important;
      border: none !important;
      outline: none !important;
      box-shadow: none !important;
      color: rgba(148, 163, 184, 0.5);
      cursor: pointer;
      padding: 4px;
      margin: 0;
      width: 28px;
      height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 1;
      transition: color 0.2s;
      -webkit-appearance: none;
      appearance: none;
      z-index: 2;
    }

    .auth-pwd-toggle:hover,
    .auth-pwd-toggle:focus {
      color: rgba(148, 163, 184, 0.9);
      background: transparent !important;
      background-color: transparent !important;
    }

    /* Body and variables inherited from variables.css */
    .container {
      display: flex;
      min-height: 100vh;
    }

    /* ===== SIDEBAR — Premium Glassmorphic ===== */
    .sidebar {
      width: 220px;
      background: linear-gradient(180deg, #111827 0%, #0c1322 50%, #0a0f1a 100%);
      border-right: 1px solid rgba(255, 255, 255, 0.06);
      padding: 0;
      display: flex;
      flex-direction: column;
      position: fixed;
      height: 100vh;
      z-index: 100;
      transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
      overflow: hidden;
    }

    .sidebar::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 180px;
      background: radial-gradient(ellipse at 30% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
      pointer-events: none;
      z-index: 0;
    }

    .sidebar.hidden {
      transform: translateX(-100%);
    }

    .sidebar-inner {
      display: flex;
      flex-direction: column;
      height: 100%;
      position: relative;
      z-index: 1;
    }

    /* Logo */
    .logo {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.75rem 0.75rem 0.6rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      margin-bottom: 0.25rem;
    }

    .logo-icon {
      width: 28px;
      height: 28px;
      border-radius: 7px;
      background: linear-gradient(135deg, #3b82f6, #6366f1);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    }

    .logo-icon i {
      width: 14px;
      height: 14px;
      color: #fff;
    }

    .logo-text {
      display: flex;
      flex-direction: column;
      gap: 1px;
    }

    .logo-title {
      font-size: 0.9rem;
      font-weight: 800;
      color: var(--text-primary);
      letter-spacing: -0.02em;
    }

    .logo-subtitle {
      font-size: 0.55rem;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      opacity: 0.7;
    }

    .sidebar-close-btn {
      display: none;
      background: none;
      border: none;
      color: var(--text-secondary);
      cursor: pointer;
      margin-left: auto;
      padding: 4px;
      border-radius: 6px;
      transition: all 0.2s;
    }

    .sidebar-close-btn:hover {
      background: rgba(255, 255, 255, 0.08);
      color: var(--text-primary);
    }

    /* Navigation */
    .sidebar-nav {
      flex: 1;
      overflow-y: auto;
      padding: 0.25rem 0.5rem;
      scrollbar-width: thin;
      scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
    }

    .sidebar .nav-item {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.45rem 0.65rem;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      color: var(--text-secondary);
      margin-bottom: 1px;
      position: relative;
      font-size: 0.8rem;
      border-left: 2px solid transparent;
      flex-direction: row;
    }

    .sidebar .nav-item>i {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      opacity: 0.6;
      transition: all 0.2s;
    }

    .sidebar .nav-item:hover {
      background: rgba(255, 255, 255, 0.04);
      color: var(--text-primary);
    }

    .sidebar .nav-item:hover>i {
      opacity: 0.9;
      color: #60a5fa;
    }

    .sidebar .nav-item.active {
      background: rgba(59, 130, 246, 0.06);
      color: var(--text-primary);
      border-left-color: #3b82f6;
    }

    .sidebar .nav-item.active>i {
      color: #60a5fa;
      opacity: 1;
    }

    /* Footer */
    .sidebar-footer {
      padding: 0.75rem 1.25rem;
      border-top: 1px solid rgba(255, 255, 255, 0.05);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .sidebar-status {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.7rem;
      color: var(--text-secondary);
      opacity: 0.7;
    }

    .status-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--success);
      box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
      animation: pulse-dot 2.5s ease-in-out infinite;
    }

    @keyframes pulse-dot {

      0%,
      100% {
        opacity: 1;
        box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
      }

      50% {
        opacity: 0.6;
        box-shadow: 0 0 2px rgba(16, 185, 129, 0.2);
      }
    }

    .sidebar-version {
      font-size: 0.6rem;
      font-weight: 600;
      color: var(--text-secondary);
      background: rgba(255, 255, 255, 0.05);
      padding: 2px 8px;
      border-radius: 4px;
      letter-spacing: 0.05em;
      opacity: 0.6;
    }

    /* Logout nav-item */
    .nav-item-logout {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.45rem 0.65rem;
      margin: 0.5rem 0.5rem 0;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      color: var(--text-primary);
      font-size: 0.8rem;
      font-weight: 400;
      background: none;
      border: none;
      width: calc(100% - 1rem);
      text-align: left;
      font-family: inherit;
      opacity: 0.55;
    }

    .nav-item-logout>i {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      transition: all 0.2s;
    }

    .nav-item-logout:hover {
      opacity: 0.85;
      background: rgba(255, 255, 255, 0.04);
    }

    .main-content {
      flex: 1;
      padding: 2rem;
      overflow-y: auto;
      margin-left: 220px;
      transition: margin-left 0.3s ease;
    }

    .main-content.full {
      margin-left: 0;
    }

    .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 2rem;
      position: relative;
      z-index: 100;
    }

    .header h1 {
      font-size: 1.875rem;
      font-weight: 600;
    }

    .mobile-menu-btn {
      display: none;
      background: none;
      border: none;
      color: var(--text-primary);
      cursor: pointer;
      padding: 0.5rem;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.625rem 1.25rem;
      border-radius: 0.5rem;
      border: 1px solid rgba(255, 255, 255, 0.12);
      cursor: pointer;
      font-size: 0.875rem;
      font-weight: 500;
      font-family: inherit;
      background: rgba(255, 255, 255, 0.04);
      color: var(--text-primary);
      backdrop-filter: blur(8px);
      transition: all 0.25s var(--ease-antigravity);
    }

    .btn:hover {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.2);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .btn-primary {
      background: rgba(99, 102, 241, 0.12);
      border-color: rgba(99, 102, 241, 0.3);
      color: #a5b4fc;
    }

    .btn-primary:hover {
      background: rgba(99, 102, 241, 0.2);
      border-color: rgba(99, 102, 241, 0.5);
      color: #c7d2fe;
      box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
    }

    .btn-secondary {
      background: rgba(255, 255, 255, 0.04);
      border-color: rgba(255, 255, 255, 0.08);
      color: var(--text-secondary);
    }

    .btn-secondary:hover {
      background: rgba(255, 255, 255, 0.08);
      color: var(--text-primary);
    }

    .btn-danger {
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.3);
      color: #fca5a5;
    }

    .btn-danger:hover {
      background: rgba(239, 68, 68, 0.2);
      border-color: rgba(239, 68, 68, 0.5);
      color: #fecaca;
      box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15);
    }

    .btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      transform: none !important;
      box-shadow: none !important;
    }

    /* === COMPACT STAT STRIP === */
    .stats-strip {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 1rem;
      flex-wrap: wrap;
    }

    .mini-stat {
      flex: 1;
      min-width: 120px;
      display: flex;
      align-items: center;
      gap: 0.6rem;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 0.6rem;
      padding: 0.6rem 0.8rem;
      backdrop-filter: blur(20px);
      transition: all 0.4s var(--ease-antigravity);
    }

    .mini-stat:hover {
      transform: translateY(-2px);
      border-color: var(--border-hover);
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    }

    .mini-stat-icon {
      width: 32px;
      height: 32px;
      border-radius: 0.4rem;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .mini-stat-icon.blue {
      background: rgba(59, 130, 246, 0.12);
      color: var(--accent);
    }

    .mini-stat-icon.green {
      background: rgba(16, 185, 129, 0.12);
      color: var(--success);
    }

    .mini-stat-icon.orange {
      background: rgba(245, 158, 11, 0.12);
      color: var(--warning);
    }

    .mini-stat-icon.red {
      background: rgba(239, 68, 68, 0.12);
      color: var(--danger);
    }

    .mini-stat-icon.purple {
      background: rgba(139, 92, 246, 0.12);
      color: #8b5cf6;
    }

    .mini-stat-icon.cyan {
      background: rgba(6, 182, 212, 0.12);
      color: #06b6d4;
    }

    .mini-stat-data {
      display: flex;
      flex-direction: column;
    }

    .mini-stat-value {
      font-size: 1.1rem;
      font-weight: 700;
      line-height: 1.2;
      font-family: 'JetBrains Mono', monospace;
    }

    .mini-stat-label {
      font-size: 0.65rem;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    /* === 2×2 CHART GRID === */
    .dashboard-charts {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
      margin-bottom: 1rem;
    }

    @media (max-width: 768px) {
      .dashboard-charts {
        grid-template-columns: 1fr;
      }
    }

    .chart-panel {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 0.75rem;
      backdrop-filter: blur(20px);
      transition: all 0.4s var(--ease-antigravity);
      overflow: hidden;
    }

    .chart-panel:hover {
      transform: translateY(-2px);
      border-color: var(--border-hover);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    .chart-panel-header {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.6rem 0.8rem;
      border-bottom: 1px solid var(--border);
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--text-primary);
    }

    .chart-panel-body {
      padding: 0.6rem;
      height: 200px;
      position: relative;
    }

    .chart-panel-body canvas {
      max-height: 100%;
    }

    /* Activity Timeline */
    .activity-body {
      overflow-y: auto;
      padding: 0 !important;
    }

    .activity-item {
      display: flex;
      align-items: flex-start;
      gap: 0.5rem;
      padding: 0.4rem 0.7rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.04);
      font-size: 0.72rem;
    }

    .activity-item:last-child {
      border-bottom: none;
    }

    .activity-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      margin-top: 4px;
      flex-shrink: 0;
    }

    .activity-dot.audit {
      background: var(--warning);
    }

    .activity-dot.report {
      background: var(--success);
    }

    .activity-dot.keyword {
      background: var(--accent);
    }

    .activity-desc {
      color: var(--text-primary);
      flex: 1;
      line-height: 1.3;
    }

    .activity-time {
      color: var(--text-secondary);
      font-size: 0.65rem;
      white-space: nowrap;
    }

    /* === COMPACT TABLE === */
    .compact-card {
      margin-bottom: 1rem;
    }

    .compact-header {
      padding: 0.6rem 0.8rem !important;
    }

    .compact-body {
      padding: 0 !important;
    }

    .compact-table {
      font-size: 0.78rem;
    }

    .compact-table th {
      padding: 0.4rem 0.6rem !important;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    .compact-table td {
      padding: 0.35rem 0.6rem !important;
    }

    .card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 0.75rem;
      margin-bottom: 1.5rem;
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      transition: all 0.4s var(--ease-antigravity);
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    .card:hover {
      transform: translateY(-2px) scale(1.01);
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-hover);
      border-color: transparent;
    }

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

    .card-title {
      font-size: 1.125rem;
      font-weight: 600;
    }

    .card-body {
      padding: 1.25rem;
      overflow-x: auto;
    }

    /* Clean Table Styles */
    table {
      width: 100%;
      border-collapse: collapse;
    }

    th,
    td {
      padding: 0.625rem 0.75rem;
      text-align: left;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
    }

    th {
      color: var(--text-secondary);
      font-weight: 500;
      font-size: 0.8rem;
      white-space: nowrap;
    }

    /* Links con hover y sin truncamiento agresivo */
    td a {
      color: var(--accent);
      text-decoration: none;
      word-break: break-all;
    }

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

    /* Botones de acciones en fila compacta */
    td:last-child {
      white-space: nowrap;
      text-align: right;
    }

    td:last-child button {
      padding: 0.25rem 0.4rem;
      margin-left: 0.25rem;
    }

    td:last-child button:first-child {
      margin-left: 0;
    }

    .keyword {
      font-weight: 500;
    }

    .position {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      font-weight: 600;
    }

    .position.up {
      color: var(--success);
    }

    .position.down {
      color: var(--danger);
    }

    .position.stable {
      color: var(--text-secondary);
    }

    .position.position-out {
      color: #d97706;
      opacity: 0.7;
      font-size: 0.8em;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      padding: 0.25rem 0.75rem;
      border-radius: 9999px;
      font-size: 0.75rem;
      font-weight: 500;
    }

    .badge-success {
      background: rgba(16, 185, 129, 0.1);
      color: var(--success);
    }

    .badge-warning {
      background: rgba(245, 158, 11, 0.1);
      color: var(--warning);
    }

    .badge-danger {
      background: rgba(239, 68, 68, 0.1);
      color: var(--danger);
    }

    .client-selector {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      cursor: pointer;
      font-size: 0.72rem;
      font-weight: 500;
      color: var(--text-secondary);
      transition: all 0.2s ease;
      position: relative;
      backdrop-filter: blur(8px);
      white-space: nowrap;
    }

    .client-selector:hover {
      border-color: rgba(99, 102, 241, 0.3);
      color: var(--text-primary);
      background: rgba(255, 255, 255, 0.06);
    }

    .client-selector i,
    .client-selector svg {
      width: 13px;
      height: 13px;
      opacity: 0.6;
    }

    .page {
      display: none;
    }

    .page.active {
      display: block;
    }

    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.7);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }

    .modal-overlay.active {
      display: flex;
    }

    .modal {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: 0.75rem;
      width: 90%;
      max-width: 500px;
      max-height: 90vh;
      overflow-y: auto;
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 1010;
      display: none;
    }

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

    .modal-title {
      font-size: 1.125rem;
      font-weight: 600;
    }

    .modal-close {
      background: none;
      border: none;
      color: var(--text-secondary);
      cursor: pointer;
      padding: 0.25rem;
    }

    .modal-body {
      padding: 1.25rem;
    }

    /* ── Confirm Modal (destructive action) ── */
    .confirm-modal {
      width: auto !important;
      min-width: 340px;
      max-width: 400px;
      text-align: center;
      padding: 2.25rem 2.5rem 2rem;
      border: 1px solid rgba(255, 255, 255, 0.06) !important;
      border-radius: 1rem;
      background: linear-gradient(168deg,
          rgba(30, 32, 44, 0.98) 0%,
          rgba(18, 19, 28, 0.99) 100%);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
      animation: confirmSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes confirmSlideIn {
      from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.92);
      }

      to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
      }
    }

    .confirm-modal-icon {
      width: 52px;
      height: 52px;
      margin: 0 auto 1.25rem;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      background: rgba(245, 158, 11, 0.1);
      border: 1px solid rgba(245, 158, 11, 0.2);
      color: #f59e0b;
    }

    .confirm-modal-icon svg {
      width: 24px;
      height: 24px;
    }

    .confirm-modal-title {
      font-size: 1.125rem;
      font-weight: 600;
      margin-bottom: 0.5rem;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }

    .confirm-modal-message {
      font-size: 0.9rem;
      color: var(--text-secondary);
      margin-bottom: 1.75rem;
      line-height: 1.5;
    }

    .confirm-modal-actions {
      display: flex;
      gap: 0.75rem;
      justify-content: center;
    }

    .confirm-modal-actions .btn {
      min-width: 110px;
      padding: 0.6rem 1.25rem;
      font-weight: 500;
      font-size: 0.875rem;
      border-radius: 0.5rem;
    }

    .btn-danger {
      background: linear-gradient(135deg, #ef4444, #dc2626);
      color: #fff;
      border: 1px solid rgba(239, 68, 68, 0.3);
      box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
      transition: all 0.2s ease;
    }

    .btn-danger:hover {
      background: linear-gradient(135deg, #f87171, #ef4444);
      box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
      transform: translateY(-1px);
    }

    .form-group {
      margin-bottom: 1rem;
    }

    .form-label {
      display: block;
      margin-bottom: 0.5rem;
      font-size: 0.875rem;
      font-weight: 500;
    }

    .form-input,
    .form-select,
    .form-textarea {
      width: 100%;
      padding: 0.625rem 0.875rem;
      background: var(--bg-primary);
      border: 1px solid var(--border);
      border-radius: 0.5rem;
      color: var(--text-primary);
      font-size: 0.875rem;
    }

    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
      outline: none;
      border-color: var(--accent);
    }

    .form-actions {
      display: flex;
      gap: 0.75rem;
      justify-content: flex-end;
      padding-top: 1rem;
    }

    .chart-container {
      position: relative;
      height: 300px;
      margin: 1rem 0;
    }

    .tabs {
      display: flex;
      gap: 0.5rem;
      border-bottom: 1px solid var(--border);
      margin-bottom: 1.5rem;
    }

    .tab {
      padding: 0.75rem 1rem;
      background: none;
      border: none;
      color: var(--text-secondary);
      cursor: pointer;
      font-size: 0.875rem;
      font-weight: 500;
      border-bottom: 2px solid transparent;
    }

    .tab.active {
      color: var(--accent);
      border-bottom-color: var(--accent);
    }

    .empty-state {
      text-align: center;
      padding: 3rem 1.5rem;
      color: var(--text-secondary);
    }

    .empty-state i {
      width: 48px;
      height: 48px;
      margin-bottom: 1rem;
      opacity: 0.5;
    }

    .integration-card {
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: 1rem;
      background: var(--bg-primary);
      border: 1px solid var(--border);
      border-radius: 0.5rem;
      margin-bottom: 0.75rem;
    }

    .integration-icon {
      width: 48px;
      height: 48px;
      border-radius: 0.5rem;
      background: var(--bg-card);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .integration-info {
      flex: 1;
    }

    .integration-name {
      font-weight: 500;
      margin-bottom: 0.25rem;
    }

    .integration-status {
      font-size: 0.875rem;
      color: var(--text-secondary);
    }

    /* GSC Searchable Site Selector */
    .gsc-sites-panel {
      margin-top: 1.5rem;
      padding: 1.25rem;
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(147, 51, 234, 0.05));
      border: 1px solid rgba(59, 130, 246, 0.2);
      border-radius: 12px;
      backdrop-filter: blur(10px);
    }

    .gsc-sites-header {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 1rem;
    }

    .gsc-sites-header h4 {
      margin: 0;
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--text-primary);
    }

    .gsc-sites-header p {
      margin: 0;
      font-size: 0.8rem;
      color: var(--text-secondary);
    }

    .gsc-site-selector {
      position: relative;
    }

    .gsc-search-wrapper {
      position: relative;
      display: flex;
      align-items: center;
      background: var(--bg-primary);
      border: 1px solid var(--border);
      border-radius: 8px;
      transition: all 0.2s ease;
    }

    .gsc-search-wrapper:focus-within {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    }

    .gsc-search-icon {
      position: absolute;
      left: 12px;
      width: 16px;
      height: 16px;
      color: var(--text-secondary);
      pointer-events: none;
    }

    .gsc-search-input {
      flex: 1;
      padding: 0.75rem 0.75rem 0.75rem 2.5rem;
      background: transparent;
      border: none;
      color: var(--text-primary);
      font-size: 0.9rem;
      outline: none;
    }

    .gsc-search-input::placeholder {
      color: var(--text-secondary);
    }

    .gsc-site-count {
      padding: 0.25rem 0.75rem;
      margin-right: 0.5rem;
      font-size: 0.75rem;
      color: var(--accent);
      background: rgba(59, 130, 246, 0.1);
      border-radius: 12px;
      white-space: nowrap;
    }

    .gsc-sites-list {
      max-height: 200px;
      overflow-y: auto;
      margin-top: 0.5rem;
      border-radius: 8px;
      background: var(--bg-primary);
      border: 1px solid var(--border);
    }

    .gsc-sites-list:empty {
      display: none;
    }

    .gsc-site-item {
      padding: 0.75rem 1rem;
      cursor: pointer;
      border-bottom: 1px solid var(--border);
      transition: background 0.15s ease;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .gsc-site-item:last-child {
      border-bottom: none;
    }

    .gsc-site-item:hover {
      background: rgba(59, 130, 246, 0.1);
    }

    .gsc-site-item.selected {
      background: rgba(59, 130, 246, 0.15);
      color: var(--accent);
    }

    .gsc-site-item .site-url {
      flex: 1;
      font-size: 0.85rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .gsc-site-item .site-permission {
      font-size: 0.7rem;
      padding: 0.2rem 0.5rem;
      background: rgba(16, 185, 129, 0.1);
      color: #10b981;
      border-radius: 4px;
      text-transform: capitalize;
    }

    .gsc-selected-site {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-top: 0.75rem;
      padding: 0.5rem 0.75rem;
      background: rgba(16, 185, 129, 0.1);
      border: 1px solid rgba(16, 185, 129, 0.3);
      border-radius: 8px;
      color: #10b981;
      font-size: 0.85rem;
    }

    .gsc-selected-site span {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .gsc-clear-btn {
      background: none;
      border: none;
      padding: 0.25rem;
      cursor: pointer;
      color: inherit;
      opacity: 0.7;
      transition: opacity 0.15s;
    }

    .gsc-clear-btn:hover {
      opacity: 1;
    }

    .gsc-assign-btn {
      margin-top: 1rem;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
    }

    @media (max-width: 1024px) {
      .sidebar {
        transform: translateX(-100%);
      }

      .sidebar.open {
        transform: translateX(0);
      }

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

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

      .sidebar-close-btn {
        display: block !important;
      }

      .logo {
        justify-content: space-between;
      }

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

      .header {
        flex-wrap: wrap;
        gap: 1rem;
      }

      .header h1 {
        font-size: 1.5rem;
      }

      /* Convertir tablas a cards en móvil */
      table,
      thead,
      tbody,
      th,
      td,
      tr {
        display: block;
      }

      thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
      }

      tbody tr {
        background: var(--bg-tertiary);
        border-radius: 0.75rem;
        margin-bottom: 1rem;
        padding: 1rem;
        border: 1px solid var(--border);
      }

      td {
        border: none;
        position: relative;
        padding: 0.5rem 0.5rem 0.5rem 45%;
        text-align: left;
        font-size: 0.875rem;
        overflow-wrap: break-word;
        word-break: break-word;
      }

      td::before {
        position: absolute;
        left: 0.75rem;
        width: 40%;
        padding-right: 0.5rem;
        white-space: nowrap;
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
      }

      /* Labels para cada columna */
      #clients-tbody td:nth-of-type(1)::before {
        content: "Cliente";
      }

      #clients-tbody td:nth-of-type(2)::before {
        content: "Web";
      }

      #clients-tbody td:nth-of-type(3)::before {
        content: "Email";
      }

      #clients-tbody td:nth-of-type(4)::before {
        content: "Fecha";
      }

      #clients-tbody td:nth-of-type(5)::before {
        content: "Acciones";
      }

      #keywords-tbody td:nth-of-type(1)::before {
        content: "Keyword";
      }

      #keywords-tbody td:nth-of-type(2)::before {
        content: "Posición";
      }

      #keywords-tbody td:nth-of-type(3)::before {
        content: "Ubicación";
      }

      #keywords-tbody td:nth-of-type(4)::before {
        content: "Motor";
      }

      #keywords-tbody td:nth-of-type(5)::before {
        content: "Tipo";
      }

      #keywords-tbody td:nth-of-type(6)::before {
        content: "Acciones";
      }

      #audits-tbody td:nth-of-type(1)::before {
        content: "Fecha";
      }

      #audits-tbody td:nth-of-type(2)::before {
        content: "Tipo";
      }

      #audits-tbody td:nth-of-type(3)::before {
        content: "Puntuación";
      }

      #audits-tbody td:nth-of-type(4)::before {
        content: "Acciones";
      }

      #reports-tbody td:nth-of-type(1)::before {
        content: "Nombre";
      }

      #reports-tbody td:nth-of-type(2)::before {
        content: "Tipo";
      }

      #reports-tbody td:nth-of-type(3)::before {
        content: "Fecha";
      }

      #reports-tbody td:nth-of-type(4)::before {
        content: "Acciones";
      }

      #cron-tbody td:nth-of-type(1)::before {
        content: "Nombre";
      }

      #cron-tbody td:nth-of-type(2)::before {
        content: "Tipo";
      }

      #cron-tbody td:nth-of-type(3)::before {
        content: "Programación";
      }

      #cron-tbody td:nth-of-type(4)::before {
        content: "Última/Siguiente";
      }

      #cron-tbody td:nth-of-type(5)::before {
        content: "Estado";
      }

      #cron-tbody td:nth-of-type(6)::before {
        content: "Acciones";
      }

      /* Acciones centradas */
      td:last-child {
        text-align: center;
        padding-left: 0.75rem;
      }

      /* Acciones centradas */
      td:last-child {
        text-align: center;
        padding-left: 0.75rem;
      }

      td:last-child::before {
        display: none;
      }

      /* Fix: Restore Fecha label for keywords table (it's not an Action column) */
      #keywords-tbody td:last-child {
        text-align: left;
        padding-left: 45% !important;
      }

      #keywords-tbody td:last-child::before {
        display: block;
        content: "Fecha";
      }

      /* Fix for Compact Table Overlap on Mobile */
      .compact-table td {
        padding: 0.5rem 0.5rem 0.5rem 45% !important;
      }

      /* ── Keywords Projects Grid → stack vertically ──────────────── */
      #keywords-projects-view>div {
        grid-template-columns: 1fr !important;
        height: auto !important;
        gap: 1rem !important;
      }

      /* ── Stats Strip → 3-column grid (3+3 rows) ────────────────── */
      .stats-strip {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        flex-wrap: unset;
        overflow-x: visible;
      }

      .mini-stat {
        min-width: 0;
        flex: unset;
      }

      /* ── Card Headers → stack title + actions ───────────────────── */
      .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
      }

      /* ── Integration Cards → wrap on mobile ─────────────────────── */
      .integration-card {
        flex-wrap: wrap;
      }

      .integration-info {
        flex: 1 1 60%;
        min-width: 0;
      }

      .integration-card .btn {
        flex-shrink: 0;
      }

      /* ── All Keywords Toolbar → wrap filters ────────────────────── */
      #keywords-all-view .card-header>div:last-child {
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
      }

      #all-kw-search {
        width: 100% !important;
      }

      /* ── Clusters Grid → single column ──────────────────────────── */
      #clusters-grid {
        grid-template-columns: 1fr !important;
      }

      /* ── Project Header Buttons → wrap ──────────────────────────── */
      #project-header .card-header>div:last-child {
        flex-wrap: wrap;
        gap: 0.5rem;
      }

      /* ── Header → compact ───────────────────────────────────────── */
      .header h1 {
        font-size: 1.25rem;
      }

      .client-selector {
        font-size: 0.68rem;
        padding: 5px 8px;
        gap: 4px;
      }

      /* ── Modals → fit mobile viewport ───────────────────────────── */
      .modal-content {
        width: 95% !important;
        max-width: 95vw !important;
        max-height: 90vh;
        overflow-y: auto;
      }

      /* ── AI Insights → compact on mobile ──────────────────────── */
      .ai-insights-panel {
        margin-bottom: 0.75rem;
      }

      .ai-panel-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
      }

      .ai-insights-list {
        width: 100%;
      }

      .ai-insight-chip {
        width: 100%;
        display: flex;
        align-items: flex-start;
        /* align top if multi-line */
        padding: 0.75rem;
      }

      .ai-insight-chip .chip-text {
        white-space: normal;
        overflow-wrap: break-word;
        flex: 1;
        min-width: 0;
        line-height: 1.4;
      }

      /* ── Dashboard Charts → single column + smaller ─────────────── */
      .dashboard-charts {
        grid-template-columns: 1fr;
        gap: 0.75rem;
      }
    }

    .loading {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
    }

    .spinner {
      width: 16px;
      height: 16px;
      border: 2px solid var(--border);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }

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

    .toast {
      position: fixed;
      bottom: 1.5rem;
      right: 1.5rem;
      padding: 1rem 1.5rem;
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: 0.5rem;
      display: none;
      align-items: center;
      gap: 0.75rem;
      z-index: 99999;
    }

    .toast.show {
      display: flex;
    }

    .toast.success {
      border-left: 4px solid var(--success);
    }

    .toast.error {
      border-left: 4px solid var(--danger);
    }

    .toast.info {
      border-left: 4px solid var(--accent);
    }

    /* ========== AI INSIGHTS - COMPACT DASHBOARD STRIP ========== */

    /* Panel Container - Glass Card */
    .ai-insights-panel {
      position: relative;
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: 0.6rem;
      margin-bottom: 0.75rem;
      padding: 0;
      overflow: hidden;
    }

    .ai-insights-panel::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(90deg, rgba(96, 165, 250, 0.4), rgba(167, 139, 250, 0.3), rgba(52, 211, 153, 0.2));
      opacity: 0.6;
      transition: opacity 0.3s ease;
    }

    .ai-insights-panel:hover::before {
      opacity: 1;
    }

    /* Insight Item - Fallback/Default State */
    .ai-insight-item {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.35rem 0.6rem;
      font-size: 0.78rem;
      color: var(--text-secondary);
      line-height: 1.3;
    }

    .ai-insight-icon {
      font-size: 0.85rem;
      flex-shrink: 0;
      line-height: 1;
    }

    .ai-insight-content {
      display: flex;
      flex-direction: column;
      /* Stack title and description */
      align-items: flex-start;
      gap: 0.2rem;
      flex: 1;
      min-width: 0;
    }

    .ai-insight-value {
      font-size: 1.25rem;
      font-weight: 600;
      color: var(--text-primary);
      line-height: 1.2;
      font-family: 'JetBrains Mono', monospace;
    }
    .ai-insight-title {
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--text-primary);
      white-space: normal;
      /* Allow wrapping */
    }

    .ai-insight-description {
      font-size: 0.72rem;
      color: var(--text-secondary);
      opacity: 0.8;
      overflow: visible;
      white-space: normal;
      /* Allow wrapping */
      line-height: 1.4;
    }

    /* Type-specific accent for inline items */
    .ai-insight-item.tip .ai-insight-title {
      color: #a78bfa;
    }

    .ai-insight-item.success .ai-insight-title {
      color: #34d399;
    }

    .ai-insight-item.warning .ai-insight-title {
      color: #fbbf24;
    }

    .ai-insight-item.critical .ai-insight-title {
      color: #f87171;
    }

    /* Panel Content Layout - Ultra Compact */
    .ai-panel-content {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.5rem 0.875rem;
    }

    /* Header becomes inline badge group */
    .ai-panel-header {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      flex-shrink: 0;
    }

    /* AI Badge - Minimal Text Label */
    .ai-panel-header .ai-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.625rem;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: rgba(96, 165, 250, 0.8);
      background: none;
      border: none;
      padding: 0;
    }

    .ai-panel-header .ai-badge svg {
      width: 10px;
      height: 10px;
      color: rgba(96, 165, 250, 0.6);
    }

    /* Client Name - Secondary */
    .ai-panel-header .client-name {
      font-size: 0.75rem;
      font-weight: 500;
      color: var(--text-secondary);
      opacity: 0.7;
    }

    /* Divider */
    .ai-panel-header .ai-divider {
      width: 1px;
      height: 16px;
      background: rgba(255, 255, 255, 0.1);
      margin: 0 0.25rem;
    }

    /* Refresh Button - Magnetic Hover */
    .ai-refresh-btn {
      background: transparent;
      border: none;
      padding: 0.375rem;
      cursor: pointer;
      color: var(--text-secondary);
      border-radius: 6px;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.5;
    }

    .ai-refresh-btn:hover {
      opacity: 1;
      color: #60a5fa;
      background: rgba(59, 130, 246, 0.1);
      transform: scale(1.05);
    }

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

    .ai-refresh-btn.loading svg {
      animation: spin 0.8s cubic-bezier(0.16, 1, 0.3, 1) infinite;
    }

    /* Insights List - Flex Flow */
    .ai-insights-list {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.5rem;
      flex: 1;
      min-width: 0;
    }

    /* Insight Chips - Premium Style */
    .ai-insight-chip {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.75rem;
      background: rgba(30, 41, 59, 0.6);
      border-radius: 8px;
      font-size: 0.8125rem;
      font-weight: 500;
      color: var(--text-primary);
      cursor: pointer;
      border: 1px solid rgba(255, 255, 255, 0.06);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .ai-insight-chip:hover {
      background: rgba(51, 65, 85, 0.8);
      border-color: rgba(255, 255, 255, 0.1);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.3);
    }

    .ai-insight-chip svg {
      width: 15px;
      height: 15px;
      flex-shrink: 0;
    }

    /* Icon Colors by Type */
    .ai-insight-chip.critical svg {
      color: #f87171;
    }

    .ai-insight-chip.warning svg {
      color: #fbbf24;
    }

    .ai-insight-chip.success svg {
      color: #34d399;
    }

    .ai-insight-chip.tip svg {
      color: #a78bfa;
    }

    .ai-insight-chip.info svg {
      color: #60a5fa;
    }

    /* Type-specific subtle borders */
    .ai-insight-chip.critical {
      border-color: rgba(248, 113, 113, 0.2);
    }

    .ai-insight-chip.warning {
      border-color: rgba(251, 191, 36, 0.2);
    }

    .ai-insight-chip.success {
      border-color: rgba(52, 211, 153, 0.2);
    }

    .ai-insight-chip.tip {
      border-color: rgba(167, 139, 250, 0.2);
    }

    /* Chip Text */
    .ai-insight-chip .chip-text {
      max-width: 180px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* Empty State - Inline Minimal */
    .ai-empty-state {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0;
      color: var(--text-secondary);
      font-size: 0.75rem;
      opacity: 0.5;
      font-style: italic;
    }

    .ai-empty-state svg {
      width: 14px;
      height: 14px;
      opacity: 0.6;
    }

    .ai-loading-dots {
      display: flex;
      gap: 0.25rem;
      padding: 0.5rem;
      justify-content: center;
    }

    .ai-loading-dots span {
      width: 6px;
      height: 6px;
      background: var(--accent);
      border-radius: 50%;
      animation: dotPulse 1.4s ease-in-out infinite both;
    }

    .ai-loading-dots span:nth-child(1) {
      animation-delay: -0.32s;
    }

    .ai-loading-dots span:nth-child(2) {
      animation-delay: -0.16s;
    }

    @keyframes dotPulse {

      0%,
      80%,
      100% {
        transform: scale(0.6);
        opacity: 0.5;
      }

      40% {
        transform: scale(1);
        opacity: 1;
      }
    }

    /* Keywords AI Analysis Bar */
    .keywords-ai-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.75rem 1rem;
      background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
      border: 1px solid rgba(59, 130, 246, 0.2);
      border-radius: 0.5rem;
      margin-bottom: 1rem;
      flex-wrap: wrap;
      gap: 0.75rem;
    }

    .keywords-ai-bar .ai-summary {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .keywords-ai-bar .ai-badge {
      background: linear-gradient(135deg, #3b82f6, #8b5cf6);
      color: white;
      padding: 0.25rem 0.5rem;
      border-radius: 0.25rem;
      font-size: 0.7rem;
      font-weight: 600;
    }

    .keywords-ai-bar .ai-quick-actions {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .keywords-ai-bar .ai-quick-actions button {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      padding: 0.375rem 0.75rem;
      border-radius: 0.375rem;
      font-size: 0.75rem;
      cursor: pointer;
      transition: all 0.2s;
    }

    .keywords-ai-bar .ai-quick-actions button:hover {
      background: rgba(99, 102, 241, 0.15);
      color: #a5b4fc;
      border-color: rgba(99, 102, 241, 0.3);
    }

    /* BENTO BOX GRID SYSTEM (Anti-Generic Disruption) */
    .bento-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 1.5rem;
      margin-top: 1rem;
    }

    .bento-card {
      background: rgba(15, 23, 42, 0.4);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 16px;
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 1rem;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
    }

    .bento-card::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .bento-card:hover {
      transform: translateY(-4px);
      border-color: rgba(255, 255, 255, 0.1);
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(124, 77, 255, 0.1) inset;
    }

    .bento-card:hover::before {
      opacity: 1;
    }

    .bento-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
    }

    .bento-title {
      font-weight: 600;
      font-size: 1.05rem;
      color: #fff;
      margin-bottom: 0.25rem;
    }

    .bento-subtitle {
      font-size: 0.85rem;
      color: var(--text-secondary);
    }

    .bento-metric {
      font-size: 2rem;
      font-weight: 700;
      letter-spacing: -0.05em;
    }

    .bento-footer {
      margin-top: auto;
      padding-top: 1rem;
      border-top: 1px solid rgba(255, 255, 255, 0.05);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    /* Animations for Bento Grid Items */
    @keyframes bentoFadeIn {
      from {
        opacity: 0;
        transform: translateY(10px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .bento-card {
      animation: bentoFadeIn 0.5s ease backwards;
    }

    /* Utility to stagger animations */
    .bento-card:nth-child(1) {
      animation-delay: 0.05s;
    }

    .bento-card:nth-child(2) {
      animation-delay: 0.1s;
    }

    .bento-card:nth-child(3) {
      animation-delay: 0.15s;
    }

    .bento-card:nth-child(4) {
      animation-delay: 0.2s;
    }

    .bento-card:nth-child(5) {
      animation-delay: 0.25s;
    }

    .bento-card:nth-child(6) {
      animation-delay: 0.3s;
    }

    /* Responsive adjustments */
    @media (max-width: 640px) {
      .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
      }
    }
/* ── Portal Admin Utilities ─────────────────────────────────────── */
.portal-empty-row {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

.portal-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.portal-role-admin { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.portal-role-client { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.portal-status-active { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.portal-status-inactive { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.portal-icon-sm {
  width: 12px;
  height: 12px;
}
.portal-icon-md {
  width: 14px;
  height: 14px;
}

.portal-text-muted {
  color: var(--text-muted);
}
.portal-text-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}
.portal-font-medium {
  font-weight: 500;
}
.portal-action-group {
  display: flex;
  gap: 4px;
}

/* ── Global Utility Styles (App.js) ── */

.kb-empty-activity {
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 1rem;
    text-align: center;
}

.kb-data-status-checking {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.kb-data-status-box {
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.kb-data-status-note {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.kb-data-status-info {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.ai-insight-clickable {
    cursor: pointer;
    border: 1px solid rgba(124, 77, 255, 0.2);
    background: rgba(124, 77, 255, 0.05);
    transition: all 0.2s ease;
}

.ai-insight-clickable:hover {
    background: rgba(124, 77, 255, 0.1);
}

.ai-insight-icon-accent {
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(124, 77, 255, 0.5));
}

.kb-table-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.kb-table-error {
    text-align: center;
    padding: 2rem;
    color: #ef4444;
}

.kb-color-accent {
    color: var(--accent);
}

.kb-fw-600 {
    font-weight: 600;
}

.audit-score-ring-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.audit-score-ring-val {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    font-family: 'JetBrains Mono', monospace;
}

.audit-score-ring-label {
    font-size: 0.7rem;
    color: var(--text-secondary, #888);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.cron-day-btn {
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.cron-day-btn.active {
    background: rgba(59,130,246,0.2);
    color: #3b82f6;
}
.cron-day-btn-weekly {
    flex: 1;
    min-width: 38px;
    padding: 0.5rem 0.25rem;
    font-size: 0.7rem;
    text-align: center;
}
.cron-day-btn-monthly {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ========================================================================= */
/* ANTI-GENERIC UI: Utility Classes & New Layout Enhancements
/* ========================================================================= */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.h-screen-calc { height: calc(100vh - 180px); }

.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; top: 0; }
.z-10 { z-index: 10; }

.overflow-y-auto { overflow-y: auto; }
.overflow-hidden { overflow: hidden; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.5px; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted, rgba(255,255,255,0.4)); }
.text-accent { color: var(--accent); }
.text-error { color: #ef4444; }

.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }
.bg-error-light { background: rgba(239, 68, 68, 0.15); }
.bg-accent-light { background: rgba(124, 77, 255, 0.05); }

.border { border: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-dashed { border: 1px dashed var(--border); }
.border-error { border: 1px solid rgba(239, 68, 68, 0.3); }
.border-accent { border: 1px solid rgba(124, 77, 255, 0.1); }

.rounded-md { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-16 { padding: 4rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.max-w-400 { max-width: 400px; margin-left: auto; margin-right: auto; }
.max-w-480 { max-width: 480px; }

.cursor-pointer { cursor: pointer; }

.opacity-30 { opacity: 0.3; }
.opacity-50 { opacity: 0.5; }

.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 16px; height: 16px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 24px; height: 24px; }
.icon-3xl { width: 48px; height: 48px; }
.icon-4xl { width: 64px; height: 64px; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-sidebar-main { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }

/* Shadows and Glows */
.shadow-glow { box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3); }
.filter-glow { filter: drop-shadow(0 0 15px rgba(124, 77, 255, 0.4)); }

/* Specific Component Utilities */
.table-th { 
    padding: 0.6rem 0.75rem; 
    text-align: center; 
    font-size: 0.75rem; 
    color: var(--text-secondary); 
    font-weight: 500; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}
.table-th-left { 
    padding: 0.6rem 1rem; 
    text-align: left; 
    font-size: 0.75rem; 
    color: var(--text-secondary); 
    font-weight: 500; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}

/* Premium Typography for Data */
.metrics-font { font-family: 'JetBrains Mono', monospace; font-weight: 500; letter-spacing: -0.5px; }
.table-row-hover { transition: all 0.2s ease; border-left: 2px solid transparent; }
.table-row-hover:hover { 
    background-color: var(--bg-secondary); 
    border-left: 2px solid var(--accent);
}


/* ========================================================================= */
/* PREMIUM TABLES & HOVER STATES (Anti-Generic)
/* ========================================================================= */
table { width: 100%; border-collapse: collapse; }

.data-table tbody tr, #all-kw-tbody tr, #keywords-tbody tr {
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}
.data-table tbody tr:hover, #all-kw-tbody tr:hover, #keywords-tbody tr:hover {
    background-color: var(--bg-secondary);
    border-left: 2px solid var(--accent);
}

.metric-cell {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

/* Blank States */
.empty-state-premium {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    background: rgba(124, 77, 255, 0.03);
    border: 1px dashed rgba(124, 77, 255, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}
.empty-state-premium:hover {
    background: rgba(124, 77, 255, 0.05);
    border: 1px dashed rgba(124, 77, 255, 0.4);
    box-shadow: 0 4px 20px rgba(124, 77, 255, 0.1);
}

