/* TTL QR Docs - Mobile-first styling */
:root {
    --ttl-red: #C8102E;
    --ttl-red-dark: #A30D26;
    --ttl-red-light: #FDECEF;
    --bg: #F7F6F2;
    --surface: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #6B6B6B;
    --text-faint: #999999;
    --border: #E5E2DA;
    --border-strong: #D0CCC0;
    --ok: #1D9E75;
    --ok-bg: #E1F5EE;
    --warn: #BA7517;
    --warn-bg: #FAEEDA;
    --danger: #C0392B;
    --danger-bg: #FBEAEA;
    --info: #185FA5;
    --info-bg: #E6F1FB;
    --radius: 10px;
    --radius-lg: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}
body.centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 500; margin: 0 0 1rem; }
h2 { font-size: 17px; font-weight: 500; margin: 1.5rem 0 0.75rem; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ===== BRAND ===== */
.brand { text-align: center; margin-bottom: 1.5rem; }
.brand-logo {
    display: inline-block;
    font-weight: 600;
    font-size: 28px;
    color: var(--ttl-red);
    letter-spacing: 3px;
    line-height: 1;
}
.brand-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ===== CARD ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
}
.error-card { text-align: center; }

/* ===== PHONE APP (mobile-first, fills viewport on mobile) ===== */
.phone-app {
    background: var(--surface);
    width: 100%;
    max-width: 420px;
    min-height: 100vh;
    padding: 28px 20px 32px;
    margin: 0 auto;
}
body.centered .phone-app { min-height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
@media (min-width: 500px) {
    .phone-app { margin: 20px auto; min-height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
}

/* ===== DOSSIER INFO ===== */
.dossier-info { text-align: center; margin-bottom: 1.5rem; padding: 1rem; background: var(--bg); border-radius: var(--radius); }
.dossier-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.dossier-name { font-size: 17px; font-weight: 500; }
.dossier-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ===== PIN KEYPAD ===== */
.pin-form { text-align: center; }
.pin-label { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 24px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); transition: all 0.15s; }
.pin-dot.filled { background: var(--ttl-red); border-color: var(--ttl-red); }

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 320px;
    margin: 0 auto;
}
.pin-btn {
    aspect-ratio: 1;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    font-size: 24px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    transition: background 0.1s, transform 0.05s;
    -webkit-touch-callout: none;
}
.pin-btn:hover { background: var(--bg); }
.pin-btn:active { background: var(--border); transform: scale(0.95); }
.pin-btn-empty { visibility: hidden; }
.pin-btn-back { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.pin-error { margin-top: 16px; font-size: 13px; color: var(--danger); min-height: 18px; }

/* ===== CLIENT : DOCS ===== */
.docs-app { padding: 0; }
.docs-header {
    background: var(--ttl-red);
    color: white;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
@media (min-width: 500px) {
    .docs-app { border-radius: var(--radius-lg); overflow: hidden; }
    .docs-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
.logout-link { color: white; opacity: 0.85; padding: 4px; }
.logout-link:hover { opacity: 1; text-decoration: none; }
.docs-header-info { flex: 1; min-width: 0; }
.docs-header-label { font-size: 11px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.5px; }
.docs-header-title { font-size: 18px; font-weight: 500; margin-top: 2px; }
.docs-header-desc { font-size: 12px; opacity: 0.9; margin-top: 2px; }
.docs-body { padding: 16px 20px 32px; }
.docs-count { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.doc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s;
}
.doc-row:hover { background: var(--bg); text-decoration: none; }
.doc-icon {
    width: 38px; height: 38px;
    border-radius: 8px;
    background: var(--ttl-red-light);
    color: var(--ttl-red);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.doc-meta { flex: 1; min-width: 0; }
.doc-name { font-size: 15px; font-weight: 500; }
.doc-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.doc-chev { color: var(--text-faint); flex-shrink: 0; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ===== FORMS ===== */
.form, form label { display: block; }
form label {
    margin-bottom: 1rem;
    font-size: 13px;
    color: var(--text-muted);
}
form label small { display: block; margin-top: 4px; }
input[type="text"], input[type="password"], input[type="file"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    margin-top: 4px;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ttl-red); outline-offset: -1px; border-color: var(--ttl-red); }
button, .btn, .btn-primary, .btn-danger {
    display: inline-block;
    padding: 10px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.btn:hover, button:hover { background: var(--bg); }
.btn-primary { background: var(--ttl-red); color: white; border-color: var(--ttl-red); }
.btn-primary:hover { background: var(--ttl-red-dark); color: white; text-decoration: none; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.9; color: white; text-decoration: none; }
.btn-danger-text { background: none; border: none; color: var(--danger); padding: 4px 8px; cursor: pointer; font-size: 13px; }
.btn-danger-text:hover { text-decoration: underline; background: none; }

.form-error { color: var(--danger); background: var(--danger-bg); padding: 10px 12px; border-radius: var(--radius); margin: 1rem 0; font-size: 14px; }
.alert { padding: 10px 14px; border-radius: var(--radius); margin: 1rem 0; font-size: 14px; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--danger-bg); color: var(--danger); }

/* ===== ADMIN ===== */
.admin-bar {
    background: white;
    color: var(--text);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.admin-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--ttl-red);
}
.admin-bar .brand-logo { color: var(--ttl-red); font-size: 18px; letter-spacing: 2px; }
.admin-bar-brand { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.admin-bar-brand .admin-title {
    color: var(--text-muted);
    font-weight: 500;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}
.admin-nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.admin-nav a {
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
    position: relative;
}
.admin-nav a:hover {
    color: var(--text);
    background: var(--bg);
    text-decoration: none;
}
.admin-nav a.active {
    color: var(--ttl-red);
    background: color-mix(in srgb, var(--ttl-red) 8%, white);
}
.admin-nav a.logout {
    color: var(--text-faint);
    margin-left: 6px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
    border-radius: 0;
}
.admin-nav a.logout:hover {
    color: var(--ttl-red);
    background: transparent;
}
.admin-main { max-width: 1400px; margin: 0 auto; padding: 32px 40px 64px; }
@media (max-width: 700px) {
    .admin-main { padding: 20px 16px 40px; }
}

.back-link { display: inline-block; margin-bottom: 1rem; font-size: 14px; color: var(--text-muted); }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 2rem;
}
.stat { background: var(--surface); padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.stat-value { font-size: 28px; font-weight: 500; margin-top: 4px; }
.stat-value.warn { color: var(--warn); }

.section-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.section-toolbar h2 { margin: 0; }

/* Dossier list */
.dossier-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.dossier-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}
.dossier-row:last-child { border-bottom: none; }
.dossier-row:hover { background: var(--bg); text-decoration: none; }
.dossier-row-code {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-muted);
    white-space: nowrap;
}
.dossier-row-info { flex: 1; min-width: 0; }
.dossier-row-name { font-weight: 500; font-size: 15px; }
.dossier-row-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dossier-row-meta { flex-shrink: 0; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 500; background: var(--bg); color: var(--text-muted); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* Dossier detail */
.dossier-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.dossier-head h1 { margin-bottom: 4px; }
.actions { flex-shrink: 0; }

.upload-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin: 0.5rem 0; background: var(--surface); padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); }
.upload-form input { margin-top: 0; }
@media (max-width: 600px) {
    .upload-form { grid-template-columns: 1fr; }
}

.doc-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 1rem; }
.doc-table-row { padding: 12px 16px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 4px 1rem; align-items: center; }
.doc-table-row:last-child { border-bottom: none; }
.doc-table-name { font-weight: 500; font-size: 14px; }
.doc-table-meta { grid-column: 1; font-size: 12px; color: var(--text-muted); }

/* QR */
.qr-block { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; background: var(--surface); padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.qr-block img { background: white; padding: 8px; border-radius: 8px; border: 1px solid var(--border); }

/* Audit */
.audit-filter { margin-bottom: 1rem; }
.audit-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.audit-table th, .audit-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.audit-table th { background: var(--bg); font-weight: 500; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.audit-table tr:last-child td { border-bottom: none; }
.pagination { margin: 1rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }

/* Login card */
.login-card { max-width: 360px; }
.login-card .brand { margin-bottom: 2rem; }

/* Print: cacher chrome admin sur la page QR */
@media print {
    .admin-bar, .back-link, .qr-block .btn, .qr-block button { display: none !important; }
    .qr-block { border: none; padding: 0; }
}

/* ============================================================
   v2 — Card-based dossier list, filters, categories, ZIP UI
   ============================================================ */

/* Admin logo image */
.admin-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Stats avec icônes */
.stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}
.stat-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-value { font-size: 26px; line-height: 1.1; }

/* Toolbar */
.toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Empty state */
.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 1rem; }
.empty-state h3 {
    color: var(--text);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.empty-state p { margin-bottom: 1.5rem; max-width: 360px; margin-left: auto; margin-right: auto; }

/* Filters bar */
.filters-bar { margin-bottom: 1rem; }
.search-input {
    position: relative;
    max-width: 480px;
}
.search-input svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
}
.search-input input {
    width: 100%;
    padding-left: 38px;
    margin-top: 0;
    height: 40px;
}

/* Category pills */
.category-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 1rem 0 1.5rem;
}
.pill {
    --pill-color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.pill:hover {
    border-color: var(--pill-color);
    color: var(--pill-color);
}
.pill-active {
    background: var(--pill-color);
    border-color: var(--pill-color);
    color: white;
}
.pill-active .pill-count {
    background: rgba(255,255,255,0.25);
    color: white;
}
.pill[data-cat="all"] { --pill-color: var(--ttl-red); }
.pill[data-cat="none"] { --pill-color: var(--text-faint); }
.pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 100px;
    min-width: 22px;
}

/* Dossier cards (grid) */
.dossier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.dossier-card {
    --card-accent: var(--text-faint);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius);
    padding: 16px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dossier-card:hover {
    border-color: var(--border-strong);
    border-left-color: var(--card-accent);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.dossier-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.dossier-card-code {
    font-family: ui-monospace, monospace;
    font-size: 11px;
    background: var(--bg);
    color: var(--text-muted);
    padding: 3px 7px;
    border-radius: 5px;
    flex-shrink: 0;
}
.dossier-card-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}
.dossier-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.dossier-card-foot {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}
.dossier-card-docs {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.dossier-card-arrow {
    color: var(--card-accent);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.15s;
}
.dossier-card:hover .dossier-card-arrow { opacity: 1; }

/* Category badge */
.cat-badge {
    --cat-color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    background: color-mix(in srgb, var(--cat-color) 12%, white);
    color: var(--cat-color);
    border: 1px solid color-mix(in srgb, var(--cat-color) 25%, white);
    line-height: 1.4;
}
.cat-badge-none {
    background: var(--bg);
    color: var(--text-faint);
    border-color: var(--border);
}

.empty-search {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Edit meta toggle */
.edit-meta {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 1rem 0 1.5rem;
}
.edit-meta summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    user-select: none;
    list-style: none;
}
.edit-meta summary::before {
    content: '⚙ ';
    margin-right: 4px;
}
.edit-meta summary::-webkit-details-marker { display: none; }
.edit-meta[open] summary { color: var(--text); margin-bottom: 0.5rem; }

/* ZIP export page */
.zip-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.zip-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}
.zip-filter select {
    margin-top: 0;
    min-width: 240px;
}

.progress-bar {
    height: 10px;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.progress-fill {
    height: 100%;
    background: var(--ttl-red);
    width: 0%;
    transition: width 0.2s ease;
}
.progress-text {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
}

/* Categories admin */
.cat-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 1rem;
}
.cat-form-grid label { margin-bottom: 0; }
@media (max-width: 600px) {
    .cat-form-grid { grid-template-columns: 1fr; }
}

.cat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cat-row {
    display: grid;
    grid-template-columns: 44px 2fr 80px 60px 60px auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.cat-row input,
.cat-row select {
    margin-top: 0;
    padding: 6px 8px;
    font-size: 13px;
}
.cat-row input[type="color"] {
    padding: 2px;
    height: 32px;
    cursor: pointer;
}
.cat-swatch {
    width: 44px;
    height: 32px;
    border-radius: 6px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.cat-row button {
    padding: 6px 10px;
    font-size: 12px;
}
@media (max-width: 800px) {
    .cat-row {
        grid-template-columns: 44px 1fr 1fr;
        gap: 6px;
    }
    .cat-row input[type="number"] { display: none; }
    .cat-row button { grid-column: span 1; }
}

/* Admin nav refinement */
.admin-nav a {
    padding: 7px 12px;
    font-size: 13px;
    transition: background 0.15s;
}

/* ============================================================
   v3 — Import d'archive ZIP
   ============================================================ */

.import-form-card { max-width: none; margin-top: 1.5rem; }
.import-form { display: flex; flex-direction: column; gap: 1.25rem; }

/* Zone de drop / upload */
.import-drop {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 0 !important;
    text-align: center;
    background: var(--bg);
}
.import-drop:hover {
    border-color: var(--ttl-red);
    background: var(--ttl-red-light);
}
.import-drop input[type="file"] {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    overflow: hidden;
    border: 0;
    padding: 0;
}
.import-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}
.import-drop-content svg { color: var(--text-faint); }
.import-drop-content strong {
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
}
.import-filename {
    font-family: ui-monospace, monospace;
    color: var(--ttl-red) !important;
    font-weight: 500;
    margin-top: 4px;
}

/* Options en grid */
.import-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.import-options label { margin-bottom: 0; }
@media (max-width: 700px) { .import-options { grid-template-columns: 1fr; } }

/* Case "Aperçu seulement" */
.import-checkbox {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--info-bg);
    border-radius: var(--radius);
    cursor: pointer;
    margin-bottom: 0 !important;
}
.import-checkbox input { margin-top: 3px; width: auto; }
.import-checkbox span {
    color: var(--info);
    font-size: 13px;
    line-height: 1.4;
}

/* Loading pendant traitement */
.import-loading {
    margin-top: 0.5rem;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.import-loading > div { flex: 1; min-width: 200px; }
.loading-spinner {
    width: 22px; height: 22px;
    border: 3px solid var(--border);
    border-top-color: var(--ttl-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Rapport d'import ===== */
.import-report {
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
}
.import-report-head {
    padding: 1.25rem 1.5rem;
    border-left: 4px solid;
}
.import-report-head.is-dry  { border-left-color: var(--info);  background: var(--info-bg); }
.import-report-head.is-done { border-left-color: var(--ok);    background: var(--ok-bg);   }
.import-report-head h2 { margin: 0; font-size: 18px; }
.import-report-head.is-dry h2  { color: var(--info); }
.import-report-head.is-done h2 { color: var(--ok); }

.import-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 1px;
    background: var(--border);
}
.import-stat {
    background: var(--surface);
    padding: 14px 12px;
    text-align: center;
}
.import-stat-num { font-size: 28px; font-weight: 500; line-height: 1; }
.import-stat-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    margin-top: 4px;
}
.import-stat.ok    .import-stat-num { color: var(--ok); }
.import-stat.warn  .import-stat-num { color: var(--warn); }
.import-stat.error .import-stat-num { color: var(--danger); }
.import-stat.info  .import-stat-num { color: var(--info); }
.import-stat.muted .import-stat-num { color: var(--text-muted); }

.import-section {
    border-top: 1px solid var(--border);
    padding: 14px 1.5rem;
}
.import-section summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    user-select: none;
    padding: 4px 0;
}
.import-section[open] summary { margin-bottom: 0.5rem; }
.import-list {
    margin: 8px 0 0 1rem;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    max-height: 320px;
    overflow-y: auto;
}
.import-list li code {
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   v3 · LOGIN PAGE · Split-screen avec décoration QR
   ============================================================ */

body.admin-login-page {
  margin: 0;
  padding: 0;
  background: var(--bg);
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

/* ====== LEFT · Brand panel ====== */
.login-brand-panel {
  position: relative;
  background: var(--bg);
  background-image: radial-gradient(rgba(200, 16, 46, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

/* Décoration QR · les 3 carrés ressemblent aux markers de position d'un vrai QR code */
.login-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.qr-mark {
  position: absolute;
  width: 96px;
  height: 96px;
  border: 4px solid color-mix(in srgb, var(--ttl-red) 12%, transparent);
  border-radius: 6px;
}
.qr-mark::before {
  content: '';
  position: absolute;
  inset: 16px;
  border: 3px solid color-mix(in srgb, var(--ttl-red) 10%, transparent);
  border-radius: 3px;
}
.qr-mark::after {
  content: '';
  position: absolute;
  inset: 30px;
  background: color-mix(in srgb, var(--ttl-red) 12%, transparent);
  border-radius: 2px;
}
.qr-mark-tr { top: 48px; right: 48px; }
.qr-mark-bl { bottom: 96px; left: 48px; }

/* Contenu textuel · au-dessus de la déco */
.login-brand-content {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin-top: auto;
  margin-bottom: auto;
}

/* Logo TTL · carte blanche avec ombre douce, intègre le fond blanc du PNG */
.login-logo-card {
  background: white;
  border-radius: 12px;
  padding: 22px 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), 0 0 0 1px var(--border);
  display: inline-block;
  margin-bottom: 36px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.login-logo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--border);
}
.login-logo-img {
  height: 64px;
  width: auto;
  display: block;
  max-width: 240px;
}
.login-logo-card-text { padding: 16px 32px; }

.login-brand-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.1;
}
.login-brand-sub {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 32px;
  max-width: 420px;
}

.login-brand-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-brand-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
}
.feature-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: color-mix(in srgb, var(--ttl-red) 12%, white);
  color: var(--ttl-red);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.login-brand-footer {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.login-brand-footer a {
  color: var(--ttl-red);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.login-brand-footer a:hover { border-bottom-color: var(--ttl-red); }


/* ====== RIGHT · Form panel ====== */
.login-form-panel {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}
.login-form-content {
  width: 100%;
  max-width: 380px;
}
.login-greet {
  margin-bottom: 36px;
}
.login-greet h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
}
.login-greet p {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-field { display: block; }
.login-field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.login-input-wrap {
  position: relative;
}
.login-input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  letter-spacing: 0.1em;
}
.login-input::placeholder {
  color: var(--text-faint);
  letter-spacing: 0.2em;
}
.login-input:focus {
  border-color: var(--ttl-red);
  background: white;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ttl-red) 8%, transparent);
}

.login-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  padding: 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.login-eye:hover {
  color: var(--text);
  background: var(--bg);
}
.login-eye .eye-hide { display: none; }
.login-eye.is-visible .eye-show { display: none; }
.login-eye.is-visible .eye-hide { display: inline-block; }
.login-eye.is-visible { color: var(--ttl-red); }

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: color-mix(in srgb, var(--ttl-red) 6%, white);
  border: 1px solid color-mix(in srgb, var(--ttl-red) 25%, white);
  color: var(--ttl-red);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}
.login-error svg { flex-shrink: 0; margin-top: 2px; }

.login-btn {
  width: 100%;
  padding: 14px 20px;
  background: var(--ttl-red);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  font-family: inherit;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ttl-red) 25%, transparent);
}
.login-btn:hover {
  background: var(--ttl-red-dark);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--ttl-red) 35%, transparent);
}
.login-btn:active { transform: scale(0.985); }
.login-btn-arrow { transition: transform 0.2s ease; }
.login-btn:hover .login-btn-arrow { transform: translateX(3px); }

.login-form-foot {
  margin-top: 28px;
  text-align: center;
}
.login-form-foot small {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.4;
}


/* ====== Responsive ====== */
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-brand-panel {
    padding: 40px 28px 32px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .login-brand-content { margin: 0; }
  .qr-mark-tr { top: 24px; right: 24px; width: 64px; height: 64px; }
  .qr-mark-bl { display: none; }
  .login-brand-features { display: none; }
  .login-brand-title { font-size: 28px; }
  .login-brand-sub { font-size: 15px; margin-bottom: 16px; }
  .login-logo-img { height: 48px; }
  .login-logo-card { margin-bottom: 20px; padding: 16px 22px; }
  .login-form-panel { padding: 40px 24px; }
}

/* ============================================================
   v3.2 · Toggle "accès libre" + badge "Public"
   ============================================================ */

/* Toggle stylisé dans le form d'édition du dossier */
.toggle-public {
    display: flex !important;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    margin: 4px 0 8px !important;
    transition: border-color 0.15s, background 0.15s;
}
.toggle-public:hover {
    border-color: var(--ttl-red);
    background: white;
}
.toggle-public input[type="checkbox"] {
    width: auto;
    margin: 3px 0 0;
    transform: scale(1.2);
    accent-color: var(--ttl-red);
    cursor: pointer;
}
.toggle-public-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.toggle-public-text strong {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}
.toggle-public-text .small {
    font-size: 12px;
    line-height: 1.4;
}

/* Badge "Public" sur les cards du dashboard */
.public-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: color-mix(in srgb, #16A34A 12%, white);
    color: #15803D;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-right: auto;
    margin-left: 8px;
}



/* ============================================================
   v3.5 · Employés · refonte sobre style produit (sans emoji)
   Identité TTL rouge utilisée avec parcimonie
   ============================================================ */

/* === Tokens additionnels === */
:root {
    --ep-border: rgba(15, 23, 42, 0.08);
    --ep-border-strong: rgba(15, 23, 42, 0.14);
    --ep-bg-soft: #FAFAF9;
    --ep-text-strong: #0F172A;
    --ep-text-muted: #64748B;
    --ep-text-subtle: #94A3B8;
}

/* === Header de page === */
.ep-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--ep-border);
}
.ep-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--ep-text-strong);
    letter-spacing: -0.02em;
}
.ep-subtitle {
    margin: 0;
    color: var(--ep-text-muted);
    font-size: 14px;
}

/* === Avatar === */
.ep-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ep-bg-soft);
    color: var(--ep-text-strong);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    border: 1px solid var(--ep-border);
    flex-shrink: 0;
}
.ep-avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 17px;
}

/* === Badges sobres === */
.ep-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.4;
}
.ep-badge-admin {
    background: rgba(200, 16, 46, 0.08);
    color: var(--ttl-red-dark);
    border: 1px solid rgba(200, 16, 46, 0.18);
}
.ep-badge-standard {
    background: var(--ep-bg-soft);
    color: var(--ep-text-muted);
    border: 1px solid var(--ep-border);
}

/* === Grille liste employés === */
.ep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.ep-card {
    background: white;
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    padding: 18px;
    text-decoration: none;
    color: var(--ep-text-strong);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 130px;
}
.ep-card:hover {
    border-color: var(--ep-border-strong);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    text-decoration: none;
    transform: translateY(-1px);
}
.ep-card.is-admin {
    border-left: 3px solid var(--ttl-red);
}
.ep-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ep-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--ep-text-strong);
    line-height: 1.3;
}
.ep-card-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--ep-border);
    color: var(--ep-text-muted);
    font-size: 13px;
}
.ep-card-meta { color: var(--ep-text-muted); }
.ep-card-meta-warn { color: var(--ttl-red-dark); }

/* === Empty state === */
.ep-empty {
    text-align: center;
    padding: 80px 24px;
    background: var(--ep-bg-soft);
    border: 1px solid var(--ep-border);
    border-radius: 12px;
    margin: 1rem 0;
}
.ep-empty-icon {
    color: var(--ep-text-subtle);
    margin-bottom: 16px;
}
.ep-empty h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--ep-text-strong);
}
.ep-empty p {
    color: var(--ep-text-muted);
    margin: 0 auto 24px;
    max-width: 420px;
    font-size: 14px;
}

/* === Formulaire de création === */
.ep-form-card {
    background: white;
    border: 1px solid var(--ep-border);
    border-radius: 12px;
    padding: 28px;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.ep-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) {
    .ep-field-grid { grid-template-columns: 1fr; }
}
.ep-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ep-field-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--ep-text-muted);
    letter-spacing: 0.02em;
}
.ep-field input[type="text"],
.ep-field input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--ep-border-strong);
    border-radius: 8px;
    font-size: 14px;
    color: var(--ep-text-strong);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ep-field input:focus {
    outline: none;
    border-color: var(--ttl-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

/* === Toggle "Administrateur" stylisé === */
.ep-toggle-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--ep-bg-soft);
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.ep-toggle-card:hover {
    border-color: var(--ep-border-strong);
}
.ep-toggle-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.ep-toggle-visual {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 1.5px solid var(--ep-border-strong);
    background: white;
    flex-shrink: 0;
    margin-top: 1px;
    position: relative;
    transition: all 0.15s;
}
.ep-toggle-card input:checked + .ep-toggle-visual {
    background: var(--ttl-red);
    border-color: var(--ttl-red);
}
.ep-toggle-card input:checked + .ep-toggle-visual::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.ep-toggle-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ep-toggle-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ep-text-strong);
}
.ep-toggle-desc {
    font-size: 13px;
    color: var(--ep-text-muted);
    line-height: 1.5;
}

.ep-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

/* === Header de la page d'édition employé === */
.ep-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 1rem 0 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--ep-border);
}
.ep-edit-identity {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ep-edit-name {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--ep-text-strong);
    letter-spacing: -0.01em;
}
.ep-edit-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ep-meta-sep {
    color: var(--ep-text-subtle);
}
.ep-meta-date {
    color: var(--ep-text-muted);
    font-size: 13px;
}

/* Bouton "Supprimer" subtil avec icône SVG */
.btn-icon-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid var(--ep-border-strong);
    color: var(--ep-text-muted);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-icon-danger:hover {
    border-color: var(--ttl-red);
    color: var(--ttl-red);
    background: rgba(200, 16, 46, 0.03);
}

/* === Alertes sobres === */
.ep-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 1.5rem;
}
.ep-alert-error {
    background: rgba(200, 16, 46, 0.06);
    color: var(--ttl-red-dark);
    border: 1px solid rgba(200, 16, 46, 0.18);
}

/* === Cards de section (Identité / PIN / Statut) === */
.ep-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 2rem;
}
@media (max-width: 1100px) {
    .ep-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .ep-cards { grid-template-columns: 1fr; }
}
.ep-section-card {
    background: white;
    border: 1px solid var(--ep-border);
    border-radius: 12px;
    padding: 22px;
    display: flex;
    flex-direction: column;
}
.ep-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.ep-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--ep-bg-soft);
    color: var(--ep-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ep-section-head h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--ep-text-strong);
}
.ep-section-desc {
    color: var(--ep-text-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px;
}
.ep-section-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ep-section-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* === Boutons === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--ttl-red);
    color: white;
    border: 1px solid var(--ttl-red);
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    line-height: 1.4;
}
.btn-primary:hover {
    background: var(--ttl-red-dark);
    border-color: var(--ttl-red-dark);
    text-decoration: none;
}
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: white;
    color: var(--ep-text-strong);
    border: 1px solid var(--ep-border-strong);
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
}
.btn-ghost:hover {
    border-color: var(--ep-text-muted);
    background: var(--ep-bg-soft);
    text-decoration: none;
}
.btn-block { width: 100%; }
.btn-ghost-small {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: white;
    color: var(--ep-text-muted);
    border: 1px solid var(--ep-border-strong);
    padding: 6px 11px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-ghost-small:hover {
    border-color: var(--ttl-red);
    color: var(--ttl-red);
}

/* === PIN flash (affichage temporaire du code) === */
.ep-pin-flash {
    background: white;
    border: 2px solid var(--ttl-red);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.ep-pin-flash::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--ttl-red);
}
.ep-pin-flash-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}
.ep-pin-flash-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(200, 16, 46, 0.08);
    color: var(--ttl-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ep-pin-flash h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--ep-text-strong);
}
.ep-pin-flash p {
    margin: 0;
    color: var(--ep-text-muted);
    font-size: 13px;
    line-height: 1.5;
}
.ep-pin-flash-code {
    text-align: center;
    font-family: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;
    font-size: 44px;
    font-weight: 700;
    color: var(--ep-text-strong);
    background: var(--ep-bg-soft);
    border: 1px dashed var(--ep-border-strong);
    border-radius: 10px;
    padding: 24px;
    letter-spacing: 10px;
    margin-bottom: 16px;
    user-select: all;
}
.ep-pin-flash-actions {
    display: flex;
    justify-content: center;
}

/* === Notice admin (au lieu de la matrice) === */
.ep-admin-notice {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: rgba(200, 16, 46, 0.03);
    border: 1px solid rgba(200, 16, 46, 0.18);
    border-radius: 12px;
    padding: 24px;
    margin-top: 1rem;
}
.ep-admin-notice-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(200, 16, 46, 0.08);
    color: var(--ttl-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ep-admin-notice-body { flex: 1; }
.ep-admin-notice-body h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--ep-text-strong);
}
.ep-admin-notice-body p {
    margin: 0 0 10px;
    color: var(--ep-text-strong);
    line-height: 1.55;
    font-size: 14px;
}
.ep-admin-notice-hint {
    color: var(--ep-text-muted) !important;
    font-size: 13px !important;
}

/* === Section matrice d'attribution === */
.ep-assign-section {
    margin-top: 1rem;
}
.ep-assign-head {
    margin-bottom: 1rem;
}
.ep-assign-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--ep-text-strong);
}
.ep-assign-subtitle {
    color: var(--ep-text-muted);
    font-size: 13px;
    margin: 0;
}

/* Toolbar : search + pills + bulk actions */
.ep-assign-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: var(--ep-bg-soft);
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    margin-bottom: 1rem;
}
.ep-assign-search-wrap {
    position: relative;
}
.ep-assign-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ep-text-subtle);
    pointer-events: none;
}
.ep-assign-search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--ep-border-strong);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ep-assign-search:focus {
    outline: none;
    border-color: var(--ttl-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}
.ep-assign-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ep-assign-pills .pill {
    background: white;
    border: 1px solid var(--ep-border-strong);
    color: var(--ep-text-muted);
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.ep-assign-pills .pill:hover {
    border-color: var(--ep-text-muted);
    color: var(--ep-text-strong);
}
.ep-assign-pills .pill-active {
    background: var(--ep-text-strong);
    border-color: var(--ep-text-strong);
    color: white;
}
.ep-assign-bulk {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Grille de dossiers */
.ep-assign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
    margin-bottom: 6rem;
}
.ep-dossier-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.ep-dossier-card:hover {
    border-color: var(--ep-border-strong);
}
.ep-dossier-card.is-checked {
    border-color: var(--ttl-red);
    background: rgba(200, 16, 46, 0.02);
}
.ep-dossier-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}
.ep-dossier-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--ep-border-strong);
    border-radius: 5px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.15s;
    margin-top: 1px;
}
.ep-dossier-check svg { opacity: 0; transition: opacity 0.15s; }
.ep-dossier-card.is-checked .ep-dossier-check {
    background: var(--ttl-red);
    border-color: var(--ttl-red);
}
.ep-dossier-card.is-checked .ep-dossier-check svg { opacity: 1; }

.ep-dossier-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}
.ep-dossier-code {
    font-family: ui-monospace, 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--ep-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
}
.ep-dossier-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ep-text-strong);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ep-dossier-cat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--ep-text-muted);
    margin-top: 3px;
}
.ep-dossier-cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cat-color, var(--ep-text-subtle));
    flex-shrink: 0;
}

/* Barre sticky save en bas */
.ep-assign-save {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--ep-border);
    padding: 14px 20px;
    margin: 0 -40px -64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
    z-index: 10;
}
.ep-assign-save-status {
    color: var(--ep-text-muted);
    font-size: 13px;
    font-weight: 500;
}
@media (max-width: 700px) {
    .ep-assign-save { margin: 0 -16px -40px; padding: 12px 16px; }
}

/* === Public badge & toggle dossier (héritage v3.2) === */
.public-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: rgba(22, 163, 74, 0.1);
    color: #15803D;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-right: auto;
    margin-left: 8px;
}
.toggle-public {
    display: flex !important;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--ep-bg-soft);
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    cursor: pointer;
    margin: 4px 0 8px !important;
    transition: border-color 0.15s, background 0.15s;
}
.toggle-public:hover { border-color: var(--ep-border-strong); }
.toggle-public input[type="checkbox"] {
    width: auto;
    margin: 3px 0 0;
    transform: scale(1.2);
    accent-color: var(--ttl-red);
    cursor: pointer;
}
.toggle-public-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.toggle-public-text strong { font-size: 14px; color: var(--ep-text-strong); font-weight: 500; }
.toggle-public-text .small { font-size: 12px; line-height: 1.4; }

/* ============================================================
   v3.6 · Recherche employés, bulk catégorie, filtre dossiers vides
   ============================================================ */

/* === Toolbar liste employés (search + role filter) === */
.ep-list-toolbar {
    display: flex;
    gap: 14px;
    margin-bottom: 1rem;
    padding: 14px;
    background: var(--ep-bg-soft);
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.ep-list-search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
}
.ep-list-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ep-text-subtle);
    pointer-events: none;
}
.ep-list-search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--ep-border-strong);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ep-list-search:focus {
    outline: none;
    border-color: var(--ttl-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}
.ep-list-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ep-list-filters .pill {
    background: white;
    border: 1px solid var(--ep-border-strong);
    color: var(--ep-text-muted);
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.ep-list-filters .pill:hover {
    border-color: var(--ep-text-muted);
    color: var(--ep-text-strong);
}
.ep-list-filters .pill-active {
    background: var(--ep-text-strong);
    border-color: var(--ep-text-strong);
    color: white;
}

/* Empty state quand recherche ne donne rien */
.ep-empty-result {
    text-align: center;
    padding: 60px 20px;
    color: var(--ep-text-muted);
}
.ep-empty-result svg {
    color: var(--ep-text-subtle);
    margin-bottom: 12px;
}
.ep-empty-result p {
    margin: 0;
    font-size: 14px;
}

/* === Alert success (catégories bulk action confirmation) === */
.ep-alert-success {
    background: rgba(22, 163, 74, 0.06);
    color: #15803D;
    border: 1px solid rgba(22, 163, 74, 0.18);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 1.5rem;
}

/* === Bulk actions par catégorie === */
.cat-block {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}
.cat-block .cat-row {
    margin: 0;
    border: none;
    background: transparent;
}
.cat-bulk {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.cat-bulk-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}
.cat-bulk-count {
    font-weight: 600;
    color: var(--text);
}
.cat-bulk-state {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.cat-bulk-state-public {
    background: rgba(22, 163, 74, 0.1);
    color: #15803D;
}
.cat-bulk-state-protected {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text);
}
.cat-bulk-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* === Stat clickable (filtre dossiers vides) === */
.stat-clickable {
    background: white;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 16px;
    font-family: inherit;
    text-align: left;
    width: 100%;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.stat-clickable:hover {
    border-color: var(--ep-border-strong);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.stat-clickable.is-active-filter {
    border-color: var(--ttl-red);
    background: rgba(200, 16, 46, 0.02);
    box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.1);
}
.stat-clickable.is-active-filter::after {
    content: 'Filtre actif';
    position: absolute;
    top: -8px;
    right: 10px;
    background: var(--ttl-red);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}
.stat-clickable {
    position: relative;
}

/* Bannière de filtre actif */
.empty-filter-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(200, 16, 46, 0.04);
    border: 1px solid rgba(200, 16, 46, 0.18);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 1.5rem 0 1rem;
    font-size: 13px;
    color: var(--ttl-red-dark);
}
.empty-filter-banner strong {
    color: var(--ttl-red-dark);
    font-weight: 600;
}
.empty-filter-banner a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ttl-red-dark);
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}
.empty-filter-banner a:hover {
    background: rgba(200, 16, 46, 0.1);
}

/* ============================================================
   v3.7 · Modes d'accès par catégorie + titulaire de dossier
   ============================================================ */

/* Badge "mode" sur les catégories */
.cat-mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.4;
    text-transform: none;
    white-space: nowrap;
}
.cat-mode-badge.mode-open {
    background: rgba(22, 163, 74, 0.1);
    color: #15803D;
    border: 1px solid rgba(22, 163, 74, 0.2);
}
.cat-mode-badge.mode-confidential {
    background: rgba(200, 16, 46, 0.08);
    color: var(--ttl-red-dark);
    border: 1px solid rgba(200, 16, 46, 0.2);
}
.cat-mode-badge.mode-manual {
    background: rgba(180, 110, 0, 0.1);
    color: #946100;
    border: 1px solid rgba(180, 110, 0, 0.2);
}

/* === Refonte de la page Catégories === */
.cat-block-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.cat-block-name {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}
.cat-block-name strong {
    font-size: 15px;
    color: var(--text);
}
.cat-block-stat-inline {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.cat-row-edit {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 2fr auto;
    gap: 12px;
    padding: 14px 16px;
    align-items: end;
    background: white;
    border: none;
    margin: 0;
}
@media (max-width: 900px) {
    .cat-row-edit { grid-template-columns: 1fr 1fr; }
    .cat-row-edit .cat-row-mode { grid-column: 1 / -1; }
    .cat-row-edit .cat-row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
.cat-row-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}
.cat-row-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.cat-row-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ep-border-strong);
    color: white;
    font-size: 9px;
    font-weight: 700;
    cursor: help;
}
.cat-row-field input,
.cat-row-field select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    width: 100%;
    box-sizing: border-box;
}
.cat-row-field input[type="color"] {
    padding: 2px;
    height: 36px;
    cursor: pointer;
}
.cat-row-actions {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

/* === Section "Accès aux dossiers" dans la page employé === */
.ep-assign-explainer {
    background: var(--ep-bg-soft);
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    padding: 18px 20px;
    margin-top: 1rem;
}
.ep-assign-summary {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ep-assign-summary li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.ep-assign-summary li strong {
    color: var(--text);
    font-weight: 600;
    min-width: 28px;
    text-align: right;
}
.ep-assign-summary .cat-mode-badge {
    min-width: 110px;
    justify-content: center;
}

/* Empty state quand aucun dossier en mode manuel */
.ep-assign-no-manual {
    background: var(--ep-bg-soft);
    border: 1px dashed var(--ep-border-strong);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-top: 1rem;
}
.ep-assign-no-manual p {
    margin: 0 0 4px;
    color: var(--text);
}
.ep-assign-no-manual a {
    color: var(--ttl-red);
}

/* ============================================================
   v3.8 · Comptes administrateurs individuels
   ============================================================ */

/* Affichage du nom de l'admin connecté dans la nav */
.admin-current {
    margin-left: auto;
    padding: 4px 12px;
    background: rgba(200, 16, 46, 0.08);
    color: var(--ttl-red-dark);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
}

/* Formulaire de création */
.admins-create-form { margin: 0; }
.admins-create-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1.5fr;
    gap: 14px;
    margin-bottom: 14px;
}
@media (max-width: 900px) {
    .admins-create-grid { grid-template-columns: 1fr; }
}
.admins-create-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--ep-text-muted);
    font-weight: 500;
}
.admins-create-grid input {
    padding: 9px 12px;
    border: 1px solid var(--ep-border-strong);
    border-radius: 7px;
    font-size: 14px;
    background: white;
}
.admins-create-grid input:focus {
    outline: none;
    border-color: var(--ttl-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}
.admins-create-grid small {
    color: var(--ep-text-subtle);
    font-size: 11px;
    font-weight: 400;
}

/* Table des admins */
.admins-table {
    background: white;
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    overflow: hidden;
}
.admins-table-head,
.admins-table-row {
    display: grid;
    grid-template-columns: 1fr 1.8fr 1.2fr 1fr 1fr;
    gap: 14px;
    padding: 12px 18px;
    align-items: center;
}
.admins-table-head {
    background: var(--ep-bg-soft);
    border-bottom: 1px solid var(--ep-border);
    font-size: 11px;
    font-weight: 600;
    color: var(--ep-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admins-table-row {
    border-top: 1px solid var(--ep-border);
    font-size: 13px;
}
.admins-table-row:first-of-type { border-top: none; }
.admins-table-row.is-me {
    background: rgba(200, 16, 46, 0.02);
}

.admins-username {
    display: flex;
    align-items: center;
    gap: 8px;
}
.admins-username-code {
    font-family: ui-monospace, 'JetBrains Mono', monospace;
    color: var(--ep-text-strong);
    font-weight: 600;
}
.admins-me-tag {
    background: var(--ttl-red);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.inline-name-form {
    display: flex;
    gap: 6px;
    margin: 0;
    align-items: center;
}
.inline-name-form input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    background: transparent;
    color: var(--ep-text-strong);
    transition: all 0.15s;
}
.inline-name-form input:hover,
.inline-name-form input:focus {
    background: white;
    border-color: var(--ep-border-strong);
}
.inline-name-form input:focus {
    outline: none;
    border-color: var(--ttl-red);
}

.admins-last { color: var(--ep-text-muted); font-size: 13px; }
.admins-last .muted { color: var(--ep-text-subtle); }

.admins-row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* Responsive : table → cards en empilé */
@media (max-width: 900px) {
    .admins-table-head { display: none; }
    .admins-table-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px 18px;
        border-bottom: 1px solid var(--ep-border);
    }
    .admins-row-actions { justify-content: flex-start; }
}

/* ============================================================
   v3.9 · Refonte page Paramètres (grille 2 colonnes sobre)
   ============================================================ */

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 1rem;
}
@media (max-width: 900px) {
    .settings-grid { grid-template-columns: 1fr; }
}
.settings-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.settings-col .ep-section-card {
    padding: 24px;
}

/* Hint discret à côté d'un field-label */
.ep-field-hint {
    color: var(--ep-text-subtle);
    font-weight: 400;
    margin-left: 4px;
}

/* === Logo preview === */
.settings-logo-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--ep-bg-soft);
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    margin-bottom: 16px;
}
.settings-logo-preview img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: white;
    border: 1px solid var(--ep-border);
    border-radius: 8px;
    padding: 6px;
}
.settings-logo-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.settings-logo-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(180, 110, 0, 0.04);
    border: 1px dashed rgba(180, 110, 0, 0.3);
    border-radius: 10px;
    color: #946100;
    font-size: 13px;
    margin-bottom: 16px;
}

/* === File input stylisé === */
.settings-file-input {
    padding: 8px;
    border: 1px dashed var(--ep-border-strong);
    border-radius: 8px;
    background: var(--ep-bg-soft);
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.settings-file-input:hover {
    border-color: var(--ttl-red);
    background: white;
}
.settings-file-input::file-selector-button {
    background: white;
    color: var(--ep-text-strong);
    border: 1px solid var(--ep-border-strong);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.15s;
}
.settings-file-input::file-selector-button:hover {
    border-color: var(--ttl-red);
    color: var(--ttl-red);
}