/* ============================================
   TEXTURE CALCULATOR v4.0 - Design Futuriste
   ============================================ */

/* Variables couleurs texture */
.texture-calculator {
    --tex-gold: #d4af37;
    --tex-gold-soft: #e8d5a3;
    --tex-cyan: #00d4ff;
    --tex-emerald: #00c896;
    --tex-amber: #ff9f43;
    --tex-coral: #ff6b6b;
    --tex-bg-field: #13161d;
    --tex-border: rgba(255, 255, 255, 0.06);
    --tex-border-accent: rgba(212, 175, 55, 0.25);
    --tex-text-dim: #8a919e;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 16px;
    background: #0e1015;
    border-radius: 16px;
    border: 1px solid var(--tex-border);
    position: relative;
    font-family: 'Outfit', sans-serif;
}

.texture-calculator::before {
    content: '';
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tex-border-accent), transparent);
}

/* Champs pleine largeur */
.tex-usage,
.tex-placeholder,
.tex-results-container,
.tex-field-warning,
.tex-field-error,
.tex-field-required {
    grid-column: 1 / -1;
}

/* Champs du calculateur - style futuriste */
.tex-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--tex-bg-field);
    border-radius: 10px;
    padding: 10px 12px;
}

.tex-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555b69;
}

.tex-select {
    width: 100%;
    padding: 8px 10px;
    background: #08090c;
    border: 1px solid var(--tex-border);
    border-radius: 6px;
    color: #f0f0f0;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.tex-select:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.tex-select:focus {
    outline: none;
    border-color: var(--tex-gold);
}

.tex-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tex-input {
    flex: 1;
    padding: 8px 10px;
    background: #08090c;
    border: 1px solid var(--tex-border);
    border-radius: 6px;
    color: #f0f0f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-align: center;
}

.tex-input:focus {
    outline: none;
    border-color: var(--tex-gold);
}

.tex-unit {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: #555b69;
    min-width: 40px;
}

/* Checkbox */
.tex-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 0;
}

.tex-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #10B981;
}

.tex-checkbox-text {
    font-size: 11px;
    color: var(--rnd-text-secondary);
}

/* Hints */
.tex-hint {
    font-size: 9px;
    color: #555b69;
    font-style: italic;
    margin-top: 4px;
}

.tex-hint-required {
    color: var(--tex-amber);
}

/* Champs avec warning */
.tex-field-warning {
    padding: 10px 12px;
    background: rgba(255, 159, 67, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 159, 67, 0.25);
}

.tex-field-required {
    padding: 10px 12px;
    background: rgba(255, 107, 107, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 107, 0.25);
}

/* Placeholder */
.tex-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    background: var(--tex-bg-field);
    border-radius: 10px;
    border: 2px dashed var(--tex-border);
}

.tex-placeholder-icon {
    font-size: 24px;
    opacity: 0.5;
}

.tex-placeholder-text {
    font-size: 11px;
    color: #555b69;
}

/* Résultats container */
.tex-results-container {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--tex-border);
}

.tex-results-placeholder {
    text-align: center;
    font-size: 10px;
    color: #555b69;
    padding: 12px;
    background: var(--tex-bg-field);
    border-radius: 8px;
    border: 1px dashed var(--tex-border);
}

/* Indicateur ingrédients connectés - style futuriste */
.tex-ingredients-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    margin-bottom: 10px;
}

.tex-ingredients-status.connected {
    background: rgba(0, 200, 150, 0.06);
    border: 1px solid rgba(0, 200, 150, 0.15);
    color: var(--tex-emerald);
}

.tex-ingredients-status.disconnected {
    background: rgba(255, 159, 67, 0.06);
    border: 1px dashed rgba(255, 159, 67, 0.25);
    color: var(--tex-amber);
}

.tex-ingredients-status .status-icon {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tex-emerald);
    box-shadow: 0 0 8px var(--tex-emerald);
}

.tex-ingredients-status.disconnected .status-icon {
    background: var(--tex-amber);
    box-shadow: 0 0 8px var(--tex-amber);
}

.tex-ingredients-status .status-text {
    flex: 1;
}

.tex-ingredients-status .status-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(0, 200, 150, 0.12);
    border-radius: 10px;
    color: var(--tex-emerald);
}

.tex-ingredients-status.disconnected .status-hint {
    font-size: 9px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Indicateur valeur détectée depuis ingrédients */
.tex-detected-hint {
    font-size: 9px;
    color: var(--tex-emerald);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tex-field-detected .tex-input {
    border-color: rgba(0, 200, 150, 0.4);
    background: rgba(0, 200, 150, 0.05);
}

.tex-field-detected .tex-label::after {
    content: ' (auto)';
    font-size: 9px;
    color: var(--tex-emerald);
    opacity: 0.8;
}

/* v4.0: Champs en lecture seule (pH, Brix détectés) - style métrique */
.tex-field-readonly {
    background: var(--tex-bg-field);
    border-radius: 10px;
    padding: 10px 12px;
}

.tex-value-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.tex-value-number {
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    color: var(--tex-gold);
}

/* Brix = gold, pH = cyan */
.tex-brix .tex-value-number { color: var(--tex-gold); }
.tex-ph .tex-value-number { color: var(--tex-cyan); }

.tex-value-number.dim { color: #555b69; }

.tex-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Badges viscosité - style futuriste */
.tex-viscosity-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.tex-visc-low {
    background: rgba(255, 107, 107, 0.12);
    color: var(--tex-coral);
}

.tex-visc-normal {
    background: rgba(0, 200, 150, 0.12);
    color: var(--tex-emerald);
}

.tex-visc-high {
    background: rgba(255, 159, 67, 0.12);
    color: var(--tex-amber);
}

.tex-visc-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: #555b69;
}

/* Hint manquant */
.tex-hint-missing {
    color: var(--tex-amber) !important;
}

/* v4.0: Quantités absolues - style futuriste cyan */
.tex-absolute-quantities {
    margin-top: 10px;
    padding: 12px;
    background: rgba(0, 212, 255, 0.04);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: 10px;
}

.tex-absolute-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.tex-absolute-icon {
    font-size: 12px;
}

.tex-absolute-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--tex-cyan);
}

.tex-absolute-base {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: #f0f0f0;
}

.tex-absolute-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tex-absolute-item {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    font-size: 11px;
}

.tex-absolute-item strong,
.tex-absolute-val {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--tex-cyan);
}

.tex-abs-emoji {
    font-size: 10px;
}

.tex-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tex-results-empty {
    text-align: center;
    color: var(--rnd-text-muted);
    font-size: 10px;
    padding: 12px;
}

/* Status résultat (calcul) */
.tex-result-status {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.tex-result-status.deterministic {
    background: rgba(0, 200, 150, 0.12);
    color: var(--tex-emerald);
    border: 1px solid rgba(0, 200, 150, 0.25);
}

.tex-result-status.fallback {
    background: rgba(255, 159, 67, 0.12);
    color: var(--tex-amber);
    border: 1px solid rgba(255, 159, 67, 0.25);
}

.tex-result-status.blocked,
.tex-result-status.error {
    background: rgba(255, 107, 107, 0.12);
    color: var(--tex-coral);
    border: 1px solid rgba(255, 107, 107, 0.25);
}

/* Doses - style futuriste */
.tex-doses {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tex-dose {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--tex-bg-field);
    border-radius: 8px;
}

.tex-dose-icon {
    font-size: 12px;
}

.tex-dose-label {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
}

.tex-dose-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--tex-emerald);
}

.tex-dose-unit {
    font-size: 10px;
    color: #555b69;
    margin-left: 2px;
}

.tex-dose-alt {
    grid-column: span 2;
    text-align: center;
    font-size: 9px;
    color: #555b69;
    font-style: italic;
    padding: 4px;
}

/* Phase aqueuse */
.tex-aqueous {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(0, 212, 255, 0.06);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.tex-aqueous-high {
    background: rgba(255, 159, 67, 0.08);
    border-color: rgba(255, 159, 67, 0.25);
}

.tex-aqueous-label {
    font-size: 10px;
    color: var(--tex-text-dim);
}

.tex-aqueous-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--tex-cyan);
}

.tex-aqueous-high .tex-aqueous-value {
    color: var(--tex-amber);
}

.tex-aqueous-warning {
    font-size: 10px;
    color: var(--tex-amber);
}

/* Température service */
.tex-service-temp {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: var(--tex-bg-field);
    border-radius: 6px;
}

.tex-temp-icon {
    font-size: 14px;
}

.tex-temp-value {
    font-size: 11px;
    color: var(--tex-text-dim);
}

/* Warnings - style futuriste */
.tex-warnings {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tex-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.4;
}

.tex-warning-error {
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.25);
    color: var(--tex-coral);
}

.tex-warning-warning {
    background: rgba(255, 159, 67, 0.08);
    border: 1px solid rgba(255, 159, 67, 0.25);
    color: var(--tex-amber);
}

.tex-warning-info {
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.15);
    color: var(--tex-cyan);
}

.tex-warning-icon {
    flex-shrink: 0;
}

.tex-warning-text {
    flex: 1;
}

/* v3.4: Infos no_cream */
.tex-foamability-info,
.tex-texture-target-info,
.tex-total-dose {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--tex-bg-field);
    border-radius: 6px;
    font-size: 11px;
    color: var(--tex-text-dim);
}

.tex-foamability-icon,
.tex-texture-icon,
.tex-total-icon {
    font-size: 14px;
}

.tex-total-base {
    font-size: 9px;
    color: #555b69;
    margin-left: auto;
}

/* Coefficients */
.tex-coefficients-info {
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.tex-coefficients-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: #555b69;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.tex-coefficients-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.tex-coef {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #8B5CF6;
    background: rgba(139, 92, 246, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

.tex-coef-total {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #8B5CF6;
}

/* Process */
.tex-process {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0, 200, 150, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(0, 200, 150, 0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.tex-process:hover {
    background: rgba(0, 200, 150, 0.15);
    border-color: rgba(0, 200, 150, 0.35);
}

.tex-process-icon {
    font-size: 14px;
}

.tex-process-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--tex-emerald);
}

/* Erreur */
.tex-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.25);
    border-radius: 10px;
    text-align: center;
}

.tex-error-icon {
    font-size: 24px;
}

.tex-error-message {
    font-size: 12px;
    font-weight: 600;
    color: var(--tex-coral);
}

.tex-error-detail,
.tex-error-alternatives {
    font-size: 10px;
    color: #555b69;
}

/* ============================================
   TEXTURE v4.1 - Styles additionnels futuristes
   ============================================ */

/* Status bar redesignée */
.tex-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 200, 150, 0.06);
    border: 1px solid rgba(0, 200, 150, 0.15);
    border-radius: 8px;
    margin-bottom: 14px;
}

.tex-status-dot {
    width: 6px;
    height: 6px;
    background: var(--tex-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--tex-emerald);
}

.tex-status-text {
    flex: 1;
    font-size: 11px;
    color: var(--tex-emerald);
}

.tex-status-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(0, 200, 150, 0.12);
    border-radius: 10px;
    color: var(--tex-emerald);
}

/* Flag alertes - minimal futuriste */
.tex-alerts-flag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-left: auto;
}

.tex-alerts-flag:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.tex-alerts-indicator {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--tex-text-dim);
}

.tex-alerts-flag.active .tex-alerts-indicator {
    background: var(--tex-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.tex-alerts-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--tex-text-dim);
    letter-spacing: 0.05em;
}

.tex-alerts-label {
    font-size: 9px;
    color: var(--tex-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Dropdown alertes */
.tex-alerts-dropdown {
    display: none;
    flex-direction: column;
    gap: 1px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    animation: texSlideDown 0.2s ease;
}

.tex-alerts-dropdown.open {
    display: flex;
}

@keyframes texSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.tex-alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 11px;
    background: transparent;
    transition: background 0.2s ease;
}

.tex-alert-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tex-alert-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--tex-gold);
    opacity: 0.7;
}

.tex-alert-item .tex-alert-text {
    color: var(--tex-text-dim);
}

.tex-alert-item .tex-alert-text strong {
    color: #f0f0f0;
    font-weight: 500;
    margin-right: 6px;
}

/* v4.3: Niveaux d'alertes - Flag colors */
.tex-alerts-flag.tex-alerts-error .tex-alerts-indicator {
    background: var(--tex-coral);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

.tex-alerts-flag.tex-alerts-warning .tex-alerts-indicator {
    background: var(--tex-amber);
    box-shadow: 0 0 8px rgba(255, 159, 67, 0.5);
}

.tex-alerts-flag.tex-alerts-info .tex-alerts-indicator {
    background: var(--tex-cyan);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* v4.3: Niveaux d'alertes - Items */
.tex-alert-item.tex-alert-error {
    background: rgba(255, 107, 107, 0.08);
    border-left: 2px solid var(--tex-coral);
}

.tex-alert-item.tex-alert-warning {
    background: rgba(255, 159, 67, 0.08);
    border-left: 2px solid var(--tex-amber);
}

.tex-alert-item.tex-alert-info {
    background: rgba(0, 212, 255, 0.06);
    border-left: 2px solid var(--tex-cyan);
}

.tex-alert-icon {
    font-size: 12px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Section label */
.tex-section {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--tex-text-dim);
    margin: 14px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--tex-border);
}

/* Grid metrics */
.tex-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tex-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Metric field */
.tex-metric {
    background: var(--tex-bg-field);
    border-radius: 10px;
    padding: 10px 12px;
}

.tex-metric-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tex-text-dim);
    margin-bottom: 6px;
}

.tex-metric-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.tex-metric-value {
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
}

.tex-metric-value.gold { color: var(--tex-gold); }
.tex-metric-value.cyan { color: var(--tex-cyan); }
.tex-metric-value.dim { color: var(--tex-text-dim); }

.tex-metric-unit {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--tex-text-dim);
}

.tex-metric-hint {
    font-size: 9px;
    color: var(--tex-emerald);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tex-metric-hint.warning { color: var(--tex-amber); }

/* Viscosity row */
.tex-visc-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tex-visc-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.tex-visc-badge.low {
    background: rgba(255, 107, 107, 0.12);
    color: var(--tex-coral);
}

.tex-visc-badge.normal {
    background: rgba(0, 200, 150, 0.12);
    color: var(--tex-emerald);
}

.tex-visc-badge.high {
    background: rgba(255, 159, 67, 0.12);
    color: var(--tex-amber);
}

.tex-visc-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--tex-text-dim);
}

/* Usage field */
.tex-usage-field {
    margin-bottom: 10px;
}

/* Mode field */
.tex-mode-field {
    margin-top: 10px;
}

.tex-mode-hint {
    font-size: 9px;
    color: var(--tex-text-dim);
    font-style: italic;
    margin-top: 4px;
}

/* Texture field */
.tex-texture-field {
    grid-column: span 2;
}

.tex-texture-desc {
    font-size: 9px;
    color: var(--tex-text-dim);
    font-style: italic;
    margin-top: 4px;
}

/* Absolute quantities redesign */
.tex-absolute {
    margin-top: 10px;
    padding: 12px;
    background: rgba(0, 212, 255, 0.04);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: 10px;
}

.tex-absolute-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.tex-absolute-icon {
    font-size: 12px;
}

.tex-absolute-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--tex-cyan);
}

.tex-absolute-base {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: #f0f0f0;
}

.tex-absolute-list {
    display: flex;
    gap: 8px;
}

.tex-absolute-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    font-size: 11px;
}

.tex-absolute-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.tex-absolute-dot.green { background: var(--tex-emerald); }
.tex-absolute-dot.orange { background: var(--tex-amber); }

.tex-absolute-val {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--tex-cyan);
}

/* Alertes standalone */
.tex-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.tex-alert-icon {
    flex-shrink: 0;
    font-size: 12px;
}

.tex-alert-text {
    flex: 1;
}

.tex-alert-text strong {
    font-weight: 600;
}

.tex-alert.critical {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.tex-alert.warning {
    background: rgba(255, 159, 67, 0.08);
    border: 1px solid rgba(255, 159, 67, 0.25);
    color: var(--tex-amber);
}

.tex-alert.info {
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.15);
    color: var(--tex-cyan);
}

/* Alerte inline sous champ */
.tex-field-alert {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 4px;
}

.tex-field-alert.critical {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.tex-field-alert.warning {
    background: rgba(255, 159, 67, 0.1);
    color: var(--tex-amber);
}

/* Dosage avec alerte */
.tex-dose.has-alert {
    border: 1px solid rgba(255, 159, 67, 0.3);
}

.tex-dose-alert {
    font-size: 9px;
    color: var(--tex-amber);
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   SORBET PACOJET v2.0 - FORMULAIRE INGRÉDIENTS
   ============================================ */

/* Grid 2 colonnes: connectés | manuels */
.tex-ingredients-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 8px 0;
}

/* Colonne gauche: bouton + section connectés */
.tex-ingredients-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tex-ingredients-column .tex-toggle-btn {
    width: 100%;
}

/* Section ingrédients */
.tex-ingredients-section {
    background: rgba(201, 169, 98, 0.05);
    border: 1px solid rgba(201, 169, 98, 0.2);
    border-radius: 8px;
    padding: 10px;
    margin: 0;
    flex: 1;
}

.tex-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tex-section-header .tex-label {
    margin: 0;
    font-weight: 600;
}

.tex-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.tex-btn-add-ingredient {
    background: var(--rnd-accent);
    color: #000;
}

.tex-btn-add-ingredient:hover {
    background: var(--rnd-accent-hover);
}

.tex-ingredients-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tex-ingredients-empty {
    text-align: center;
    padding: 20px;
    color: var(--rnd-text-muted);
    font-size: 12px;
    font-style: italic;
}

/* Carte ingrédient */
.tex-ingredient {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
}

.tex-ingredient-invalid {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.05);
}

.tex-ingredient-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.tex-ingredient-name {
    flex: 1;
    font-weight: 500;
}

.tex-btn-remove {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

.tex-btn-remove:hover {
    background: rgba(239, 68, 68, 0.4);
}

.tex-ingredient-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.tex-ing-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tex-ing-field label {
    font-size: 9px;
    color: var(--rnd-text-muted);
    text-transform: uppercase;
}

.tex-ing-field .tex-input {
    padding: 4px 6px;
    font-size: 12px;
    text-align: center;
}

.tex-ingredient-error {
    margin-top: 6px;
    padding: 4px 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
    font-size: 10px;
    color: #EF4444;
}

/* Presets */
.tex-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tex-presets-label {
    font-size: 10px;
    color: var(--rnd-text-muted);
    margin-right: 4px;
}

.tex-btn-preset {
    background: rgba(255, 255, 255, 0.05);
    color: var(--rnd-text-secondary);
    font-size: 10px;
    padding: 3px 8px;
}

.tex-btn-preset:hover {
    background: rgba(201, 169, 98, 0.2);
    color: var(--rnd-accent);
}

/* Summary des totaux */
.tex-totals-summary {
    margin: 8px 0;
}

.tex-totals-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--rnd-accent);
    margin-bottom: 8px;
}

.tex-totals-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.tex-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.tex-total-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--rnd-text);
}

.tex-total-label {
    font-size: 9px;
    color: var(--rnd-text-muted);
    text-transform: uppercase;
}

.tex-regime-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.tex-regime-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.tex-regime-lean {
    background: rgba(56, 189, 248, 0.2);
    color: #38BDF8;
}

.tex-regime-creamy {
    background: rgba(251, 191, 36, 0.2);
    color: #FBBF24;
}

.tex-regime-target {
    font-size: 10px;
    color: var(--rnd-text-muted);
}

/* Résultats Sorbet v2 */
.tex-sorbet-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.tex-style-badge,
.tex-texture-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    color: var(--rnd-text-secondary);
}

.tex-sorbet-totals {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.tex-sorbet-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.tex-sorbet-total .tex-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--rnd-text);
}

.tex-sorbet-total .tex-lbl {
    font-size: 9px;
    color: var(--rnd-text-muted);
    text-transform: uppercase;
}

.tex-sorbet-total.tex-in-target {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tex-sorbet-total.tex-in-target .tex-val {
    color: #10B981;
}

.tex-sorbet-total.tex-out-target {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tex-sorbet-total.tex-out-target .tex-val {
    color: #F59E0B;
}

.tex-sorbet-target {
    text-align: center;
    font-size: 10px;
    color: var(--rnd-text-muted);
    margin-bottom: 10px;
}

.tex-adjusted {
    margin-left: 8px;
    color: #8B5CF6;
}

.tex-sorbet-doses {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 6px;
}

.tex-doses-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--rnd-accent);
    margin-bottom: 8px;
}

/* ========== MODE HYBRIDE - TOGGLE MANUEL/CONNEXION ========== */
.tex-ingredient-mode {
    margin-bottom: 16px;
}

.tex-toggle-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.tex-toggle-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tex-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.8);
}

.tex-toggle-btn.active {
    background: linear-gradient(135deg, #00c7be 0%, #0095a8 100%);
    border-color: #00c7be;
    color: white;
    box-shadow: 0 0 12px rgba(0, 199, 190, 0.3);
}

/* Mode connexion - Ingrédients connectés */
.tex-connected-count {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(0, 199, 190, 0.2);
    color: #00c7be;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.tex-ingredient-connected {
    border-left: 3px solid #00c7be;
}

.tex-ingredient-auto {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0, 199, 190, 0.15);
    color: #00c7be;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tex-ing-field-readonly {
    opacity: 0.7;
}

.tex-ing-field-readonly .tex-value {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.tex-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.tex-empty-text {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.tex-empty-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* Responsive texture calculator */
@media (max-width: 768px) {
    .texture-calculator {
        padding: 10px;
        gap: 8px;
    }

    .tex-doses {
        grid-template-columns: 1fr;
    }

    .tex-dose-alt {
        grid-column: span 1;
    }

    .process-notes-meta {
        grid-template-columns: 1fr;
    }

    .tex-ingredient-fields {
        grid-template-columns: repeat(2, 1fr);
    }

    .tex-totals-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tex-sorbet-totals {
        grid-template-columns: repeat(2, 1fr);
    }
}
