/* =====================================================================
   Kooblenz Cloud
   Gestaltungsvariablen aus dem Dashboard uebernommen, damit sich beides
   wie ein Haus anfuehlt. Eigener Akzent (Tuerkis statt Blau), damit man
   auf einen Blick sieht, wo man ist.
   ================================================================== */

:root {
    --ink: #0A0A0B;
    --ink-raised: #101012;
    --panel: #141416;
    --panel-hover: #1A1A1D;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --paper: #F2F2F3;
    --muted: #8A8A92;
    --muted-dim: #5C5C64;
    --accent: #2BB3A3;
    --accent-hover: #35D0BD;
    --accent-soft: rgba(43, 179, 163, 0.13);
    --accent-ink: #04201D;
    --ok: #34C77B;
    --down: #E5484D;
    --warn: #E5A93D;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .7);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --kopf-h: 58px;
}

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

/* Muss vor allen Komponenten stehen: eine Klassenregel mit display
   schluege sonst das Browser-Default [hidden]{display:none}, und ein
   unsichtbares Overlay laege ueber der Seite und finge jeden Klick ab. */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

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

body.cloud {
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-body);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

:focus-visible {
    outline: 2px solid var(--accent-hover);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--accent); color: var(--accent-ink);
    padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip:focus { left: 0; }

.schein {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(52rem 30rem at 12% -12%, rgba(43, 179, 163, .10), transparent 60%),
        radial-gradient(40rem 26rem at 92% 104%, rgba(79, 110, 247, .07), transparent 58%);
}

.nur-breit { display: none; }
@media (min-width: 860px) { .nur-breit { display: inline; } }

/* =====================================================================
   Kopfzeile
   ================================================================== */

.kopf {
    position: sticky; top: 0; z-index: 30;
    height: var(--kopf-h);
    display: flex; align-items: center; gap: 14px;
    padding: 0 16px;
    background: rgba(10, 10, 11, .82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.marke { display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0; }
.marke-zeichen {
    width: 30px; height: 30px; border-radius: 8px;
    display: grid; place-items: center;
    background: linear-gradient(140deg, var(--accent), #1d8fa0);
    color: #04201D;
}
.marke-text { font-weight: 700; letter-spacing: -.02em; font-size: 15px; }
.marke-text span { color: var(--muted); font-weight: 500; }
@media (max-width: 560px) { .marke-text { display: none; } }

.suchfeld { position: relative; flex: 1 1 auto; max-width: 460px; }
.suchfeld-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--muted-dim); pointer-events: none; display: flex;
}
.suchfeld input {
    width: 100%; height: 36px;
    padding: 0 12px 0 34px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 999px; outline: none;
    transition: border-color .15s, background .15s;
}
.suchfeld input::placeholder { color: var(--muted-dim); }
.suchfeld input:focus { border-color: var(--accent); background: var(--ink-raised); }

.kopf-rechts { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.kopf-knopf {
    display: inline-flex; align-items: center; gap: 8px;
    height: 34px; padding: 0 11px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    color: var(--muted); font-size: 13px; font-weight: 500;
    transition: background .15s, color .15s;
}
.kopf-knopf:hover { background: var(--panel-hover); color: var(--paper); }
.kopf-knopf.an { background: var(--accent-soft); color: var(--accent-hover); }

.avatar {
    width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink);
    font-size: 11px; font-weight: 700;
}

.speicher {
    display: none; flex-direction: column; gap: 4px;
    padding: 5px 11px; border-radius: var(--radius-sm);
    min-width: 148px;
    transition: background .15s;
}
.speicher:hover { background: var(--panel-hover); }
@media (min-width: 720px) { .speicher { display: flex; } }
.speicher-balken {
    display: block; height: 4px; border-radius: 2px;
    background: rgba(255, 255, 255, .09); overflow: hidden;
}
.speicher-balken > span {
    display: block; height: 100%; border-radius: 2px;
    background: var(--accent);
    transition: width .4s var(--ease);
}
.speicher-knapp .speicher-balken > span { background: var(--warn); }
.speicher-text { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

/* =====================================================================
   Inhalt
   ================================================================== */

.inhalt {
    position: relative; z-index: 1;
    max-width: 1180px; margin: 0 auto;
    padding: 22px 16px 96px;
}

.meldung {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; margin-bottom: 16px;
    border-radius: var(--radius); border: 1px solid var(--border);
    font-size: 13.5px;
}
.meldung-ok      { background: rgba(52, 199, 123, .10); border-color: rgba(52, 199, 123, .3); color: #8ee7b8; }
.meldung-fehler  { background: rgba(229, 72, 77, .10);  border-color: rgba(229, 72, 77, .3);  color: #f2a3a5; }
.meldung-hinweis { background: var(--panel); color: var(--muted); }

/* Brotkrumen -------------------------------------------------------- */

.krumen {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-bottom: 14px; font-size: 14px; min-height: 28px;
}
.krume {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: var(--radius-sm);
    color: var(--muted); transition: background .15s, color .15s;
}
.krume:hover { background: var(--panel-hover); color: var(--paper); }
.krume-hier { color: var(--paper); font-weight: 600; }
.krume-hier:hover { background: none; }
.krume-trenner { color: var(--muted-dim); }

/* Werkzeugleiste ---------------------------------------------------- */

.leiste {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    margin-bottom: 18px;
}
.leiste-rechts { margin-left: auto; display: flex; gap: 9px; align-items: center; }

.knopf {
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 14px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500; cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.knopf:hover { background: var(--panel-hover); border-color: var(--border-strong); }
.knopf:active { transform: translateY(1px); }
.knopf-haupt {
    background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600;
}
.knopf-haupt:hover { background: var(--accent-hover); }
.knopf-gefahr { color: #f2a3a5; }
.knopf-gefahr:hover { background: rgba(229, 72, 77, .12); border-color: rgba(229, 72, 77, .35); }
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopf-klein { height: 30px; padding: 0 10px; font-size: 12.5px; }

/* =====================================================================
   Dateiliste
   ================================================================== */

/*
 * Kein `overflow: hidden` hier.
 *
 * Es waere der bequeme Weg zu runden Ecken, schneidet aber jedes
 * Zeilenmenue ab, das ueber den unteren Listenrand hinausragt — und ein
 * abgeschnittenes Menue ist nicht nur halb sichtbar, es ist gar nicht
 * mehr anklickbar: der Klick geht durch auf das, was dahinter liegt.
 * Die Ecken werden stattdessen an den Kindelementen gerundet.
 */
.liste {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* -1px, weil der Rahmen der Liste innen einen Pixel wegnimmt. */
.liste-kopf {
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.liste > *:last-child,
.liste .zeile:last-child,
.liste .leer:last-child {
    border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
}

.liste-kopf {
    display: grid;
    grid-template-columns: 1fr 108px 132px 40px;
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
    color: var(--muted-dim); font-weight: 600;
}
.liste-kopf a { color: inherit; }
.liste-kopf a:hover { color: var(--paper); }
.liste-kopf .sortiert { color: var(--accent); }
@media (max-width: 700px) {
    .liste-kopf { grid-template-columns: 1fr 40px; }
    .liste-kopf .weg-schmal { display: none; }
}

.zeile {
    display: grid;
    grid-template-columns: 1fr 108px 132px 40px;
    gap: 12px; align-items: center;
    padding: 0 14px;
    min-height: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, .045);
    transition: background .12s;
    position: relative;
}
.zeile:last-child { border-bottom: none; }
.zeile:hover { background: var(--panel-hover); }
@media (max-width: 700px) {
    .zeile { grid-template-columns: 1fr 40px; }
    .zeile .weg-schmal { display: none; }
}

.zeile-name {
    display: flex; align-items: center; gap: 11px;
    min-width: 0; padding: 9px 0;
}
.zeile-symbol { color: var(--muted); display: flex; flex-shrink: 0; }
.zeile .ordner-symbol { color: var(--accent); }
.zeile-text {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 14px;
}
.zeile-name a:hover .zeile-text { text-decoration: underline; }
.zeile-zusatz {
    font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.zeile-geteilt {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: 8px; padding: 2px 7px;
    background: var(--accent-soft); color: var(--accent-hover);
    border-radius: 999px; font-size: 10.5px; font-weight: 600;
    flex-shrink: 0;
}

/* Menue je Zeile ---------------------------------------------------- */

.menue-halter { position: relative; justify-self: end; }
.menue-knopf {
    width: 30px; height: 30px; display: grid; place-items: center;
    background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
    color: var(--muted); cursor: pointer;
}
.menue-knopf:hover { background: rgba(255, 255, 255, .07); color: var(--paper); }
.menue {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 20;
    min-width: 186px; padding: 5px;
    background: var(--ink-raised); border: 1px solid var(--border-strong);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
}

/*
 * Eine Zeile mit offenem Menue muss ueber ihren Nachbarn liegen.
 *
 * Jede .zeile ist `position: relative` und bildet damit einen eigenen
 * Stapelzusammenhang. Ohne diese Regel wuerde das Menue der dritten
 * Zeile von der vierten ueberdeckt — die kommt im Dokument spaeter und
 * gewinnt allein dadurch.
 *
 * Zweimal notiert: `:has()` greift von selbst, die Klasse setzt das
 * Skript zusaetzlich. Das ist keine Doppelung aus Unsicherheit, sondern
 * deckt den Fall ab, dass das Skript nicht laedt.
 */
.zeile:has(details.menue-halter[open]),
.zeile.menue-offen,
tr:has(details.menue-halter[open]) { z-index: 25; position: relative; }

/*
 * Wenn unten kein Platz ist, klappt das Menue nach oben. Das setzt das
 * Skript; ohne Skript bleibt es bei "nach unten", was seit dem Wegfall
 * von overflow:hidden immerhin bedienbar ist.
 */
.menue.nach-oben { top: auto; bottom: calc(100% + 4px); }

/*
 * In einer Rollflaeche (die Tabellen der Verwaltung auf schmalen
 * Schirmen) hilft beides nicht: ein Rollcontainer schneidet ab, egal
 * wie die Stapelung aussieht. Dort loest das Skript das Menue aus dem
 * Fluss und setzt es fest ans Fenster.
 */
.menue.freigestellt {
    position: fixed;
    right: auto;
    top: auto;
    z-index: 80;
}
.menue button, .menue a {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; border: none; background: none; border-radius: var(--radius-sm);
    font-size: 13px; text-align: left; cursor: pointer; color: var(--paper);
}
.menue button:hover, .menue a:hover { background: var(--panel-hover); }
.menue .gefahr { color: #f2a3a5; }
.menue-trenner { height: 1px; margin: 5px 0; background: var(--border); }

/* Leerer Ordner ----------------------------------------------------- */

.leer {
    padding: 62px 24px; text-align: center; color: var(--muted);
}
.leer-zeichen {
    width: 56px; height: 56px; margin: 0 auto 16px;
    display: grid; place-items: center; border-radius: 16px;
    background: var(--panel-hover); color: var(--muted-dim);
}
.leer h2 { font-size: 16px; font-weight: 600; color: var(--paper); margin-bottom: 6px; }
.leer p { font-size: 13.5px; }

/* =====================================================================
   Hochladen
   ================================================================== */

/* Ablegeflaeche ueber der ganzen Seite */
.ablegen {
    position: fixed; inset: 0; z-index: 60;
    display: grid; place-items: center;
    background: rgba(10, 10, 11, .82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ablegen-rahmen {
    padding: 46px 62px; text-align: center;
    border: 2px dashed var(--accent); border-radius: 18px;
    background: rgba(43, 179, 163, .07);
}
.ablegen-rahmen strong { display: block; font-size: 18px; margin-top: 12px; }
.ablegen-rahmen span { color: var(--muted); font-size: 13.5px; }

/* Fortschrittsfeld unten rechts */
.uploads {
    position: fixed; right: 16px; bottom: 16px; z-index: 50;
    width: min(370px, calc(100vw - 32px));
    background: var(--ink-raised); border: 1px solid var(--border-strong);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.uploads-kopf {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px; border-bottom: 1px solid var(--border);
    font-size: 13px; font-weight: 600;
}
.uploads-schliessen {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: 18px; line-height: 1; padding: 0 4px;
}
.uploads-liste { max-height: 264px; overflow-y: auto; }

.upload {
    padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .045);
}
.upload:last-child { border-bottom: none; }
.upload-kopf {
    display: flex; align-items: center; gap: 10px; margin-bottom: 7px;
}
.upload-name {
    flex: 1; min-width: 0; font-size: 13px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upload-wert { font-family: var(--font-mono); font-size: 11px; color: var(--muted); flex-shrink: 0; }
.upload-balken { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.upload-balken > span {
    display: block; height: 100%; width: 0; border-radius: 2px;
    background: var(--accent); transition: width .25s var(--ease);
}
.upload.fertig .upload-balken > span { background: var(--ok); }
.upload.fehler .upload-balken > span { background: var(--down); }
.upload.fehler .upload-wert { color: #f2a3a5; }

/* =====================================================================
   Dialoge
   ================================================================== */

.dialog-grund {
    position: fixed; inset: 0; z-index: 70;
    display: grid; place-items: center; padding: 20px;
    background: rgba(6, 6, 7, .7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.dialog {
    width: min(440px, 100%);
    background: var(--ink-raised); border: 1px solid var(--border-strong);
    border-radius: 14px; box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.dialog-kopf { padding: 18px 20px 0; }
.dialog-kopf h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.dialog-kopf p { margin-top: 6px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.dialog-leib { padding: 16px 20px; }
.dialog-fuss {
    display: flex; justify-content: flex-end; gap: 9px;
    padding: 14px 20px; border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .015);
}

/* =====================================================================
   Formulare
   ================================================================== */

.feld { margin-bottom: 14px; }
.feld label {
    display: block; margin-bottom: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.feld input[type=text], .feld input[type=email], .feld input[type=password],
.feld input[type=number], .feld input[type=datetime-local], .feld select, .eingabe {
    width: 100%; height: 38px; padding: 0 12px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-sm); outline: none;
    transition: border-color .15s, background .15s;
}
.feld input:focus, .feld select:focus, .eingabe:focus {
    border-color: var(--accent); background: var(--ink-raised);
}
.feld-hinweis { margin-top: 6px; font-size: 12px; color: var(--muted-dim); line-height: 1.5; }
.feld-fehler { margin-top: 6px; font-size: 12px; color: #f2a3a5; }

.ankreuz {
    display: flex; align-items: flex-start; gap: 9px;
    font-size: 13.5px; color: var(--muted); cursor: pointer;
}
.ankreuz input { margin-top: 2px; accent-color: var(--accent); width: 15px; height: 15px; }

/* =====================================================================
   Schlichte Seiten
   ================================================================== */

body.schlicht { display: grid; place-items: center; min-height: 100dvh; padding: 22px; }
.schlicht-mitte { position: relative; z-index: 1; width: min(420px, 100%); }

.karte {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 15px; padding: 30px 28px; box-shadow: var(--shadow);
}
.karte-breit { width: min(560px, 100%); }
.karte-marke {
    display: flex; align-items: center; gap: 10px;
    justify-content: center; margin-bottom: 22px;
}
.karte-marke .marke-zeichen { width: 34px; height: 34px; }
.karte-marke .marke-text { font-size: 16px; }
.karte h1 {
    font-size: 19px; font-weight: 700; letter-spacing: -.02em;
    text-align: center; margin-bottom: 7px;
}
.karte-unter {
    text-align: center; color: var(--muted); font-size: 13.5px;
    margin-bottom: 22px; line-height: 1.55;
}
.karte-fuss {
    margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--border);
    text-align: center; font-size: 13px; color: var(--muted);
}
.karte-fuss a { color: var(--accent-hover); font-weight: 500; }
.karte-fuss a:hover { text-decoration: underline; }

.knopf-voll { width: 100%; justify-content: center; height: 40px; }

/* =====================================================================
   Konto / Verwaltung
   ================================================================== */

/* Kein overflow:hidden — Begruendung wie bei .liste weiter oben. */
.abschnitt {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 18px;
}
.abschnitt-kopf {
    padding: 15px 18px; border-bottom: 1px solid var(--border);
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.abschnitt-kopf h2 { font-size: 14.5px; font-weight: 650; }
.abschnitt-kopf p { margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.abschnitt-leib { padding: 18px; }

.seitentitel {
    font-size: 21px; font-weight: 700; letter-spacing: -.025em; margin-bottom: 5px;
}
.seitenunter { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; line-height: 1.55; }

.tabelle { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabelle th {
    text-align: left; padding: 9px 12px;
    font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
    color: var(--muted-dim); font-weight: 600;
    border-bottom: 1px solid var(--border);
}
.tabelle td { padding: 11px 12px; border-bottom: 1px solid rgba(255, 255, 255, .045); }
.tabelle tr:last-child td { border-bottom: none; }
.tabelle-rollt { overflow-x: auto; }

.marke-status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
}
.marke-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-aktiv    { background: rgba(52, 199, 123, .12); color: #6bdba0; }
.status-wartend  { background: rgba(229, 169, 61, .12); color: #e9c07a; }
.status-gesperrt { background: rgba(229, 72, 77, .12);  color: #f2a3a5; }

.kacheln {
    display: grid; gap: 12px; margin-bottom: 18px;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
}
.kachel {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 15px 16px;
}
.kachel-wert { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.kachel-text { margin-top: 3px; font-size: 12px; color: var(--muted); }

/* =====================================================================
   Freigabeseite
   ================================================================== */

.freigabe-datei {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; margin-bottom: 20px;
    background: var(--ink-raised); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.freigabe-symbol {
    width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-hover);
}
.freigabe-namen { min-width: 0; }
.freigabe-namen strong {
    display: block; font-size: 14.5px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.freigabe-namen span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.kopierfeld { display: flex; gap: 8px; }
.kopierfeld input {
    flex: 1; min-width: 0; height: 38px; padding: 0 12px;
    background: var(--ink); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
