/* ===================================================================
   Wolke – Stylesheet
   Unternehmensfarben:  Anthrazit #444444  ·  Mintgrün #98FF98
   Alle Farben sind hier als Variablen definiert – zum Anpassen nur
   diesen Block ändern.
   =================================================================== */

:root {
    /* Unternehmensfarben */
    --brand-gray:  #222222;
    --brand-mint:  #98FF98;

    --bg:          #f3f4f3;
    --surface:     #ffffff;
    --surface-2:   #f7f8f7;
    --border:      #e1e4e1;
    --text:        #444444;           /* Fließtext in Anthrazit */
    --heading:     #2e2e2e;
    --muted:       #6e716e;
    --nav-bg:      var(--brand-gray);
    --nav-text:    #e6e6e6;
    --nav-muted:   rgba(255,255,255,.62);
    --nav-hover:   rgba(255,255,255,.08);
    --nav-line:    rgba(255,255,255,.10);
    --nav-active:  #ffffff;

    --accent:      var(--brand-mint);  /* Flächen: Buttons, Balken, Markierungen */
    --accent-2:    #c8ffc8;            /* hellere Mint-Stufe für Verläufe */
    --accent-hover:#7ef27e;
    --accent-dark: #1d7a3d;            /* Mint abgedunkelt – für Text/Links auf Weiß (Kontrast ≥ 4,5:1) */
    --accent-ink:  var(--brand-gray);  /* Schrift auf Mint */
    --accent-soft: #ebffeb;
    --accent-rgb:  152, 255, 152;

    --folder:      #8af58a;
    --meter:       #5fd65f;            /* Füllung von Balken auf hellem Grund */
    --focus-border:var(--brand-gray);
    --folder-tab:  var(--brand-mint);

    --danger:      #d93025;
    --danger-soft: #fdecea;
    --success:     #1d7a3d;
    --success-soft:#e3f8e6;
    --info:        var(--brand-gray);
    --info-soft:   #ececec;
    --warn:        #9a5b00;
    --warn-line:   #f0b44c;
    --warn-soft:   #fff5df;

    --radius:      10px;
    --radius-sm:   6px;
    --shadow:      0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.18);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:          #1e1e1e;
        --surface:     #2a2a2a;
        --surface-2:   #313131;
        --border:      #3e3e3e;
        --text:        #e8e8e8;
        --heading:     #ffffff;
        --muted:       #a9aca9;
        --nav-bg:      #383838;
        --accent-dark: var(--brand-mint);  /* auf dunklem Grund ist Mint selbst gut lesbar */
        --accent-soft: #233a27;
        --folder:      #7ee87e;
        --meter:       var(--brand-mint);
        --focus-border:var(--brand-mint);
        --info:        #e0e0e0;
        --info-soft:   #3a3a3a;
        --danger-soft: #3d1a18;
        --success:     var(--brand-mint);
        --success-soft:#233a27;
        --warn:        #ffc766;
        --warn-soft:   #3a301a;
        --shadow:      0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
        color-scheme: dark;
    }
}

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

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

body {
    margin: 0;
    font: 15px/1.5 var(--font);
    background: var(--bg);
    color: var(--text);
}

a { color: var(--accent-dark); text-decoration: none; }
h1, h2 { color: var(--heading); }
a:hover { text-decoration: underline; }

h1 { font-size: 1.6rem; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 1rem; }
p  { margin: 0 0 1rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.break { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Marke ---------- */
.brand-mark {
    display: inline-block; flex: none;
    width: 30px; height: 22px;
    margin-right: 10px;
    background: var(--brand-mint);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 22'%3E%3Cpath d='M8 21.5h15.5a6.5 6.5 0 0 0 1.1-12.9A8.5 8.5 0 0 0 8.2 6.3 7.6 7.6 0 0 0 8 21.5z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 22'%3E%3Cpath d='M8 21.5h15.5a6.5 6.5 0 0 0 1.1-12.9A8.5 8.5 0 0 0 8.2 6.3 7.6 7.6 0 0 0 8 21.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Auf hellem Grund (Login-Karte) braucht die Wolke eine dunklere Kontur */
.auth-brand .brand-mark { background: var(--brand-gray); }
@media (prefers-color-scheme: dark) { .auth-brand .brand-mark { background: var(--brand-mint); } }

/* ---------- Seitennavigation (links, vertikal) ---------- */
:root { --nav-w: 248px; }

.sidenav {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    width: var(--nav-w);
    display: flex; flex-direction: column;
    background: var(--nav-bg);
    color: var(--nav-text);
    border-right: 1px solid rgba(255,255,255,.06);
}
.sidenav-head {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; padding: 0 1.1rem;
    flex: none;
}
.brand { color: #fff; font-weight: 600; font-size: 1.15rem; white-space: nowrap; display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }

.sidenav-nav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.07); }
.nav-heading {
    padding: 0 .75rem .45rem;
    font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--nav-muted);
}

.nav-item {
    position: relative;
    display: flex; align-items: center; gap: .75rem;
    width: 100%;
    padding: .55rem .75rem;
    border: 0; border-radius: 8px;
    background: transparent;
    color: var(--nav-text);
    font: inherit; font-size: .93rem; text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nav-item .icon { flex: none; opacity: .85; }
.nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-item.active {
    background: rgba(var(--accent-rgb), .16);
    color: #fff; font-weight: 600;
}
.nav-item.active::before {
    content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.nav-item.active .icon { color: var(--accent); opacity: 1; }
.nav-item:focus-visible, .nav-user:focus-visible, .nav-burger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sidenav-foot {
    flex: none;
    display: flex; flex-direction: column; gap: .5rem;
    padding: .9rem .75rem 1rem;
    border-top: 1px solid rgba(255,255,255,.07);
}
.sidenav-quota { padding: .25rem .75rem .5rem; }
.sidenav-quota .quota-label { color: var(--nav-muted); }
.sidenav-quota meter, .sidenav-quota meter::-webkit-meter-bar { background: rgba(255,255,255,.14); }
.sidenav-quota meter::-webkit-meter-optimum-value { background: var(--brand-mint); }
.sidenav-quota meter:-moz-meter-optimum::-moz-meter-bar { background: var(--brand-mint); }

.nav-user {
    display: flex; align-items: center; gap: .7rem;
    padding: .5rem .6rem;
    border-radius: 8px;
    color: var(--nav-text);
}
.nav-user:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav-user.active { background: rgba(var(--accent-rgb), .16); }
.nav-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.nav-user-text strong { color: #fff; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user-text span { font-size: .76rem; color: var(--nav-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-logout { color: var(--nav-muted); font-size: .88rem; }

/* Platz für die Leiste */
body.has-nav { padding-left: var(--nav-w); }

/* Handy-Kopfzeile + Schalter (nur unter 900px sichtbar) */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.mobilebar, .nav-close, .nav-backdrop { display: none; }
.nav-burger { display: inline-grid; }
.nav-burger, .nav-close {
    position: relative;
    place-items: center;
    width: 40px; height: 40px;
    border-radius: 8px;
    color: var(--nav-text);
    cursor: pointer;
}
.nav-burger:hover, .nav-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.burger-dot {
    position: absolute; top: 8px; right: 7px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent); border: 2px solid var(--nav-bg);
}
.nav-toggle:focus-visible ~ .mobilebar .nav-burger { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 900px) {
    body.has-nav { padding-left: 0; }

    .mobilebar {
        position: sticky; top: 0; z-index: 40;
        display: flex; align-items: center; gap: .5rem;
        height: 56px; padding: 0 .6rem;
        background: var(--nav-bg);
    }
    .mobilebar .brand { flex: 1; font-size: 1.05rem; }
    .mobilebar .avatar { margin-right: .25rem; }

    .sidenav {
        width: min(300px, 85vw);
        transform: translateX(-100%);
        transition: transform .25s ease, visibility .25s;
        visibility: hidden;
        box-shadow: none;
    }
    .nav-close { display: inline-grid; }
    .nav-toggle:checked ~ .sidenav {
        transform: none; visibility: visible;
        box-shadow: 8px 0 32px rgba(0,0,0,.35);
    }
    .nav-backdrop {
        position: fixed; inset: 0; z-index: 45;
        display: block;
        background: rgba(20,20,20,.5);
        opacity: 0; pointer-events: none;
        transition: opacity .25s;
    }
    .nav-toggle:checked ~ .nav-backdrop { opacity: 1; pointer-events: auto; }
    /* Seite hinter offenem Menü nicht scrollen */
    body.has-nav:has(.nav-toggle:checked) { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
    .sidenav, .nav-backdrop { transition: none; }
}

.avatar {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    flex: none;
}
.avatar:hover { text-decoration: none; }
.avatar-sm { width: 30px; height: 30px; font-size: .85rem; }

/* ---------- Layout ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 1.75rem 2rem 4rem; }

.layout-files { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start; }
.sidebar {
    position: sticky; top: 1.5rem;
    display: flex; flex-direction: column; gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}
.content {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: 1rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.card-danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

/* ---------- Auth-Seiten ---------- */
.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 110% -10%, rgba(var(--accent-rgb), .22), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(var(--accent-rgb), .12), transparent 60%),
        var(--nav-bg);
}
.auth-container { display: grid; place-items: center; min-height: 100vh; padding: 2rem 1rem; }
.auth-container > .alert { width: 100%; max-width: 400px; }
.auth-card {
    width: 100%; max-width: 400px;
    background: var(--surface);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}
.auth-brand { font-weight: 600; font-size: 1.1rem; margin-bottom: 1.5rem; }
.auth-switch { text-align: center; margin: 1.25rem 0 0; color: var(--muted); }
.share-card { text-align: center; }
.share-card .auth-brand { text-align: left; }

/* ---------- Formulare ---------- */
.stack { display: flex; flex-direction: column; gap: .9rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 500; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }

input[type=text], input[type=email], input[type=password], input[type=search], select {
    width: 100%;
    font: inherit;
    font-size: .95rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .55rem .7rem;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--focus-border);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .6);
}
input:disabled { background: var(--surface-2); color: var(--muted); }
input[readonly] { background: var(--surface-2); font-size: .85rem; }

.inline-form { display: flex; gap: .5rem; margin: 0; }
.inline-form input, .inline-form select { flex: 1; min-width: 0; }
form { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font: inherit; font-size: .9rem; font-weight: 500;
    padding: .5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, transform .05s;
    list-style: none;
}
.btn::-webkit-details-marker { display: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b3261e; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { padding: .3rem .65rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Meldungen ---------- */
.alert {
    padding: .7rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border-left: 4px solid;
    font-size: .93rem;
}
.alert-success { background: var(--success-soft); border-color: var(--success); }
.alert-error   { background: var(--danger-soft);  border-color: var(--danger); }
.alert-info    { background: var(--info-soft);    border-color: var(--info); }

/* ---------- Upload ---------- */
.upload-box { display: flex; flex-direction: column; gap: .6rem; }
.dropzone {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
    padding: 1.4rem .75rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--meter); background: var(--accent-soft); }
/* Das Datei-Input liegt unsichtbar über der ganzen Fläche → Klick und Drag & Drop funktionieren ohne JS */
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone-icon {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 1.3rem; font-weight: 700;
}
.dropzone-text { font-weight: 600; }

/* ---------- Speicheranzeige ---------- */
.quota { display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; }
.quota-label { display: flex; justify-content: space-between; gap: .5rem; color: var(--muted); }
meter {
    width: 100%; height: 8px;
    border-radius: 999px;
    background: var(--border);
    appearance: none;
}
meter::-webkit-meter-bar { background: var(--border); border: 0; border-radius: 999px; height: 8px; }
meter::-webkit-meter-optimum-value { background: var(--meter); border-radius: 999px; }
meter::-webkit-meter-suboptimum-value { background: var(--warn-line); border-radius: 999px; }
meter::-webkit-meter-even-less-good-value { background: var(--danger); border-radius: 999px; }
meter:-moz-meter-optimum::-moz-meter-bar { background: var(--meter); border-radius: 999px; }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--warn-line); border-radius: 999px; }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--danger); border-radius: 999px; }

/* ---------- Toolbar / Suche ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar-actions { display: flex; gap: .5rem; align-items: center; }
.search { flex: 0 1 280px; }
.search input { border-radius: 999px; padding-left: 1rem; }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: 1.05rem; font-weight: 500; min-width: 0; }
.breadcrumbs a { color: var(--text); }
.breadcrumbs a:last-of-type:not(:only-of-type) { color: var(--text); }
.breadcrumbs .sep { color: var(--muted); }

.subnav { display: flex; gap: .25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .2rem; }
.subnav a { padding: .35rem .9rem; border-radius: 999px; color: var(--muted); font-size: .9rem; }
.subnav a:hover { text-decoration: none; color: var(--text); }
.subnav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ---------- Tabellen ---------- */
.filetable { width: 100%; border-collapse: collapse; }
.filetable th {
    text-align: left;
    font-size: .78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted);
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--border);
}
.filetable th a { color: var(--muted); }
.filetable th a.sorted { color: var(--text); }
.filetable th a.sorted::after { content: " ↓"; }
.filetable td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.filetable tbody tr:hover { background: var(--surface-2); }
.filetable tbody tr:last-child td { border-bottom: 0; }
.col-size { width: 100px; white-space: nowrap; }
.col-date { width: 150px; white-space: nowrap; color: var(--muted); font-size: .9rem; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.col-quota { width: 220px; }
.row-locked td { opacity: .6; }

.item-name { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }

.user-cell { display: flex; align-items: center; gap: .7rem; }

.link-field { min-width: 260px; }

/* ---------- Datei-Icons (reines CSS) ---------- */
.ficon {
    position: relative;
    flex: none;
    display: inline-grid; place-items: center;
    width: 30px; height: 34px;
    border-radius: 4px 9px 4px 4px;
    background: #8a94a8;
    color: #fff;
    font-size: .55rem; font-weight: 800; letter-spacing: .02em;
}
.ficon::after { content: ""; }
.ficon-folder {
    width: 34px; height: 26px;
    border-radius: 3px 5px 5px 5px;
    background: var(--folder);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.10);
}
.ficon-folder::before {
    content: ""; position: absolute; top: -4px; left: 0;
    width: 14px; height: 6px;
    border-radius: 3px 3px 0 0;
    background: var(--folder);
}
.ficon-img  { background: #1e8e3e; } .ficon-img::after  { content: "IMG"; }
.ficon-vid  { background: #9334e6; } .ficon-vid::after  { content: "VID"; }
.ficon-aud  { background: #e52592; } .ficon-aud::after  { content: "AUD"; }
.ficon-pdf  { background: #d93025; } .ficon-pdf::after  { content: "PDF"; }
.ficon-zip  { background: #5f6368; } .ficon-zip::after  { content: "ZIP"; }
.ficon-doc  { background: #1a73e8; } .ficon-doc::after  { content: "DOC"; }
.ficon-xls  { background: #188038; } .ficon-xls::after  { content: "XLS"; }
.ficon-file::after { content: "•••"; }
.ficon-lg { width: 64px; height: 76px; font-size: .95rem; margin: .5rem auto 1rem; border-radius: 8px 18px 8px 8px; }

/* ---------- Badges / Tags ---------- */
.badge {
    display: inline-block;
    margin-left: .4rem;
    padding: .05rem .5rem;
    border-radius: 999px;
    font-size: .72rem; font-weight: 600;
    background: var(--accent-soft);
    color: var(--accent-dark);
    vertical-align: 1px;
}
.badge-admin  { background: var(--info-soft); color: var(--info); }
.badge-locked { background: var(--danger-soft); color: var(--danger); }
@media (prefers-color-scheme: dark) {
    .badge { color: var(--accent); }
    .badge-admin { color: var(--text); }
    .badge-locked { color: #f28b82; }
}

.tag { font-size: .8rem; padding: .1rem .55rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.tag-admin { background: var(--info-soft); }
.tag-delete, .tag-folder { background: var(--surface-2); }
.tag-upload { background: var(--success-soft); }
.tag-login { background: var(--accent-soft); }

/* ---------- Aufklapp-Menüs (details/summary, ohne JavaScript) ---------- */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--surface-2); }
.menu-panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
    width: 340px;
    display: flex; flex-direction: column; gap: .7rem;
    padding: .9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: left;
    white-space: normal;
}
.menu-panel-wide { width: 360px; }
.share-link { font-weight: 500; margin-bottom: .5rem; }

details.confirm > summary { list-style: none; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm[open] > summary { display: none; }
details.confirm form {
    padding: .75rem;
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
}
details.confirm p { margin: 0 0 .6rem; font-size: .9rem; }
.card details.confirm form { margin-top: .5rem; }

/* ---------- Statistik-Kacheln ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat {
    display: flex; flex-direction: column;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 3px solid var(--accent);
}
.stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 700; margin: .2rem 0; }
.stat-sub { font-size: .82rem; color: var(--muted); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 1rem 0 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* ---------- Leerzustand / Pager ---------- */
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty-icon {
    width: 72px; height: 54px; margin: 0 auto 1rem;
    border-radius: 6px 10px 10px 10px;
    background: var(--folder);
    opacity: .45;
}
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .layout-files { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .col-date, .col-quota { display: none; }
}
@media (max-width: 640px) {
    .container { padding: 1rem .75rem 3rem; }
    .content { padding: .75rem; }
    .col-size { display: none; }
    .menu-panel, .menu-panel-wide { width: min(340px, calc(100vw - 2rem)); }
    .stats { grid-template-columns: 1fr 1fr; }
    .search { flex-basis: 100%; }
    .link-field { min-width: 0; }
}

/* ===================================================================
   Ordnerfreigaben zwischen Benutzern
   =================================================================== */
.nav-count {
    display: inline-grid; place-items: center;
    min-width: 20px; height: 20px; padding: 0 6px; margin-left: .25rem;
    border-radius: 999px;
    background: var(--accent); color: var(--accent-ink);
    font-size: .72rem; font-weight: 700;
}

/* Ordner-Icon mit Personen-Symbol */
.ficon-shared::after {
    content: "";
    position: absolute; right: -5px; bottom: -5px;
    width: 15px; height: 15px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    background:
        radial-gradient(circle at 50% 36%, #fff 0 2.6px, transparent 3px),
        radial-gradient(ellipse 6px 4px at 50% 100%, #fff 0 99%, transparent 100%),
        var(--info);
}
.ico-people {
    display: inline-block; width: 16px; height: 16px; border-radius: 50%;
    background:
        radial-gradient(circle at 50% 36%, currentColor 0 3px, transparent 3.5px),
        radial-gradient(ellipse 7px 5px at 50% 100%, currentColor 0 99%, transparent 100%);
    opacity: .8;
}

.badge-shared { background: var(--info-soft); color: var(--info); }
.badge-shared:hover { text-decoration: none; filter: brightness(.96); }


/* Berechtigungs-Pillen */
.perm {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .12rem .6rem;
    border-radius: 999px;
    font-size: .78rem; font-weight: 600;
    white-space: nowrap;
}
.perm::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.perm-owner { background: var(--accent-soft); color: var(--accent-dark); }
.perm-write { background: var(--success-soft); color: var(--success); }
.perm-read  { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
@media (prefers-color-scheme: dark) {
    .perm-owner { color: var(--accent); }
}

.avatar-alt { background: var(--brand-gray); color: var(--brand-mint); }

/* Hinweis in der Seitenleiste bei fremden Ordnern */
.share-info {
    display: flex; gap: .7rem; align-items: center;
    padding: .8rem;
    border-radius: var(--radius-sm);
    background: var(--info-soft);
    font-size: .9rem;
}
.share-info .perm { margin-top: .25rem; }

/* Teilen-Seite */
.breadcrumbs-page { margin-bottom: 1rem; font-size: .95rem; }
.share-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.25rem; align-items: start; }
.share-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.25rem; }
.share-head .ficon { margin-top: .4rem; }
.share-head h1 { font-size: 1.35rem; margin-bottom: .2rem; overflow-wrap: anywhere; }
.share-head p { margin: 0; }

.add-member {
    display: grid; grid-template-columns: 1fr 150px auto; gap: .5rem;
    padding: .9rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.section-title {
    font-size: .8rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted);
    margin: 1.75rem 0 .6rem;
}
h1 + .section-title { margin-top: 1rem; }

.member-list { list-style: none; margin: 0; padding: 0; }
.member {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--border);
}
.member:last-child { border-bottom: 0; }
.member-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member-who .muted { overflow-wrap: anywhere; }
.member-perm select { width: 130px; flex: none; padding: .3rem .5rem; font-size: .85rem; }
.member-inherited { opacity: .8; }

.card-help h2 { font-size: 1rem; }
.perm-help { margin: 0 0 1rem; }
.perm-help dt { margin-bottom: .3rem; }
.perm-help dd { margin: 0 0 1rem; font-size: .88rem; color: var(--muted); }

details.confirm-inline { position: relative; display: inline-block; }
details.confirm-inline form {
    position: absolute; right: 0; top: 0; z-index: 30;
    width: 280px; text-align: left; white-space: normal;
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    border: 1px solid var(--border);
}
details.confirm-inline[open] > summary { display: inline-flex; visibility: hidden; }

.content + .section-title, .content + h2 { margin-top: 2rem; }

@media (max-width: 900px) {
    .share-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .add-member { grid-template-columns: 1fr; }
    .member { flex-wrap: wrap; }
    .member-perm { order: 3; flex-basis: 100%; padding-left: 42px; }
}

/* ===================================================================
   Upload: Drag & Drop, Warteschlange, Fortschritt (upload.js)
   =================================================================== */
.layout-files { grid-template-columns: 290px 1fr; }

.dropzone { transition: border-color .15s, background .15s, padding .2s; }
.dropzone-compact { padding: .8rem .75rem; flex-direction: row; gap: .6rem; }
.dropzone-compact .dropzone-icon { width: 30px; height: 30px; font-size: 1rem; }
.dropzone-compact .hint { display: none; }
.dropzone-compact .dropzone-text::after { content: " – weitere hinzufügen"; font-weight: 400; color: var(--muted); }

.upload-submit:disabled { opacity: .5; cursor: not-allowed; }
.upload-submit.btn-secondary-state {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.upload-queue {
    display: flex; flex-direction: column; gap: .5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.upload-queue[hidden] { display: none; }

.uq-head {
    display: flex; justify-content: space-between; align-items: center; gap: .5rem;
    padding: .55rem .75rem 0;
    font-size: .8rem; font-weight: 600; color: var(--muted);
}
.uq-clear {
    font: inherit; font-weight: 500; color: var(--accent-dark);
    background: none; border: 0; padding: 0; cursor: pointer;
}
.uq-clear:hover { text-decoration: underline; }


.uq-list { list-style: none; margin: 0; padding: 0 .35rem; max-height: 320px; overflow-y: auto; }
.uq-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .45rem .4rem;
    border-radius: var(--radius-sm);
}
.uq-item + .uq-item { border-top: 1px solid var(--border); }
.uq-main { flex: 1; min-width: 0; }
.uq-name {
    font-size: .86rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.uq-meta { display: flex; gap: .4rem; font-size: .75rem; color: var(--muted); }
.uq-meta span + span::before { content: "·"; margin-right: .4rem; }
.uq-remove {
    flex: none;
    width: 24px; height: 24px;
    display: grid; place-items: center;
    border: 0; border-radius: 50%;
    background: transparent; color: var(--muted);
    font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.uq-remove:hover { background: var(--danger-soft); color: var(--danger); }
.uq-check {
    flex: none; width: 22px; height: 22px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--success); color: #fff;
    font-size: .75rem; font-weight: 700;
}

.uq-item.is-invalid, .uq-item.is-error { background: var(--danger-soft); }
.uq-item.is-invalid .uq-status, .uq-item.is-error .uq-status { color: var(--danger); font-weight: 600; }
@media (prefers-color-scheme: dark) {
    .uq-item.is-invalid .uq-status, .uq-item.is-error .uq-status { color: #f28b82; }
}
.uq-item.is-invalid .ficon { opacity: .5; }
.uq-item.is-done .uq-status { color: var(--success); }
.uq-item.is-uploading .uq-status { color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.uq-item.is-cancelled { opacity: .6; }

.ficon-sm { width: 22px; height: 26px; font-size: .42rem; border-radius: 3px 7px 3px 3px; }

/* Fortschrittsbalken */
progress.uq-bar, progress.uq-total-bar {
    display: block; width: 100%;
    height: 4px; margin-top: .3rem;
    border: 0; border-radius: 999px;
    background: var(--border);
    appearance: none; -webkit-appearance: none;
    overflow: hidden;
}
progress.uq-total-bar { height: 8px; margin: 0; }
progress.uq-bar::-webkit-progress-bar, progress.uq-total-bar::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
progress.uq-bar::-webkit-progress-value, progress.uq-total-bar::-webkit-progress-value {
    background: var(--meter);
    border-radius: 999px;
    transition: width .2s;
}
progress.uq-bar::-moz-progress-bar, progress.uq-total-bar::-moz-progress-bar {
    background: var(--meter);
    border-radius: 999px;
}
.uq-item.is-done progress.uq-bar::-webkit-progress-value { background: var(--success); }
.uq-item.is-done progress.uq-bar::-moz-progress-bar { background: var(--success); }

.uq-total {
    padding: .65rem .75rem .75rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.uq-total-text { margin-top: .35rem; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.uq-note {
    margin: .5rem .5rem 0;
    padding: .5rem .65rem;
    border-radius: var(--radius-sm);
    background: var(--info-soft);
    font-size: .8rem;
}

/* Seitenweites Drop-Overlay */
.drop-overlay {
    position: fixed; inset: 0; z-index: 100;
    display: none; place-items: center;
    background: rgba(30,30,30,.55);
    backdrop-filter: blur(2px);
    pointer-events: none;
}
body.is-dragging .drop-overlay { display: grid; }
body.is-dragging .dropzone { border-color: var(--meter); background: var(--accent-soft); }
.drop-overlay-box {
    display: flex; flex-direction: column; align-items: center; gap: .4rem;
    padding: 2.5rem 3.5rem;
    border: 3px dashed var(--meter);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.drop-overlay-box .dropzone-icon { width: 56px; height: 56px; font-size: 1.7rem; margin-bottom: .4rem; animation: drop-bounce 1s ease-in-out infinite; }
.drop-overlay-box strong { font-size: 1.15rem; }
.drop-overlay-box span:last-child { color: var(--muted); font-size: .9rem; }
@keyframes drop-bounce { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .drop-overlay-box .dropzone-icon { animation: none; } }

@media (max-width: 900px) {
    .layout-files { grid-template-columns: 1fr; }
}
.dropzone-icon { flex: none; }
.uq-meta { flex-wrap: wrap; }
.uq-size { white-space: nowrap; }
.uq-item.is-invalid .uq-meta, .uq-item.is-error .uq-meta { flex-direction: column; gap: 0; }
.uq-item.is-invalid .uq-meta span + span::before, .uq-item.is-error .uq-meta span + span::before { content: none; }
.uq-status { overflow-wrap: anywhere; }

/* ===================================================================
   Freischaltung neuer Benutzer
   =================================================================== */
.badge-pending { background: var(--warn-soft); color: var(--warn); }


/* Uhr-Symbol (reines CSS) */
.pending-icon {
    position: relative; flex: none;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--warn-soft);
    border: 2px solid var(--warn-line);
}
.pending-icon::before, .pending-icon::after {
    content: ""; position: absolute; left: 50%; bottom: 50%;
    width: 2px; border-radius: 2px;
    background: var(--warn);
    transform-origin: 50% 100%;
}
.pending-icon::before { height: 10px; margin-left: -1px; }
.pending-icon::after  { height: 7px;  margin-left: -1px; transform: rotate(110deg); }


/* Hinweis für wartende Benutzer (Seitenleiste) */
.pending-box {
    display: flex; gap: .75rem; align-items: flex-start;
    padding: .9rem;
    border-radius: var(--radius);
    background: var(--warn-soft);
    border: 1px solid var(--warn-line);
    font-size: .88rem;
}
.pending-box p { margin: .25rem 0 0; color: var(--muted); font-size: .84rem; }

/* Admin: Liste wartender Konten */
.pending-panel {
    margin-bottom: 1.5rem;
    padding: 1.1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--warn-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.pending-panel-head { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: .5rem; }
.pending-panel-head h2 { margin: .2rem 0 .15rem; font-size: 1.05rem; }
.pending-panel-head p { margin: 0; }
.pending-list { list-style: none; margin: 0; padding: 0; }
.pending-list li {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem 0;
    border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
    .pending-list li { flex-wrap: wrap; }
    .pending-list .member-who { flex-basis: calc(100% - 42px); }
}

/* Datei-Ansicht: zwischen 900 und 1180 px reicht der Platz neben der Navigation nicht für zwei Spalten */
@media (max-width: 1180px) {
    .layout-files { grid-template-columns: 1fr; }
    .layout-files .sidebar { position: static; }
}
@media (min-width: 641px) and (max-width: 1180px) {
    .layout-files .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
    .layout-files .sidebar > .upload-box { grid-row: span 3; }
}
