/* =====================================================
   CardManager — Feuille de style principale
   ===================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary:      #1d4ed8;
    --color-primary-hover:#1e40af;
    --color-bg:           #f1f5f9;
    --color-white:        #ffffff;
    --color-border:       #e2e8f0;
    --color-border-focus: #93c5fd;
    --color-text:         #0f172a;
    --color-text-muted:   #64748b;
    --color-error:        #dc2626;
    --color-error-bg:     #fef2f2;
    --color-error-border: #fecaca;
    --color-success:      #16a34a;
    --color-success-bg:   #f0fdf4;
    --color-sidebar-bg:   #1e293b;
    --color-sidebar-text: #e2e8f0;
    --color-sidebar-muted:#94a3b8;
    --color-sidebar-hover:#2d3f57;
    --color-sidebar-active:#2563eb;
    --color-header-bg:    #0f172a;
    --font:               -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius:             6px;
    --shadow-sm:          0 1px 3px rgba(0,0,0,.08);
    --shadow-md:          0 4px 12px rgba(0,0,0,.10);
}

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
}

/* =====================================================
   COMPOSANTS COMMUNS
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}

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

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

.btn-logout {
    background: rgba(255,255,255,.1);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,.15);
    font-size: 12px;
    padding: 6px 12px;
}
.btn-logout:hover {
    background: rgba(255,255,255,.18);
    color: white;
}

.btn-danger-outline {
    background: transparent;
    color: var(--color-error);
    border: 1px solid var(--color-error);
}
.btn-danger-outline:hover {
    background: var(--color-error-bg);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 14px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: var(--color-error-border);
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: #bbf7d0;
}

/* =====================================================
   PAGE LOGIN
   ===================================================== */

/* =====================================================
   LOGIN — SPLIT SCREEN
   ===================================================== */

.login-body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.login-split {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.login-left {
    flex: 0 0 50%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 10%;
    background: #ffffff;
    overflow: hidden;
}

.login-form-wrap {
    width: 100%;
    max-width: 380px;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #0a1628;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}

.login-alert {
    margin-bottom: 20px;
}

.login-field {
    margin-bottom: 16px;
}

.login-field input {
    width: 100%;
    padding: 14px 22px;
    font-size: 15px;
    font-family: var(--font);
    color: #0a1628;
    background: #fdfde8;
    border: 1.5px solid #b8cdd8;
    border-radius: 50px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field input:focus {
    border-color: #0c2d4e;
    box-shadow: 0 0 0 3px rgba(12, 45, 78, 0.1);
}

.login-field input::placeholder {
    color: #8aacbc;
}

.login-btn {
    display: block;
    width: 100%;
    padding: 14px 22px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #ffffff;
    background: #0c2d4e;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 8px;
}

.login-btn:hover {
    background: #0f3a63;
}

.login-right {
    flex: 0 0 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c2d4e;
    overflow: hidden;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 24px;
}

.login-logo-img {
    width: 70%;
    max-width: 340px;
}

/* =====================================================
   FORMULAIRE GÉNÉRAL
   ===================================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.form-group textarea {
    resize: vertical;
    line-height: 1.5;
}

.form-group + .form-group {
    margin-top: 0;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

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

.form-group-wide {
    flex: 2;
}

/* =====================================================
   DASHBOARD — STRUCTURE
   ===================================================== */

.dashboard-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 52px;
    background: var(--color-header-bg);
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--color-primary);
    color: white;
    font-weight: 700;
    font-size: 12px;
    border-radius: 6px;
}

.header-title {
    font-weight: 700;
    font-size: 15px;
    color: white;
    letter-spacing: -0.02em;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-enseigne {
    font-weight: 600;
    font-size: 13px;
    color: #e2e8f0;
}

.header-email {
    font-size: 12px;
    color: #94a3b8;
}

.app-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* =====================================================
   SIDEBAR
   ===================================================== */

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--color-sidebar-bg);
    border-right: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-header h2 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-sidebar-muted);
}

.card-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-sidebar-muted);
    background: rgba(255,255,255,.08);
    padding: 2px 8px;
    border-radius: 20px;
}

.sidebar-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    color: var(--color-sidebar-muted);
    font-size: 13px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

.card-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding: 6px 0;
}

.card-list-item {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.12s;
}

.card-list-item:hover {
    background: var(--color-sidebar-hover);
}

.card-list-item.active {
    background: rgba(37, 99, 235, 0.2);
    border-left-color: var(--color-sidebar-active);
}

.card-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-item-file {
    font-size: 11px;
    color: var(--color-sidebar-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =====================================================
   ÉDITEUR
   ===================================================== */

.editor-panel {
    flex: 1;
    overflow-y: auto;
    background: var(--color-bg);
}

.editor-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-muted);
    gap: 12px;
}

.placeholder-icon {
    font-size: 48px;
    opacity: 0.3;
}

.editor-placeholder p {
    font-size: 14px;
}

.editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.editor-topbar h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
}

.editor-filename {
    font-size: 11px;
    color: var(--color-text-muted);
    font-family: monospace;
    margin-top: 2px;
    display: block;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.save-status {
    font-size: 12px;
    font-weight: 500;
    min-width: 160px;
    text-align: right;
}

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

.save-status.error {
    color: var(--color-error);
}

.save-status.saving {
    color: var(--color-text-muted);
}

.editor-body {
    display: flex;
    align-items: flex-start;
    height: calc(100vh - 65px);
    overflow: hidden;
}

.editor-form {
    flex: 1;
    min-width: 0;
    max-width: 640px;
    padding: 24px;
    overflow-y: auto;
    height: 100%;
}

.editor-aside {
    flex: 0 0 500px;
    height: 100%;
    overflow-y: auto;
    padding: 20px 16px;
    background: var(--color-white);
    border-left: 1px solid var(--color-border);
}

.aside-media-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.aside-media-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.aside-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.aside-photo-wrap {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.aside-photo-preview {
    width: 100%;
    height: 100%;
}

.aside-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aside-photo-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--color-text-muted);
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
}

.aside-photo-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.aside-photo-controls .btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 6px 8px;
}

.inline-qr-wrap {
    display: flex;
    justify-content: center;
    background: #fff;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid var(--color-border);
}

.inline-qr-wrap img,
.inline-qr-wrap canvas {
    display: block;
    max-width: 100%;
}

.inline-qr-url {
    font-size: 10px;
    color: var(--color-text-muted);
    word-break: break-all;
    line-height: 1.4;
}

.aside-qr-actions {
    display: flex;
    gap: 6px;
}

.aside-export-btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 6px 8px;
}

.form-section {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.form-section .form-row {
    margin-bottom: 12px;
}

.form-section .form-row:last-child {
    margin-bottom: 0;
}

.form-section .form-group:not(:last-child) {
    margin-bottom: 0;
}

/* =====================================================
   PHOTO
   ===================================================== */

.photo-area {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.photo-preview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-empty {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px dashed var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--color-text-muted);
    flex-shrink: 0;
    text-align: center;
}

.photo-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* =====================================================
   MODAL RECADRAGE PHOTO
   ===================================================== */

.crop-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.crop-box {
    background: var(--color-white);
    border-radius: 10px;
    padding: 24px;
    width: 340px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.crop-box-header h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.crop-hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

.crop-stage {
    display: flex;
    justify-content: center;
}

#cropCanvas {
    border-radius: 8px;
    cursor: grab;
    border: 2px solid var(--color-border);
    display: block;
}

#cropCanvas:active {
    cursor: grabbing;
}

.crop-zoom-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crop-zoom-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
}

#cropZoom {
    flex: 1;
    accent-color: var(--color-primary);
}

.crop-box-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* =====================================================
   CHARGEMENT DANS L'ÉDITEUR
   ===================================================== */

.editor-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--color-text-muted);
    gap: 12px;
}

.editor-loading .spinner {
    border-top-color: var(--color-primary);
    border-color: var(--color-border);
    border-top-color: var(--color-primary);
}

/* =====================================================
   SIDEBAR — RECHERCHE & CONTRÔLES
   ===================================================== */

.sidebar-search {
    padding: 10px 12px 6px;
}

.sidebar-search input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius);
    color: var(--color-sidebar-text);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
}

.sidebar-search input:focus {
    background-color: rgba(255,255,255,.12);
    border-color: rgba(96,165,250,.5);
}

.sidebar-search input::placeholder {
    color: var(--color-sidebar-muted);
}

.sidebar-search input::-webkit-search-cancel-button {
    filter: invert(1) opacity(0.4);
    cursor: pointer;
}

.sidebar-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px 8px;
}

.sidebar-ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius);
    color: var(--color-sidebar-muted);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.12s;
    white-space: nowrap;
}

.sidebar-ctrl-btn:hover {
    background: rgba(255,255,255,.08);
    color: var(--color-sidebar-text);
}

.sidebar-ctrl-btn.active {
    background: rgba(37,99,235,.25);
    border-color: rgba(37,99,235,.5);
    color: #93c5fd;
}

.sidebar-ctrl-sep {
    flex: 1;
}

/* =====================================================
   VUE GRILLE
   ===================================================== */

.card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
    align-content: start;
}

.card-grid-item {
    background: rgba(255,255,255,.05);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 12px 8px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    transition: background 0.12s, border-color 0.12s;
}

.card-grid-item:hover {
    background: rgba(255,255,255,.1);
}

.card-grid-item.active {
    border-color: var(--color-sidebar-active);
    background: rgba(37,99,235,.2);
}

.card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.card-grid-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-sidebar-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.card-grid-sub {
    font-size: 10px;
    color: var(--color-sidebar-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* =====================================================
   ÉTATS VIDES
   ===================================================== */

.no-results {
    list-style: none;
    padding: 20px 16px;
    font-size: 13px;
    color: var(--color-sidebar-muted);
    text-align: center;
}

/* =====================================================
   RÉSEAUX SUPPLÉMENTAIRES
   ===================================================== */

.extra-url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.extra-url-row input[type="text"] {
    flex: 0 0 130px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color 0.15s;
}

.extra-url-row input[type="url"] {
    flex: 1;
    padding: 8px 10px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color 0.15s;
}

.extra-url-row input:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.extra-url-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: background 0.15s;
}

.extra-url-remove:hover {
    background: #fecaca;
}

.extra-url-add {
    margin-top: 4px;
    font-size: 12px;
}

/* =====================================================
   BOUTON SAVE — ÉTAT DIRTY
   ===================================================== */

#btnSave.dirty {
    background: #d97706;
}
#btnSave.dirty:hover {
    background: #b45309;
}

.save-status.dirty {
    color: #d97706;
}

/* =====================================================
   BADGE ADMIN
   ===================================================== */

.header-badge-admin {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 4px;
    padding: 2px 7px;
}

/* =====================================================
   FOLDER PICKER (ADMIN)
   ===================================================== */

.folder-picker {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding-bottom: 4px;
}

.folder-picker-header {
    padding: 12px 16px 6px;
}

.folder-picker-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-sidebar-muted);
}

.folder-input-wrap {
    display: flex;
    gap: 6px;
    padding: 4px 12px 4px;
}

.folder-input-wrap input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius);
    color: var(--color-sidebar-text);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s;
}

.folder-input-wrap input:focus {
    border-color: rgba(96,165,250,.5);
    background: rgba(255,255,255,.11);
}

.folder-input-wrap input::placeholder {
    color: var(--color-sidebar-muted);
}

.folder-input-btn {
    padding: 6px 10px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius);
    color: var(--color-sidebar-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
}

.folder-input-btn:hover {
    background: rgba(255,255,255,.18);
}

.folder-picker-footer {
    padding: 6px 12px 10px;
}

.folder-export-btn {
    width: 100%;
    justify-content: center;
    font-size: 11px;
    padding: 5px 10px;
    background: rgba(255,255,255,.06);
    color: var(--color-sidebar-muted);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius);
}

.folder-export-btn:hover:not(:disabled) {
    background: rgba(255,255,255,.12);
    color: var(--color-sidebar-text);
}

.folder-export-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.folder-zip-btn {
    margin-top: 2px;
    border-color: rgba(20, 184, 166, 0.3);
    color: #5eead4;
}

.folder-zip-btn:hover:not(:disabled) {
    background: rgba(20, 184, 166, 0.15);
    color: #99f6e4;
}

.zip-export-status {
    font-size: 11px;
    color: var(--color-sidebar-muted);
    padding: 2px 0;
    text-align: center;
}

.folder-create-btn {
    margin-top: 4px;
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.folder-create-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
}

/* QR color picker */
.qr-color-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 2px;
}

.qr-color-label {
    font-size: 11px;
    color: var(--color-text-muted);
}

.qr-color-row input[type="color"] {
    width: 26px;
    height: 26px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1px;
    cursor: pointer;
    background: none;
}

.qr-color-hex {
    font-size: 11px;
    color: var(--color-text-muted);
    font-family: monospace;
}

/* =====================================================
   MODAL GÉNÉRIQUE
   ===================================================== */

.modal-box {
    background: var(--color-white);
    border-radius: 10px;
    padding: 24px;
    width: 420px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.modal-box-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.modal-close:hover { color: var(--color-text); }

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-box-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-status {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius);
}

.modal-status-ok {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.modal-status-err {
    background: var(--color-error-bg);
    color: var(--color-error);
}

/* =====================================================
   MODAL IMPORT EXCEL
   ===================================================== */

.modal-box-wide {
    width: 640px;
    max-width: 95vw;
}

.import-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.import-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted);
}

.import-hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

.import-file-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-filename {
    font-size: 13px;
    color: var(--color-text-muted);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.import-preview-info {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-success);
}

.import-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.import-table thead th {
    background: var(--color-bg);
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.import-table tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--color-border);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-table tbody tr:last-child td {
    border-bottom: none;
}

.import-more {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 5px 8px;
}

.import-photo-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.import-photo-preview {
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-photo-preview img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--color-border);
}

.import-optional {
    font-size: 11px;
    color: var(--color-text-muted);
    font-style: italic;
}

.import-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.import-progress-log {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 160px;
    overflow-y: auto;
}

.import-log-error {
    font-size: 12px;
    color: var(--color-error);
    background: var(--color-error-bg);
    border: 1px solid var(--color-error-border);
    border-radius: var(--radius);
    padding: 4px 8px;
}

/* =====================================================
   RESPONSIVE MINIMAL
   ===================================================== */

@media (max-width: 768px) {
    .sidebar {
        width: 220px;
    }

    .header-email {
        display: none;
    }

    .form-row {
        flex-direction: column;
    }

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