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

:root {
    /* Faclim Brand Colors - Industriel / Acier */
    --primary: #1e3a5f;          /* Bleu marine industriel */
    --primary-dark: #0f2744;      /* Bleu marine foncé */
    --primary-light: #2d5a8a;     /* Bleu marine clair */
    --secondary: #e65100;         /* Orange Faclim - énergie */
    --secondary-light: #ff6b35;   /* Orange clair */
    --accent: #ff8f00;            /* Orange accent */
    --success: #2e7d32;           /* Vert industriel */
    --danger: #c62828;            /* Rouge industriel */
    --warning: #f9a825;           /* Jaune sécurité */
    --bg: #f5f5f5;                /* Gris clair background */
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #5f6368;
    --border: #dadce0;
    --steel: #78909c;             /* Gris acier */
    --shadow: 0 2px 8px rgb(0 0 0 / 0.12);
    --shadow-lg: 0 8px 24px rgb(0 0 0 / 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header - Faclim Style */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 16px 0;
    box-shadow: var(--shadow-lg);
    border-bottom: 3px solid var(--secondary);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
}

.header-guide-link {
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    margin-left: 1rem;
}

.header-guide-link:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Language Selector */
.lang-selector {
    display: flex;
    gap: 4px;
    margin-left: 1rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px var(--secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.logout-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.status-indicator {
    font-size: 12px;
    animation: pulse 2s ease-in-out infinite;
}

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

.status-indicator.offline {
    color: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main */
.main {
    padding: 30px 0;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.action-bar-left {
    flex: 1;
    max-width: 400px;
}

.action-bar-right {
    display: flex;
    gap: 12px;
}

.reference-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.reference-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.reference-input::placeholder {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-bar-left {
        max-width: none;
    }
    
    .action-bar-right {
        justify-content: flex-end;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 8px;
}

.stat-content h3 {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    align-items: start; /* Colonnes indépendantes en hauteur */
}


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

/* Panel */
.panel {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.panel-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.panel-body {
    padding: 12px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-secondary:hover {
    background: var(--surface);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

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

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

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

.btn-secondary:hover {
    background: #4b5563;
}

.btn-edit-mode {
    background: #f59e0b;
    color: white;
}

.btn-edit-mode:hover {
    background: #d97706;
}

#cancel-edit-btn {
    margin-left: 8px;
}

/* Items List - S'agrandit avec le contenu */
.items-list {
    padding: 16px;
}

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

.item-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

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

.item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: nowrap;
}

.item-separator {
    color: var(--text-secondary);
    font-weight: 300;
}

.item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.item-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary);
    color: white;
}

.item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.item-detail {
    font-size: 13px;
}

.item-detail-label {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

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

.item-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--surface);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

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

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast-icon {
    font-size: 24px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Dimensions display */
.dimension-item {
    display: inline-block;
    font-size: 0.9em;
    color: var(--text);
}

.dimension-item strong {
    color: var(--primary);
}

/* Item illustration */
.item-illustration {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 8px;
    text-align: center;
}

.item-illustration img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    display: block;
    margin: 0 auto;
}

/* Dimensions grid */
.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dimension-label {
    font-weight: bold;
    color: var(--primary);
    margin-right: 0.25rem;
}

.dimension-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.25rem;
}

.text-secondary {
    color: var(--text-secondary);
    font-style: italic;
}

/* Quote Panel */
.quote-panel {
    margin-top: 2rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 2px solid var(--success);
}

.quote-panel .panel-header {
    background: var(--success);
    color: white;
}

.quote-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-size: 1.25rem;
    color: var(--success);
    border-top: 2px solid var(--success);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.form-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--success);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-success:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    width: 100%;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-small {
    max-width: 400px;
}

.modal-description {
    margin-bottom: 1rem;
    color: var(--text);
}

.reference-input-large {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

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

.text-small {
    font-size: 0.875rem;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
    text-align: center;
}

.modal-header h3 {
    font-size: 1.5rem;
}

.modal-body {
    padding: 2rem;
}

.quote-success {
    text-align: center;
}

.quote-number {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.quote-number span {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
}

.quote-number strong {
    display: block;
    font-size: 2rem;
    margin-top: 0.5rem;
}

.quote-details {
    text-align: left;
}

.quote-details p {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.quote-details p:last-child {
    border-bottom: none;
    margin-top: 1rem;
    padding: 1rem;
    background: #f0fdf4;
    border-radius: 8px;
}

.email-sent {
    color: var(--success);
}

.email-not-sent {
    color: var(--text-secondary);
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    text-align: center;
}

.modal-footer .btn {
    min-width: 150px;
}

/* Action Bar Vertical Layout */
.action-bar-vertical {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.action-row:first-child {
    padding-top: 0;
}

.action-row:last-child {
    padding-bottom: 0;
}

.action-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    min-width: 160px;
}

.action-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Quotes Selector */
.quotes-select {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 300px;
}

.quotes-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.quotes-select:disabled {
    background: var(--bg);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.quotes-select option:disabled {
    color: var(--text-secondary);
    font-style: italic;
}

.quotes-select option.has-json {
    color: var(--text);
    font-weight: 500;
}

.quotes-select option.no-json {
    color: var(--text-secondary);
}

#load-quote-btn {
    width: auto;
    white-space: nowrap;
}

#load-quote-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Loading state for quotes selector */
.quotes-select.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10' stroke-dasharray='30' stroke-dashoffset='10'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

/* Notes textarea */
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    max-height: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
}

.form-textarea::placeholder {
    color: var(--text-secondary);
}

/* Item notes display */
.item-notes {
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
}

.item-notes-label {
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.item-notes-value {
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Quantity input */
.form-group-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-group-inline label {
    margin-bottom: 0;
    white-space: nowrap;
}

/* Dimension rows - compact */
.dim-row {
    margin-bottom: 6px;
    gap: 8px;
}

.dim-row label {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.dim-row input {
    width: 100px;
    text-align: right;
    font-weight: 600;
}

/* Offset Selector - Boutons de positionnement rapide */
.offset-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Layout vertical : input au-dessus, boutons en dessous */
.offset-selector-vertical {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.offset-buttons {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: 6px;
    padding: 2px;
    justify-content: center;
}

.offset-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.offset-btn:hover {
    background: var(--border);
    color: var(--text);
}

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

.offset-input {
    width: 80px;
    text-align: right;
    font-weight: 600;
}

/* Input plus large pour les offsets */
.offset-input-wide {
    width: 100%;
    min-width: 100px;
    text-align: center;
}

.offset-input.hidden {
    display: none;
}

.offset-selector-row .offset-selector {
    margin-left: auto;
    min-width: 120px;
}

.quantity-input {
    width: 80px;
    text-align: center;
    font-weight: 600;
}

#item-notes {
    flex: 1;
    text-align: left;
}

/* Item quantity badge */
.item-quantity-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
}

/* ===================== */
/* OCR Upload Zone       */
/* ===================== */
.ocr-panel {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border: 2px dashed var(--accent);
}

.ocr-upload-zone {
    border: 2px dashed var(--steel);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.ocr-upload-zone:hover,
.ocr-upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(30, 58, 95, 0.05);
}

.ocr-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ocr-icon {
    font-size: 3rem;
}

.ocr-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--primary-light);
    color: white;
    border-radius: 8px;
    margin-top: 1rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* OCR Results Modal */
.modal-large {
    max-width: 900px;
    width: 95%;
}

.ocr-results-table-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

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

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

.ocr-results-table th {
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
    font-weight: 600;
}

.ocr-results-table th:first-child {
    width: 40px;
    text-align: center;
}

.ocr-results-table td:first-child {
    text-align: center;
}

.ocr-results-table tr:hover {
    background: rgba(30, 58, 95, 0.05);
}

.ocr-results-table tr.uncertain {
    background: rgba(255, 143, 0, 0.1);
}

.ocr-item-name {
    font-weight: 600;
    color: var(--primary);
}

.ocr-dimensions {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ocr-quantity {
    font-weight: 700;
    color: var(--secondary);
}

.ocr-notes {
    font-size: 0.8rem;
    color: var(--steel);
    max-width: 200px;
}

.ocr-parsing-notes {
    background: var(--bg);
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Note des items non inclus */
.ocr-failed-note {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid var(--warning);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.ocr-failed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.ocr-failed-header .btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.ocr-failed-list {
    background: white;
    border-radius: 4px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    font-family: monospace;
    font-size: 0.85rem;
    max-height: 150px;
    overflow-y: auto;
}

.ocr-failed-list div {
    padding: 2px 0;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.toolbar .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Collapsible Sections */
.collapsible-section {
    margin-bottom: 1rem;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-close-section {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close-section:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--danger);
}

/* Panel header with actions */
.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* OCR Disclaimer */
.ocr-disclaimer {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid var(--warning);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #5d4037;
}

/* Odoo Panel */
.odoo-panel .panel-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.odoo-panel .action-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.odoo-panel .action-separator {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* Editing quote info banner */
.editing-quote-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid var(--secondary);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.editing-badge {
    color: var(--secondary);
    font-size: 0.9rem;
}

.editing-badge strong {
    color: var(--primary);
}

/* Delivery checkbox */
.delivery-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.delivery-checkbox:hover {
    background: #e9ecef;
    border-color: var(--primary);
}

.delivery-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.delivery-checkbox input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 500;
}

.modal-delivery-option {
    margin-top: 1rem;
    justify-content: center;
}

/* Accessories Section (gauge & connectors) */
.accessories-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.accessories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.accessories-header h4 {
    margin: 0;
    color: var(--primary);
    font-size: 0.95rem;
}

.mez-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.mez-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

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

.accessory-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.accessory-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.accessory-select {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    background: white;
    padding: 0.25rem 0.35rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
}

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

.accessory-select.mismatch {
    border-color: var(--danger);
    background-color: #fff5f5;
    color: var(--danger);
}

.accessories-warning {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fff5f5;
    border: 1px solid var(--danger);
    border-radius: 4px;
    color: var(--danger);
    font-size: 0.85rem;
}

/* 3D Viewer Container */
.item-3d-container {
    width: 100%;
    height: 300px;
    background: #1a1a1a;
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
}

.item-3d-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Responsive */
@media (max-width: 900px) {
    .toolbar {
        flex-wrap: wrap;
    }
    
    .action-row {
        flex-wrap: wrap;
    }
    
    .action-label {
        width: 100%;
        min-width: auto;
        margin-bottom: 4px;
    }
    
    .quotes-select {
        min-width: auto;
        flex: 1;
    }
    
    .reference-input {
        flex: 1;
        min-width: 200px;
    }
}
