/* =========================================================================
   Drive — feuille de styles unique
   Clair et sombre, pilotés par [data-theme] sur <html>.
   ========================================================================= */

:root {
    --bg:          #f6f7f9;
    --surface:     #ffffff;
    --surface-2:   #f0f2f5;
    --surface-3:   #e6e9ee;
    --border:      #dfe3e9;
    --border-soft: #eaedf1;
    --text:        #10131a;
    --text-2:      #4a5262;
    --muted:       #79808f;
    --accent:      #4f46e5;
    --accent-2:    #6366f1;
    --accent-soft: #eef0fe;
    --danger:      #dc2626;
    --danger-soft: #fdecec;
    --ok:          #059669;
    --ok-soft:     #e7f6f0;
    --warn:        #d97706;
    --warn-soft:   #fdf2e3;
    --shadow-sm:   0 1px 2px rgba(16, 19, 26, .06), 0 1px 3px rgba(16, 19, 26, .04);
    --shadow:      0 4px 12px rgba(16, 19, 26, .08), 0 1px 3px rgba(16, 19, 26, .06);
    --shadow-lg:   0 16px 48px rgba(16, 19, 26, .16), 0 4px 12px rgba(16, 19, 26, .08);
    --r-sm: 7px;
    --r:    11px;
    --r-lg: 16px;
    --sidebar: 244px;
}

[data-theme="dark"] {
    --bg:          #0e1014;
    --surface:     #171a21;
    --surface-2:   #1e222b;
    --surface-3:   #272c37;
    --border:      #2a2f3a;
    --border-soft: #232833;
    --text:        #e9ecf2;
    --text-2:      #b3bac8;
    --muted:       #7e879a;
    --accent:      #7c7aff;
    --accent-2:    #8b89ff;
    --accent-soft: #1e1f3d;
    --danger:      #f87171;
    --danger-soft: #2c1a1c;
    --ok:          #34d399;
    --ok-soft:     #12281f;
    --warn:        #fbbf24;
    --warn-soft:   #2b2213;
    --shadow-sm:   0 1px 2px rgba(0, 0, 0, .4);
    --shadow:      0 4px 14px rgba(0, 0, 0, .45);
    --shadow-lg:   0 20px 56px rgba(0, 0, 0, .6);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }

::selection { background: var(--accent); color: #fff; }

/* Barres de défilement discrètes, sans casser la molette. */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }

/* =========================================================================
   Écrans d'authentification
   ========================================================================= */

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 15% -10%, var(--accent-soft), transparent 65%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 396px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 32px 30px;
}

.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-brand .mark { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: #fff; flex: none; }
.auth-brand h1 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.auth-brand p { font-size: 12.5px; color: var(--muted); }

.auth-card h2 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.auth-card .lede { font-size: 13px; color: var(--muted); margin-bottom: 22px; line-height: 1.55; }

/* =========================================================================
   Formulaires
   ========================================================================= */

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 550; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }

.input, .select, .textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.input::placeholder { color: var(--muted); }
.textarea { resize: vertical; min-height: 66px; }

.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 7px 0; }
.check input { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--accent); flex: none; cursor: pointer; }
.check span { font-size: 13px; }
.check .hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

/* =========================================================================
   Boutons
   ========================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 550;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; flex: none; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn-danger:hover { background: var(--danger-soft); }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-icon { padding: 7px; }
.btn-icon svg { width: 16px; height: 16px; }

/* =========================================================================
   Alertes
   ========================================================================= */

.alert {
    padding: 10px 13px;
    border-radius: var(--r-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.5;
}
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-ok    { background: var(--ok-soft);     color: var(--ok);     border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-warn  { background: var(--warn-soft);   color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-info  { background: var(--surface-2);   color: var(--text-2); border-color: var(--border); }

/* =========================================================================
   Ossature de l'application
   ========================================================================= */

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar);
    flex: none;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 17px 18px; border-bottom: 1px solid var(--border-soft); }
.sidebar-brand .mark { width: 31px; height: 31px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; flex: none; }
.sidebar-brand .name { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-actions { padding: 14px 14px 6px; display: grid; gap: 8px; }

.nav { padding: 10px 10px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 12px 8px 6px; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--r-sm);
    color: var(--text-2); font-size: 13.5px; font-weight: 500;
    transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a svg { width: 17px; height: 17px; flex: none; }
.nav a .count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 500; }

.quota { padding: 14px 18px; border-top: 1px solid var(--border-soft); }
.quota-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 7px; }
.quota-bar { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.quota-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s ease; }
.quota-fill.warn { background: var(--warn); }
.quota-fill.full { background: var(--danger); }

.sidebar-foot { padding: 11px 14px; border-top: 1px solid var(--border-soft); display: flex; align-items: center; gap: 9px; }
.avatar { width: 29px; height: 29px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; }
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot .who b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who span { font-size: 11px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* =========================================================================
   Barre d'outils
   ========================================================================= */

.toolbar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 22px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}

.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1; font-size: 14px; }
.crumbs a, .crumbs span.here { padding: 4px 8px; border-radius: var(--r-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { background: var(--surface-2); color: var(--text); }
.crumbs .sep { color: var(--border); flex: none; }
.crumbs .here { font-weight: 600; }
.crumbs a.drop-target, .crumbs .here.drop-target { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.search { position: relative; width: 260px; flex: none; }
.search input { width: 100%; padding: 8px 30px 8px 33px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-sm); outline: none; font-size: 13px; }
.search input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 3px; border-radius: 4px; display: none; }
.search.filled .clear { display: block; }
.search .clear:hover { background: var(--surface-3); color: var(--text); }

.seg { display: flex; background: var(--surface-2); border-radius: var(--r-sm); padding: 2px; flex: none; }
.seg button { border: 0; background: transparent; padding: 5px 9px; border-radius: 5px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button svg { width: 15px; height: 15px; }

/* Barre de sélection, superposée à la barre d'outils */
.selbar {
    display: none; align-items: center; gap: 10px;
    padding: 12px 22px;
    background: var(--accent-soft);
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    position: sticky; top: 0; z-index: 21;
}
.selbar.on { display: flex; }
.selbar .n { font-weight: 600; color: var(--accent); font-size: 13.5px; }
.selbar .spacer { flex: 1; }

/* =========================================================================
   Contenu
   ========================================================================= */

.content { flex: 1; padding: 20px 22px 90px; position: relative; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: border-color .12s, box-shadow .12s, transform .08s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card.dragging { opacity: .4; }
.card.drop-target { border-color: var(--accent); background: var(--accent-soft); }

.card .preview { height: 116px; display: grid; place-items: center; background: var(--surface-2); position: relative; overflow: hidden; }
.card .preview img { width: 100%; height: 100%; object-fit: cover; }
.card .preview .glyph { color: var(--muted); }
.card .preview .glyph svg { width: 38px; height: 38px; }

.card .meta { padding: 9px 11px 11px; border-top: 1px solid var(--border-soft); }
.card .meta .name { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.card .meta .sub { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.card .tick {
    position: absolute; top: 8px; left: 8px;
    width: 19px; height: 19px; border-radius: 5px;
    background: rgba(255, 255, 255, .92); border: 1px solid var(--border);
    display: grid; place-items: center; opacity: 0; transition: opacity .12s;
    color: transparent;
}
.card:hover .tick, .card.selected .tick { opacity: 1; }
.card.selected .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.card .tick svg { width: 12px; height: 12px; }

.card .badges { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.chip-link {
    display: grid; place-items: center;
    width: 21px; height: 21px; border-radius: 6px;
    background: var(--ok); color: #fff; box-shadow: var(--shadow-sm);
}
.chip-link svg { width: 12px; height: 12px; }
.chip-link.expired { background: var(--warn); }

/* Vue liste */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.list-head, .list-row { display: grid; grid-template-columns: 34px 1fr 108px 132px 44px; align-items: center; gap: 10px; padding: 0 14px; }
.list-head { height: 38px; border-bottom: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.list-head button { border: 0; background: transparent; padding: 0; cursor: pointer; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; display: flex; align-items: center; gap: 4px; }
.list-head button:hover { color: var(--text); }
.list-head svg { width: 11px; height: 11px; }

.list-row { height: 46px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row.selected { background: var(--accent-soft); }
.list-row.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.list-row .cell-icon { display: grid; place-items: center; color: var(--muted); }
.list-row .cell-icon svg { width: 19px; height: 19px; }
.list-row .cell-icon img { width: 26px; height: 26px; border-radius: 4px; object-fit: cover; }
.list-row .cell-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.list-row .cell-name .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.list-row .cell-size, .list-row .cell-date { font-size: 12.5px; color: var(--muted); }
.list-row .cell-act { display: flex; justify-content: flex-end; }

.folder-tint { color: var(--accent); }

/* États */
.empty { text-align: center; padding: 76px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; margin: 0 auto 14px; opacity: .35; }
.empty h3 { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.empty p { font-size: 13px; max-width: 330px; margin: 0 auto; line-height: 1.6; }

.skeleton { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.skeleton div { height: 168px; border-radius: var(--r); background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 220% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* =========================================================================
   Dépôt de fichiers
   ========================================================================= */

.dropzone {
    position: fixed; inset: 0; z-index: 90;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    backdrop-filter: blur(3px);
    display: none; place-items: center;
    pointer-events: none;
}
.dropzone.on { display: grid; }
.dropzone .inner {
    background: var(--surface);
    border: 2px dashed var(--accent);
    border-radius: var(--r-lg);
    padding: 44px 60px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.dropzone svg { width: 42px; height: 42px; color: var(--accent); margin: 0 auto 14px; }
.dropzone b { display: block; font-size: 16px; margin-bottom: 4px; }
.dropzone span { font-size: 13px; color: var(--muted); }

.uploads {
    position: fixed; right: 20px; bottom: 20px; z-index: 70;
    width: 338px; max-width: calc(100vw - 40px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    display: none;
    overflow: hidden;
}
.uploads.on { display: block; }
.uploads-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13px; font-weight: 600; }
.uploads-head .spacer { flex: 1; }
.uploads-body { max-height: 268px; overflow-y: auto; }

.up-item { padding: 9px 14px; border-bottom: 1px solid var(--border-soft); }
.up-item:last-child { border-bottom: 0; }
.up-item .top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.up-item .nm { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.up-item .pc { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.up-item .track { height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.up-item .fill { height: 100%; background: var(--accent); width: 0; transition: width .18s ease; }
.up-item.done .fill { background: var(--ok); }
.up-item.fail .fill { background: var(--danger); }
.up-item.fail .pc { color: var(--danger); }
.up-item .err { font-size: 11.5px; color: var(--danger); margin-top: 5px; line-height: 1.4; }

/* =========================================================================
   Fenêtres modales
   ========================================================================= */

.modal-back {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(10, 12, 16, .5);
    backdrop-filter: blur(2px);
    display: none; place-items: center;
    padding: 20px;
}
.modal-back.on { display: grid; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 468px;
    max-height: calc(100vh - 40px);
    display: flex; flex-direction: column;
    animation: pop .16s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal.wide { max-width: 640px; }

.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { font-size: 15px; font-weight: 620; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border-soft); }

/* Aperçu plein écran */
.viewer { position: fixed; inset: 0; z-index: 110; background: rgba(8, 9, 12, .93); display: none; flex-direction: column; }
.viewer.on { display: flex; }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: 13px 18px; color: #e8eaf0; }
.viewer-head .nm { font-size: 13.5px; font-weight: 550; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-head .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #e8eaf0; }
.viewer-head .btn:hover { background: rgba(255, 255, 255, .16); }
.viewer-stage { flex: 1; display: grid; place-items: center; padding: 0 18px 22px; min-height: 0; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); object-fit: contain; }
.viewer-stage iframe { width: 100%; height: 100%; border: 0; border-radius: var(--r-sm); background: #fff; }
.viewer-stage .none { color: #9aa1ad; text-align: center; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.viewer-nav:hover { background: rgba(255, 255, 255, .2); }
.viewer-nav.prev { left: 16px; }
.viewer-nav.next { right: 16px; }

/* =========================================================================
   Partage
   ========================================================================= */

.share-url { display: flex; gap: 8px; margin-bottom: 6px; }
.share-url input { flex: 1; font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace; font-size: 12.5px; background: var(--surface-2); }

.tabs { display: flex; gap: 2px; background: var(--surface-2); border-radius: var(--r-sm); padding: 3px; margin-bottom: 12px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 6px 10px; border-radius: 5px; font-size: 12.5px; font-weight: 550; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.snippet { position: relative; }
.snippet textarea { width: 100%; font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; min-height: 62px; resize: vertical; outline: none; }

.disclose { border-top: 1px solid var(--border-soft); margin-top: 14px; padding-top: 6px; }
.disclose summary { cursor: pointer; font-size: 13px; font-weight: 550; color: var(--text-2); padding: 8px 0; list-style: none; display: flex; align-items: center; gap: 7px; }
.disclose summary::-webkit-details-marker { display: none; }
.disclose summary svg { width: 13px; height: 13px; transition: transform .15s; }
.disclose[open] summary svg { transform: rotate(90deg); }

.stat-row { display: flex; gap: 18px; padding: 11px 13px; background: var(--surface-2); border-radius: var(--r-sm); margin-bottom: 14px; }
.stat-row .stat b { display: block; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-row .stat span { font-size: 11.5px; color: var(--muted); }

/* =========================================================================
   Tableaux (liens, invités)
   ========================================================================= */

.page { padding: 24px 26px 80px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.page-head h1 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.page-head p { font-size: 13.5px; color: var(--muted); margin-top: 3px; line-height: 1.55; max-width: 620px; }
.page-head .spacer { flex: 1; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 620; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.table .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.table .nowrap { white-space: nowrap; }
.table .acts { display: flex; gap: 5px; justify-content: flex-end; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 550; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-off { background: var(--surface-3); color: var(--muted); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-accent { background: var(--accent-soft); color: var(--accent); }

.truncate { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================================
   Notifications
   ========================================================================= */

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 130; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 16px;
    background: var(--text); color: var(--bg);
    border-radius: 22px;
    font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: rise .2s ease;
    pointer-events: auto;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.toast svg { width: 15px; height: 15px; flex: none; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok  { background: var(--ok); color: #fff; }

/* =========================================================================
   Menu contextuel
   ========================================================================= */

.menu {
    position: fixed; z-index: 120;
    min-width: 196px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-lg);
    padding: 5px;
    display: none;
}
.menu.on { display: block; }
.menu button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 7px 10px; border: 0; background: transparent;
    border-radius: 5px; font-size: 13px; cursor: pointer; text-align: left;
}
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-soft); }
.menu button svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.menu button.danger svg { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border-soft); margin: 5px 0; }

/* =========================================================================
   Responsive
   ========================================================================= */

.mobile-only { display: none; }

@media (max-width: 880px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 60;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(10, 12, 16, .45); display: none; }
    .scrim.on { display: block; }
    .mobile-only { display: inline-flex; }
    .toolbar { padding: 10px 14px; gap: 8px; flex-wrap: wrap; }
    .search { width: 100%; order: 3; }
    .content { padding: 14px 14px 90px; }
    .page { padding: 16px 14px 80px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
    .card .preview { height: 96px; }
    .list-head, .list-row { grid-template-columns: 30px 1fr 76px 40px; }
    .list-head .col-date, .list-row .cell-date { display: none; }
    .uploads { right: 10px; left: 10px; width: auto; bottom: 10px; }
    .table-scroll { overflow-x: auto; }
    .table { min-width: 640px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
