/* ═══════════════════════════════════════════════
   ddcustomer4ch — ClickHouse-Styled Design System
   Black + Yellow (#FADB14) theme
   ═══════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
    --ch-yellow: #FADB14;
    --ch-yellow-hover: #FFE833;
    --ch-yellow-dim: #FADB1433;
    --ch-yellow-glow: #FADB1466;

    --bg-primary: #0A0A0A;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-card-hover: #1C1C1C;
    --bg-input: #1A1A1A;
    --bg-table-row-hover: #1A1A0F;

    --border-primary: #2A2A2A;
    --border-active: #FADB1455;

    --text-primary: #F0F0F0;
    --text-secondary: #999999;
    --text-dim: #666666;
    --text-on-yellow: #000000;

    --status-prospect: #666;
    --status-qualified: #FADB14;
    --status-contacted: #3B82F6;
    --status-opportunity: #10B981;
    --status-disqualified: #EF4444;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--ch-yellow-dim);

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

::selection {
    background: var(--ch-yellow);
    color: var(--text-on-yellow);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ─── Navigation ─── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    backdrop-filter: blur(12px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    display: flex;
    align-items: center;
    animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    from {
        filter: drop-shadow(0 0 4px var(--ch-yellow-dim));
    }

    to {
        filter: drop-shadow(0 0 12px var(--ch-yellow-glow));
    }
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.nav-title .highlight {
    color: var(--ch-yellow);
    font-weight: 800;
}

.nav-tabs {
    display: flex;
    gap: 4px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.nav-tab.active {
    color: var(--ch-yellow);
    background: var(--ch-yellow-dim);
    border-color: var(--border-active);
}

/* ─── Main Layout ─── */
.main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

.tab-content {
    display: none;
    animation: fadeIn 300ms ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* ─── Filters Bar ─── */
.filters-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.filters-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filters-row.second {
    margin-top: 12px;
    justify-content: space-between;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 0 12px;
    min-width: 220px;
    transition: border-color var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--ch-yellow);
    box-shadow: 0 0 0 2px var(--ch-yellow-dim);
}

.search-box svg {
    color: var(--text-dim);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 10px 0;
    outline: none;
}

.filter-select {
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.filter-select:focus {
    border-color: var(--ch-yellow);
    outline: none;
    box-shadow: 0 0 0 2px var(--ch-yellow-dim);
}

.filter-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.fit-range {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.fit-input {
    width: 70px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 8px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.8125rem;
    text-align: center;
}

.fit-input:focus {
    border-color: var(--ch-yellow);
    outline: none;
}

.fit-separator {
    color: var(--text-dim);
}

.filter-actions {
    display: flex;
    gap: 8px;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--ch-yellow);
    color: var(--text-on-yellow);
    border-color: var(--ch-yellow);
}

.btn-primary:hover {
    background: var(--ch-yellow-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-primary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--text-dim);
    background: var(--bg-card-hover);
}

.btn-danger {
    background: transparent;
    color: var(--status-disqualified);
    border-color: var(--status-disqualified);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ─── Stats Row ─── */
.stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ch-yellow);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Data Table ─── */
.table-container {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.data-table thead th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.6875rem;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}

.data-table thead th.sortable:hover {
    color: var(--ch-yellow);
}

.data-table thead th.sort-active {
    color: var(--ch-yellow);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-primary);
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-table-row-hover);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: 12px 14px;
    vertical-align: middle;
}

.company-name {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.company-name:hover {
    color: var(--ch-yellow);
}

.company-domain {
    font-size: 0.6875rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.fit-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 4px 10px;
    border-radius: var(--radius-xl);
    font-weight: 700;
    font-size: 0.75rem;
}

.fit-excellent {
    background: #13501C;
    color: #4ADE80;
}

.fit-good {
    background: #3A3A00;
    color: var(--ch-yellow);
}

.fit-average {
    background: #2A2000;
    color: #F59E0B;
}

.fit-below {
    background: #2A1500;
    color: #FB923C;
}

.fit-low {
    background: #2A0000;
    color: #EF4444;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-xl);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-prospect {
    background: #222;
    color: #999;
}

.status-qualified {
    background: var(--ch-yellow-dim);
    color: var(--ch-yellow);
}

.status-contacted {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}

.status-opportunity {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.status-disqualified {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.label-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    font-size: 0.625rem;
    font-weight: 600;
    margin: 1px 2px;
    border: 1px solid;
}

.action-btns {
    display: flex;
    gap: 4px;
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    color: var(--ch-yellow);
    border-color: var(--ch-yellow);
}

.action-btn.delete:hover {
    color: var(--status-disqualified);
    border-color: var(--status-disqualified);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-state p {
    margin-top: 12px;
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.page-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 8px 14px;
    font-family: var(--font);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    border-color: var(--ch-yellow);
    color: var(--ch-yellow);
}

.page-btn.active {
    background: var(--ch-yellow);
    color: var(--text-on-yellow);
    border-color: var(--ch-yellow);
    font-weight: 700;
}

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

/* ─── Bulk Action Bar ─── */
.bulk-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(250, 219, 20, 0.08), rgba(250, 219, 20, 0.04));
    border: 1px solid var(--border-active);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    animation: fadeIn 200ms ease;
}

.bulk-info {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ch-yellow);
    white-space: nowrap;
}

.bulk-info span {
    font-size: 1.1rem;
    font-weight: 800;
}

.bulk-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ─── Checkboxes ─── */
.col-check {
    width: 40px;
    text-align: center !important;
}

.row-check {
    accent-color: var(--ch-yellow);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#select-all {
    accent-color: var(--ch-yellow);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.data-table tbody tr.selected {
    background: rgba(250, 219, 20, 0.06);
    border-left: 2px solid var(--ch-yellow);
}

/* ─── Analytics ─── */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 16px;
}

.analytics-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color var(--transition-normal);
}

.analytics-card:hover {
    border-color: var(--border-active);
}

.analytics-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.overview-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.overview-stat {
    flex: 1;
    text-align: center;
}

.overview-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ch-yellow);
    line-height: 1;
}

.overview-label {
    font-size: 0.6875rem;
    color: var(--text-dim);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-container {
    min-height: 200px;
}

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.8125rem;
}

.chart-bar-label {
    flex: 0 0 140px;
    text-align: right;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ch-yellow), var(--ch-yellow-hover));
    border-radius: var(--radius-sm);
    transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
    min-width: 2px;
    display: flex;
    align-items: center;
    padding-left: 8px;
}

.chart-bar-value {
    flex: 0 0 50px;
    font-weight: 600;
    color: var(--ch-yellow);
    font-size: 0.75rem;
}

/* ─── Upload ─── */
.upload-area {
    border: 2px dashed var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    background: var(--bg-card);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--ch-yellow);
    background: var(--ch-yellow-dim);
    box-shadow: var(--shadow-glow);
}

.upload-icon {
    margin-bottom: 16px;
}

.upload-area h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.upload-desc {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 24px;
    font-family: monospace;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin: 20px 0 12px;
}

.progress-fill {
    height: 100%;
    background: var(--ch-yellow);
    border-radius: 3px;
    transition: width var(--transition-normal);
    width: 0%;
}

.upload-result {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
}

.add-company-section {
    margin-top: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.add-company-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--ch-yellow);
    outline: none;
    box-shadow: 0 0 0 2px var(--ch-yellow-dim);
}

.form-group.full {
    grid-column: 1 / -1;
}

.company-form .btn-primary {
    margin-top: 8px;
}

/* ─── Labels ─── */
.labels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.labels-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.label-form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.label-input {
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    min-width: 200px;
}

.label-input:focus {
    border-color: var(--ch-yellow);
    outline: none;
}

.label-color-picker {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.labels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.label-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color var(--transition-fast);
}

.label-card:hover {
    border-color: var(--border-active);
}

.label-card-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.label-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.label-card-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.label-card-count {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.label-card-actions {
    display: flex;
    gap: 4px;
}

/* ─── Modal ─── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 200ms ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 300ms ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

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

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-item .value {
    font-size: 0.9375rem;
    font-weight: 500;
}

.detail-item.full {
    grid-column: 1 / -1;
}

.detail-fit-reasons {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
}

.detail-fit-reasons h4 {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.fit-reason-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    padding: 3px 0;
}

.fit-reason-item::before {
    content: "▸";
    color: var(--ch-yellow);
}

.modal-labels {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
}

.modal-labels h4 {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.modal-label-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.modal-label-add {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}

.modal-label-add select {
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.8125rem;
}

/* ─── Toast ─── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--ch-yellow);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    font-size: 0.875rem;
    color: var(--text-primary);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    animation: slideInRight 300ms ease;
    max-width: 360px;
}

.toast.error {
    border-left-color: var(--status-disqualified);
}

.toast.success {
    border-left-color: #10B981;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        height: auto;
        padding: 12px;
        gap: 8px;
    }

    .nav-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }

    .filters-row {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .filter-select {
        min-width: 100%;
    }

    .stats-row {
        flex-direction: column;
    }

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

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

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

    .labels-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .label-form-inline {
        flex-wrap: wrap;
    }
}

/* ─── Loading shimmer ─── */
.shimmer {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ─── Enrichment Dashboard ─── */
.enrichment-controls-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.enrichment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.enrichment-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.enrichment-header-left h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.enrichment-subtitle {
    font-size: 0.8125rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.enrichment-config {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.enrichment-type-group {
    flex: 1;
    max-width: 320px;
}

.enrichment-type-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.enrichment-type-select {
    width: 100%;
    min-width: 240px;
}

/* Success Banner */
.enrichment-success-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.enrichment-success-banner.banner-animate {
    animation: successSlideIn 400ms ease;
}

@keyframes successSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

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

.success-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 50%;
}

.success-text h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #10B981;
    margin: 0 0 4px;
}

.success-text p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Progress Card */
.enrichment-progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.enrichment-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.enrichment-progress-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.enrichment-progress-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.enrichment-progress-mode {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--ch-yellow);
    background: var(--ch-yellow-dim);
    border: 1px solid var(--border-active);
    padding: 3px 10px;
    border-radius: var(--radius-xl);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enrichment-progress-stats {
    display: flex;
    align-items: center;
    gap: 14px;
}

.enrichment-pct {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ch-yellow);
}

.enrichment-counts {
    font-size: 0.8125rem;
    color: var(--text-dim);
}

.enrichment-progress-track {
    width: 100%;
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

.enrichment-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10B981, #34D399);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.enrichment-progress-fill.animated {
    background: linear-gradient(90deg, #10B981, #34D399, #10B981);
    background-size: 200% 100%;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 0%;
    }

    100% {
        background-position: 0% 0%;
    }
}

.enrichment-progress-detail {
    display: flex;
    gap: 24px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Results Card */
.enrichment-results-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.enrichment-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-primary);
}

.enrichment-results-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.enrichment-results-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ch-yellow);
}

.enrichment-results-table-wrap {
    max-height: 500px;
    overflow-y: auto;
}

/* Spin animation for loading button */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-icon {
    animation: spin 1s linear infinite;
}

/* ─── LinkedIn Stats Cards ─── */
.enrichment-linkedin-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.li-stat-card {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    text-align: center;
    transition: border-color var(--transition-normal);
}

.li-stat-card:hover {
    border-color: var(--border-active);
}

.li-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.li-stat-with .li-stat-value {
    color: #10B981;
}

.li-stat-without .li-stat-value {
    color: #F59E0B;
}

.li-stat-total .li-stat-value {
    color: var(--ch-yellow);
}

.li-stat-label {
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.enrichment-type-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 6px;
    font-style: italic;
}

/* Stop button */
.btn-danger {
    background: #EF4444;
    color: white;
    border: 1px solid #DC2626;
}

.btn-danger:hover {
    background: #DC2626;
}


/* ─── Chat Widget ─── */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    font-family: var(--font);
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ch-yellow), #f59e0b);
    border: none;
    color: var(--bg-body);
    box-shadow: 0 4px 14px rgba(250, 219, 20, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.chat-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(250, 219, 20, 0.6);
}

.chat-toggle-btn svg {
    width: 28px;
    height: 28px;
}

.chat-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    max-height: calc(100vh - 120px);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-panel.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.chat-header {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.chat-close-btn:hover {
    color: var(--status-disqualified);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Scrollbar for chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

.chat-message {
    max-width: 85%;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Markdown parsing inside chat */
.chat-message p {
    margin-bottom: 8px;
}

.chat-message p:last-child {
    margin-bottom: 0;
}

.chat-message pre {
    background: var(--bg-input);
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
}

.chat-message code {
    font-family: monospace;
    color: var(--ch-yellow);
}

.chat-message ul {
    margin-left: 20px;
    margin-bottom: 8px;
}

.chat-message table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.chat-message th,
.chat-message td {
    border: 1px solid var(--border-primary);
    padding: 4px 8px;
}

.chat-message.bot {
    align-self: flex-start;
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 16px 16px 16px 4px;
    border: 1px solid var(--border-primary);
}

.chat-message.user {
    align-self: flex-end;
    background: var(--ch-yellow-dim);
    color: var(--ch-yellow);
    padding: 12px 16px;
    border-radius: 16px 16px 4px 16px;
    border: 1px solid rgba(250, 219, 20, 0.2);
}

.chat-message.loading {
    align-self: flex-start;
    color: var(--text-dim);
    font-style: italic;
}

.chat-sql-debug {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-primary);
    font-family: monospace;
    word-break: break-all;
}

.chat-input-area {
    padding: 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-primary);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

#chat-input:focus {
    border-color: var(--ch-yellow);
}

#chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--ch-yellow);
    color: var(--bg-body);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

#chat-send-btn:hover {
    background: var(--ch-yellow-hover);
}

#chat-send-btn svg {
    width: 18px;
    height: 18px;
    margin-left: -2px;
}