/**
 * Component Styles - Reusable UI Components
 * Golden Book Admin v2
 */

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

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

.card-title {
    font-weight: 600;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #333;
}

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

.btn-secondary:hover {
    background: #d5d5d5;
}

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

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.view-toggle.active {
    background: var(--primary);
    color: white;
}

.view-toggle.active:hover {
    background: #333;
}

/* Action Buttons (Modern) */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(0,0,0,0.05);
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 14px;
}

.action-btn:hover {
    background: rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.action-btn--view {
    background: rgba(139,115,85,0.1);
    color: #8b7355;
}

.action-btn--view:hover {
    background: #8b7355;
    color: #fff;
}

.action-btn--edit {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
}

.action-btn--edit:hover {
    background: #3b82f6;
    color: #fff;
}

.action-btn--delete {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}

.action-btn--delete:hover {
    background: #ef4444;
    color: #fff;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-light);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

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

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox input {
    width: auto;
}

.form-input-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
}

tr:hover {
    background: #f5f5f5;
}

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

td.actions {
    display: flex;
    gap: 0.25rem;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-gray {
    background: #f3f4f6;
    color: #374151;
}

.badge-markers {
    background: #dbeafe;
    color: #1e40af;
    margin-left: 0.25rem;
}

/* ============================================
   MODAL
   ============================================ */
/* Main modal overlays - MUST be position: fixed to stay centered on viewport */
#modalOverlay,
#pickerOverlay {
    position: fixed !important;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

#modalOverlay.active,
#pickerOverlay.active {
    opacity: 1;
    visibility: visible;
}

#pickerOverlay {
    z-index: 150;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.2s;
}

.modal--large {
    max-width: 1100px;
}

.modal--fullscreen {
    width: calc(100vw - 32px);
    height: calc(100vh - 32px);
    margin: 16px;
    max-width: none;
    max-height: none;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

.modal--fullscreen .modal-header,
.modal--fullscreen .modal-footer {
    flex: 0 0 auto;
}

.modal--fullscreen .modal-body {
    flex: 1 1 auto;
    overflow: auto;
    overflow-x: hidden;
    padding: 1.25rem 3rem calc(1.25rem + 88px);
}

.modal--fullscreen .modal-header,
.modal--fullscreen .modal-footer {
    padding-left: 3rem;
    padding-right: 3rem;
}

.modal--fullscreen .modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
}

.modal--fullscreen .form-row {
    gap: 1.5rem;
}

.modal--fullscreen .form-group {
    margin-bottom: 1.25rem;
}

.modal--fullscreen .modal-body > * {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.modal--fullscreen #installationForm {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

.modal--fullscreen .images-row {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.modal--fullscreen .focal-picker {
    aspect-ratio: auto;
    height: clamp(160px, 22vh, 200px);
}

.modal--fullscreen .form-group {
    margin-bottom: 1rem;
}

.modal--fullscreen .form-row {
    margin-bottom: 0;
}

/* Two-column layout for installation modal */
.modal-body--two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.modal-images-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-images-column .image-slot {
    flex: 1;
}

.modal-images-column .focal-picker {
    height: clamp(250px, 36vh, 400px) !important;
}

.modal-images-column .image-slot__header {
    margin-bottom: 0.5rem;
}

.modal-images-column .focal-coords {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.modal-images-column .marker-toolbar {
    margin-top: 0.5rem;
}

.modal-form-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-form-column .form-group {
    margin-bottom: 0;
}

.modal-form-column .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 1320px), (max-height: 900px) {
    .modal--fullscreen {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        margin: 8px;
    }

    .modal--fullscreen .modal-header,
    .modal--fullscreen .modal-footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .modal--fullscreen .modal-body {
        padding: 0.9rem 1.25rem calc(0.9rem + 84px);
    }
}

@media (max-width: 1120px), (max-height: 760px) {
    .modal-body--two-columns {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .modal-images-column .focal-picker {
        height: clamp(170px, 28vh, 300px) !important;
    }

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

/* ============================================
   SETTINGS STRUCTURE
   ============================================ */
.settings-sticky {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.settings-sticky__title {
    font-weight: 600;
    font-size: 1rem;
}

.settings-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.settings-nav {
    position: sticky;
    top: 64px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.settings-nav__title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.settings-nav a {
    color: var(--text);
    text-decoration: none;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}

.settings-nav a:hover {
    background: #eef2f7;
}

.settings-group {
    margin-bottom: 1.5rem;
}

.settings-group__title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin: 0 0 0.5rem 0.25rem;
}

@media (max-width: 900px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
    .settings-nav {
        position: relative;
        top: auto;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

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

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

.modal-title {
    font-weight: 600;
    flex-shrink: 0;
}

.modal-nav-arrows {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 1.5rem;
}

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

/* ============================================
   IMAGE COMPONENTS
   ============================================ */

/* Image Preview */
.image-preview {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    background: #f3f4f6;
}

/* Image Upload */
.image-upload {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    max-width: 100%;
}

.image-upload:hover {
    border-color: var(--secondary);
}

.image-upload input {
    display: none;
}

/* Focal Point Picker */
.focal-picker {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 8px;
    overflow: hidden;
    cursor: crosshair;
    background: #f3f4f6;
    border: 2px solid var(--border);
}

.focal-picker:hover {
    border-color: var(--secondary);
}

.focal-picker img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.focal-picker__marker {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: rgba(139, 115, 85, 0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: grab;
    z-index: 10;
}

.focal-picker__marker:active {
    cursor: grabbing;
}

.focal-picker__crosshair {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.focal-picker__crosshair::before,
.focal-picker__crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255,255,255,0.4);
}

.focal-picker__crosshair::before {
    width: 1px;
    height: 100%;
    left: var(--fx, 50%);
}

.focal-picker__crosshair::after {
    height: 1px;
    width: 100%;
    top: var(--fy, 50%);
}

.focal-picker__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    font-size: 0.875rem;
}

.focal-coords {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Images Row Layout */
.images-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.image-slot {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.image-slot__label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.image-slot__actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

/* ============================================
   MARKER EDITOR
   ============================================ */
.marker-editor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
}

.marker-editor.active {
    pointer-events: auto;
    cursor: crosshair;
}

.marker-point {
    position: absolute;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--secondary);
    border-radius: 50%;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 16px;
    font-weight: 400;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: transform 0.15s, box-shadow 0.15s;
    pointer-events: auto;
    z-index: 20;
}

.marker-point:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.marker-point::before {
    content: '+';
}

.marker-point__delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: var(--error);
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.marker-point:hover .marker-point__delete {
    display: flex;
}

.marker-point__gamme {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    background: var(--secondary);
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s;
}

.marker-point:hover .marker-point__gamme {
    opacity: 1;
    cursor: pointer;
}

.marker-point::after {
    content: '✎';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.15s;
}

.marker-point:hover::after {
    opacity: 0.6;
}

.marker-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.marker-count {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ============================================
   QUICK MARKER OVERLAY
   ============================================ */
.quick-marker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

.quick-marker-overlay__container {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    cursor: crosshair;
}

.quick-marker-overlay__container img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

.quick-marker-overlay__hint {
    color: #fff;
    font-size: 0.875rem;
    opacity: 0.8;
}

.quick-marker-overlay__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
}

.quick-marker-overlay__close:hover {
    background: rgba(255,255,255,0.3);
}

.quick-marker-overlay__point {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #ef4444;
    border: 3px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    pointer-events: none;
}

/* ============================================
   GAMME POPUP
   ============================================ */
.gamme-popup {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 0.75rem;
    z-index: 10000;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.gamme-popup__item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 6px;
    color: var(--text);
    transition: background 0.15s, color 0.15s;
}

.gamme-popup__item:hover {
    background: var(--secondary);
    color: #fff;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

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

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

/* ============================================
   LOGIN
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
}

.toast {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    animation: slideIn 0.2s ease-out;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
}

.toast--lg {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    min-width: 340px;
    font-size: 1rem;
    gap: 0.9rem;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

.toast-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.toast--lg .toast-icon {
    width: 34px;
    height: 34px;
}

.toast-icon-emoji {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

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

/* ============================================
   UTILITIES
   ============================================ */

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

/* Drag & Drop */
.draggable {
    cursor: move;
}

.draggable-card {
    cursor: move;
}

.draggable-card.drag-over {
    outline: 2px dashed var(--secondary);
}

.dragging {
    opacity: 0.5;
}

.drag-over {
    border-top: 2px solid var(--secondary);
}

/* Media Thumb */
.media-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-card__title {
    font-size: 0.75rem;
    margin: 0.25rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Code & Details */
code {
    word-break: break-all;
}

details {
    word-break: break-word;
}

summary {
    white-space: normal;
}

/* ============================================
   FILTERS
   ============================================ */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
}

/* ============================================
   SETTINGS PICKER
   ============================================ */
.settings-choice {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.settings-choice__preview {
    width: 180px;
    height: 110px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f3f3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.8rem;
}

.settings-choice__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-choice__meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-choice__title {
    font-weight: 600;
}

.settings-choice__value {
    color: var(--text-light);
    font-size: 0.875rem;
}

.settings-choice__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ============================================
   TYPES LIST
   ============================================ */
.types-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.type-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.type-item__drag {
    cursor: grab;
    color: var(--text-light);
    user-select: none;
}

.type-item__name {
    flex: 1;
}

.type-item__slug {
    width: 180px;
}

.type-item__actions {
    display: flex;
    gap: 0.25rem;
}

/* ============================================
   FIELDS LIST (Gamme Custom Fields)
   ============================================ */
.fields-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.15s;
}

.field-item--inactive {
    opacity: 0.5;
}

.field-item--dragging {
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}

.field-item--drag-over {
    border-color: var(--secondary);
    background: rgba(139, 115, 85, 0.05);
}

.field-item__handle {
    cursor: grab;
    color: var(--text-light);
    padding: 0.25rem;
    flex-shrink: 0;
}

.field-item__handle:active {
    cursor: grabbing;
}

.field-item__toggle {
    flex-shrink: 0;
}

.field-item__toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.field-item__info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.field-item__label {
    font-weight: 500;
}

.field-item__type {
    font-size: 0.75rem;
    color: var(--text-light);
    background: rgba(0,0,0,0.05);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.field-item__badge {
    font-size: 0.65rem;
    color: #fff;
    background: var(--secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.field-item__actions {
    display: flex;
    gap: 0.25rem;
}

/* ============================================
   CONFIG SECTION (Collapsible)
   ============================================ */
.config-section {
    margin-top: 1.5rem;
}

.config-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.config-section__header:hover {
    border-color: var(--secondary);
}

.config-section__header.is-open {
    border-radius: 10px 10px 0 0;
    border-bottom: none;
}

.config-section__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.config-section__title svg {
    width: 20px;
    height: 20px;
    stroke: var(--secondary);
}

.config-section__chevron {
    width: 20px;
    height: 20px;
    transition: transform 0.25s;
}

.config-section__header.is-open .config-section__chevron {
    transform: rotate(180deg);
}

.config-section__body {
    display: none;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    background: #fff;
}

.config-section__body.is-open {
    display: block;
}

.config-section__desc {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.config-section__actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.4;
}

.empty-state__text {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* ============================================
   MEDIA PICKER
   ============================================ */
.media-picker__toolbar {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.media-picker__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    max-height: 420px;
    overflow: auto;
    padding-right: 0.25rem;
}

.media-picker__item {
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f8f8f8;
    transition: all 0.2s;
}

.media-picker__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.media-picker__item.active {
    border-color: var(--secondary);
}

.media-picker__item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.media-picker__label {
    padding: 0.5rem;
    font-size: 0.75rem;
    text-align: center;
    color: var(--text);
}

.media-picker__label small {
    color: var(--text-light);
}

/* ============================================
   CHECKBOX LIST
   ============================================ */
.checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
    max-height: 200px;
    overflow: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text);
}

/* ============================================
   FOCAL PICKER - Point focal sélecteur
   ============================================ */
.focal-picker {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 8px;
    overflow: hidden;
    cursor: crosshair;
    background: #f3f4f6;
    border: 2px solid var(--border);
}

.focal-picker:hover {
    border-color: var(--secondary);
}

.focal-picker img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.focal-picker__marker {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: rgba(139, 115, 85, 0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: grab;
    z-index: 10;
}

.focal-picker__marker:active {
    cursor: grabbing;
}

.focal-picker__crosshair {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.focal-picker__crosshair::before,
.focal-picker__crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255,255,255,0.4);
}

.focal-picker__crosshair::before {
    width: 1px;
    height: 100%;
    left: var(--fx, 50%);
}

.focal-picker__crosshair::after {
    height: 1px;
    width: 100%;
    top: var(--fy, 50%);
}

.focal-picker__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    font-size: 0.875rem;
}

.focal-coords {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Layout 2 images */
.images-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.image-slot {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.image-slot__label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.image-slot__actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .images-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MARKER EDITOR - Éditeur de marqueurs caves
   ============================================ */
.marker-editor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
}

.marker-editor.active {
    pointer-events: auto;
    cursor: crosshair;
}

.marker-point {
    position: absolute;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--secondary);
    border-radius: 50%;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 16px;
    font-weight: 400;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: transform 0.15s, box-shadow 0.15s;
    pointer-events: auto;
    z-index: 20;
}

.marker-point:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.marker-point::before {
    content: '+';
}

.marker-point__delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: var(--error);
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.marker-point:hover .marker-point__delete {
    display: flex;
}

.marker-point__gamme {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    background: var(--secondary);
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s;
}

.marker-point:hover .marker-point__gamme {
    opacity: 1;
    cursor: pointer;
}

.marker-point::after {
    content: '✎';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.15s;
}

.marker-point:hover::after {
    opacity: 0.6;
}

.marker-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.marker-count {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Gamme popup (sélection de gamme pour marqueur) */
.gamme-popup {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 0.75rem;
    z-index: 10000;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.gamme-popup__item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 6px;
    color: var(--text);
    transition: background 0.15s, color 0.15s;
}

.gamme-popup__item:hover {
    background: var(--secondary);
    color: #fff;
}

/* ========================================
   Quick Marker Overlay
   ======================================== */

.quick-marker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.quick-marker-overlay__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.quick-marker-overlay__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.quick-marker-overlay__title {
    position: absolute;
    top: 2rem;
    left: 2rem;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.quick-marker-overlay__info {
    position: absolute;
    top: 5.5rem;
    left: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.quick-marker-nav {
    position: absolute;
    top: 3.5rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quick-marker-nav__btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-marker-nav__btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.quick-marker-nav__btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quick-marker-nav__position {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.quick-marker-overlay__container {
    position: relative;
    max-width: 90%;
    max-height: 85%;
    cursor: crosshair;
}

.quick-marker-overlay__image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.quick-marker-overlay__markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.quick-marker-overlay__marker {
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border: 3px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    transition: all 0.2s;
}

.quick-marker-overlay__marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
    background: var(--error);
}

.quick-marker-overlay__marker-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.quick-marker-overlay__marker:hover .quick-marker-overlay__marker-label {
    opacity: 1;
}

.quick-marker-overlay__marker-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: var(--error);
    border: 2px solid white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    cursor: pointer;
}

.quick-marker-overlay__marker:hover .quick-marker-overlay__marker-delete {
    display: flex;
}

.quick-marker-overlay__footer {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
}

.quick-marker-overlay__count {
    color: white;
    font-size: 0.875rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.quick-marker-overlay__status {
    color: white;
    font-size: 0.85rem;
    opacity: 0.85;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.35);
}

.quick-marker-overlay__status[data-state="saving"] {
    background: rgba(234, 179, 8, 0.25);
}

.quick-marker-overlay__status[data-state="saved"] {
    background: rgba(34, 197, 94, 0.25);
}

.quick-marker-overlay__status[data-state="error"] {
    background: rgba(239, 68, 68, 0.35);
}

.quick-marker-overlay__save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.quick-marker-overlay__save:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.quick-marker-overlay__save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quick marker icon in grid */
.installation-card[data-quick-marker] {
    position: relative;
}

.installation-card[data-quick-marker]::before {
    content: '⚡';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.installation-card[data-quick-marker]:hover::before {
    opacity: 0.9;
}

/* ========================================
   Translations Page
   ======================================== */

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

.translations-lang-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.translations-lang-tab {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.translations-lang-tab:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.translations-lang-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
}

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

.translations-lang-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.translations-lang-code {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.translations-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
}

.translations-section-header:hover {
    background: var(--bg-secondary);
    margin: 0 -1rem 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 0;
}

.translations-section-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.translations-section-toggle svg {
    width: 20px;
    height: 20px;
}

.translations-section.collapsed .translations-section-toggle {
    transform: rotate(-90deg);
}

.translations-section.collapsed .translations-section-content {
    display: none;
}

.translations-section-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.translations-section-title {
    flex: 1;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.translations-section-count {
    font-size: 0.875rem;
    color: var(--text-light);
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.translations-section-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.translations-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: background 0.2s;
}

.translations-row:hover {
    background: var(--bg-hover);
}

.translations-row-label {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.translations-row-label-text {
    font-weight: 500;
    color: var(--text);
}

.translations-row-key {
    font-size: 0.75rem;
    color: var(--text-light);
    background: rgba(0,0,0,0.05);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
}

.translations-row-input {
    flex: 1;
}

.translations-row-input .form-input {
    width: 100%;
    margin: 0;
}

.translations-row-input .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

/* Sticky language tabs */
.translations-lang-tabs-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    padding: 1.5rem 1.5rem 1rem;
    margin: 0 0 1.5rem;
    transition: box-shadow 0.3s ease;
}

.translations-lang-tabs-wrapper.is-fixed {
    position: fixed;
    top: 0;
    /* width et left seront définis dynamiquement par JS */
}

.translations-lang-tabs-placeholder {
    /* Placeholder pour éviter le jump quand le wrapper devient fixed */
    display: none;
}

.translations-lang-tabs-placeholder.active {
    display: block;
}

.translations-lang-tabs-wrapper .card {
    max-width: 1200px;
    margin: 0 auto;
}

.translations-lang-tabs-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.translations-lang-tabs-wrapper.is-stuck {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.translations-lang-tabs-wrapper.is-stuck::after {
    opacity: 1;
}

/* French reference text */
.translations-row-reference {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.375rem;
    font-style: italic;
    opacity: 0.7;
    line-height: 1.3;
}

.translations-row-reference em {
    font-weight: 500;
    color: var(--text);
    opacity: 0.8;
}

@media (max-width: 768px) {
    .translations-lang-tab {
        min-width: 120px;
        padding: 0.75rem;
    }

    .translations-lang-flag {
        font-size: 1.5rem;
    }

    .translations-lang-name {
        font-size: 0.875rem;
    }

    .translations-row {
        flex-direction: column;
        align-items: stretch;
    }

    .translations-row-label {
        flex: 1;
    }
}

/* ========================================
   Contact Form Page
   ======================================== */

.contact-field-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: background 0.2s, box-shadow 0.2s;
}

.contact-field-item:hover {
    background: var(--bg-hover);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.contact-field-grip {
    cursor: grab;
    color: var(--text-light);
    font-size: 1.25rem;
    padding: 0.25rem;
    user-select: none;
}

.contact-field-grip:active {
    cursor: grabbing;
}

.contact-field-info {
    flex: 1;
}

.contact-field-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.contact-field-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.contact-field-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-field-order {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-light);
}

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

.badge-secondary {
    background: var(--secondary);
    color: white;
}

/* Sortable list */
.sortable-list {
    min-height: 100px;
}

.contact-field-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.contact-field-item[draggable="true"] {
    cursor: move;
}

/* Step Containers */
.step-container {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-primary);
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid var(--border);
}

.step-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.step-count {
    font-size: 0.875rem;
    color: var(--text-light);
    background: rgba(0,0,0,0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.step-fields {
    padding: 1rem;
    min-height: 80px;
    background: var(--bg-primary);
}

.step-fields[data-step] {
    transition: background 0.2s;
}

.step-fields[data-step]:hover {
    background: #fafbfc;
}

.step-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-light);
    font-style: italic;
    border: 2px dashed var(--border);
    border-radius: 8px;
    text-align: center;
}

/* Button icon */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--bg-hover);
}

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

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text);
}

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

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Field editor accordion */
.field-editor-section {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-primary);
}

.field-editor-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.field-editor-section-header:hover {
    background: var(--bg-hover);
}

.field-editor-section-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

.field-editor-section-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 4px;
    background: #10b981;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-editor-section-arrow {
    font-size: 1.25rem;
    transition: transform 0.2s;
    color: var(--text-light);
}

.field-editor-section.collapsed .field-editor-section-arrow {
    transform: rotate(-90deg);
}

.field-editor-section-content {
    padding: 1rem;
}

.field-editor-section.collapsed .field-editor-section-content {
    display: none;
}

.field-editor-section-desc {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    font-size: 0.875rem;
    color: #1e40af;
    border-radius: 4px;
}

/* Option row styling */
.options-list {
    margin-bottom: 1rem;
}

.option-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.option-row-col {
    display: flex;
    flex-direction: column;
}

.option-row-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.375rem;
}

.option-row input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9375rem;
}

.btn-add-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-option:hover {
    background: #16a34a;
}

.btn-remove-option {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    font-size: 1.125rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-remove-option:hover {
    background: #fca5a5;
}

.options-count {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Menu Management Styles */
#menuEditorModal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

#menuEditorModal .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

#menuEditorModal .modal-content {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 640px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    overflow: hidden;
}

#menuEditorModal .modal-header,
#menuEditorModal .modal-body {
    padding: 1rem 1.25rem;
}

#menuEditorModal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0 1.25rem 1rem;
}
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
}

.menu-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.menu-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.menu-item[draggable="true"] {
    cursor: move;
}

.menu-item__grip {
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: grab;
    user-select: none;
}

.menu-item__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-item__info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.menu-item__label {
    font-weight: 600;
    color: var(--text);
}

.menu-item__meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.menu-item__children {
    margin-top: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-child-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.menu-child-item:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.menu-child-item__info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.menu-child-item__url {
    font-size: 0.75rem;
    color: var(--text-light);
}

.menu-child-item__actions {
    display: flex;
    gap: 0.25rem;
}

.menu-item__actions {
    display: flex;
    gap: 0.25rem;
}

.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 2px dashed var(--border);
}

/* ============================================
   SIDE PANEL (Lateral Drawer)
   ============================================ */
.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    max-width: 90vw;
    height: 100vh;
    background: var(--card);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-panel.active {
    transform: translateX(0);
}

.side-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    flex-shrink: 0;
}

.side-panel__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.side-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.side-panel__close:hover {
    background: var(--border);
    color: var(--text);
}

.side-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.side-panel__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-shrink: 0;
}

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

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

.drawer-section__title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin: 0 0 1rem;
}

/* Gammes drawer readability */
#gammeForm .drawer-section {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    padding: 1rem 1rem 0.5rem;
    margin-bottom: 1rem;
    background: #f7f8fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#gammeForm .drawer-section__title {
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--text);
    margin: 0 0 0.95rem;
}

#gammeForm .form-label {
    color: var(--text);
    font-weight: 600;
    font-size: 0.88rem;
}

#gammeForm .gamme-subtitle {
    margin: 0.1rem 0 0.7rem;
    font-size: 0.8rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text);
    font-weight: 700;
}

#gammeForm .gamme-hint {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-light);
    font-size: 0.82rem;
    line-height: 1.45;
}

#gammeForm .gamme-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text);
    font-size: 0.95rem;
}

#gammeForm .gamme-check + .gamme-check {
    margin-top: 0.4rem;
}

#gammeForm .gamme-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Drawer Language Tabs */
.drawer-lang-tabs {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
}

.drawer-lang-tabs--sticky {
    position: sticky;
    top: var(--lang-tabs-sticky-top, 0.5rem);
    z-index: 12;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
}

.drawer-lang-tab {
    flex: 1;
    padding: 0.5rem 0.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.drawer-lang-tab:hover {
    border-color: var(--secondary);
    color: var(--text);
}

.drawer-lang-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.drawer-lang-tab--filled::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.drawer-lang-tab.active.drawer-lang-tab--filled::after {
    background: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .drawer-lang-tabs.drawer-lang-tabs--sticky:not(#installationSeoTabs) {
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .drawer-lang-tabs.drawer-lang-tabs--sticky:not(#installationSeoTabs) .drawer-lang-tab {
        flex: 0 0 auto;
        min-width: 52px;
    }

    .side-panel {
        width: 100%;
        max-width: 100%;
    }
}

/* ============================================
   COLOR PICKER
   ============================================ */
.color-picker {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-picker input[type="color"] {
    width: 48px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    background: white;
}

.color-picker input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-picker input[type="text"] {
    flex: 1;
    font-family: 'Monaco', 'Courier New', monospace;
    text-transform: uppercase;
}
