/* ========================================================================
   DEVIS CREATOR - STYLES DESKTOP
   Pour écrans PC (min-width: 1025px)
   Version: 4.0 - AJOUT DES 6 NOUVEAUX BOUTONS DE CHAMPS
   ======================================================================== */

/* === VARIABLES GLOBALES STYLE FACTUROPRO === */
:root {
    /* Palette FacturoPro */
    --primary-color: #2563eb;
    --primary-hover: #1e40af;
    --secondary-color: #1e40af;
    --accent-color: #dc2626;
    --accent-hover: #b91c1c;
    --success-color: #10b981;
    --success-hover: #059669;
    --warning-color: #f59e0b;
    --info-color: #0891b2;
    
    /* Couleurs neutres FacturoPro */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Style FacturoPro */
    --border-color: var(--gray-200);
    --border-radius: 15px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    
    /* Bordure noire fine pour les éléments du devis */
    --black-thin-border: 1px solid #000000;
    
    /* Couleurs alternées pour les lignes (effet zébré) */
    --zebra-blue: #3498db;
    --zebra-orange: #ff9800;
    
    /* Espacements */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Transitions FacturoPro */
    --transition-fast: 0.3s ease;
    --transition-normal: 0.3s ease;
    
    /* Typographie FacturoPro */
    --font-sans: 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
    --font-mono: 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
    
    /* Focus states */
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.5);
    --focus-ring-danger: 0 0 0 3px rgba(220, 38, 38, 0.5);
}

/* === RESET ET BASE STYLE FACTUROPRO === */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: #f1f5f9;
    min-height: 100vh;
    padding: var(--spacing-lg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === FOCUS ET ACCESSIBILITÉ === */
*:focus {
    outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-color: var(--primary-color);
}

button:focus-visible.btn-danger,
.delete-btn:focus-visible {
    box-shadow: var(--focus-ring-danger);
    border-color: var(--accent-color);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === CONTAINER PRINCIPAL STYLE FACTUROPRO === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: none;
}

/* === EN-TÊTE STYLE FACTUROPRO === */
header {
    background: linear-gradient(135deg, #60a5fa, #93c5fd);
    color: white;
    padding: 8px 20px;
    text-align: center;
    position: relative;
    line-height: 1.2;
}

header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: 2px;
    position: relative;
    z-index: 1;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

header .description {
    font-size: clamp(0.9rem, 2vw, 1rem);
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.2;
}

/* === CONTENU PRINCIPALE === */
.main-content {
    padding: var(--spacing-xl);
}

/* === EN-TÊTE DU FORMULAIRE STYLE FACTUROPRO === */
.devis-header-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: var(--spacing-md);
    padding: 10px 15px;
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

/* === GROUPES DE FORMULAIRES STYLE FACTUROPRO === */
.form-group {
    margin-bottom: 2px;
}

.form-group.with-button-inside {
    position: relative;
}

.form-group-standard {
    margin-bottom: 2px;
}

.form-group label,
.form-group-standard label {
    display: block;
    font-weight: 600;
    font-size: 0.7rem !important;
    color: var(--gray-700);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
}

/* === CHAMPS DE FORMULAIRE STYLE FACTUROPRO === */
.form-group input,
.form-group select,
.form-group textarea,
.form-group-standard input {
    width: 100% !important;
    padding: 6px 10px !important;
    font-size: 1rem !important;
    color: #1e40af !important;
    font-weight: 600 !important;
    background: white !important;
    border: 2px solid #60a5fa !important;
    border-radius: 8px !important;
    transition: all var(--transition-fast) !important;
    font-family: inherit !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    box-shadow: 0 2px 6px rgba(96, 165, 250, 0.25) !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

input[name="numero_devis"],
input[name="date_creation"] {
    width: 100% !important;
    padding: 6px 10px !important;
    font-size: 1rem !important;
    color: #1e40af !important;
    font-weight: 600 !important;
    background: white !important;
    border: 2px solid #60a5fa !important;
    border-radius: 8px !important;
    transition: all var(--transition-fast) !important;
    font-family: inherit !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    box-shadow: 0 2px 6px rgba(96, 165, 250, 0.25) !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover,
.form-group-standard input:hover,
input[name="numero_devis"]:hover,
input[name="date_creation"]:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 3px 8px rgba(96, 165, 250, 0.35) !important;
    background: #ffffff !important;
    outline: none;
    border-radius: 8px !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-group-standard input:focus,
input[name="numero_devis"]:focus,
input[name="date_creation"]:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2), 0 3px 10px rgba(96, 165, 250, 0.4) !important;
    background: #ffffff !important;
    outline: none;
    border-radius: 8px !important;
}

/* === SELECT AVEC BOUTON STYLE FACTUROPRO === */
.select-with-button {
    display: flex;
    border: 2px solid #60a5fa !important;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    transition: border-color var(--transition-fast);
    box-shadow: 0 2px 6px rgba(96, 165, 250, 0.25) !important;
    height: 32px;
}

.select-with-button:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 3px 8px rgba(96, 165, 250, 0.35) !important;
}

.select-with-button:focus-within {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2), 0 3px 10px rgba(96, 165, 250, 0.4) !important;
}

.select-with-button select {
    flex: 1;
    border: none !important;
    padding: 0 12px;
    background: white;
    border-radius: 0;
    text-align: center;
    text-align-last: center;
    line-height: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    font-size: 1rem !important;
    color: #1e40af !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    outline: none !important;
}

.select-with-button select option {
    text-align: center;
    padding: 6px;
    line-height: normal;
    color: #1e40af !important;
    font-weight: 600 !important;
}

.select-with-button select:focus {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

.btn-inside-select {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--success-color), var(--success-hover));
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-inside-select:hover {
    background: linear-gradient(135deg, var(--success-hover), var(--success-color));
    transform: scale(1.05);
}

.form-group:has([name="client_id"]) .btn-inside-select {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.form-group:has([name="client_id"]) .btn-inside-select:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: scale(1.05);
}

.form-group:has([name="projet_id"]) .btn-inside-select {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.form-group:has([name="projet_id"]) .btn-inside-select:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: scale(1.05);
}

/* === SECTION OBJET PROJET === */
.project-object-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: none;
    grid-column: 1 / -1;
}

.project-object-section label {
    display: none !important;
}

.project-object-section input[type="text"],
.project-object-input,
input.project-object-input,
.devis-header-fields input[name="objet_devis"] {
    flex: 1;
    width: 100% !important;
    min-width: 200px !important;
    max-width: 6cm !important;
    padding: 6px 10px 6px 2px !important;
    font-size: 1rem !important;
    color: #1e40af !important;
    font-weight: 600 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #9ca3af !important;
    border-radius: 0 !important;
    transition: all var(--transition-fast) !important;
    outline: none !important;
    box-shadow: none !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    line-height: 1 !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
}

.project-object-section input[type="text"]::placeholder,
.project-object-input::placeholder,
input.project-object-input::placeholder {
    color: #9ca3af !important;
    font-weight: 400 !important;
    font-style: italic;
}

.project-object-section input[type="text"]:hover,
.project-object-input:hover,
input.project-object-input:hover {
    border-bottom-color: #6b7280 !important;
    background: transparent !important;
}

.project-object-section input[type="text"]:focus,
.project-object-input:focus,
input.project-object-input:focus {
    border-bottom-color: #1e40af !important;
    background: transparent !important;
}

/* === ZONE DES ÉLÉMENTS DU DEVIS === */
#devis-items {
    margin-bottom: var(--spacing-xl);
    padding: 25px 0 25px 0;
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

/* === CONTAINER LIGNE === */
.line-container {
    display: flex;
    align-items: flex-start;
    gap: 0px;
    margin-bottom: 1px !important;
    justify-content: flex-start;
    position: relative;
}

.line-container:has(+ .devis-title),
.line-container:has(+ .devis-subtitle) {
    margin-bottom: 15px !important;
}

.line-content {
    flex: 1;
    margin-bottom: 1px;
}

/* === NOUVELLE STRUCTURE DESKTOP LAYOUT === */
.desktop-layout {
    display: flex;
    flex-direction: column;
    padding: 5px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1px;
    transition: all var(--transition-fast);
    position: relative;
}

.desktop-layout:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tablet-layout,
.mobile-layout {
    display: none !important;
}

/* === BOUTONS DU HAUT (L et Ch) === */
.desktop-top-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: 3px;
    margin-left: 4px;
}

.desktop-top-buttons .btn-title,
.desktop-top-buttons .btn-subtitle {
    width: 28px !important;
    height: 24px !important;
    font-size: 13px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease;
}

.desktop-top-buttons .btn-title {
    background: #10b981 !important;
    color: white !important;
    border: 1px solid #059669 !important;
}

.desktop-top-buttons .btn-subtitle {
    background: #3b82f6 !important;
    color: white !important;
    border: 1px solid #2563eb !important;
}

.desktop-top-buttons .btn-title:disabled {
    background: #d1d5db !important;
    border-color: #9ca3af !important;
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.desktop-top-buttons .btn-subtitle:disabled {
    background: #d1d5db !important;
    border-color: #9ca3af !important;
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.desktop-top-buttons .btn-title:hover,
.desktop-top-buttons .btn-subtitle:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.desktop-top-buttons .btn-title:active,
.desktop-top-buttons .btn-subtitle:active {
    transform: none !important;
}

/* === LIGNE PRINCIPALE (Textarea + tous les champs) === */
.desktop-main-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px 110px 80px 110px;
    gap: 3px;
    align-items: center;
    margin-bottom: 3px;
}

/* === CONTAINER POUR BADGE + TEXTAREA === */
.designation-with-badge {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    border: 0.5px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    transition: all var(--transition-fast);
}

.designation-with-badge:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.designation-with-badge:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

/* === BADGE NUMÉRO DE LIGNE (GRIS FONCÉ) === */
.line-number-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: #d1d5db !important;
    color: #1f2937 !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    font-family: 'Courier New', monospace !important;
    letter-spacing: 0.01em;
    border-right: 2px solid #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    pointer-events: none;
    min-width: 55px;
}

/* === TEXTAREA DANS LE CONTAINER === */
.desktop-main-row .designation-with-badge textarea {
    flex: 1 !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 8px 12px !important;
    margin: 0 !important;
    background: white !important;
    box-shadow: none !important;
    outline: none !important;
    min-height: 35px;
    height: auto;
    resize: vertical;
    font-family: inherit;
    overflow-wrap: break-word;
    box-sizing: border-box;
    line-height: 1.4;
    vertical-align: top;
    font-size: 1.05rem !important;
    font-style: italic !important;
    color: #334155 !important;
}

.desktop-main-row .designation-with-badge textarea::placeholder {
    font-size: 1.05rem !important;
    font-style: italic !important;
    color: #64748b !important;
    opacity: 1 !important;
}

.desktop-main-row textarea {
    width: 100%;
    min-height: 35px;
    height: auto;
    padding: 8px 12px;
    background-color: white;
    border: 0.5px solid var(--border-color);
    border-radius: 8px !important;
    resize: vertical;
    transition: all var(--transition-fast);
    font-family: inherit;
    overflow-wrap: break-word;
    box-sizing: border-box;
    line-height: 1.4;
    vertical-align: top;
    font-size: 1.05rem !important;
    font-style: italic !important;
    color: #334155 !important;
}

.desktop-main-row textarea::placeholder {
    font-size: 1.05rem !important;
    font-style: italic !important;
    color: #64748b !important;
    opacity: 1 !important;
}

.desktop-main-row textarea:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.desktop-main-row textarea:focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

.desktop-main-row input[type="number"],
.desktop-main-row select {
    width: 100%;
    height: 35px;
    padding: 0 12px;
    color: #1e293b !important;
    background-color: white;
    border: 0.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    line-height: 35px;
    vertical-align: middle;
}

.desktop-main-row select {
    text-align: center;
    text-align-last: center;
    font-size: 0.9375rem !important;
    color: #1e293b !important;
}

.desktop-main-row select option {
    font-size: 0.9375rem !important;
    color: #1e293b !important;
}

.desktop-main-row input[type="number"] {
    text-align: center;
    font-family: var(--font-mono);
    color: #1e293b !important;
    font-size: 0.875rem !important;
}

.desktop-main-row input[type="number"]::placeholder {
    color: #1e293b !important;
    opacity: 1 !important;
}

.desktop-main-row input:hover,
.desktop-main-row select:hover,
.desktop-main-row textarea:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.desktop-main-row input:focus,
.desktop-main-row select:focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

.desktop-main-row .total-display {
    width: 100%;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
    border: 0.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-mono);
    box-shadow: var(--shadow-sm);
}

.desktop-main-row .delete-line-btn {
    position: absolute !important;
    top: 3px !important;
    right: 3px !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
    color: #dc2626 !important;
    font-size: 20px !important;
    font-weight: bold;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    box-shadow: none !important;
    line-height: 1;
    padding: 0 !important;
    outline: none !important;
    z-index: 5;
}

.desktop-main-row .delete-line-btn:hover {
    color: #b91c1c !important;
}

.desktop-main-row .delete-line-btn:active {
    color: #991b1b !important;
}

.line-container:first-child .delete-line-btn {
    display: none !important;
}

/* === BOUTONS DU BAS (+ ligne et 6 boutons de champs) === */
.desktop-bottom-buttons {
    display: flex;
    gap: 4px;
    margin-left: 4px;
    flex-wrap: wrap;
}

.desktop-bottom-buttons .add-line-btn {
    width: 28px !important;
    height: 24px !important;
    font-size: 17px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    line-height: 1 !important;
    transition: all 0.2s ease;
    border: 1px solid #f59e0b !important;
    background: #fbbf24 !important;
    color: #78350f !important;
}

.desktop-bottom-buttons .add-line-btn:hover {
    background: #f59e0b !important;
    border-color: #d97706 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.desktop-bottom-buttons .add-line-btn:active {
    background: #d97706 !important;
    transform: none;
}

/* === STYLES DES 6 BOUTONS DE CHAMPS === */
.desktop-bottom-buttons .btn-bullet {
    width: 28px !important;
    height: 24px !important;
    font-size: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    line-height: 1 !important;
    transition: all 0.2s ease;
    border: 1px solid;
}

/* Bouton abc - Bleu clair */
.desktop-bottom-buttons .btn-bullet-abc {
    background: #60a5fa !important;
    color: white !important;
    border-color: #3b82f6 !important;
    font-size: 10px !important;
}

.desktop-bottom-buttons .btn-bullet-abc:hover {
    background: #3b82f6 !important;
    border-color: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Bouton 123 - Violet */
.desktop-bottom-buttons .btn-bullet-123 {
    background: #a78bfa !important;
    color: white !important;
    border-color: #8b5cf6 !important;
    font-size: 10px !important;
}

.desktop-bottom-buttons .btn-bullet-123:hover {
    background: #8b5cf6 !important;
    border-color: #7c3aed !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Bouton • (puce) - Rouge */
.desktop-bottom-buttons .btn-bullet-dot {
    background: #ef4444 !important;
    color: white !important;
    border-color: #dc2626 !important;
    font-size: 17px !important;
    padding-bottom: 1px !important;
}

.desktop-bottom-buttons .btn-bullet-dot:hover {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Bouton - (tiret) - Gris */
.desktop-bottom-buttons .btn-bullet-dash {
    background: #9ca3af !important;
    color: white !important;
    border-color: #6b7280 !important;
    font-size: 17px !important;
}

.desktop-bottom-buttons .btn-bullet-dash:hover {
    background: #6b7280 !important;
    border-color: #4b5563 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Bouton ○ (cercle) - Vert clair */
.desktop-bottom-buttons .btn-bullet-circle {
    background: #34d399 !important;
    color: white !important;
    border-color: #10b981 !important;
    font-size: 17px !important;
}

.desktop-bottom-buttons .btn-bullet-circle:hover {
    background: #10b981 !important;
    border-color: #059669 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.desktop-bottom-buttons .btn-bullet:active {
    transform: none;
}

/* === EFFET ZÉBRÉ AVEC CLASSES FIXES === */
.line-container.zebra-gray .desktop-layout {
    background: #f1f5f9 !important;
    color: var(--gray-700) !important;
    border: 1px solid #64748b !important;
}

.line-container.zebra-blue .desktop-layout {
    background: #3498db !important;
    color: white !important;
    border: 1px solid #2a4f6f !important;
}

.line-container.zebra-blue .desktop-main-row input,
.line-container.zebra-blue .desktop-main-row select,
.line-container.zebra-blue .desktop-main-row textarea {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--gray-800) !important;
    border: 1px solid #2a4f6f !important;
}

.line-container.zebra-blue .desktop-main-row .total-display {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--gray-800) !important;
    border: 1px solid #2a4f6f !important;
}

/* === BORDURES POUR LES CHAMPS SELON LE FOND === */
.line-container.zebra-gray .desktop-main-row input,
.line-container.zebra-gray .desktop-main-row select,
.line-container.zebra-gray .desktop-main-row textarea,
.line-container.zebra-gray .desktop-main-row .total-display {
    border: 1px solid #94a3b8 !important;
}

/* === TITRES ET SOUS-TITRES === */
.devis-title {
    background: transparent;
    margin-top: -12px !important;
    margin-bottom: 0px !important;
    margin-left: 0px !important;
    padding: 0 !important;
    border: none;
    box-shadow: none;
    transition: none;
    position: relative;
    line-height: 1 !important;
    width: 100% !important;
}

.devis-title:first-child {
    margin-top: 0 !important;
}

.devis-title:hover {
    box-shadow: none;
    transform: none;
}

/* Container pour badge + input */
.title-container {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    background: #10b981;
    border: 1px solid #059669;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

/* Badge LOT (non modifiable) */
.title-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    background: #047857 !important;
    color: white !important;
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    font-family: 'Courier New', monospace !important;
    letter-spacing: 0.05em;
    border-right: 2px solid #065f46;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    pointer-events: none;
}

.devis-subtitle {
    background: transparent;
    margin-top: -12px !important;
    margin-bottom: 0px !important;
    margin-left: 0px !important;
    padding: 0 !important;
    border: none;
    box-shadow: none;
    transition: none;
    position: relative;
    line-height: 1 !important;
    width: 100% !important;
}

.devis-subtitle:first-child {
    margin-top: 0 !important;
}

.devis-subtitle:hover {
    box-shadow: none;
    transform: none;
}

/* Container pour badge + input */
.subtitle-container {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 0;
    overflow: hidden;
}

/* Badge CHAPITRE (non modifiable) */
.subtitle-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 18px;
    background: #2563eb !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    font-family: 'Courier New', monospace !important;
    letter-spacing: 0.03em;
    border-right: 2px solid #1e40af;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    pointer-events: none;
}

.devis-title + .line-container,
.devis-subtitle + .line-container,
.devis-title + .devis-subtitle {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* DESIGN TITRE - Input sans le préfixe LOT (maintenant dans le badge) */
.devis-title .title-field,
.devis-title input[type="text"] {
    flex: 1 !important;
    width: 100% !important;
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    border: none !important;
    background: #10b981 !important;
    color: white !important;
    padding: 9px 40px 9px 15px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
    letter-spacing: 0.01em !important;
    min-height: auto !important;
    margin: 0 !important;
    display: block !important;
    resize: none !important;
    font-family: inherit !important;
}

.devis-title .title-field::placeholder,
.devis-title input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.devis-title .title-field:hover,
.devis-title input[type="text"]:hover {
    background: #059669 !important;
}

.devis-title .title-field:focus,
.devis-title input[type="text"]:focus {
    background: #10b981 !important;
    outline: none !important;
}

/* DESIGN SOUS-TITRE - Input sans le préfixe numéro (maintenant dans le badge) */
.devis-subtitle .subtitle-field,
.devis-subtitle input[type="text"] {
    flex: 1 !important;
    width: 100% !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    border: none !important;
    background: #dbeafe !important;
    color: #1e40af !important;
    padding: 7px 40px 7px 15px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
    letter-spacing: 0.01em !important;
    min-height: auto !important;
    margin: 0 !important;
    display: block !important;
    resize: none !important;
    font-family: inherit !important;
}

.devis-subtitle .subtitle-field::placeholder,
.devis-subtitle input[type="text"]::placeholder {
    color: #60a5fa !important;
}

.devis-subtitle .subtitle-field:hover,
.devis-subtitle input[type="text"]:hover {
    background: #bfdbfe !important;
}

.devis-subtitle .subtitle-field:focus,
.devis-subtitle input[type="text"]:focus {
    background: #dbeafe !important;
    outline: none !important;
}

/* Ligne qui suit le titre/sous-titre */
.devis-title + .line-container .desktop-layout,
.devis-subtitle + .line-container .desktop-layout {
    border-radius: 0 0 6px 6px !important;
    margin-top: 0 !important;
}

/* BOUTON X DANS TITRE/SOUS-TITRE */
.devis-title .delete-btn,
.devis-subtitle .delete-btn {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 24px !important;
    height: 24px !important;
    background: rgba(220, 38, 38, 0.1) !important;
    color: var(--accent-color) !important;
    font-size: 16px !important;
    font-weight: bold !important;
    border: 1px solid rgba(220, 38, 38, 0.3) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    line-height: 1 !important;
    padding: 0 !important;
    z-index: 10 !important;
    opacity: 0.7 !important;
}

.devis-title .delete-btn:hover,
.devis-subtitle .delete-btn:hover {
    background: rgba(220, 38, 38, 0.2) !important;
    color: var(--accent-hover) !important;
    border-color: var(--accent-color) !important;
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3) !important;
    opacity: 1 !important;
}

/* Cacher boutons de déplacement */
.devis-title button:not(.delete-btn),
.devis-subtitle button:not(.delete-btn),
.devis-title .move-btn,
.devis-subtitle .move-btn,
.devis-title [class*="move"],
.devis-subtitle [class*="move"],
.devis-title [class*="arrow"],
.devis-subtitle [class*="arrow"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* === STYLES POUR LES PUCES (BULLETS) - 5 TYPES === */
.bullets-container {
    width: 100%;
    margin: 0;
    padding: 0 4px;
}

/* Espace après le dernier champ puce - UNIQUEMENT s'il contient des puces */
.bullets-container:not(:empty) {
    margin-bottom: 16px !important;
}

.devis-bullet {
    display: grid;
    grid-template-columns: 30px 1fr 30px;
    gap: 8px;
    padding: 0;
    background: transparent;
    margin-bottom: 4px;
    align-items: flex-start;
}

/* === INDENTATION PROGRESSIVE === */
.devis-bullet[data-indent="0"] { margin-left: 0px; }      /* abc */
.devis-bullet[data-indent="1"] { margin-left: 10px; }     /* 123 */
.devis-bullet[data-indent="2"] { margin-left: 20px; }     /* • */
.devis-bullet[data-indent="3"] { margin-left: 30px; }     /* - */
.devis-bullet[data-indent="4"] { margin-left: 40px; }     /* ○ */

/* === ICÔNES DES BULLETS === */
.bullet-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.95rem;
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 0;
}

/* Couleurs des icônes selon le type */
.bullet-abc .bullet-icon {
    background: #60a5fa;
    color: white;
    border: 1px solid #3b82f6;
    font-size: 0.7rem;
}

.bullet-123 .bullet-icon {
    background: #a78bfa;
    color: white;
    border: 1px solid #8b5cf6;
    font-size: 0.7rem;
}

.bullet-dot .bullet-icon {
    background: #ef4444;
    color: white;
    border: 1px solid #dc2626;
}

.bullet-dash .bullet-icon {
    background: #9ca3af;
    color: white;
    border: 1px solid #6b7280;
}

.bullet-circle .bullet-icon {
    background: #34d399;
    color: white;
    border: 1px solid #10b981;
}

.bullet-field {
    width: 100%;
    min-height: 30px;
    height: auto;
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px !important;
    resize: vertical;
    transition: all var(--transition-fast);
    font-family: inherit;
    overflow-wrap: break-word;
    box-sizing: border-box;
    line-height: 1.4;
    font-size: 0.90rem !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* === STYLES SPÉCIFIQUES PAR TYPE === */

/* abc - Bleu clair + texte bleu foncé + gras */
.bullet-abc .bullet-field {
    background: linear-gradient(135deg, #eff6ff, #dbeafe) !important;
    color: #1e3a8a !important;
    font-weight: 700 !important;
    font-style: normal !important;
    border-color: #93c5fd !important;
}

.bullet-abc .bullet-field::placeholder {
    color: #60a5fa !important;
    opacity: 0.7 !important;
    font-style: normal !important;
}

/* 123 - Violet clair + texte violet foncé */
.bullet-123 .bullet-field {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe) !important;
    color: #5b21b6 !important;
    font-weight: 400 !important;
    font-style: normal !important;
    border-color: #c4b5fd !important;
}

.bullet-123 .bullet-field::placeholder {
    color: #a78bfa !important;
    opacity: 0.7 !important;
    font-style: normal !important;
}

/* • (dot) - Rouge clair + texte rouge foncé */
.bullet-dot .bullet-field {
    background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
    color: #991b1b !important;
    font-weight: 400 !important;
    font-style: normal !important;
    border-color: #fca5a5 !important;
}

.bullet-dot .bullet-field::placeholder {
    color: #f87171 !important;
    opacity: 0.7 !important;
    font-style: normal !important;
}

/* - (dash) - Gris clair + texte gris foncé + italique */
.bullet-dash .bullet-field {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6) !important;
    color: #374151 !important;
    font-weight: 400 !important;
    font-style: italic !important;
    border-color: #d1d5db !important;
}

.bullet-dash .bullet-field::placeholder {
    color: #9ca3af !important;
    opacity: 0.7 !important;
    font-style: italic !important;
}

/* ○ (circle) - Vert clair + texte vert */
.bullet-circle .bullet-field {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7) !important;
    color: #15803d !important;
    font-weight: 400 !important;
    font-style: normal !important;
    border-color: #86efac !important;
}

.bullet-circle .bullet-field::placeholder {
    color: #4ade80 !important;
    opacity: 0.7 !important;
    font-style: normal !important;
}

/* Hover states */
.bullet-abc .bullet-field:hover {
    border-color: #60a5fa !important;
    box-shadow: 0 4px 8px rgba(96, 165, 250, 0.15) !important;
}

.bullet-123 .bullet-field:hover {
    border-color: #a78bfa !important;
    box-shadow: 0 4px 8px rgba(167, 139, 250, 0.15) !important;
}

.bullet-dot .bullet-field:hover {
    border-color: #f87171 !important;
    box-shadow: 0 4px 8px rgba(248, 113, 113, 0.15) !important;
}

.bullet-dash .bullet-field:hover {
    border-color: #9ca3af !important;
    box-shadow: 0 4px 8px rgba(156, 163, 175, 0.15) !important;
}

.bullet-circle .bullet-field:hover {
    border-color: #4ade80 !important;
    box-shadow: 0 4px 8px rgba(74, 222, 128, 0.15) !important;
}

/* Focus states */
.bullet-field:focus {
    outline: none;
}

.delete-bullet-btn {
    width: 24px;
    height: 24px;
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    font-size: 16px;
    font-weight: bold;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 3px;
}

.delete-bullet-btn:hover {
    background: rgba(220, 38, 38, 0.15);
    color: #b91c1c;
    border-color: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

/* === CONTAINER DES TOTAUX === */
.devis-container {
    max-width: 550px;
    margin: var(--spacing-lg) 0 var(--spacing-lg) auto;
    padding: 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding: 2px 0;
    line-height: 1.1;
}

.total-line span:first-child {
    font-size: 1rem;
    color: var(--gray-700);
    font-weight: 600;
    line-height: 1.1;
}

.total-line span:last-child {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    text-align: right;
    font-family: var(--font-mono);
    line-height: 1.1;
}

.total-line.final-total {
    margin: 12px 0 8px 0;
    padding: 12px 0 8px 0;
    border-top: 3px solid var(--border-color);
    font-weight: bold;
}

.total-line.final-total span {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.1;
}

/* === CONTRÔLES EN BAS === */
.bottom-controls {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding: 25px;
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    justify-content: flex-start;
    flex-wrap: wrap;
}

.btn-danger,
.btn-pdf,
.btn-save,
.btn-delete {
    height: 48px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    min-width: 140px;
}

.btn-danger,
.btn-delete {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
}

.btn-pdf {
    background: linear-gradient(135deg, #ea580c, #dc2626);
}

.btn-save {
    background: linear-gradient(135deg, var(--success-color), var(--success-hover));
}

.btn-danger:hover,
.btn-pdf:hover,
.btn-save:hover,
.btn-delete:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* === BOUTONS GÉNÉRAUX === */
.delete-btn:not(.desktop-main-row .delete-line-btn) {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.delete-btn:not(.desktop-main-row .delete-line-btn):hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* === IMPRESSION === */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border: none;
        max-width: none;
    }
    
    header {
        background: white !important;
        color: black !important;
    }
    
    .desktop-top-buttons,
    .desktop-bottom-buttons,
    .bottom-controls {
        display: none !important;
    }
    
    .line-content {
        width: 100% !important;
    }
    
    .desktop-layout {
        display: flex !important;
    }
    
    .tablet-layout,
    .mobile-layout {
        display: none !important;
    }
}