﻿/* =====================================================
   MODAL IMPRESSION PRO - Plein écran
   Utilise les variables CSS de app.css
   ===================================================== */

.print-modal-overlay {
    position: fixed; /* ← clé du problème */
    inset: 0; /* top/right/bottom/left: 0 */
    z-index: 9999; /* un z-index raisonnable suffit */
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}
.print-modal-container {
    width: 100vw;
    height: 100vh; /* avec fixed sur l'overlay, ça couvre bien tout */
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========== HEADER ========== */
.print-modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
}

    .header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.header-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: white !important;
}
.header-text .header-subtitle {
    color: white !important;
}

.header-subtitle {
    font-size: 0.95rem;
    margin: 0.25rem 0 0 0;
    opacity: 0.9;
}

.close-button {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

    .close-button:hover:not(:disabled) {
        background: rgba(255, 255, 255, 0.25);
        transform: scale(1.05);
    }

    .close-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ========== STEPS INDICATOR ========== */
.header-step {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    gap: 1rem;
    min-width: 1000px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

    .step-item:not(.active):not(.completed) {
        opacity: 0.5;
    }

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    transition: all 0.3s;
}

.step-item.active .step-circle {
    background: white;
    color: var(--primary-color);
    border-color: white;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);
}

.step-item.completed .step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
}

.step-label {
    color: white;
}

.step-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.step-desc {
    font-size: 0.85rem;
    opacity: 0.85;
}

.step-connector {
    width: 80px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s;
}

    .step-connector.completed {
        background: var(--success-color);
    }

/* ========== CONTENT ========== */
.print-modal-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-primary);
}

.step-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 3rem 2rem;
    animation: contentFadeIn 0.4s ease-out;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    text-align: center;
    margin-bottom: 3rem;
}

    .step-header h2 {
        font-size: 2rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0 0 0.5rem 0;
    }

    .step-header p {
        font-size: 1.1rem;
        color: var(--text-secondary);
        margin: 0;
    }

/* ========== ÉTAPE 1: IMPRIMANTE ========== */
.printers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.printer-card-lg {
    background: var(--bg-card);
    border: 3px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

    .printer-card-lg:hover:not(.disabled) {
        border-color: var(--primary-color);
        box-shadow: var(--shadow-lg);
        transform: translateY(-4px);
    }

    .printer-card-lg.selected {
        border-color: var(--primary-color);
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), var(--bg-card));
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }

    .printer-card-lg.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.printer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.5rem;
}

.printer-icon-lg {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.selected-badge {
    width: 40px;
    height: 40px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.printer-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.printer-id-lg {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.printer-name-lg {
    font-size: 1rem;
    color: var(--text-secondary);
}

.printer-status-lg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

    .printer-status-lg.active {
        color: var(--success-color);
    }

    .printer-status-lg.inactive {
        color: var(--danger-color);
    }

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ========== ÉTAPE 2: MODÈLES & VARIANTES ========== */
.step-layout-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: calc(100vh - 150px);
}

.selection-panel,
.print-list-panel {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.panel-header-print {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

    .panel-header-print h2 {
        margin: 0 0 0.5rem 0;
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--text-primary);
    }

    .panel-header-print p {
        margin: 0;
        font-size: 0.95rem;
        color: var(--text-secondary);
    }

/* Section modèle parent */
.model-parent-section,
.variants-section {
    padding: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

    .section-title svg {
        color: var(--primary-color);
    }

.model-card-selection {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1.5rem;
}

.model-card-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    border: 2px solid var(--border-color);
}

    .model-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.model-card-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.model-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

    .meta-item.price {
        color: var(--success-color);
        font-weight: 700;
        font-size: 1rem;
    }

.btn-add-to-list {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

    .btn-add-to-list:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

/* Variantes */
.selection-panel {
    overflow-y: auto;
}

.variants-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.variant-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

    .variant-item:hover {
        border-color: var(--primary-color);
        box-shadow: var(--shadow);
    }

.variant-info {
    flex: 1;
}

.variant-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.variant-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ✅ NOUVEAU: Indicateur de différences avec tooltip */
.variant-differences-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    color: white;
    cursor: help;
    transition: all 0.2s;
}

    .variant-differences-indicator:hover {
        transform: scale(1.1);
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
    }

    .variant-differences-indicator svg {
        width: 14px;
        height: 14px;
    }

/* ✅ NOUVEAU: Tooltip des différences */
.variant-differences-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    min-width: 280px;
    max-width: 400px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s;
}

    .variant-differences-tooltip::before {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 8px solid transparent;
        border-top-color: var(--gray-800);
    }

.variant-differences-indicator:hover .variant-differences-tooltip {
    opacity: 1;
    visibility: visible;
}

.tooltip-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--white);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

    .tooltip-row:last-child {
        margin-bottom: 0;
    }

.tooltip-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    min-width: 100px;
    flex-shrink: 0;
}

.tooltip-value {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.old-value {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: line-through;
}

.arrow {
    color: var(--warning-color);
    font-weight: 700;
}

.new-value {
    color: white;
    font-weight: 600;
}

.variant-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attribute-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
}

    .attribute-badge.more {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

.btn-add-variant {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .btn-add-variant:hover {
        background: var(--primary-dark);
        transform: scale(1.1);
    }

.loading-variants,
.no-variants {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

    .no-variants svg {
        color: var(--border-color);
        margin-bottom: 1rem;
    }

    .no-variants p {
        margin: 1rem 0;
        font-size: 1rem;
    }

/* Liste d'impression */
.print-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.print-list-table {
    display: flex;
    flex-direction: column;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 0.5fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 0.5fr;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s;
}

    .table-row:hover {
        border-color: var(--primary-color);
        box-shadow: var(--shadow);
    }

.item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

    .item-icon.parent {
        background: linear-gradient(135deg, #6366f1, #8b5cf6);
    }

    .item-icon.variant {
        background: var(--gradient-primary);
    }

.item-details {
    flex: 1;
}

.item-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.item-type {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .qty-btn:hover {
        border-color: var(--primary-color);
        background: var(--primary-color);
        color: white;
    }

.qty-input {
    width: 60px;
    height: 36px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

    .qty-input:focus {
        outline: none;
        border-color: var(--primary-color);
    }

.template-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: white;
    cursor: pointer;
}

    .template-select:focus {
        outline: none;
        border-color: var(--primary-color);
    }

.btn-remove {
    width: 36px;
    height: 36px;
    border: 2px solid var(--danger-color);
    background: white;
    color: var(--danger-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .btn-remove:hover {
        background: var(--danger-color);
        color: white;
    }

.empty-print-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

    .empty-print-list svg {
        color: var(--border-color);
        margin-bottom: 1.5rem;
    }

    .empty-print-list h3 {
        font-size: 1.25rem;
        color: var(--text-primary);
        margin: 0 0 0.5rem 0;
    }

    .empty-print-list p {
        margin: 0;
    }

/* ========== ÉTAPE 3: VALIDATION ========== */
.validation-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.summary-card {
    background: var(--gradient-primary);
    color: white;
    border-radius: 16px;
    padding: 2rem;
    height: fit-content;
    box-shadow: var(--shadow-lg);
}

    .summary-card h2 {
        font-size: 1.5rem;
        font-weight: 700;
        margin: 0 0 2rem 0;
    }

.summary-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.summary-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

    .summary-item.highlight {
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

.summary-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 0.875rem;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.validation-list {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

    .validation-list h3 {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0 0 1.5rem 0;
    }

.validation-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

    .validation-item:last-child {
        margin-bottom: 0;
    }

.validation-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.validation-item-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.item-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.parent-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.variant-badge {
    background: var(--gradient-primary);
    color: white;
}

.validation-item-qty {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--success-color);
}

.validation-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    gap: 1rem;
    font-size: 0.95rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
}

.detail-value {
    color: var(--text-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attr-tag {
    padding: 0.25rem 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.85rem;
}

/* ========== FOOTER ========== */
.print-modal-footer {
    background: var(--bg-card);
    border-top: 2px solid var(--border-color);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

.footer-left,
.footer-right {
    display: flex;
    gap: 1rem;
}

/* ========== MODAL CONFIRMATION ========== */
.modal-overlay-confirmation {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-confirmation {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.95) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-confirmation-header {
    padding: 2rem;
    text-align: center;
    border-radius: 16px 16px 0 0;
}

    .modal-confirmation-header.success {
        background: linear-gradient(135deg, var(--success-color), #059669);
        color: white;
    }

    .modal-confirmation-header.error {
        background: linear-gradient(135deg, var(--danger-color), #dc2626);
        color: white;
    }

    .modal-confirmation-header svg {
        margin-bottom: 1rem;
    }

    .modal-confirmation-header h3 {
        font-size: 1.5rem;
        font-weight: 700;
        margin: 0;
    }

.modal-confirmation-content {
    padding: 2rem;
    text-align: center;
}

    .modal-confirmation-content p {
        margin: 0;
        font-size: 1rem;
        color: var(--text-primary);
        line-height: 1.6;
    }

.modal-confirmation-footer {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
}

/* ========== LOADING & EMPTY STATES ========== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

    .loading-container p {
        margin-top: 1.5rem;
        font-size: 1.1rem;
    }

.empty-state-lg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

    .empty-state-lg svg {
        color: var(--border-color);
        margin-bottom: 2rem;
    }

    .empty-state-lg h3 {
        font-size: 1.5rem;
        color: var(--text-primary);
        margin: 0 0 1rem 0;
    }

    .empty-state-lg p {
        font-size: 1.1rem;
        color: var(--text-secondary);
        margin: 0;
    }

/* ========== SPINNERS ========== */
.spinner,
.spinner-small,
.spinner-large {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner {
    width: 24px;
    height: 24px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-large {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .step-layout-2col {
        grid-template-columns: 1fr;
        height: auto;
    }

    .print-list-panel {
        min-height: 400px;
    }

    .validation-layout {
        grid-template-columns: 1fr;
    }

    .header-step {
        display: none;
    }
}

@media (max-width: 1024px) {
    .printers-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .step-connector {
        width: 40px;
    }

    .step-desc {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 1rem 1.5rem;
    }

    .header-icon {
        width: 48px;
        height: 48px;
    }

    .header-text h1 {
        font-size: 1.25rem;
    }

    .step-container {
        padding: 2rem 1rem;
    }

    .printers-grid {
        grid-template-columns: 1fr;
    }

    .table-header {
        display: none;
    }

    .table-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .print-modal-footer {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .footer-left,
    .footer-right {
        width: 100%;
        flex-direction: column;
    }

    .header-step {
        display: none;
    }
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .attribute-input-row {
        grid-template-columns: 1fr;
    }

    .header-step {
        display: none;
    }
}
/*EditPrintModal*/
/* =====================================================
   MODAL ÉDITION ITEM - Styles
   ===================================================== */



/* ========== CONTENT ========== */
.dark{
    color:black;
}

.section-title-edit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

    .section-title-edit svg {
        color: var(--primary-color);
    }

/* ========== FORM ========== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

    .form-label svg {
        color: var(--primary-color);
        flex-shrink: 0;
    }

.required-star {
    color: var(--danger-color);
    font-weight: 700;
    margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: white;
    transition: all 0.2s;
}

    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }

    .form-input::placeholder,
    .form-textarea::placeholder {
        color: var(--text-secondary);
        opacity: 0.6;
    }

.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-select {
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.form-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* ========== APERÇU DES MODIFICATIONS ========== */
.changes-preview {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.changes-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

    .changes-header svg {
        flex-shrink: 0;
    }

.changes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.change-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    font-size: 0.875rem;
}

.change-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 140px;
    flex-shrink: 0;
}

.change-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--text-secondary);
}

.old-value-preview {
    color: var(--text-secondary);
    text-decoration: line-through;
    opacity: 0.6;
}

.arrow-preview {
    color: var(--primary-color);
    font-weight: 700;
}

.new-value-preview {
    color: var(--primary-color);
    font-weight: 600;
}

/* ========== FOOTER ========== */
.edit-item-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 16px 16px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .edit-item-modal {
        width: 95%;
        max-height: 95vh;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .edit-item-header {
        padding: 1rem 1.5rem;
    }

        .edit-item-header h2 {
            font-size: 1.25rem;
        }

    .header-icon-edit {
        width: 40px;
        height: 40px;
    }

    .edit-item-content {
        padding: 1.5rem;
    }

    .edit-item-footer {
        padding: 1rem 1.5rem;
        flex-direction: column-reverse;
    }

        .edit-item-footer .btn {
            width: 100%;
            justify-content: center;
        }
}

@media (max-width: 480px) {
    .change-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .change-label {
        min-width: auto;
    }
}

/* Bouton d'édition */
.btn-edit {
    width: 36px;
    height: 36px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .btn-edit:hover {
        background: var(--primary-color);
        color: white;
        transform: scale(1.05);
    }

/* Indicateur de modification */
.edit-indicator {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: editPulse 2s infinite;
}

@keyframes editPulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    50% {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.6);
    }
}

/* Ajuster td-actions pour contenir 2 boutons */
.td-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: relative;
}

/* Affichage du nom avec indicateur d'édition */
.item-name.edited {
    color: var(--success-color);
    font-weight: 700;
}

    .item-name.edited::after {
        content: "✓";
        margin-left: 0.5rem;
        color: var(--success-color);
        font-size: 0.875rem;
    }

/* Style pour le mode responsive */
@media (max-width: 768px) {
    .table-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        position: relative;
    }

    .td-actions {
        position: absolute;
        top: 1rem;
        right: 1rem;
        gap: 0.5rem;
    }

    .edit-indicator {
        top: -4px;
        right: -4px;
        width: 18px;
        height: 18px;
    }
}
/*css brand modal*/
/* =====================================================
   BRAND IMAGE SECTION
   ===================================================== */

.brand-image-section {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.brand-image-preview {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

    .brand-image-preview img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 1rem;
    }

.no-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem;
}

    .no-image-placeholder svg {
        margin-bottom: 0.75rem;
        opacity: 0.5;
    }

    .no-image-placeholder p {
        margin: 0;
        font-size: 0.875rem;
        font-weight: 500;
    }

.header-icon-edit {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .brand-image-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .brand-image-preview {
        width: 100%;
        height: 250px;
    }
}
/* ========== BOUTON ÉDITION MARQUE ========== */
.btn-edit-brand {
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

    .btn-edit-brand:hover {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }

    .btn-edit-brand svg {
        flex-shrink: 0;
    }
/* =====================================================
   EDIT BRAND MODAL - Styles plein écran
   ===================================================== */

/* Layout 2 colonnes */
.brand-edit-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: calc(100vh - 200px);
    max-width: 1800px;
    margin: 0 auto;
}

.brand-image-panel,
.brand-info-panel {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Section upload d'image */
.brand-image-upload-section {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
}

.brand-image-preview-large {
    width: 100%;
    aspect-ratio: 1;
    max-height: 200px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 3px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
}

    .brand-image-preview-large:hover {
        border-color: var(--primary-color);
    }

    .brand-image-preview-large img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 1rem;
    }

.no-image-placeholder-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
}

    .no-image-placeholder-large svg {
        margin-bottom: 1.5rem;
        opacity: 0.3;
    }

    .no-image-placeholder-large p {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 500;
    }

/* Bouton supprimer image */
.btn-remove-image {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    background: var(--danger-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

    .btn-remove-image:hover {
        transform: scale(1.1);
        box-shadow: var(--shadow-xl);
    }

/* Contrôles d'upload */
.brand-image-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-input-hidden {
    display: none;
}

.btn-upload-image {
    width: 100%;
    padding: 1.25rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

    .btn-upload-image:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

.upload-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border: 2px solid var(--danger-color);
    border-radius: 10px;
    color: var(--danger-color);
    font-size: 0.95rem;
    font-weight: 500;
}

.upload-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Section informations */
.brand-info-form {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
}

.form-field-large {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-label-large {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

    .form-label-large svg {
        color: var(--primary-color);
        flex-shrink: 0;
    }

.form-input-large,
.form-textarea-large {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-primary);
    background: white;
    transition: all 0.2s;
    font-family: inherit;
}

    .form-input-large:focus,
    .form-textarea-large:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }

    .form-input-large::placeholder,
    .form-textarea-large::placeholder {
        color: var(--text-secondary);
        opacity: 0.6;
    }

.form-textarea-large {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .brand-edit-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .brand-image-panel {
        min-height: 400px;
    }

    .brand-info-panel {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .brand-image-upload-section,
    .brand-info-form {
        padding: 1.5rem;
    }

    .brand-image-preview-large {
        max-height: 350px;
    }

    .btn-upload-image {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .btn-remove-image {
        width: 40px;
        height: 40px;
    }

    .form-input-large,
    .form-textarea-large {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
}
/* Bouton supprimer image (overlay en haut à droite) */
.btn-remove-image {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    background: var(--danger-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

    .btn-remove-image:hover:not(:disabled) {
        transform: scale(1.1);
        box-shadow: var(--shadow-xl);
    }

    .btn-remove-image:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .btn-remove-image svg {
        pointer-events: none;
    }

/*local agent*/
/* =====================================================
   MODAL LOCAL AGENT ACCESS - Styles spécifiques
   À ajouter dans ModalMobileAccess.css ou fichier dédié
   Réutilise toutes les classes de print-modal existantes
   ===================================================== */

/* ── Badge Local Agent (distinctif des badges mobile) ── */
.la-badge {
    background: linear-gradient(135deg, #0077b6, #00b4d8);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    width: fit-content;
    margin-bottom: 0.5rem;
}

/* ── Boutique principale (non désélectionnable) ── */
.shop-card-main {
    border-color: var(--primary-color) !important;
    background: linear-gradient(135deg, rgba(0, 119, 182, 0.04), var(--bg-card)) !important;
}

.badge-main {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.15rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ══════════════════════════════════════════════════════
   BLOC PERMISSIONS (étape 4)
   ══════════════════════════════════════════════════════ */
.permissions-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 2rem auto;
}

.permission-group {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* En-têtes groupes */
.permission-group-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.rfid-header {
    background: linear-gradient(135deg, #0077b6, #00b4d8);
}


/* Liste d'items de permission */
.permission-items {
    display: flex;
}

.permission-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

    .permission-row:last-child {
        border-bottom: none;
    }

    .permission-row:hover:not(:has(input:disabled)) {
        background: var(--bg-secondary);
    }

    .permission-row.active {
        background: linear-gradient(135deg, rgba(0, 119, 182, 0.04), rgba(0, 180, 216, 0.04));
    }

/* Toggle switch */
.permission-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 26px;
    transition: background 0.3s;
    cursor: pointer;
}

    .toggle-slider::before {
        content: '';
        position: absolute;
        width: 20px;
        height: 20px;
        left: 3px;
        top: 3px;
        background: white;
        border-radius: 50%;
        transition: transform 0.3s;
        box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    }

.toggle-checkbox:checked + .toggle-slider {
    background: var(--primary-color);
}

    .toggle-checkbox:checked + .toggle-slider::before {
        transform: translateX(22px);
    }

.toggle-checkbox:disabled + .toggle-slider {
    background: var(--success-color);
    cursor: not-allowed;
    opacity: 0.85;
}

    .toggle-checkbox:disabled + .toggle-slider::before {
        transform: translateX(22px);
    }

/* Textes permission */
.permission-info {
    flex: 1;
}

.permission-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.permission-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Badges requis / optionnel */
.badge-required {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.2rem 0.6rem;
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-optional {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 119, 182, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(0, 119, 182, 0.2);
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Résumé permissions ── */
.permissions-summary {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
}

.perm-summary-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.perm-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.perm-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.perm-chip-read {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.perm-chip-write {
    background: rgba(0, 119, 182, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(0, 119, 182, 0.25);
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .permissions-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .permission-row {
        padding: 1rem;
        gap: 0.75rem;
    }

    .badge-required,
    .badge-optional {
        display: none;
    }
}