/* ============================================
   EEI Calculator - Europump
   Styles CSS
   ============================================ */

/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;

    --bg-color: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #1e293b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition: all 0.2s ease;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.25rem;
    margin: 0;
}

.logo .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
}

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

.nav-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.lang-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.lang-code {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.lang-arrow {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: var(--transition);
}

.lang-btn.active .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.lang-option:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.lang-option:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.lang-option.active {
    background: var(--primary-color);
    color: white;
}

.lang-option span {
    font-size: 1.125rem;
}

/* Main */
.main {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Calculator Container */
.calculator-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Step Cards */
.step-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-color), var(--border-light));
    border-bottom: 1px solid var(--border-color);
}

.step-header.clickable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.step-header.clickable:hover {
    background: linear-gradient(135deg, var(--border-light), var(--bg-color));
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step-header h2 {
    flex: 1;
    font-size: 1.125rem;
    margin: 0;
}

.step-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-header .toggle-icon {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.help-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.help-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.step-content {
    padding: 1.5rem;
}

.step-description {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

/* Mode Selector */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.mode-option {
    cursor: pointer;
}

.mode-option input {
    display: none;
}

.mode-card {
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    height: 100%;
}

.mode-option input:checked + .mode-card {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.02));
}

.mode-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.mode-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--secondary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.mode-badge.recommended {
    background: var(--success-color);
}

.mode-option input:checked + .mode-card .mode-badge {
    background: var(--primary-color);
}

.mode-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.mode-card p {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.mode-profile {
    padding: 0.5rem;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    flex: 1;
    min-width: 220px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label sub {
    font-size: 0.7em;
}

.required {
    color: var(--danger-color);
}

.form-group input,
.form-group select {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    background: var(--bg-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-with-unit {
    display: flex;
    align-items: stretch;
}

.input-with-unit input {
    flex: 1;
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: none;
}

.input-with-unit .unit {
    padding: 0.625rem 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    min-width: 50px;
    justify-content: center;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

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

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: 26px;
    transition: var(--transition);
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.toggle-switch input:checked + .slider {
    background: var(--primary-color);
}

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

.toggle-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Subsection */
.subsection {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.subsection h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.subsection-desc {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--text-primary);
}

.toggle-icon {
    font-size: 0.75rem;
}

.collapsible {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.3s ease;
}

.collapsible.collapsed {
    max-height: 0;
}

.step-content.collapsible.collapsed {
    padding: 0;
}

/* Coefficient Section */
.coefficient-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.coefficient-section h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.coeff-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Action Section */
.action-section {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

/* Results */
.results-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 2px solid var(--success-color);
}

.results-card.hidden {
    display: none;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    color: var(--success-color);
    margin: 0;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

.results-main {
    padding: 2rem;
}

/* EEI Display */
.eei-display {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-color), var(--border-light));
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.eei-value-container {
    margin-bottom: 1.5rem;
}

.eei-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.eei-value {
    display: block;
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.eei-unit {
    display: block;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.eei-gauge {
    max-width: 400px;
    margin: 0 auto 2rem;
    height: 12px;
    /* Échelle 0.4-1.2: vert 0.4-0.75 (0-44%), orange 0.75-1.0 (44-75%), rouge >1.0 (75-100%) */
    background: linear-gradient(to right,
        #10b981 0%,
        #10b981 44%,
        #f59e0b 44%,
        #f59e0b 75%,
        #ef4444 75%,
        #ef4444 100%);
    border-radius: 6px;
    position: relative;
}

.gauge-fill {
    position: absolute;
    top: -4px;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
    transition: left 0.5s ease;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    position: absolute;
    bottom: -24px;
    left: 0;
    right: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.eei-interpretation {
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    display: inline-block;
}

.eei-interpretation.excellent,
.eei-interpretation.good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.eei-interpretation.moderate {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.eei-interpretation.poor {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Results Details */
.results-details {
    margin-bottom: 2rem;
}

.results-details h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.detail-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.detail-item .value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-item .unit {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Results Table */
.results-breakdown h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.results-table th,
.results-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-primary);
}

.results-table td {
    color: var(--text-secondary);
}

.results-table tbody tr:hover {
    background: var(--border-light);
}

/* Results Disclaimer */
.results-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.results-disclaimer svg {
    width: 20px;
    height: 20px;
    color: var(--warning-color);
    flex-shrink: 0;
}

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

/* Hidden class */
.hidden {
    display: none !important;
}

/* Documentation */
.documentation-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    align-items: start;
}

.doc-nav {
    position: sticky;
    top: 100px;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.doc-nav h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.doc-nav ul {
    list-style: none;
}

.doc-nav li {
    margin-bottom: 0.25rem;
}

.doc-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: var(--transition);
}

.doc-link:hover {
    background: var(--bg-color);
    color: var(--text-primary);
    text-decoration: none;
}

.doc-link.active {
    background: var(--primary-color);
    color: white;
}

.doc-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.doc-article {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.doc-article:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.doc-article h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.doc-article h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.doc-article p {
    margin-bottom: 1rem;
}

.doc-article ul,
.doc-article ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.doc-article li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Info Box */
.info-box {
    padding: 1rem 1.25rem;
    background: rgba(37, 99, 235, 0.05);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
}

.info-box.warning {
    background: rgba(245, 158, 11, 0.05);
    border-left-color: var(--warning-color);
}

.info-box h4 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.info-box.warning h4 {
    color: var(--warning-color);
}

.info-box p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* Postman Download Box */
.postman-download-box {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 108, 55, 0.08), rgba(255, 108, 55, 0.02));
    border: 1px solid rgba(255, 108, 55, 0.3);
    border-radius: var(--radius);
    margin: 1.5rem 0 2rem 0;
}

.postman-download-box h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #ff6c37;
    font-size: 1.1rem;
}

.postman-download-box > p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.postman-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.postman-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.postman-buttons .btn-icon {
    font-size: 1.1rem;
}

.postman-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0 !important;
    font-style: italic;
}

/* Steps List */
.steps-list {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}

.steps-list li {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.5rem;
}

.steps-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Doc Tables */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.doc-table th,
.doc-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.doc-table th {
    background: var(--bg-color);
    font-weight: 600;
}

.doc-table.small {
    font-size: 0.8125rem;
}

.doc-table.small th,
.doc-table.small td {
    padding: 0.5rem 0.75rem;
}

.mode-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

/* Profile Cards */
.profile-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.profile-card {
    padding: 1.25rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.profile-card h4 {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.profile-table {
    width: 100%;
    font-size: 0.8125rem;
}

.profile-table th,
.profile-table td {
    padding: 0.5rem;
    text-align: center;
}

.profile-table th {
    text-align: left;
    font-weight: 500;
}

/* Pump Types Grid */
.pump-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.pump-type-card {
    padding: 1.25rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.pump-type-card h4 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.pump-type-card p:first-of-type {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Formula Box */
.formula-box {
    padding: 1.25rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin: 1rem 0;
}

.formula-box h4 {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.formula-box .formula {
    font-family: 'Courier New', monospace;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.formula-box ul {
    margin-bottom: 0;
}

/* Standards List */
.standards-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.standard-item {
    padding: 1.25rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.standard-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.standard-item p {
    margin-bottom: 0.5rem;
}

.standard-item ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

/* API Documentation */
.api-endpoint {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.api-endpoint h4 {
    margin-bottom: 0.5rem;
}

.api-endpoint h4 code {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.api-endpoint > p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.api-endpoint details {
    margin-top: 0.75rem;
}

.api-endpoint summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.api-endpoint pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

.api-endpoint pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.api-endpoint ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.api-endpoint ul code {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

/* About */
.about-container {
    max-width: 800px;
    margin: 0 auto;
}

.about-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.about-card h2 {
    margin-bottom: 1rem;
}

.about-card h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.about-card p {
    margin-bottom: 1rem;
}

.warning-box {
    padding: 1.25rem;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    margin: 1rem 0;
}

.warning-box p {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.warning-box p:last-child {
    margin-bottom: 0;
}

.links-list {
    list-style: none;
    padding: 0;
}

.links-list li {
    margin-bottom: 0.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

.modal-header h2 {
    font-size: 1.125rem;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-color);
    border-radius: var(--radius);
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Interpolation Table */
.interpolation-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.interpolation-table th,
.interpolation-table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.interpolation-table th {
    background: var(--bg-color);
    font-weight: 600;
}

.interpolation-table input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
}

.interpolation-table input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Modal des résultats */
.modal-results {
    max-width: 900px;
    width: 95%;
}

.modal-results .modal-body {
    max-height: 70vh;
}

.modal-results .results-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-results .eei-display {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg-color) 0%, #e0e7ff 100%);
    border-radius: var(--radius-lg);
}

.modal-results .eei-value-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.modal-results .eei-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-results .eei-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.modal-results .eei-unit {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.modal-results .eei-gauge {
    position: relative;
    height: 12px;
    background: linear-gradient(to right, #10b981, #f59e0b, #ef4444);
    border-radius: 6px;
    margin: 1rem auto;
    max-width: 300px;
}

.modal-results .gauge-fill {
    position: absolute;
    top: -4px;
    width: 20px;
    height: 20px;
    background: var(--bg-card);
    border: 3px solid var(--text-primary);
    border-radius: 50%;
    transform: translateX(-50%);
    transition: left 0.5s ease;
}

.modal-results .gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.modal-results .eei-interpretation {
    margin-top: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
}

.modal-results .eei-interpretation.excellent {
    color: var(--success-color);
}

.modal-results .eei-interpretation.good {
    color: var(--warning-color);
}

.modal-results .eei-interpretation.poor {
    color: var(--danger-color);
}

.modal-results .results-details h3,
.modal-results .results-breakdown h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.modal-results .details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.modal-results .detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.modal-results .detail-item .label {
    color: var(--text-secondary);
}

.modal-results .detail-item .value {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-results .detail-item .unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.modal-results .results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.modal-results .results-table th,
.modal-results .results-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.modal-results .results-table th {
    background: var(--bg-color);
    font-weight: 600;
    font-size: 0.75rem;
}

.modal-results .results-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: #92400e;
    margin-top: 1rem;
}

.modal-results .results-disclaimer svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #f59e0b;
}

.modal-results .results-disclaimer p {
    margin: 0;
    color: inherit;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: var(--text-muted);
    padding: 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-content .disclaimer {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 1024px) {
    .documentation-container {
        grid-template-columns: 1fr;
    }

    .doc-nav {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .mode-selector {
        grid-template-columns: 1fr;
    }

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

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

    .results-header {
        flex-direction: column;
        gap: 1rem;
    }

    .results-actions {
        width: 100%;
        justify-content: center;
    }

    .eei-value {
        font-size: 3rem;
    }

    .doc-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 1rem;
    }

    .step-content {
        padding: 1rem;
    }

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

    .results-table {
        font-size: 0.75rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.5rem;
    }
}

/* Print styles */
@media print {
    .header,
    .nav,
    .action-section,
    .help-btn,
    .results-actions,
    .results-disclaimer,
    .footer,
    .login-overlay {
        display: none !important;
    }

    .results-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    body {
        background: white;
    }
}

/* ============================================
   Login & Authentication Styles
   ============================================ */

/* User section in header */
.user-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn svg {
    width: 18px;
    height: 18px;
    stroke: rgba(255, 255, 255, 0.8);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.8);
}

.logout-btn:hover svg {
    stroke: white;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Login Modal */
.login-modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.login-overlay.active .login-modal {
    transform: translateY(0);
}

/* Login Header */
.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    stroke: white;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-header p {
    opacity: 0.9;
    font-size: 0.875rem;
}

/* Login Form */
.login-form {
    padding: 2rem;
}

.login-error {
    background: #fef2f2;
    color: var(--danger-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
    border: 1px solid #fecaca;
}

.login-error.visible {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-field {
    margin-bottom: 1.25rem;
}

.login-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-field input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: var(--transition);
    background: var(--bg-color);
}

.login-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition);
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.login-submit:active {
    transform: translateY(0);
}

.login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Login Footer */
.login-footer {
    padding: 1rem 2rem;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-footer small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Responsive login */
@media (max-width: 480px) {
    .login-modal {
        margin: 0.5rem;
    }

    .login-header {
        padding: 1.5rem;
    }

    .login-form {
        padding: 1.5rem;
    }

    .user-section {
        display: none;
    }
}

/* ============================================
   Test Loader Bar
   ============================================ */
.test-loader-bar {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.test-loader-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.test-loader-content label {
    font-weight: 500;
    color: var(--primary-dark);
    white-space: nowrap;
}

.test-loader-content select {
    flex: 1;
    min-width: 250px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-light);
    border-radius: var(--radius);
    background: white;
    font-family: var(--font-family);
    font-size: 0.875rem;
    cursor: pointer;
}

.test-loader-content select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.test-expected-eei {
    font-weight: 600;
    color: var(--primary-dark);
    padding: 0.375rem 0.75rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--primary-light);
    font-size: 0.875rem;
}

.test-expected-eei:empty {
    display: none;
}

.template-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
}

.btn-outline,
.btn-small.btn-outline {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.btn-outline:hover,
.btn-small.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-outline svg {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .test-loader-content {
        flex-direction: column;
        align-items: stretch;
    }

    .test-loader-content select {
        min-width: 100%;
    }

    .template-buttons {
        margin-left: 0;
        justify-content: center;
    }
}

/* ============================================
   Database Section
   ============================================ */

.database-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.database-container h2 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Database Tabs */
.db-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.db-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.db-tab:hover {
    color: var(--primary-color);
}

.db-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Tab Content */
.db-tab-content {
    display: none;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

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

/* Database Filters */
.db-filters {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    font-family: var(--font-family);
    font-size: 0.875rem;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Database Table */
.db-table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.db-table th,
.db-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.db-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.db-table tbody tr:hover {
    background: var(--bg-color);
}

.db-table td {
    color: var(--text-secondary);
}

.db-source {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.db-note {
    font-style: italic;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

.coefficients-cell code {
    font-size: 0.7rem;
    word-break: break-all;
    display: block;
    max-width: 250px;
}

/* Mode Selector for Coefficients */
.mode-selector-db {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mode-btn-db {
    padding: 0.5rem 1.25rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.mode-btn-db:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.mode-btn-db.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Mode Coefficient Content */
#modeCoeffContent {
    display: grid;
    gap: 1.5rem;
}

.coeff-section {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.coeff-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.coeff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.coeff-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.coeff-item:last-child {
    border-bottom: none;
}

.coeff-key {
    font-weight: 500;
    color: var(--text-secondary);
}

.coeff-value {
    font-family: monospace;
    color: var(--primary-color);
}

/* Profile Display */
.profile-display {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.profile-point {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.profile-point .q-ratio {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.profile-point .time-pct {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* PDS Data Grid */
.pds-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.pds-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
}

.pds-card h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.pds-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.pds-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* PDS Selector */
.pds-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.pds-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.pds-selector select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    font-size: 0.9rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-small:hover {
    background: var(--primary-dark);
}

.pds-results {
    margin: 1rem 0;
}

.pds-hint {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

.pds-error {
    color: var(--danger-color);
    padding: 1rem;
    text-align: center;
}

.pds-data-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.pds-data-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.pds-losses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.pds-loss-item {
    text-align: center;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.pds-loss-item span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.pds-loss-item strong {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.pds-coefficients {
    margin-top: 1rem;
    font-size: 0.85rem;
}

.pds-coefficients summary {
    cursor: pointer;
    color: var(--text-secondary);
}

.pds-coefficients code {
    display: block;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f5f5f5;
    border-radius: var(--radius);
    font-size: 0.75rem;
    overflow-x: auto;
}

.vfd-losses-table table {
    width: 100%;
    border-collapse: collapse;
}

.vfd-losses-table th,
.vfd-losses-table td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.vfd-losses-table th {
    background: var(--bg-color);
    font-weight: 600;
}

/* Mode Description */
.mode-description {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    color: white;
    margin-bottom: 1.5rem;
}

.mode-description h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.mode-description p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .db-filters {
        flex-direction: column;
        gap: 1rem;
    }

    .db-tabs {
        flex-wrap: wrap;
    }

    .mode-selector-db {
        flex-wrap: wrap;
    }

    .profile-display {
        flex-direction: column;
    }
}

/* ============================================
   Validation Tests Section
   ============================================ */

.validation-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.validation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.validation-table th {
    background: var(--bg-dark);
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.validation-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.validation-table tbody tr:nth-child(even) {
    background: var(--bg-color);
}

.validation-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

.validation-table .mode-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.75rem;
}

.eei-expected,
.eei-achieved {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    white-space: nowrap;
}

.eei-expected {
    color: var(--text-primary);
}

.eei-achieved {
    color: var(--primary-color);
    font-weight: 600;
}

.deviation-ok {
    color: var(--success-color);
    font-weight: 600;
}

.deviation-warn {
    color: var(--warning-color);
    font-weight: 600;
}

.deviation-error {
    color: var(--danger-color);
    font-weight: 600;
}

/* Validation Actions */
.validation-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.validation-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.validation-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.validation-status.running {
    color: var(--info-color);
}

.validation-status.success {
    color: var(--success-color);
}

.validation-status.error {
    color: var(--danger-color);
}

.validation-table tbody tr.test-running {
    background: rgba(6, 182, 212, 0.1);
}

.validation-table tbody tr.test-passed {
    background: rgba(16, 185, 129, 0.1);
}

.validation-table tbody tr.test-failed {
    background: rgba(239, 68, 68, 0.1);
}

/* Test Coverage Grid */
.test-coverage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.coverage-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: var(--transition);
}

.coverage-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.coverage-card h4 {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.coverage-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.coverage-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.coverage-card li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
}

.coverage-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

@media (max-width: 768px) {
    .validation-table {
        font-size: 0.75rem;
    }

    .validation-table th,
    .validation-table td {
        padding: 0.5rem 0.6rem;
    }

    .test-coverage-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .test-coverage-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Debug Modal Styles
   ========================================== */
.modal-debug {
    max-width: 1000px;
    width: 95%;
}

.modal-debug.modal-large {
    max-width: 1200px;
}

.modal-debug .modal-body {
    max-height: 75vh;
    overflow-y: auto;
}

/* Debug Loading */
.debug-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.debug-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Debug Sections */
.debug-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.debug-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.debug-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.debug-section h3::before {
    content: "";
    width: 4px;
    height: 1em;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Debug Grid */
.debug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.debug-item {
    background: var(--bg-color);
    padding: 0.75rem;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.debug-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.debug-item .value {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    color: var(--text-color);
    word-break: break-all;
}

/* Debug Steps */
.debug-steps-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.debug-step {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1rem;
    border-left: 3px solid var(--primary-color);
}

.debug-step .step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.debug-step .step-number {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.debug-step .step-name {
    font-weight: 600;
    color: var(--text-color);
}

.debug-step .step-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.debug-step .step-formula {
    background: var(--bg-card);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.debug-step .step-formula code {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.debug-step .step-io {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.8rem;
}

.debug-step .step-inputs,
.debug-step .step-outputs {
    background: var(--bg-card);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.debug-step .step-inputs strong,
.debug-step .step-outputs strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.debug-step .step-inputs ul,
.debug-step .step-outputs ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.debug-step .step-inputs li,
.debug-step .step-outputs li {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    padding: 0.1rem 0;
}

.debug-step .step-inputs code,
.debug-step .step-outputs code {
    color: var(--primary-color);
}

/* Debug Table */
.debug-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.debug-table th,
.debug-table td {
    padding: 0.5rem 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.debug-table th {
    background: var(--bg-color);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.debug-table td {
    font-family: 'Fira Code', monospace;
}

.debug-table tbody tr:hover {
    background: var(--bg-color);
}

/* Debug Modal Footer */
.modal-debug .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Responsive Debug */
@media (max-width: 768px) {
    .debug-grid {
        grid-template-columns: 1fr 1fr;
    }

    .debug-step .step-io {
        grid-template-columns: 1fr;
    }

    .debug-table {
        font-size: 0.7rem;
    }

    .debug-table th,
    .debug-table td {
        padding: 0.4rem;
    }
}

@media (max-width: 480px) {
    .debug-grid {
        grid-template-columns: 1fr;
    }

    .modal-debug {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}
