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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #374151;
    line-height: 1.55;
    font-size: 13px;
    overflow-x: hidden;
    max-width: 100vw;
}

/* === Layout === */
.dashboard-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px 20px;
}

/* === Header === */
.dashboard-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    padding: 22px 28px 20px;
    margin-bottom: 16px;
    border-radius: 10px;
    color: white;
}

.dashboard-header h1 {
    font-size: 21px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    letter-spacing: -0.3px;
}

.dashboard-header .subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
}

/* Header stat cards */
.header-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 16px;
}

.stat-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s;
}

.stat-card:hover {
    background: rgba(255,255,255,0.18);
}

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1px;
    letter-spacing: -0.5px;
}

.stat-label {
    display: block;
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}


/* Chart header row with inline toggles */
.chart-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.chart-header-row h3 {
    margin-bottom: 0 !important;
}

.chart-toggles {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.chart-toggle {
    padding: 3px 10px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.chart-toggle:hover {
    border-color: #9ca3af;
    background: #e5e7eb;
}

.chart-toggle.active {
    background: #4b7baa;
    color: #ffffff;
    border-color: #4b7baa;
}

/* Plotly chart containers */
.plotly-container {
    width: 100%;
    min-height: 350px;
}

/* === Import Section === */
.import-section {
    background: #f8f9fb;
    padding: 12px 18px;
    margin-bottom: 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.import-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.import-header h2 {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.import-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-left: auto;
}

.import-body {
    margin-top: 12px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.import-body.collapsed {
    max-height: 0 !important;
    margin-top: 0;
    overflow: hidden;
}

.import-instructions {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.5;
}

.import-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.import-item {
    display: flex;
    flex-direction: column;
}

.import-item label {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.import-item input[type="file"] {
    font-size: 11px;
    color: #374151;
    padding: 6px 0;
}

.import-item input[type="file"]::file-selector-button {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    font-size: 11px;
    color: #374151;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s;
}

.import-item input[type="file"]::file-selector-button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

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

.import-progress {
    margin-bottom: 12px;
}

.import-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.import-progress-fill {
    height: 100%;
    background: #4b7baa;
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.import-progress-text {
    font-size: 11px;
    color: #9ca3af;
}

.import-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #b91c1c;
    line-height: 1.5;
}

/* === Management Overview === */
.management-overview {
    background: #ffffff;
    padding: 20px 22px;
    margin-bottom: 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.management-overview h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.overview-subtitle {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.overview-grid .chart-card {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    box-shadow: none;
    background: #fafbfc;
}

.overview-grid .chart-card h3 {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.overview-grid .chart-card canvas {
    width: 100% !important;
    max-height: 280px;
}

.overview-grid-wide {
    grid-template-columns: 1fr;
    margin-bottom: 16px;
}

.overview-grid-wide .chart-card canvas {
    max-height: 320px;
}


/* === Query Panel — compact, subdued === */
.query-panel {
    background: #f8f9fb;
    padding: 12px 18px;
    margin-bottom: 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.query-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.query-panel-header h2 {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.filter-count {
    font-size: 11px;
    color: #9ca3af;
    margin-left: auto;
}

.btn-toggle {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 3px 7px;
    cursor: pointer;
    font-size: 9px;
    color: #9ca3af;
    transition: all 0.2s;
}

.btn-toggle:hover {
    border-color: #9ca3af;
    color: #6b7280;
}

.btn-toggle.collapsed .toggle-icon {
    transform: rotate(-90deg);
    display: inline-block;
}

.filters-body {
    margin-top: 12px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filters-body.collapsed {
    max-height: 0 !important;
    margin-top: 0;
    overflow: hidden;
}

/* Filter grid — tight */
.filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.filters-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="number"] {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 12px;
    color: #374151;
    background: white;
    transition: border-color 0.2s;
}

.filter-group select:hover,
.filter-group input:hover {
    border-color: #9ca3af;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #6b8db5;
    box-shadow: 0 0 0 2px rgba(107,141,181,0.15);
}

/* Range inputs */
.range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.range-inputs input {
    flex: 1;
    min-width: 0;
}

.range-sep {
    color: #d1d5db;
    font-weight: 500;
    font-size: 11px;
}

/* Filter chips */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 0;
    margin-bottom: 8px;
}

.filter-chips:empty {
    margin-bottom: 0;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #e8eef4;
    color: #4b6a8a;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.filter-chip .chip-remove {
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    color: #6b8db5;
    font-weight: 700;
}

.filter-chip .chip-remove:hover {
    color: #c05c5c;
}

/* Filter actions */
.filter-actions {
    display: flex;
    gap: 6px;
}

/* === Buttons === */
.btn {
    padding: 6px 14px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #4b7baa;
    color: white;
}

.btn-primary:hover {
    background: #3d6590;
}

.btn-secondary {
    background: #e5e7eb;
    color: #6b7280;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-sm {
    padding: 3px 7px;
    font-size: 11px;
}

/* === Tabs === */
.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab:hover {
    color: #4b6a8a;
}

.tab.active {
    color: #1e3a5f;
    border-bottom-color: #4b7baa;
    font-weight: 600;
}

/* === Content Sections === */
.content-section {
    display: none;
    animation: fadeIn 0.2s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 14px;
    letter-spacing: -0.2px;
}

/* === Chart Grid === */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.chart-card {
    background: #ffffff;
    padding: 16px 18px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    min-width: 0;
    transition: box-shadow 0.2s ease;
}

.chart-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.chart-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

/* Section footnote (e.g., examiners meeting disclaimer) */
.section-footnote {
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
    margin: -8px 0 14px;
    line-height: 1.5;
    border-left: 2px solid #d4a843;
    padding-left: 10px;
}

/* Programme filter buttons inside chart cards */
.chart-prog-filter {
    margin-bottom: 8px;
}

.chart-prog-select {
    font-family: inherit;
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    min-width: 200px;
    outline: none;
    transition: border-color 0.15s;
}

.chart-prog-select:focus {
    border-color: #4b7baa;
    box-shadow: 0 0 0 2px rgba(75, 123, 170, 0.15);
}

.chart-card canvas {
    width: 100% !important;
    max-height: 300px;
}

.chart-full {
    grid-column: 1 / -1;
}

/* === Data Tables === */
.data-table-container {
    margin-bottom: 16px;
}

.data-table-container:empty {
    display: none;
}

.data-table-wrap {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow-x: auto;
}

.data-table-wrap h3 {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    padding: 12px 16px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    background: #f3f4f6;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table th:hover {
    background: #e8eaed;
}

.data-table th .sort-arrow {
    margin-left: 3px;
    font-size: 9px;
    color: #d1d5db;
}

.data-table th .sort-arrow.active {
    color: #4b7baa;
}

.data-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.data-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.data-table tbody tr:hover {
    background: #eef2f7;
}

/* === Insights === */
.insights-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.insights-container:empty {
    display: none;
}

.insights-heading {
    grid-column: 1 / -1;
    font-size: 14px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 4px 0 2px;
    letter-spacing: -0.2px;
}

.insight-item {
    background: #ffffff;
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 3px solid #d1d5db;
    border-top: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.insight-item.positive {
    border-left-color: #6aab8e;
}

.insight-item.warning {
    border-left-color: #d4a843;
}

.insight-item.critical {
    border-left-color: #c27c7c;
}

.insight-item h4 {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.insight-metric {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 2px 0 6px;
    line-height: 1.2;
}

.metric-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-detail {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

.insights-disclaimer {
    grid-column: 1 / -1;
    font-size: 11px;
    color: #6b7280;
    margin: -4px 0 6px;
    background: #f8f9fb;
    padding: 8px 12px;
    border-radius: 6px;
    line-height: 1.5;
}

/* === Footer === */
.dashboard-footer {
    text-align: center;
    padding: 14px;
    margin-top: 20px;
    color: #9ca3af;
    font-size: 11px;
}

/* === Loading === */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(240,242,245,0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #4b7baa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

.loading-text {
    font-size: 13px;
    color: #9ca3af;
}

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

/* === Notifications === */
.notification {
    position: fixed;
    top: 16px;
    right: 16px;
    background: #1e3a5f;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(30,58,95,0.25);
    z-index: 1000;
    font-size: 12px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(300px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === Predictive Analytics === */
.predictive-subheading {
    font-size: 14px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 18px 0 10px;
    letter-spacing: -0.2px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.predictive-subheading:first-of-type {
    margin-top: 0;
}

/* Confusion matrix cell tinting */
.cm-table td {
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.cm-label {
    font-weight: 600 !important;
    font-size: 12px !important;
    color: #6b7280 !important;
    text-align: left !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cm-tp {
    background: rgba(106,171,142,0.15);
    color: #2d6044;
}

.cm-tn {
    background: rgba(75,123,170,0.12);
    color: #2c5a8a;
}

.cm-fp {
    background: rgba(194,124,124,0.15);
    color: #8b3a3a;
}

.cm-fn {
    background: rgba(212,168,67,0.15);
    color: #7a5c10;
}

.cm-metrics {
    display: flex;
    gap: 16px;
    padding: 10px 16px;
    font-size: 12px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.cm-metrics strong {
    color: #1e3a5f;
}

/* === Responsive === */

/* iPad landscape / small laptops */
@media (max-width: 1024px) {
    .header-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .filters {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .import-status-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* iPad portrait / tablets */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 10px;
    }

    .dashboard-header {
        padding: 16px 18px;
    }

    .dashboard-header h1 {
        font-size: 17px;
    }

    .header-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 10px 12px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 9px;
    }

    .management-overview {
        padding: 14px 16px;
    }

    .management-overview h2 {
        font-size: 15px;
    }

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

    .filters-row-2 {
        grid-template-columns: 1fr;
    }

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

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

    .import-status-list {
        grid-template-columns: 1fr;
    }

    .import-upload-row {
        flex-direction: column;
        align-items: stretch;
    }

    .import-upload-row select {
        max-width: 100%;
    }

    /* Touch-friendly tabs — scrollable, larger tap targets */
    .tabs {
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: 10px 14px;
        font-size: 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Touch-friendly controls */
    .filter-group select,
    .filter-group input[type="text"],
    .filter-group input[type="number"] {
        padding: 10px 10px;
        font-size: 14px;
        min-height: 44px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 44px;
    }

    .data-table {
        font-size: 11px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
}

/* Phones */
@media (max-width: 480px) {
    .dashboard-container {
        padding: 8px;
    }

    .header-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .stat-value {
        font-size: 17px;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }

    .chart-card {
        padding: 12px;
    }

    .chart-card h3 {
        font-size: 12px;
    }

    .overview-grid .chart-card canvas {
        max-height: 260px;
    }

    .section-title {
        font-size: 15px;
    }

    .insights-container {
        grid-template-columns: 1fr;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .header-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-header h1 {
        font-size: 15px;
    }
}

/* === Print === */
@media print {
    .query-panel,
    .import-section,
    .tabs,
    .dashboard-footer,
    .loading-overlay,
    .notification,
    .filter-chips,
    .chart-toggles,
    #exportPDF,
    #exportData,
    .filter-actions,
    .assistant-container {
        display: none !important;
    }

    .content-section {
        display: block !important;
        page-break-before: always;
    }

    .content-section:first-of-type {
        page-break-before: auto;
    }

    .chart-card {
        page-break-inside: avoid;
        break-inside: avoid;
        border: 1px solid #e5e7eb;
    }

    .chart-grid {
        page-break-inside: avoid;
    }

    .data-table-wrap {
        border: 1px solid #e5e7eb;
        page-break-inside: avoid;
    }

    .dashboard-header {
        background: #1e3a5f;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .management-overview {
        page-break-before: always;
    }

    body {
        background: white;
    }

    .dashboard-container {
        max-width: 100%;
    }
}

/* === Management Overview Collapsible === */
.management-overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    gap: 10px;
}

.management-overview-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 16px;
}

.management-overview-body.collapsed {
    max-height: 0 !important;
    margin-top: 0;
    overflow: hidden;
}

/* === AI Assistant Disclaimer === */
.assistant-disclaimer {
    background: #fef9e7;
    border: 1px solid #f0e1a4;
    border-left: 4px solid #d4a843;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #6b5c16;
    line-height: 1.6;
}

/* === Insights Data Disclaimer === */
.insights-data-disclaimer {
    background: #f0f7f4;
    border: 1px solid #c8e6d8;
    border-left: 4px solid #6aab8e;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #2d6044;
    line-height: 1.5;
}

/* === Import Dropdown Redesign === */
.import-upload-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.import-upload-row select {
    flex: 1;
    max-width: 280px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 12px;
    color: #374151;
    background: white;
    font-family: inherit;
}

.import-upload-row input[type="file"] {
    font-size: 11px;
    color: #374151;
}

.import-upload-row input[type="file"]::file-selector-button {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    font-size: 11px;
    color: #374151;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s;
}

.import-upload-row input[type="file"]::file-selector-button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.import-status-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    list-style: none;
    margin-bottom: 12px;
}

.import-status-list li {
    font-size: 11px;
    color: #9ca3af;
    padding: 6px 10px;
    background: #f3f4f6;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 6px;
}

.import-status-list li.loaded {
    color: #2d6044;
    background: #f0f7f4;
    border-color: #c8e6d8;
}

.import-status-list li .status-icon {
    font-size: 12px;
}

.import-status-list li.loaded .status-icon {
    color: #6aab8e;
}

/* === AI Assistant === */
.assistant-container {
    max-width: 800px;
    margin: 0 auto;
}

.assistant-mode-selector {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.assistant-mode {
    padding: 6px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.assistant-mode:hover {
    border-color: #9ca3af;
    background: #e5e7eb;
}

.assistant-mode.active {
    background: #4b7baa;
    color: #ffffff;
    border-color: #4b7baa;
}

.assistant-config {
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.assistant-config label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
    margin-top: 8px;
}

.assistant-config label:first-child {
    margin-top: 0;
}

.assistant-config input,
.assistant-config select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 12px;
    color: #374151;
    background: white;
    font-family: inherit;
    transition: border-color 0.2s;
}

.assistant-config input:focus,
.assistant-config select:focus {
    outline: none;
    border-color: #4b7baa;
    box-shadow: 0 0 0 2px rgba(75, 123, 170, 0.15);
}

.chat-container {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.chat-messages {
    height: 360px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9fafb;
}

.chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-bubble.user {
    align-self: flex-end;
    background: #4b7baa;
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.chat-bubble.assistant {
    align-self: flex-start;
    background: #ffffff;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 3px;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.chat-input-row textarea {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    resize: none;
    color: #374151;
    transition: border-color 0.2s;
}

.chat-input-row textarea:focus {
    outline: none;
    border-color: #4b7baa;
    box-shadow: 0 0 0 2px rgba(75, 123, 170, 0.15);
}

.chat-input-row .btn {
    align-self: flex-end;
}
