/**
 * Shared UI Styles
 *
 * Common CSS for selector pages, results pages, and admin pages.
 * Button system, icon buttons, form controls, and layout utilities.
 *
 * @package AI-Content-Generator
 * @since 1.0.0
 */

/* ==========================================================================
   Typography
   ========================================================================== */

body {
    font-family: 'Inter', sans-serif;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   Custom Scrollbar (Dark Theme)
   ========================================================================== */

.city-list-container::-webkit-scrollbar {
    width: 8px;
}

.city-list-container::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

.city-list-container::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.city-list-container::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ==========================================================================
   Toggle Switch
   ========================================================================== */

.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #475569;
    transition: 0.2s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background-color: #2563eb;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle input:disabled + .toggle-slider {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ==========================================================================
   City Item Hover
   ========================================================================== */

.city-item {
    transition: background 0.1s;
}

.city-item:hover {
    background: rgba(51, 65, 85, 0.5);
}

/* ==========================================================================
   Quick Select Button
   ========================================================================== */

.quick-btn {
    transition: all 0.15s;
}

.quick-btn:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.quick-btn.filter-active {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.2);
}

.quick-btn.filter-active:hover {
    background: rgba(168, 85, 247, 0.3);
    color: #d8b4fe;
    border-color: rgba(168, 85, 247, 0.4);
}

/* ==========================================================================
   Batch/Sequential Item Hover
   ========================================================================== */

.batch-item {
    transition: all 0.15s;
}

.batch-item:hover,
.sequential-item:hover {
    border-color: #3b82f6;
    background: rgba(51, 65, 85, 0.5);
}

/* ==========================================================================
   Range Slider
   ========================================================================== */

input[type="range"] {
    -webkit-appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-track {
    height: 6px;
    background: #475569;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -5px;
}

input[type="range"]:disabled::-webkit-slider-thumb {
    background: #64748b;
    cursor: not-allowed;
}

.config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: rgba(71, 85, 105, 0.5);
    border-radius: 0.5rem;
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.progress-bar {
    width: 100%;
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
    transition: width 0.3s ease-in-out;
}

/* ==========================================================================
   Utility: Opacity for Disabled State
   ========================================================================== */

.opacity-50 {
    opacity: 0.5;
}

/* ==========================================================================
   Tier Badges (Purple Intensity Gradient)
   ========================================================================== */

.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Tier 1: Darkest purple (highest priority) */
.tier-badge-1 {
    background: #7c3aed;
    color: #ffffff;
}

/* Tier 2: Medium purple */
.tier-badge-2 {
    background: #a78bfa;
    color: #ffffff;
}

/* Tier 3: Light purple (dark text for contrast) */
.tier-badge-3 {
    background: #c4b5fd;
    color: #1e1b4b;
}

/* Tier 4: Lightest purple (dark text for contrast) */
.tier-badge-4 {
    background: #ddd6fe;
    color: #1e1b4b;
}

/* Tier 5: Excluded (admin-only, dark/muted) */
.tier-badge-5 {
    background: #374151;
    color: #9ca3af;
}

/* Custom tiers 6-9: Teal gradient for non-standard tiers */
.tier-badge-6 {
    background: #0d9488;
    color: #ffffff;
}

.tier-badge-7 {
    background: #2dd4bf;
    color: #042f2e;
}

.tier-badge-8 {
    background: #5eead4;
    color: #042f2e;
}

.tier-badge-9 {
    background: #99f6e4;
    color: #042f2e;
}

/* ==========================================================================
   City Progress Dots (inline with city count)
   ========================================================================== */

.city-dots {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

.city-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.city-dot:hover {
    transform: scale(1.4);
}

.city-dot-pending { background: #64748b; }
.city-dot-processing { background: #3b82f6; animation: dotPulse 1s ease-in-out infinite; }
.city-dot-completed { background: #10b981; }
.city-dot-error { background: #ef4444; }
.city-dot-skipped { background: #6b7280; }

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* ==========================================================================
   Prompt Status Badges (with icons)
   ========================================================================== */

.prompt-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border-width: 1px;
    border-style: solid;
}

.prompt-status-active {
    background-color: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.prompt-status-active::before {
    content: "✓";
    font-weight: 600;
}

.prompt-status-missing {
    background-color: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.prompt-status-missing::before {
    content: "✗";
    font-weight: 600;
}

a.prompt-status-missing {
    cursor: pointer;
    transition: background-color 0.15s;
    text-decoration: none;
}

a.prompt-status-missing:hover {
    background-color: rgba(239, 68, 68, 0.25);
    text-decoration: none;
}

/* ==========================================================================
   Icon Button (small action buttons)
   ========================================================================== */

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon:hover {
    background-color: rgba(71, 85, 105, 0.5);
    color: #ffffff;
}

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

.btn-icon--danger:hover {
    color: #f87171;
}

.btn-icon--success:hover {
    color: #34d399;
}

/* ==========================================================================
   Tier Item Card (Custom Tiers list)
   ========================================================================== */

.tier-card {
    padding: 1rem;
    transition: background 0.15s;
}

.tier-card:hover {
    background: rgba(51, 65, 85, 0.5);
}

.tier-card.inactive {
    opacity: 0.6;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */

.filter-bar {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid #334155;
}

.filter-bar .filter-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
}

.filter-bar .filter-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.filter-bar .filter-input::placeholder {
    color: #64748b;
}

.filter-bar .filter-select {
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    min-width: 150px;
}

.filter-bar .filter-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.section-locked {
    pointer-events: none;
    opacity: 0.45;
    user-select: none;
    transition: opacity 0.2s ease;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

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

/* Variants */
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }

.btn-secondary { background: #334155; color: #e2e8f0; }
.btn-secondary:hover { background: #475569; }

.btn-success { background: #22c55e; color: white; }
.btn-success:hover { background: #16a34a; }

.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: #eab308; color: #1e293b; }
.btn-warning:hover { background: #ca8a04; }

/* Sizes */
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

/* Export button (green action, icon animation) */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #059669;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-export:hover { background: #047857; }
.btn-export:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-export .btn-icon { width: 1rem; height: 1rem; }
.btn-export.exporting .btn-icon { animation: spin 1s linear infinite; }

/* Selection counter */
.selected-count { font-weight: 600; color: #3b82f6; }

/* Shared icon spin (uses Tailwind's @keyframes spin) */
.icon-spinning { animation: spin 0.8s linear infinite; }

/* ==========================================================================
   Model Badge (shared across results pages)
   ========================================================================== */

:root {
    --model-lime: #84cc16;
    --model-sky: #0ea5e9;
    --model-violet: #8b5cf6;
    --model-blue: #3b82f6;
    --model-amber: #f59e0b;
    --model-emerald: #10b981;
    --model-unknown: #64748b;
}

.model-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid;
    white-space: nowrap;
}

.model-lime {
    border-color: var(--model-lime);
    color: var(--model-lime);
    background: rgba(132, 204, 22, 0.1);
}
.model-sky {
    border-color: var(--model-sky);
    color: var(--model-sky);
    background: rgba(14, 165, 233, 0.1);
}
.model-violet {
    border-color: var(--model-violet);
    color: var(--model-violet);
    background: rgba(139, 92, 246, 0.1);
}
.model-blue {
    border-color: var(--model-blue);
    color: var(--model-blue);
    background: rgba(59, 130, 246, 0.1);
}
.model-amber {
    border-color: var(--model-amber);
    color: var(--model-amber);
    background: rgba(245, 158, 11, 0.1);
}
.model-emerald {
    border-color: var(--model-emerald);
    color: var(--model-emerald);
    background: rgba(16, 185, 129, 0.1);
}
.model-unknown {
    border-color: var(--model-unknown);
    color: var(--model-unknown);
    background: rgba(100, 116, 139, 0.1);
}

/* ==========================================================================
   Status Badges (shared across results/status pages)
   ========================================================================== */

.success-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-radius: 0.25rem;
}
.error-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
}
.status-completed, .status-ended, .status-succeeded { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-running, .status-in_progress { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-paused, .status-expired { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.status-stopped, .status-canceled { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.status-error, .status-failed, .status-errored { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-pending, .status-draft { background: #334155; color: #94a3b8; }

/* ==========================================================================
   Config Pills (rendered by config-display-template.php)
   ========================================================================== */

.config-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.config-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: #334155;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    color: #94a3b8;
}
.config-pill.active {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}
.pill-label { opacity: 0.8; }
.pill-value { font-weight: 600; }

/* ==========================================================================
   QA Badges (shared across results pages)
   ========================================================================== */

.qa-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
}
.qa-pass { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.qa-fail { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.qa-none { background: #334155; color: #94a3b8; }

/* ==========================================================================
   Validation Badges
   ========================================================================== */

.validation-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.validation-passed { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.validation-failed { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ==========================================================================
   Violation Severity (used in results detail views)
   ========================================================================== */

.violation-item {
    font-size: 0.7rem;
    color: #e2e8f0;
    padding: 0.25rem 0;
    line-height: 1.3;
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
}
.violation-severity {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 0.2rem;
    font-size: 0.5rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.severity-critical { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.severity-high { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.severity-warning { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.severity-low { background: #334155; color: #94a3b8; }

/* ==========================================================================
   Export Badge
   ========================================================================== */

.export-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    color: rgb(96, 165, 250);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ==========================================================================
   Missing Embedding Indicator
   ========================================================================== */

.missing-embed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-radius: 50%;
    color: #eab308;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.5rem;
    cursor: help;
}

/* ==========================================================================
   Results Table (shared across batch/sequential results pages)
   ========================================================================== */

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.results-table th {
    text-align: left;
    padding: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #334155;
}
.results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #334155;
    vertical-align: middle;
}
.results-table tbody tr:hover {
    background: #334155;
}

.checkbox-col { width: 2.5rem; text-align: center; }
.checkbox-col input[type="checkbox"] { width: 1rem; height: 1rem; cursor: pointer; }

/* ==========================================================================
   Filter Buttons (results page status tabs)
   ========================================================================== */

.filter-btn {
    padding: 0.5rem 1rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.15s;
}
.filter-btn:hover {
    background: #334155;
    color: #e2e8f0;
}
.filter-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #3b82f6;
}

/* ==========================================================================
   Run QA Button (inline in results tables)
   ========================================================================== */

.run-qa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.run-qa-btn:hover { background: #2563eb; }
.run-qa-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.run-qa-btn.scoring { animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ==========================================================================
   Button Variants: QA & Download (results action bar)
   ========================================================================== */

.btn-qa {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-qa:hover { background: #2563eb; }
.btn-qa:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-qa .btn-icon { width: 1rem; height: 1rem; }
.btn-qa.scoring .btn-icon { animation: spin 1s linear infinite; }

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #06b6d4;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-download:hover { background: #0891b2; }

.export-error {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #f87171;
    padding: 4px 10px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid #f87171;
    border-radius: 4px;
}

/* Tier color variants (inline size, used in results tables) */
.tier-1 { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.tier-2 { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.tier-3 { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.tier-4 { background: rgba(234, 179, 8, 0.15); color: #eab308; }

/* Alerts (shared across status/results pages) */
.alert { padding: 1rem 1.25rem; border-radius: 0.5rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; }
.alert-success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.2); color: #22c55e; }
.alert-info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); color: #3b82f6; }
.alert-warning { background: rgba(234, 179, 8, 0.1); border: 1px solid rgba(234, 179, 8, 0.2); color: #eab308; }
.alert-danger { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #ef4444; }

/* ==========================================================================
   QA Legend Popovers (QA Results page)
   ========================================================================== */

.legend-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    background: rgba(51, 65, 85, 0.3);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: default;
}
.legend-item:hover {
    background: rgba(51, 65, 85, 0.6);
    border-color: rgba(100, 116, 139, 0.3);
}
.legend-item .info-trigger {
    opacity: 0.6;
    transition: all 0.15s ease;
    margin-left: 0.25rem;
    color: #60a5fa;
}
.legend-item:hover .info-trigger {
    opacity: 1;
    transform: scale(1.1);
}
.legend-popover {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(-0.5rem);
    width: 280px;
    padding: 1rem;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(100, 116, 139, 0.4);
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05) inset;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    pointer-events: none;
}
.legend-popover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: #1e293b;
}
.legend-item:hover .legend-popover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.legend-popover-title {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.legend-popover-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.legend-popover-example {
    font-size: 0.6875rem;
    color: #64748b;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.625rem;
    border-radius: 0.375rem;
    border-left: 2px solid currentColor;
}
.legend-popover-example strong {
    color: #cbd5e1;
}
/* Edge position adjustments */
.legend-item:first-child .legend-popover,
.legend-item:nth-child(2) .legend-popover {
    left: 0;
    transform: translateX(0) translateY(-0.5rem);
}
.legend-item:first-child:hover .legend-popover,
.legend-item:nth-child(2):hover .legend-popover {
    transform: translateX(0) translateY(0);
}
.legend-item:first-child .legend-popover::before,
.legend-item:nth-child(2) .legend-popover::before {
    left: 1.5rem;
}

/* ==========================================================================
   QA Similarity - Shared Components
   ========================================================================== */

/* Decorative background for similarity pages */
.bg-similarity-page {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px),
        radial-gradient(ellipse at 20% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
    background-size: 32px 32px, 32px 32px, auto, auto;
}

/* Selection card + table */
.selection-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    overflow: hidden;
}
.selection-header {
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.selection-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.selection-title svg { width: 18px; height: 18px; color: #a855f7; }

.selection-table { width: 100%; border-collapse: collapse; }
.selection-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 1px solid #334155;
    background: rgba(0, 0, 0, 0.2);
}
.selection-table td {
    padding: 14px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.selection-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}
.selection-table tbody tr:hover {
    background: rgba(51, 65, 85, 0.3);
}

/* Similarity badges */
.similarity-score { font-family: 'JetBrains Mono', monospace; font-size: 0.875rem; font-weight: 600; }
.similarity-score.critical { color: #ef4444; }
.similarity-score.warning { color: #f59e0b; }

.severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 20px;
}
.severity-badge.critical { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #ef4444; }
.severity-badge.warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #f59e0b; }

.lang-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #334155;
    border-radius: 4px;
    color: #94a3b8;
}

/* City display helpers (similarity pages) */
.city-name { font-weight: 500; color: #f1f5f9; }
.city-state { font-size: 0.75rem; color: #64748b; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #64748b;
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: #94a3b8; margin-bottom: 4px; }

/* Config hash pill */
.config-hash {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    padding: 2px 6px;
    background: #334155;
    border-radius: 4px;
    color: #64748b;
}

/* Markdown content rendering */
.content-body h1, .content-body h2, .content-body h3 { margin: 1em 0 0.5em; color: #f1f5f9; }
.content-body h1 { font-size: 1.3rem; }
.content-body h2 { font-size: 1.1rem; }
.content-body h3 { font-size: 1rem; }
.content-body p { margin-bottom: 1em; color: #94a3b8; }
.content-body li { margin-left: 1.5em; color: #94a3b8; }
.content-body strong { color: #f1f5f9; }

/* ==========================================================================
   QA Similarity - Data Table (shared)
   ========================================================================== */

.data-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 1px solid #334155;
    background: rgba(0, 0, 0, 0.2);
}
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    vertical-align: middle;
}
.data-table tbody tr:hover {
    background: rgba(51, 65, 85, 0.3);
}

/* ==========================================================================
   QA Similarity - Pagination (shared)
   ========================================================================== */

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 12px;
}
/* Separator when pagination is inside a card/table container */
.pagination-container.with-separator {
    border-top: 1px solid #334155;
}
.pagination-info {
    font-size: 0.8rem;
    color: #64748b;
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.per-page-select {
    background: #334155;
    border: 1px solid #475569;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
}
.page-nav {
    display: flex;
    gap: 4px;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.15s;
}
.page-btn:hover { background: #475569; color: white; }
.page-btn.active { background: #3b82f6; border-color: #3b82f6; color: white; }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
button.page-btn { font: inherit; }
.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    color: #64748b;
    font-size: 0.8rem;
}

/* ==========================================================================
   QA Similarity - Loading Spinner (shared)
   ========================================================================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: #94a3b8;
    font-size: 0.875rem;
}
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #334155;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   Secret Tooltip (extracted from accounts.php — #130b)
   ========================================================================== */

#secret-tooltip {
    display: none;
    position: fixed;
    background: #422006;
    border: 2px solid #f59e0b;
    color: #fef3c7;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    width: 260px;
    white-space: normal;
    z-index: 99999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
    pointer-events: none;
}

#secret-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 44px;
    border: 6px solid transparent;
    border-top-color: #f59e0b;
}

/* ==========================================================================
   Highlight Row Animation (extracted from qa-rules-translations.php — #130b)
   ========================================================================== */

.highlight-row {
    animation: highlight 2s ease-out;
}

@keyframes highlight {
    0% { background-color: rgba(168, 85, 247, 0.3); }
    100% { background-color: transparent; }
}

/* ==========================================================================
   Notification Component (extracted from notifications.php — #130c)
   ========================================================================== */

/* Notification Bell Button */
.notification-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.notification-bell-btn:hover {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.3);
}
.notification-bell-icon {
    width: 18px;
    height: 18px;
    color: #fbbf24;
}
.notification-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    border: 2px solid var(--bg-secondary, #1e293b);
}

/* Modal Overlay */
.notification-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.notification-modal-overlay.hidden {
    display: none;
}

/* Modal Container */
.notification-modal {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 440px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Modal Header */
.notification-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #334155;
    background: #0f172a;
}
.notification-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
}
.notification-modal-icon {
    width: 20px;
    height: 20px;
    color: #fbbf24;
}
.notification-modal-count {
    background: #334155;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
}
.notification-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}
.notification-modal-close:hover {
    background: #334155;
    color: #f1f5f9;
}
.notification-modal-close svg {
    width: 18px;
    height: 18px;
}

/* Modal Body */
.notification-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 200px;
    max-height: 400px;
}

/* Loading State */
.notification-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: #64748b;
    font-size: 14px;
}
.notification-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #334155;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Empty State */
.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    color: #64748b;
    text-align: center;
}
.notification-empty svg {
    width: 48px;
    height: 48px;
    color: #475569;
    margin-bottom: 8px;
}

/* Notification Items */
.notification-item {
    padding: 14px;
    border-radius: 8px;
    background: #0f172a;
    border: 1px solid #334155;
    margin-bottom: 10px;
    transition: all 0.2s;
}
.notification-item:last-child {
    margin-bottom: 0;
}
.notification-item:hover {
    border-color: #475569;
}
.notification-item.success {
    border-left: 3px solid #10b981;
}
.notification-item.error {
    border-left: 3px solid #ef4444;
}
.notification-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.notification-item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.notification-item-icon.success { color: #10b981; }
.notification-item-icon.error { color: #ef4444; }
.notification-item-title {
    font-weight: 500;
    color: #f1f5f9;
    font-size: 14px;
}
.notification-item-message {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 10px;
}
.notification-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.notification-item-time {
    font-size: 12px;
    color: #64748b;
}
.notification-item-actions {
    display: flex;
    gap: 12px;
}
.notification-item-actions a,
.notification-item-actions button {
    font-size: 12px;
    color: #3b82f6;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}
.notification-item-actions a:hover,
.notification-item-actions button:hover {
    color: #60a5fa;
}
.notification-item-actions button {
    color: #64748b;
}
.notification-item-actions button:hover {
    color: #94a3b8;
}

/* Modal Footer */
.notification-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid #334155;
    background: #0f172a;
}
.notification-btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.notification-btn-secondary:hover {
    background: #334155;
    color: #f1f5f9;
}
.notification-btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.notification-btn-secondary svg {
    width: 14px;
    height: 14px;
}
.notification-btn-primary {
    padding: 8px 20px;
    background: #3b82f6;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.notification-btn-primary:hover {
    background: #2563eb;
}

/* JS-injected notification sub-label */
.notification-sub-label {
    font-size: 12px;
    color: #475569;
}

/* JS-injected small spinner override */
.notification-loading-spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* ==========================================================================
   Flag Modal Component (extracted from flag-modal.php — #130c)
   ========================================================================== */

/* Flag Modal Overlay */
.flag-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.flag-modal-overlay.hidden {
    display: none;
}

/* Flag Modal */
.flag-modal {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Modal Header */
.flag-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #334155;
}

.flag-modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #f8fafc;
}

.flag-modal-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #f59e0b;
}

.flag-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.flag-modal-close:hover {
    background: #334155;
    color: #f8fafc;
}

.flag-modal-close svg {
    width: 1rem;
    height: 1rem;
}

/* Modal Body */
.flag-modal-body {
    padding: 1.25rem;
}

/* City Info */
.flag-city-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #0f172a;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.flag-city-name {
    font-weight: 600;
    color: #f8fafc;
}

.flag-city-meta {
    display: flex;
    gap: 0.5rem;
}

.flag-qa-badge,
.flag-age-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    background: #334155;
    color: #94a3b8;
}

.flag-qa-badge.low {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Stale Warning */
.flag-stale-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #fbbf24;
}

.flag-stale-warning svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.flag-stale-warning.hidden {
    display: none;
}

/* Form Fields */
.flag-field {
    margin-bottom: 1rem;
}

.flag-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.flag-optional {
    font-weight: 400;
    color: #64748b;
}

.flag-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f8fafc;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.flag-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.flag-textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f8fafc;
    font-size: 0.875rem;
    min-height: 80px;
    resize: vertical;
    transition: border-color 0.2s;
}

.flag-textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.flag-char-count {
    text-align: right;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Error Display */
.flag-error {
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.flag-error.hidden {
    display: none;
}

/* Modal Footer */
.flag-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #334155;
    background: #0f172a;
    border-radius: 0 0 12px 12px;
}

.flag-btn-secondary,
.flag-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.flag-btn-secondary {
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
}

.flag-btn-secondary:hover {
    background: #334155;
    color: #f8fafc;
}

.flag-btn-primary {
    background: #b45309;
    border: none;
    color: #f8fafc;
}

.flag-btn-primary:hover {
    background: #d97706;
}

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

.flag-btn-icon {
    width: 1rem;
    height: 1rem;
}

/* Flag Button (for results pages) */
.flag-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 6px;
    color: #fbbf24;
    cursor: pointer;
    transition: all 0.2s;
}

.flag-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.3);
}

.flag-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Flag Badge (for flagged/locked items) */
.flag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.flag-badge.flagged {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.flag-badge.locked {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    cursor: not-allowed;
}

.flag-badge svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* ==========================================================================
   Lock Explorer (extracted from lock-explorer-template.php — #130c)
   ========================================================================== */

.lock-row:hover { background-color: rgba(51, 65, 85, 0.3); }
.sort-btn { cursor: pointer; user-select: none; }
.sort-btn:hover { color: #e2e8f0; }
.sort-btn .sort-icon { opacity: 0.3; }
.sort-btn.active .sort-icon { opacity: 1; }
.detail-panel { animation: slideDown 0.2s ease-out; }
@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 400px; }
}

/* Graph view */
.graph-detail-panel { width: 380px; transform: translateX(100%); transition: transform 0.2s ease-out; z-index: 30; }
.graph-detail-panel.open { transform: translateX(0); }
.graph-tab { transition: color 0.15s, border-color 0.15s; }
.graph-layout-btn.active {
    background-color: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.3);
}
.graph-empty-icon { opacity: 0.08; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-dot--orphan { border: 2px dashed #ef4444; background: transparent; }
.legend-dot--stale { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.4); }
.legend-rect { width: 14px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* Legend — Segmented Cards */
.legend-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 8px;
    padding: 8px 14px;
}
.legend-group__title {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding-right: 10px;
    border-right: 1px solid rgba(51, 65, 85, 0.5);
    white-space: nowrap;
}
.legend-group__items {
    display: flex;
    align-items: center;
    gap: 10px;
}
.legend-group__item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.legend-group__label {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

/* ==========================================================================
   Export History (extracted from export-history-template.php — #130c)
   ========================================================================== */

/* Summary Cards */
.stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}
.stat-card .stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* Export Table */
.export-table {
    width: 100%;
    border-collapse: collapse;
}
.export-table th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #334155;
    background: #0f172a;
}
.export-table td {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    color: #cbd5e1;
    border-bottom: 1px solid #1e293b;
}
.export-table tr:hover td {
    background: rgba(30, 41, 59, 0.5);
}
.export-table tr.active-preview td {
    background: rgba(16, 185, 129, 0.05);
}

/* Badges */
.badge-lang {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
}
.badge-lang-en { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-lang-fr { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-version {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

/* Action Buttons (export-specific) */
.btn-preview {
    background: #334155;
    color: #cbd5e1;
}
.btn-preview:hover { background: #475569; }
.btn-preview.active { background: rgba(16, 185, 129, 0.2); color: #34d399; }

/* JSON Preview */
.json-preview-panel {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    overflow: hidden;
}
.json-preview-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.json-preview-header h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #94a3b8;
}
.json-preview-content {
    padding: 1rem;
    max-height: 500px;
    overflow: auto;
}
.json-preview-content pre {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #cbd5e1;
    white-space: pre-wrap;
    word-break: break-word;
}
.json-preview-empty {
    padding: 2rem;
    text-align: center;
    color: #64748b;
    font-size: 0.8125rem;
}

/* Download All button */
.btn-download-all {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    background: #059669;
    color: white;
    transition: background 0.15s;
}
.btn-download-all:hover { background: #047857; }
.btn-download-all svg { width: 1rem; height: 1rem; }

/* ==========================================================================
   Progress Bar: Running Shimmer (extracted from sequential-generator.php — #130d)
   ========================================================================== */

.progress-bar.running {
    background: linear-gradient(90deg, #a855f7 0%, #d8b4fe 50%, #a855f7 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* City status transition */
.city-status { transition: all 0.2s ease-in-out; }

/* Pulse animation class (uses shared @keyframes pulse above) */
.pulse { animation: pulse 2s infinite; }

/* ==========================================================================
   Collapsible Sections (extracted from single-generator.php — #130d)
   ========================================================================== */

.collapsible-header {
    cursor: pointer;
    user-select: none;
}
.collapsible-header:hover {
    background: rgba(51, 65, 85, 0.5);
}
.collapsible-content {
    transition: max-height 0.3s ease, opacity 0.2s;
    overflow: hidden;
}
.collapsible-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
}
.collapse-arrow {
    transition: transform 0.2s;
}
.collapse-arrow.collapsed {
    transform: rotate(-90deg);
}

/* Prompt preview collapsible */
.prompt-collapsible {
    max-height: 500px;
    transition: max-height 0.3s ease, opacity 0.2s, padding 0.2s;
    overflow: hidden;
}
.prompt-collapsible.collapsed {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ==========================================================================
   Prompt Preview Tabs (extracted from single-generator.php — #130d)
   ========================================================================== */

.prompt-tab {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}
.prompt-tab:hover {
    color: white;
}
.prompt-tab.active {
    color: white;
    border-bottom-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}
.prompt-panel {
    display: none;
}
.prompt-panel.active {
    display: block;
}

/* ==========================================================================
   Modal & Processing Overlays (extracted from single-generator.php — #130d)
   ========================================================================== */

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

.processing-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 24px;
}
.processing-overlay.active { display: flex; }

/* ==========================================================================
   Spinner Variants & Spinning (extracted from single-generator.php — #130d)
   ========================================================================== */

/* Large spinner for processing overlay (60px) */
.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* Inline spinning animation */
.spinning {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   Prompt Content (extracted from single-generator.php — #130d)
   ========================================================================== */

.prompt-content {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 1rem;
    height: 500px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #94a3b8;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ==========================================================================
   Model Badge: Small Variant (extracted from single-generator.php — #130d)
   ========================================================================== */

.model-badge-sm {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    border-width: 1px;
    background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Status/Progress Animations (extracted from sequential-status.php — #130d)
   ========================================================================== */

/* Running status badge pulse */
.status-running { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* Emerald shimmer for running progress bars */
.progress-running {
    background: linear-gradient(90deg, #10b981, #34d399, #10b981);
    background-size: 200% 100%;
    animation: progressShimmer 2s ease-in-out infinite;
}
@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   City Status Colors (extracted from sequential-status.php — #130d)
   ========================================================================== */

.city-pending { color: #64748b; }
.city-processing { color: #3b82f6; animation: pulse 1s infinite; }
.city-completed { color: #10b981; }
.city-error { color: #ef4444; }
.city-skipped { color: #6b7280; }

/* ==========================================================================
   Timeline Cards (extracted from sequential-status.php — #130d)
   ========================================================================== */

.timeline-card {
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.timeline-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #f8fafc;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
.timeline-item:last-child {
    border-bottom: none;
}
.timeline-label {
    font-size: 0.8125rem;
    color: #94a3b8;
}
.timeline-value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #f8fafc;
}

/* ==========================================================================
   Sidebar Delete Button (extracted from batch-status.php — #130d)
   ========================================================================== */

.batch-list-wrapper { position: relative; }
.btn-delete-sidebar {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1;
}
.batch-list-wrapper:hover .btn-delete-sidebar { opacity: 1; }
.btn-delete-sidebar:hover { background: #c82333; }

/* ==========================================================================
   Status Badges — Pill (extracted from batch-status.php — #130d)
   ========================================================================== */

.status-badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-draft { background: #334155; color: #cbd5e1; }
.status-pending { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.status-in_progress { background: rgba(59, 130, 246, 0.15); color: #3b82f6; animation: pulse 2s ease-in-out infinite; }
.status-canceling { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.status-ended { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-failed { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-scheduled { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

/* ==========================================================================
   Progress Bar Segments (extracted from batch-status.php — #130d)
   ========================================================================== */

.progress-segment { height: 100%; transition: width 0.3s ease; }
.progress-succeeded { background: #10b981; }
.progress-errored { background: #ef4444; }
.progress-expired { background: #eab308; }
.progress-pending { background: #334155; }
.progress-pending.progress-active {
    background: repeating-linear-gradient(
        -45deg,
        #334155,
        #334155 8px,
        #3b4f6b 8px,
        #3b4f6b 16px
    );
    background-size: 32px 32px;
    animation: progress-stripe 1s linear infinite;
}
@keyframes progress-stripe {
    0% { background-position: 0 0; }
    100% { background-position: 32px 0; }
}

/* ==========================================================================
   Request Status Badges (extracted from batch-status.php — #130d)
   ========================================================================== */

.request-status {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}
.request-succeeded { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.request-errored { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.request-expired { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.request-pending { background: #334155; color: #94a3b8; }
.request-canceled { background: #334155; color: #94a3b8; }

/* ==========================================================================
   Tab Buttons (extracted from regenerate/index.php — #130e)
   ========================================================================== */

.tab-btn { transition: all 0.2s; }
.tab-btn.active { background-color: rgb(51 65 85); color: white; }
.tab-btn:not(.active) { color: rgb(148 163 184); }
.tab-btn:not(.active):hover { color: white; background-color: rgb(71 85 105); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ==========================================================================
   Spinner Emerald Variant (extracted from regenerate/single.php — #130e)
   ========================================================================== */

.spinner-emerald { border-top-color: #10b981; }

/* ==========================================================================
   Progress Bar Emerald Running (extracted from regenerate/sequential.php — #130e)
   ========================================================================== */

.progress-bar.running-emerald {
    background: linear-gradient(90deg, #10b981 0%, #6ee7b7 50%, #10b981 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ==========================================================================
   Diff Viewer (extracted from regenerate/results.php — #130e)
   ========================================================================== */

.diff-line {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.diff-added {
    background: rgba(34, 197, 94, 0.15);
    border-left: 3px solid #22c55e;
}
.diff-removed {
    background: rgba(239, 68, 68, 0.15);
    border-left: 3px solid #ef4444;
}
.diff-unchanged {
    background: transparent;
    border-left: 3px solid transparent;
    color: #94a3b8;
}
.diff-context {
    background: rgba(148, 163, 184, 0.05);
}

/* ==========================================================================
   Item List (extracted from regenerate/results.php — #130e)
   ========================================================================== */

.item-list-item {
    display: block;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}
.item-list-item:hover {
    border-color: #3b82f6;
}
.item-list-item.active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

/* ==========================================================================
   Prompt Underline Tabs (extracted from prompts/edit.php + preview.php — #130f)
   ========================================================================== */

.prompt-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.prompt-tab:hover { color: white; }
.prompt-tab.active { color: white; border-bottom-color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.prompt-tab.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ==========================================================================
   Placeholder Highlight (extracted from prompts/preview.php + edit.php — #130f)
   ========================================================================== */

.placeholder-highlight {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}

/* ==========================================================================
   Preview Content (extracted from prompts/preview.php — #130f)
   ========================================================================== */

.preview-content {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ==========================================================================
   Expandable Rows (extracted from prompts/audit.php — #130f)
   ========================================================================== */

.details-row { display: none; }
.details-row.expanded { display: table-row; }
.expand-btn.expanded svg { transform: rotate(180deg); }

/* ==========================================================================
   CodeMirror Dark Theme (extracted from prompts/edit.php — #130f)
   ========================================================================== */

.CodeMirror {
    height: 100%;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 0.5rem;
}
.CodeMirror-gutters { background: #1e293b; border-right: 1px solid #334155; }
.CodeMirror-linenumber { color: #64748b; }
.CodeMirror-cursor { border-left: 2px solid #60a5fa; }
.CodeMirror-selected { background: #334155 !important; }
.CodeMirror-focused .CodeMirror-selected { background: #3b82f6 !important; opacity: 0.3; }
.cm-placeholder {
    color: #f59e0b !important;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 3px;
    padding: 0 2px;
}

/* ==========================================================================
   Google Sign-In Button (extracted from auth/login.php — #130f)
   ========================================================================== */

.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: #fff;
    color: #1f1f1f;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 10px 24px;
    font-family: 'Roboto', arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.25px;
    transition: background-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    min-width: 200px;
}
.google-btn:hover { background-color: #f7f8f8; box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); }
.google-btn:active { background-color: #f1f3f4; }
.google-btn svg { width: 18px; height: 18px; }
