/* ==========================================================================
   HANEL.PRO - AI KEYWORD CLUSTER TOOL (STYLE.CSS)
   ========================================================================== */

:root {
    --bg-page: #03101c;
    --bg-surface: #071526;
    --bg-card: #0b1a2d;
    --bg-card-hover: #0f233d;
    --brand: #00a3e2;
    --brand-light: #38bdf8;
    --brand-glow: rgba(0, 163, 226, 0.25);
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 163, 226, 0.5);
    --text-heading: #ffffff;
    --text-body: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --amber-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --purple: #a855f7;
    --purple-light: #c084fc;
}

body {
    background-color: var(--bg-page);
    color: var(--text-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
}

/* Nav */
.tool-nav {
    background: #030d17;
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.tool-nav-inner {
    max-width: 1560px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.back-link:hover {
    color: var(--brand-light);
}

.tool-container {
    max-width: 1560px;
    margin: 0 auto;
    padding: 24px;
}

/* Header Card */
.tool-header-card {
    background: linear-gradient(135deg, #071526 0%, #0c2038 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 28px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.badge-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(0, 163, 226, 0.12);
    border: 1px solid rgba(0, 163, 226, 0.25);
    color: var(--brand-light);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00a3e2;
    box-shadow: 0 0 8px #00a3e2;
}
.tool-header-card h1 {
    margin: 0 0 8px 0;
    color: var(--text-heading);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.tool-header-card p {
    margin: 0;
    color: var(--text-body);
    font-size: 0.88rem;
    max-width: 960px;
    line-height: 1.5;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--stat-color);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.stat-label {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-heading);
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.stat-value small {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* Settings Bar */
.settings-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.settings-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.settings-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.custom-select {
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 6px 10px;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}
.custom-select:focus {
    border-color: var(--brand);
}
.custom-input {
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 6px 10px;
    color: #ffffff;
    font-size: 0.76rem;
    outline: none;
}
.custom-input:focus {
    border-color: var(--brand);
}

/* API Settings Drawer */
.api-drawer {
    background: #040e1a;
    border: 1px solid var(--border-focus);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    animation: fadeInDown 0.2s ease-out;
}
.drawer-label {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

/* Workspace Grid */
.workspace-grid {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1200px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* Panel */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.panel-header {
    background: #06111f;
    border-bottom: 1px solid var(--border);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.panel-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-body {
    padding: 16px 18px;
}

/* Textarea */
.keywords-textarea {
    width: 100%;
    box-sizing: border-box;
    height: 400px;
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
}
.keywords-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Big AI Cluster CTA */
.btn-cluster-cta {
    width: 100%;
    background: linear-gradient(135deg, #00a3e2 0%, #0284c7 50%, #0369a1 100%);
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 10px;
    padding: 14px 20px;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 163, 226, 0.35);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.3px;
}
.btn-cluster-cta:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 163, 226, 0.5);
    background: linear-gradient(135deg, #38bdf8 0%, #00a3e2 50%, #0284c7 100%);
}
.btn-cluster-cta:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.cta-icon {
    font-size: 1.25rem;
}

.ai-tip-box {
    margin-top: 14px;
    background: rgba(0, 163, 226, 0.05);
    border: 1px solid rgba(0, 163, 226, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
}

/* View Pill Buttons */
.view-pill-group {
    display: inline-flex;
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 3px;
    gap: 3px;
}
.view-pill-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.view-pill-btn:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}
.view-pill-btn.active {
    background: rgba(0, 163, 226, 0.2);
    border-color: rgba(0, 163, 226, 0.5);
    color: var(--brand-light);
    box-shadow: 0 2px 8px rgba(0, 163, 226, 0.2);
}

/* Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    text-decoration: none;
}
.btn-action:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}
.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}
.btn-emerald {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.45);
    color: #34d399;
}
.btn-emerald:hover {
    background: #10b981;
    color: #ffffff;
}
.btn-amber {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fbbf24;
}
.btn-amber:hover {
    background: #f59e0b;
    color: #ffffff;
}

.chip-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-body);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.chip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Results Container */
.results-container {
    min-height: 480px;
    max-height: 600px;
    overflow-y: auto;
}

/* TREE VIEW */
.tree-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tree-campaign-card {
    background: #040e1a;
    border: 1px solid var(--border);
    border-left: 3px solid #38bdf8;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.tree-campaign-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
}
.tree-campaign-header {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.tree-camp-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tree-theme-badge {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
}
.tree-adgroups-list {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tree-adgroup-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px;
}
.tree-adgroup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.tree-ag-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #34d399;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tree-intent-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}
.tree-kw-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tree-kw-pill {
    background: #071526;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 3px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.tree-kw-pill:hover {
    background: rgba(0, 163, 226, 0.15);
    border-color: var(--brand);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Table View */
.table-responsive-wrap {
    overflow-x: auto;
    max-height: 520px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #040e1a;
}
.ads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}
.ads-table thead {
    background: #061221;
    position: sticky;
    top: 0;
    z-index: 10;
}
.ads-table th {
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.ads-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ads-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Cards Grid View */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}
.card-group {
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Empty State */
.empty-placeholder {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    border: 2px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(4, 14, 26, 0.4);
    margin: 10px 0;
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 14px;
    display: inline-block;
    animation: floatIcon 3s ease-in-out infinite;
}
@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ==========================================================================
   AI PROGRESS TRACKER (Tiến trình chạy thời gian thực)
   ========================================================================== */
.ai-progress-tracker {
    background: #040e1a;
    border: 1px solid rgba(0, 163, 226, 0.35);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
    animation: fadeInDown 0.3s ease-out;
    margin-bottom: 16px;
}

.progress-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.progress-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pulsing-radar {
    width: 14px;
    height: 14px;
    background-color: #38bdf8;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}
.pulsing-radar::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid #38bdf8;
    animation: pulseRing 1.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
@keyframes pulseRing {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

.progress-main-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.2px;
}
.progress-sub-title {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.progress-timer-pill {
    background: rgba(0, 163, 226, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 6px 14px;
    border-radius: 99px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #38bdf8;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Progress bar fill */
.progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: #061528;
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00a3e2 0%, #38bdf8 50%, #34d399 100%);
    border-radius: 99px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}
.progress-bar-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
#progCurrentStepText {
    font-weight: 600;
    color: #38bdf8;
}
#progPercentText {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #ffffff;
}

/* Stepper List */
.progress-steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.prog-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.25s ease;
}
.prog-step-item.active {
    background: rgba(0, 163, 226, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 2px 10px rgba(0, 163, 226, 0.15);
}
.prog-step-item.completed {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(52, 211, 153, 0.3);
}

.step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0b1a2d;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.25s;
}
.prog-step-item.active .step-dot {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    animation: pulseDot 1.2s infinite;
}
@keyframes pulseDot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
.prog-step-item.completed .step-dot {
    background: #059669;
    border-color: #34d399;
    color: #ffffff;
}

.step-text {
    flex: 1;
}
.step-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.prog-step-item.active .step-title {
    color: #38bdf8;
}
.prog-step-item.completed .step-title {
    color: #34d399;
}
.step-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

/* Console Logs Window */
.prog-console-box {
    background: #02070f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
}
.prog-console-header {
    background: #06111f;
    padding: 7px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.console-blink-cursor {
    color: #34d399;
    animation: blinkCursor 1s step-start infinite;
}
@keyframes blinkCursor {
    50% { opacity: 0; }
}
.prog-console-body {
    padding: 10px 14px;
    max-height: 140px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.6;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.console-log-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.console-time {
    color: #64748b;
    flex-shrink: 0;
}
.console-msg {
    color: #cbd5e1;
    word-break: break-word;
}
.console-msg.highlight {
    color: #38bdf8;
    font-weight: 600;
}
.console-msg.success {
    color: #34d399;
    font-weight: 600;
}

/* Toast */
.toast-msg {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0b2238;
    color: #ffffff;
    border: 1px solid var(--brand);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.toast-msg.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Keyword Integrity & Audit Card */
.audit-report-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 17, 31, 0.95) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInDown 0.25s ease-out;
}
.audit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 10px;
}
.audit-badge-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #10b981;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}
.audit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
}
.audit-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.audit-item-label {
    font-size: 0.68rem;
    color: var(--text-muted);
}
.audit-item-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
}

/* Match Type Badge */
.badge-match-type {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.badge-match-type.phrase {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}
.badge-match-type.exact {
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #34d399;
}
.badge-match-type.broad {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

/* STAG Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.modal-content-box {
    background: #06111f;
    border: 1px solid var(--border-focus);
    border-radius: 14px;
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
    animation: fadeInDown 0.25s ease-out;
}
.modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.stag-rule-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 16px;
}
.stag-rule-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--brand-light);
    margin-bottom: 6px;
}
.stag-rule-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.6;
}
.stag-rule-card li {
    margin-bottom: 4px;
}
.stag-rule-card code {
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 5px;
    border-radius: 4px;
    color: #38bdf8;
    font-size: 0.72rem;
}

/* Negatives & Bidding Strategy View */
.negatives-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 900px) {
    .negatives-view-grid {
        grid-template-columns: 1fr;
    }
}
.neg-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}
.neg-tag {
    display: inline-block;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fb7185;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-family: 'JetBrains Mono', monospace;
    margin: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.neg-tag:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: #f43f5e;
}
.rsa-preview-box {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px dashed rgba(56, 189, 248, 0.25);
    border-radius: 6px;
    font-size: 0.74rem;
}


