/* ═══════════════════════════════════════════════════════════════
   Backlink Operations — Design System v3 (Modern)
   Matching seoframeby.com reference design
   ═══════════════════════════════════════════════════════════════ */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --primary-bg: rgba(59,130,246,0.08);
    --success: #22c55e;
    --success-bg: #f0fdf4;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --error: #ef4444;
    --error-bg: #fef2f2;

    --bg: #ffffff;
    --bg-page: #f0f4f8;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    --sidebar-width: 240px;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.04);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 150ms ease;
}

/* ─── Dark Mode ────────────────────────────────────────── */
body.dark-mode {
    --bg: #0f172a;
    --bg-page: #0b1120;
    --bg-secondary: #1e293b;
    --bg-tertiary: #1e293b;
    --border: #334155;
    --border-light: #1e293b;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary-light: rgba(59,130,246,0.15);
    --primary-bg: rgba(59,130,246,0.12);
    --success-bg: rgba(34,197,94,0.1);
    --warning-bg: rgba(245,158,11,0.1);
    --error-bg: rgba(239,68,68,0.1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.3);
}

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

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-page);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* ─── SIDEBAR (Light Theme) ────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    transition: background var(--transition), border-color var(--transition);
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}
.brand-icon {
    width: 34px; height: 34px; border-radius: var(--radius);
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px;
}
.brand-text { font-weight: 700; font-size: 16px; color: var(--text); }

.sidebar-section-label {
    font-size: 10px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 16px 16px 6px; margin-bottom: 2px;
}

.sidebar-nav { flex: 1; padding: 4px 8px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius);
    color: var(--text-secondary); text-decoration: none;
    font-size: 13px; font-weight: 500;
    transition: all var(--transition); margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-tertiary); color: var(--text); }
.nav-item.active {
    background: var(--primary);
    color: white !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.nav-item.active svg { stroke: white; }
.nav-item svg { flex-shrink: 0; }
.nav-divider { height: 1px; background: var(--border); margin: 8px 8px; }

.sidebar-dark-toggle {
    padding: 8px; border-top: 1px solid var(--border);
}
.dark-mode-btn {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 12px; border-radius: var(--radius);
    background: var(--bg-tertiary);
    border: 1px solid var(--border); color: var(--text-secondary);
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all var(--transition);
}
.dark-mode-btn:hover { background: var(--bg-secondary); color: var(--text); }

.sidebar-footer {
    padding: 12px; border-top: 1px solid var(--border);
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text-muted); }
.logout-btn-full {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 12px; border-radius: var(--radius);
    background: none; border: none; color: var(--text-secondary);
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all var(--transition);
}
.logout-btn-full:hover { color: var(--error); background: var(--error-bg); }

.main-content {
    flex: 1; margin-left: var(--sidebar-width);
    padding: 24px 28px; min-height: 100vh;
}

/* ─── Auth ─────────────────────────────────────────────── */
.auth-body { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); min-height: 100vh; }
.auth-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card {
    background: white; border-radius: var(--radius-lg); padding: 40px;
    width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 20px; font-weight: 800; color: var(--text); margin-top: 12px; }

/* ─── Alerts ───────────────────────────────────────────── */
.alert {
    padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
    font-size: 13px; font-weight: 500; animation: slideDown .3s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.alert-success { background: var(--success-bg); color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: var(--error-bg); color: #991b1b; border: 1px solid #fecaca; }

/* ─── Page Header ──────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 26px; font-weight: 800; color: var(--text); }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ─── Stats ────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-xl);
    padding: 20px 24px; transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.stat-card-row { display: flex; align-items: center; justify-content: space-between; }
.stat-label {
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px;
}
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-value.danger { color: var(--error); }
.stat-value.success { color: var(--success); }
.stat-icon {
    width: 40px; height: 40px; border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
}
.stat-icon-blue { background: #dbeafe; color: #2563eb; }
.stat-icon-purple { background: #ede9fe; color: #7c3aed; }
.stat-icon-green { background: #dcfce7; color: #16a34a; }
.stat-icon-red { background: #fee2e2; color: #dc2626; }

/* ─── Panel / Card ─────────────────────────────────────── */
.panel {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-xl); overflow: hidden; margin-bottom: 20px;
    transition: background var(--transition), border-color var(--transition);
}
.panel-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.panel-title { font-size: 15px; font-weight: 700; color: var(--text); }
.panel-body { padding: 0; }

/* ─── Tables ───────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 10px 16px;
    background: var(--bg-tertiary);
    font-size: 11px; font-weight: 700; color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase; letter-spacing: 0.04em;
    white-space: nowrap; position: sticky; top: 0; z-index: 5;
    transition: background var(--transition);
}
.data-table td {
    padding: 10px 16px; border-bottom: 1px solid var(--border-light);
    font-size: 13px; color: var(--text);
    transition: background var(--transition);
}
.data-table tr { transition: background var(--transition); }
.data-table tbody tr:hover td { background: var(--primary-bg); }
.data-table tr:last-child td { border-bottom: none; }

.table-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.table-link:hover { text-decoration: underline; }

/* Table checkbox */
.table-checkbox {
    width: 16px; height: 16px; border-radius: 4px;
    border: 2px solid var(--border); cursor: pointer;
    accent-color: var(--primary);
}

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius);
    font-size: 13px; font-weight: 600; border: none;
    cursor: pointer; transition: all var(--transition);
    text-decoration: none; line-height: 1.4; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(59,130,246,0.3); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-secondary); border-color: #cbd5e1; }
.btn-outline-primary {
    background: transparent; color: var(--primary);
    border: 1px solid var(--primary); border-radius: var(--radius);
}
.btn-outline-primary:hover { background: var(--primary-bg); }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon {
    padding: 6px; border-radius: var(--radius-sm);
    background: none; border: none; cursor: pointer;
    font-size: 18px; color: var(--text-secondary);
}

/* Action icon buttons */
.btn-icon-action {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--radius);
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; transition: all var(--transition);
}
.btn-icon-action:hover { background: var(--bg-secondary); color: var(--primary); }
.btn-icon-action.btn-icon-danger:hover { background: var(--error-bg); color: var(--error); }

/* ─── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 13px; font-family: var(--font);
    color: var(--text); background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-error { font-size: 12px; color: var(--error); margin-top: 4px; }

/* ─── Badges ───────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; padding: 3px 10px;
    border-radius: 99px; font-size: 11px; font-weight: 600;
}
.badge-success { background: var(--success-bg); color: #166534; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-error { background: var(--error-bg); color: #991b1b; }
.badge-info { background: var(--primary-light); color: #1e40af; }
.badge-muted { background: var(--bg-tertiary); padding: 3px 10px; color: var(--text-secondary); }

/* ─── Toolbar ──────────────────────────────────────────── */
.toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.toolbar-search {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 13px; background: var(--bg); color: var(--text);
    min-width: 240px; transition: all var(--transition);
}
.toolbar-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }
.toolbar-search-wrap {
    position: relative; flex-shrink: 0;
}
.toolbar-search-wrap svg,
.toolbar-search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ─── Modal ────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px); z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--bg); border-radius: var(--radius-lg); width: 100%;
    max-width: 600px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalSlide .25s ease;
}
@keyframes modalSlide { from { opacity:0; transform:translateY(16px) scale(0.98); } to { opacity:1; transform:translateY(0) scale(1); } }
.modal-lg { max-width: 800px; }
.modal-header {
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 16px 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* ─── Tabs ─────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
    padding: 10px 16px; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); background: none; border: none;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    cursor: pointer; display: flex; align-items: center; gap: 6px;
    transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count {
    background: var(--bg-tertiary); padding: 1px 7px; border-radius: 99px;
    font-size: 11px; font-weight: 700;
}
.tab-btn.active .tab-count { background: var(--primary-light); color: var(--primary); }

/* ─── Template Cards ───────────────────────────────────── */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.template-card {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-xl);
    padding: 20px 24px; transition: all var(--transition); position: relative;
}
.template-card:hover { box-shadow: var(--shadow-lg); }
.template-card-default { border-color: var(--primary); border-width: 2px; }
.template-default-badge {
    position: absolute; top: -1px; left: 20px;
    background: var(--primary); color: white; font-size: 10px; font-weight: 800;
    padding: 2px 10px; border-radius: 0 0 6px 6px; letter-spacing: 0.05em;
}
.template-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.template-card-icon {
    width: 40px; height: 40px; border-radius: var(--radius-lg);
    background: var(--bg-secondary); display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.template-card-actions { display: flex; gap: 4px; }
.template-card-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.template-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.template-card-edit {
    display: flex; align-items: center; gap: 8px; padding: 10px 0;
    border-top: 1px solid var(--border); text-decoration: none;
    color: var(--primary); font-weight: 600; font-size: 13px;
}
.template-card-edit:hover { color: var(--primary-dark); }

/* ─── Empty State ──────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-dashed {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
    border: 2px dashed var(--border); border-radius: var(--radius-xl);
}
.competitor-empty {
    border: 2px dashed var(--border); border-radius: var(--radius-xl);
    text-align: center; padding: 60px; color: var(--text-muted);
}

/* ─── Pagination ───────────────────────────────────────── */
.pagination-wrapper { padding: 12px 16px; border-top: 1px solid var(--border); }
.pagination-wrapper nav { display: flex; justify-content: center; }

/* ─── Spinner ──────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { display: inline-block; animation: spin 1s linear infinite; }

/* ─── Utilities ────────────────────────────────────────── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-mono { font-family: monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.project-icon {
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    background: var(--bg-secondary); display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.stat-icon-circle {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin-right: 16px;
}
.stat-icon-teal { background: #ccfbf1; color: #0d9488; }
.brand-icon-lg { width: 48px; height: 48px; font-size: 18px; border-radius: var(--radius-lg); }

/* ─── Backlink Split Layout ──────────────────────────── */
.backlink-layout { display: flex; gap: 0; min-height: 500px; }
.backlink-folders {
    width: 220px; flex-shrink: 0; border-right: 1px solid var(--border);
    padding: 12px 0; overflow-y: auto;
}
.backlink-main { flex: 1; min-width: 0; }
.folder-section-label {
    font-size: 10px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 12px 16px 4px; display: flex; align-items: center; justify-content: space-between;
}
.folder-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 500;
    color: var(--text-secondary); transition: all var(--transition);
    border: none; background: none; width: 100%; text-align: left;
}
.folder-item:hover { background: var(--bg-tertiary); color: var(--text); }
.folder-item.active {
    background: var(--primary); color: white; font-weight: 600;
    border-radius: 0 var(--radius) var(--radius) 0; margin-right: 8px;
}
.folder-item svg { flex-shrink: 0; }
.folder-count {
    margin-left: auto; font-size: 11px; font-weight: 700;
    background: var(--bg-tertiary); padding: 1px 7px; border-radius: 99px;
    color: var(--text-muted);
}
.folder-item.active .folder-count { background: rgba(255,255,255,0.2); color: white; }

/* ─── Spreadsheet ─────────────────────────────────────── */
.spreadsheet-table td { vertical-align: middle; }
.spreadsheet-input {
    width: 100%; border: none; background: transparent;
    padding: 10px 16px; font-size: 13px; color: var(--text);
    resize: none; overflow: hidden; min-height: 40px; display: block;
    font-family: var(--font); transition: background var(--transition);
}
.spreadsheet-input:focus { outline: none; background: var(--primary-bg); }
.spreadsheet-input::placeholder { color: var(--text-muted); }
.cell-url { max-width: 0; }
.cell-domain-url .domain-text { font-weight: 700; font-size: 13px; color: var(--text); }
.cell-domain-url .url-text { font-size: 11px; color: var(--text-muted); }

/* ─── Checkbox Toggle ─────────────────────────────────── */
.toggle-wrap {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: var(--radius);
    background: var(--bg-tertiary); border: 1px solid var(--border);
    margin-top: 8px;
}
.toggle-label { font-size: 13px; color: var(--text); font-weight: 500; }
.toggle-sublabel { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.toggle-switch {
    position: relative; width: 36px; height: 20px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border); border-radius: 99px; transition: .3s;
}
.toggle-slider:before {
    content: ""; position: absolute; width: 16px; height: 16px;
    left: 2px; bottom: 2px; background: white; border-radius: 50%; transition: .3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(16px); }

/* Domain analysis badges */
.domain-analysis { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.domain-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600;
}
.domain-badge-new { background: var(--success-bg); color: #166534; }
.domain-badge-existing { background: var(--warning-bg); color: #92400e; }
.domain-badge-skip { background: var(--bg-tertiary); color: var(--text-muted); }

/* ─── Inline Select (compact) ─────────────────────────── */
.inline-select {
    padding: 4px 8px; border: 1px solid transparent; border-radius: var(--radius-sm);
    font-size: 12px; background: transparent; color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition);
}
.inline-select:hover { border-color: var(--border); background: var(--bg); }
.inline-select:focus { border-color: var(--primary); outline: none; background: var(--bg); }

/* ─── Autocomplete Dropdown ──────────────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 260px; overflow-y: auto;
}
.autocomplete-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; cursor: pointer; transition: background var(--transition);
    border-bottom: 1px solid var(--border-light);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--primary-bg); }
.autocomplete-item .ac-domain { font-weight: 700; font-size: 13px; color: var(--text); }
.autocomplete-item .ac-url { font-size: 11px; color: var(--text-muted); display: block; max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autocomplete-item .ac-status {
    margin-left: auto; font-size: 10px; padding: 2px 8px;
    border-radius: 99px; font-weight: 600; flex-shrink: 0;
}
.autocomplete-item .ac-status.active { background: var(--success-bg); color: #166534; }
.autocomplete-item .ac-status.problematic { background: var(--warning-bg); color: #92400e; }
.autocomplete-new {
    padding: 10px 14px; font-size: 12px; color: var(--primary);
    font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px;
    border-top: 1px solid var(--border);
}
.autocomplete-new:hover { background: var(--primary-bg); }
.autocomplete-empty {
    padding: 14px; text-align: center; font-size: 12px; color: var(--text-muted);
}

.row-warning { background-color: rgba(245, 158, 11, 0.1) !important; }
.row-warning:hover { background-color: rgba(245, 158, 11, 0.15) !important; }
.row-danger { background-color: rgba(239, 68, 68, 0.1) !important; }
.row-danger:hover { background-color: rgba(239, 68, 68, 0.15) !important; }
