/* ==========================================================================
   FileHub – Studio-Design
   Navy #0f1e3a · Koralle #ff5a36 · Gelb #ffd23f · Syne (Display) + DM Sans
   ========================================================================== */

:root {
    --navy: #0f1e3a;
    --navy-2: #16294d;
    --coral: #ff5a36;
    --coral-dark: #d8431f;
    --yellow: #ffd23f;
    --yellow-soft: #fff7d6;
    --ink: #0f1e3a;
    --muted: #566480;
    --line: #e3e8f1;
    --soft: #e9eef7;
    --paper: #ffffff;
    --side-text: #c9d4e8;
    --side-muted: #8ea0c4;
    --ok: #1f7a4d;
    --err: #c0392b;
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-w: 296px;
    --font-display: 'Syne', 'DM Sans', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--coral-dark); }
img { max-width: 100%; display: block; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--soft); padding: 2px 6px; border-radius: 6px; }
pre.pre { white-space: pre-wrap; background: var(--soft); padding: 14px; border-radius: var(--radius-sm); font-size: 12px; text-align: left; max-width: 720px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--yellow); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* --- Typografie ---------------------------------------------------------- */
.display {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
}
.display--xl { font-size: clamp(40px, 6vw, 60px); }
.display--lg { font-size: clamp(32px, 5vw, 40px); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.lead { color: var(--muted); font-size: 15px; max-width: 640px; }
.hint { font-size: 12px; color: var(--side-muted); margin: 6px 0 0; }
.c-coral { color: var(--coral); }
.c-yellow { color: var(--yellow); }
.c-muted { color: var(--muted); }

/* --- Marke --------------------------------------------------------------- */
.brand {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -.02em;
    color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand--light, .sidebar .brand { color: #fff; }
.brand--light:hover, .sidebar .brand:hover { color: #fff; }
.brand__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); display: inline-block; }

/* --- Buttons & Felder ---------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 18px; border-radius: 12px;
    border: 2px solid var(--ink); background: transparent; color: var(--ink);
    font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; line-height: 1.2;
    transition: transform .08s ease, background .15s ease, color .15s ease;
}
.btn:hover { color: var(--ink); background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--coral); border-color: var(--coral); color: var(--ink); }
.btn--primary:hover { background: #ff6d4d; border-color: #ff6d4d; color: var(--ink); }
.btn--block { width: 100%; }
.btn--lg { padding: 15px 22px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .field__input:focus-visible, .iconbtn:focus-visible, .thumb:focus-visible, .tile:focus-visible, .tree__item:focus-visible {
    outline: 3px solid var(--yellow); outline-offset: 2px;
}

.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }
.inline-form { display: inline; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; }
.field__input {
    width: 100%; padding: 12px 14px; border-radius: 12px;
    border: 2px solid var(--ink); background: #fff; color: var(--ink);
    font: inherit; font-size: 15px; outline: 0;
}
.field__input:focus { border-color: var(--coral); }

.form { display: flex; flex-direction: column; gap: 18px; }
.form--narrow { width: min(420px, 100%); }
.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { .grid--2 { grid-template-columns: 1fr; } }

.divider { display: flex; align-items: center; gap: 12px; color: var(--side-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.note { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.note svg { flex-shrink: 0; margin-top: 2px; }
.note--yellow { background: var(--yellow-soft); border: 2px solid var(--yellow); }

.flash { padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; margin-bottom: 16px; }
.flash--ok { background: #e6f5ec; color: var(--ok); border: 2px solid #bfe6cf; }
.flash--error { background: #fdecea; color: var(--err); border: 2px solid #f6c9c4; }
.flash--info { background: var(--yellow-soft); color: var(--ink); border: 2px solid var(--yellow); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.badge--navy { background: var(--navy); color: #fff; }
.badge--yellow { background: var(--yellow); color: var(--ink); }
.badge--coral { background: var(--coral); color: var(--ink); }

.card { border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.card__head { padding: 12px 18px; background: var(--navy); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.card .grid, .card > .hint { padding: 18px; }
.card > .hint { padding-top: 0; }

.avatar {
    width: 36px; height: 36px; border-radius: 10px; background: var(--yellow); color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.avatar--lg { width: 40px; height: 40px; border-radius: 12px; }

/* --- Auth-Seiten (Login, Install, Fehler) -------------------------------- */
body.auth { background: var(--paper); }

.split { display: flex; min-height: 100vh; }
.split__brand {
    width: 44%; min-width: 320px; box-sizing: border-box; padding: 48px;
    display: flex; flex-direction: column; background: var(--navy); color: #fff; position: relative; overflow: hidden;
}
.split__hero { margin-top: clamp(40px, 12vh, 110px); position: relative; z-index: 1; }
.split__lead { margin: 26px 0 0; max-width: 380px; font-size: 16px; line-height: 1.55; color: var(--side-text); }
.split__form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.blocks { position: absolute; right: -40px; bottom: -40px; display: grid; grid-template-columns: repeat(3, 96px); gap: 12px; opacity: .95; }
.blocks__b { width: 96px; height: 96px; border-radius: 18px; background: rgba(255,255,255,.08); }
.blocks__b--coral { background: var(--coral); }
.blocks__b--yellow { background: var(--yellow); }
@media (max-width: 860px) {
    .split { flex-direction: column; }
    .split__brand { width: 100%; min-width: 0; padding: 32px 24px 48px; }
    .split__hero { margin-top: 28px; }
    .blocks { display: none; }
    .split__form { padding: 32px 20px 48px; align-items: flex-start; }
}

.page { max-width: 820px; margin: 0 auto; padding: 48px 24px 64px; }
.page--narrow { max-width: 760px; }
.page--center { min-height: 100vh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; max-width: 640px; }
.page .brand { margin-bottom: 36px; }
.page .display { margin-bottom: 10px; }
.page--center .btn { margin-top: 12px; }

.checks { list-style: none; margin: 0; padding: 10px 18px; }
.checks__item { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; font-size: 14px; }
.checks__mark { font-weight: 700; width: 18px; }
.checks__item.is-ok .checks__mark { color: var(--ok); }
.checks__item.is-fail .checks__mark { color: var(--err); }
.checks__info { color: var(--muted); font-size: 12px; }

/* --- App-Shell ------------------------------------------------------------ */
body.app { background: var(--paper); }
.shell { display: flex; min-height: 100vh; }

.topbar { display: none; }

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; box-sizing: border-box;
    padding: 34px 26px 30px 30px; display: flex; flex-direction: column;
    background: var(--navy); color: #fff; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar__brand { margin-bottom: 8px; }
.sidebar__label { margin-top: 34px; margin-bottom: 12px; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--side-muted); }
.sidebar__spacer { flex: 1; min-height: 24px; }

.tree { display: flex; flex-direction: column; gap: 2px; }
.tree__item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
    color: var(--side-text); font-size: 15px; border-left: 3px solid transparent; margin-left: -3px;
}
.tree__item:hover { color: #fff; background: rgba(255,255,255,.06); }
.tree__item.is-active { color: #fff; font-weight: 600; background: rgba(255,255,255,.1); border-left-color: var(--coral); }
.tree__item.is-active .tree__icon { color: var(--coral); }
.tree__item.is-open:not(.is-active) { color: #fff; }
.tree__icon { flex-shrink: 0; }
.tree__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree__count { font-size: 12px; color: var(--side-muted); }
.tree__item--d0 { padding-left: 26px; }
.tree__item--d1 { padding-left: 44px; font-size: 14px; }
.tree__item--d2 { padding-left: 62px; font-size: 14px; }
.tree__item--d3 { padding-left: 80px; font-size: 13px; }
.tree__item--d4, .tree__item--d5, .tree__item--d6 { padding-left: 96px; font-size: 13px; }

.adminnav { display: flex; flex-direction: column; gap: 10px; font-size: 15px; font-weight: 500; }
.adminnav__item { color: var(--side-text); border-left: 3px solid transparent; margin-left: -15px; padding-left: 12px; }
.adminnav__item:hover { color: #fff; }
.adminnav__item.is-active { color: #fff; font-weight: 700; border-left-color: var(--coral); }

.userbox { display: flex; align-items: center; gap: 12px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); }
.userbox__name { font-weight: 600; font-size: 14px; }
.userbox__meta { font-size: 12px; color: var(--side-muted); }
.userbox .linkbtn { color: var(--side-muted); }
.userbox .linkbtn:hover { color: #fff; }

.main { flex: 1; min-width: 0; padding: 30px 40px 48px; }

/* --- Seitenkopf ------------------------------------------------------------ */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.pagehead__text { min-width: 0; }
.pagehead__meta { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.pagehead__tools { display: flex; align-items: center; gap: 10px; padding-top: 10px; flex-wrap: wrap; }
.pagehead .display { margin-top: 4px; overflow-wrap: anywhere; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); flex-wrap: wrap; }
.crumbs a:hover { color: var(--coral-dark); }
.crumbs__current { color: var(--ink); }

.search {
    display: flex; align-items: center; gap: 10px; width: 260px; max-width: 100%;
    padding: 11px 14px; border-radius: 12px; border: 2px solid var(--ink); color: var(--muted); font-size: 13px; background: #fff;
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.search:focus-within { border-color: var(--coral); }

/* --- Ordner-Kacheln -------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.tile {
    display: flex; flex-direction: column; justify-content: space-between; min-height: 104px;
    padding: 16px; border-radius: var(--radius); color: #fff; background: var(--navy);
    transition: transform .1s ease, box-shadow .15s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,30,58,.18); color: inherit; }
.tile__label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.tile__name { font-family: var(--font-display); font-weight: 700; font-size: 20px; overflow-wrap: anywhere; }
.tile__meta { font-size: 12px; }
.tile--navy { background: var(--navy); color: #fff; }
.tile--navy .tile__label { color: var(--side-muted); opacity: 1; }
.tile--coral { background: var(--coral); color: var(--ink); }
.tile--yellow { background: var(--yellow); color: var(--ink); }
.tile--soft { background: var(--soft); color: var(--ink); }
.tile--soft .tile__label { color: var(--muted); opacity: 1; }
.tile--back { background: transparent; border: 2px dashed #c9d4e8; color: var(--muted); gap: 10px; }
.tile--back:hover { color: var(--ink); border-color: var(--ink); box-shadow: none; }
.tile--back .tile__name { font-size: 18px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tile { min-height: 88px; padding: 12px; } .tile__name { font-size: 17px; } }

/* --- Dateiliste ------------------------------------------------------------ */
.files { display: flex; flex-direction: column; }
.files__head, .files__row {
    display: grid; grid-template-columns: 56px minmax(0, 1fr) 90px 120px 120px 44px;
    gap: 14px; align-items: center;
}
.files__head { padding: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); }
.files__row { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.files__row:hover { background: #fafbfd; }
.files__name { min-width: 0; }
.files__link { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files__sub { font-size: 12px; color: var(--muted); }
.files__size, .files__date { color: var(--muted); white-space: nowrap; }
.files__action { display: flex; justify-content: center; }
.files__nohit { padding: 24px 0; color: var(--muted); text-align: center; }

.fileicon { width: 56px; height: 40px; border-radius: 8px; background: var(--soft); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.fileicon--image { color: #1d6fb8; }
.fileicon--video { color: #7c3aed; }
.fileicon--audio { color: #0f8a6a; }
.fileicon--archive { color: #b45309; }
.fileicon--pdf { color: var(--coral-dark); }
.fileicon--sheet { color: #1f7a4d; }

.thumb { width: 56px; height: 40px; border-radius: 8px; border: 0; padding: 0; overflow: hidden; cursor: zoom-in; background: var(--soft); display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.iconbtn { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: transparent; border: 2px solid transparent; }
.iconbtn:hover { background: var(--navy); color: #fff; }

.empty { padding: 36px 20px; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); margin-top: 14px; }
.empty__title { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.empty__text { color: var(--muted); font-size: 14px; margin-top: 6px; }
.empty--slim { padding: 18px; color: var(--muted); font-size: 14px; }

.files__meta-m { display: none; }
.files__meta-m .badge { padding: 1px 6px; font-size: 11px; margin-left: 2px; }

@media (max-width: 900px) {
    .files__head { display: none; }
    .files__row { grid-template-columns: 48px minmax(0, 1fr) 40px; gap: 12px; }
    .files__size, .files__date, .files__status { display: none; }
    .files__meta-m { display: inline; }
    .fileicon, .thumb { width: 48px; height: 36px; }
}

/* --- Lightbox -------------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(15,30,58,.92); display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox__figure img { max-width: min(1400px, 100%); max-height: calc(100vh - 100px); object-fit: contain; border-radius: 12px; background: #fff; }
.lightbox__figure figcaption { color: #fff; font-size: 14px; font-weight: 500; }
.lightbox__close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--coral); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
body.lb-open { overflow: hidden; }

/* --- Mobil: Topbar + ausklappbare Sidebar ------------------------------------ */
@media (max-width: 900px) {
    .topbar {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 14px 16px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30;
    }
    .topbar .brand { font-size: 20px; color: #fff; }
    .topbar__menu { width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(255,255,255,.1); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

    .shell { display: block; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 40; width: min(320px, 86vw); height: 100vh;
        transform: translateX(-100%); transition: transform .2s ease; padding: 28px 22px;
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar__backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(15,30,58,.5); }
    .sidebar__backdrop[hidden] { display: none; }
    body.nav-open { overflow: hidden; }

    .main { padding: 20px 16px 110px; }
    .pagehead__tools { width: 100%; padding-top: 0; }
    .search { width: 100%; }
}

/* ==========================================================================
   Paket 2 – Upload, Eingang, Verwaltung, Gast
   ========================================================================== */

/* --- Buttons/Badges (Ergänzungen) ------------------------------------------ */
.btn--sm { padding: 8px 12px; font-size: 12px; border-radius: 9px; }
.btn--navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn--danger { border-color: var(--coral); color: var(--coral-dark); }
.btn--danger:hover { background: #fdecea; color: var(--coral-dark); }
.btn--ghost { border-color: rgba(255,255,255,.4); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.badge--muted { border: 2px solid var(--muted); color: var(--muted); padding: 2px 8px; }
.badge--outline { border: 2px solid var(--ink); color: var(--ink); padding: 2px 8px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; background: var(--coral); color: var(--ink); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 2px solid var(--ink); font-size: 13px; font-weight: 600; color: var(--ink); background: #fff; }
.chip.is-active { background: var(--navy); color: #fff; }
.chip--yellow { background: var(--yellow); border-color: var(--yellow); color: var(--ink); font-size: 12px; }
.chips { gap: 8px; }
.c-amber { color: #b45309; font-weight: 600; }
.c-coral-dark { color: var(--coral-dark); font-weight: 600; }
.strong { font-weight: 600; color: var(--ink); }
.h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 18px; }

.field__input--sm { padding: 8px 10px; font-size: 13px; border-radius: 9px; }
.field__input--area { resize: vertical; min-height: 72px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.field--inline { flex-direction: column; flex: 1; min-width: 200px; }
.field--span { grid-column: 1 / -1; }
.field__group { display: flex; gap: 8px; }
.field__group .field__input { flex: 1; min-width: 0; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) { .grid--3 { grid-template-columns: 1fr; } }
select.field__input { appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230f1e3a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 36px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input, .matrix__cell input, .bulkbar__check input, .inbox__check input { width: 20px; height: 20px; accent-color: var(--navy); margin: 0; cursor: pointer; }

.segmented { display: inline-flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.segmented__opt { position: relative; flex: 1; }
.segmented__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented__opt span { display: block; padding: 9px 14px; font-size: 13px; font-weight: 600; text-align: center; white-space: nowrap; cursor: pointer; }
.segmented__opt input:checked + span { background: var(--navy); color: #fff; }
.segmented__opt input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: -3px; }
.segmented__opt input:disabled + span { opacity: .5; cursor: not-allowed; }
.segmented--3 { width: 100%; }

.form__actions { display: flex; justify-content: flex-end; gap: 10px; }
.form--row { flex-direction: row; align-items: center; gap: 12px; margin-top: 4px; }
.card__body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.card__body.grid { display: grid; }
.card__head--row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card__headtools { display: flex; gap: 8px; flex-wrap: wrap; }
.card__head--yellow { background: var(--yellow); color: var(--ink); }
.card__head--coral { background: var(--coral); color: var(--ink); display: flex; align-items: center; justify-content: space-between; }
.card__sub { font-family: var(--font-body); font-weight: 600; font-size: 12px; }
.card__count { font-family: var(--font-body); font-size: 12px; font-weight: 600; }
.card__foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.5; }
.card--narrow { max-width: 520px; }
.card--aside { margin-bottom: 0; }

.panel { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 16px; border-radius: var(--radius); background: var(--yellow-soft); border: 2px solid var(--yellow); margin-bottom: 20px; }
.panel[hidden] { display: none; }
.panel--inset { margin: 0; border-radius: 0; border-left: 0; border-right: 0; }

/* --- Browser: Zweispalter + Aside -------------------------------------------- */
.browse { display: block; }
.browse--aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.browse__aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
@media (max-width: 1180px) { .browse--aside { grid-template-columns: 1fr; } .browse__aside { position: static; } }

.tile-wrap { position: relative; }
.tile-wrap .tile { height: 100%; }
.tile__menu { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255,255,255,.25); color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tile--navy .tile__menu { color: #fff; }
.tile__menu:hover { background: rgba(255,255,255,.5); }
.tile--soft .tile__menu:hover, .tile--yellow .tile__menu:hover, .tile--coral .tile__menu:hover { background: rgba(15,30,58,.12); }

.popover { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 280px; padding: 12px; border-radius: 12px; background: #fff; border: 2px solid var(--ink); box-shadow: 0 14px 32px rgba(15,30,58,.18); display: flex; flex-direction: column; gap: 8px; }
.popover[hidden] { display: none; }
.popover__row { display: flex; gap: 8px; align-items: center; }
.popover__row .field__input { flex: 1; min-width: 0; }
.popover--row { position: relative; top: auto; right: auto; grid-column: 1 / -1; margin: 6px 0 4px; }
.files__row { position: relative; }
.files__action { display: flex; justify-content: flex-end; gap: 2px; }
.files__head, .files__row { grid-template-columns: 56px minmax(0, 1fr) 90px 120px 120px 88px; }

/* --- Dropzone --------------------------------------------------------------- */
.dropzone { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 18px; border-radius: var(--radius); border: 2px dashed var(--coral); background: #fff3ef; transition: background .15s ease, border-color .15s ease; }
.dropzone.is-drag { background: #ffe4dc; border-style: solid; }
.dropzone__icon { width: 48px; height: 48px; border-radius: 12px; background: var(--coral); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.dropzone__title { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.dropzone__text { font-size: 12px; color: var(--muted); line-height: 1.5; }
.dropzone__pick { position: relative; overflow: hidden; background: #fff; }
.dropzone__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__submit[hidden] { display: none; }
.uplist { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.uplist:empty { display: none; }
.uplist__item { padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 12px; }
.uplist__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uplist__bar { height: 5px; border-radius: 999px; background: var(--soft); margin: 6px 0; overflow: hidden; }
.uplist__bar span { display: block; height: 100%; width: 0; background: var(--navy); transition: width .2s ease; }
.uplist__msg { color: var(--muted); }
.uplist__item.is-ok .uplist__msg { color: var(--ok); font-weight: 600; }
.uplist__item.is-ok .uplist__bar span { width: 100% !important; background: var(--ok); }
.uplist__item.is-error .uplist__msg { color: var(--err); font-weight: 600; }
.uplist__item.is-error .uplist__bar { display: none; }

.asidelist { list-style: none; margin: 0; padding: 4px 16px; }
.asidelist__item { padding: 11px 0; border-bottom: 1px solid var(--line); }
.asidelist__item:last-child { border-bottom: 0; }
.asidelist__item--row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.asidelist__text { min-width: 0; }
.asidelist__name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asidelist__meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* --- Gast-Layout ------------------------------------------------------------- */
.guestbar { display: flex; align-items: center; gap: 16px; padding: 16px 40px; background: var(--navy); color: #fff; flex-wrap: wrap; }
.guestbar .brand { font-size: 22px; }
.guestbar__spacer { flex: 1; }
.guestbar__meta { font-size: 13px; color: var(--side-muted); }
.main--guest { padding: 30px 40px 48px; max-width: 1400px; margin: 0 auto; }
@media (max-width: 900px) { .guestbar { padding: 14px 16px; gap: 10px; } .main--guest { padding: 20px 16px 48px; } }

/* --- Link-Passwortseite -------------------------------------------------------- */
.gate { min-height: 100vh; display: flex; flex-direction: column; background: var(--soft); }
.gate__bar { padding: 22px 40px; background: var(--navy); }
.gate__main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.gate__card { width: min(520px, 100%); background: #fff; border-radius: 20px; border: 2px solid var(--ink); overflow: hidden; }
.gate__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 30px; background: var(--yellow); }
.eyebrow--dark { color: var(--ink); }
.gate__expiry { font-size: 12px; font-weight: 600; }
.gate__body { padding: 30px; display: flex; flex-direction: column; gap: 18px; }
.gate__folder { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.gate__folder strong { color: var(--ink); }
.gate__badges { display: flex; gap: 8px; flex-wrap: wrap; }
.gate__note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; text-align: center; }
.gate__foot { display: flex; justify-content: space-between; gap: 12px; padding: 18px 40px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.gate__foot a { text-decoration: underline; }
@media (max-width: 600px) { .gate__bar, .gate__foot { padding-left: 16px; padding-right: 16px; } .gate__body { padding: 22px; } }

/* --- Eingang ------------------------------------------------------------------ */
.bulkbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--yellow); margin-bottom: 18px; }
.bulkbar__check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.bulkbar__spacer { flex: 1; }
.bulkbar__label { font-size: 13px; font-weight: 600; }
.bulkbar__group { display: flex; gap: 6px; align-items: center; }
.bulkbar .segmented { background: #fff; }
.bulkbar .field__input--sm { max-width: 200px; }

.inbox { display: flex; flex-direction: column; }
.inbox__head, .inbox__row { display: grid; grid-template-columns: 28px 56px minmax(0, 1fr) 170px 150px 80px 110px 100px; gap: 14px; align-items: center; }
.inbox__head { padding: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); }
.inbox__row { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.inbox__row:has(.js-row-check:checked) { background: var(--yellow-soft); }
.inbox__check { display: flex; justify-content: center; }
.inbox__name { min-width: 0; }
.inbox__from { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox__target, .inbox__size, .inbox__date { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox__action { display: flex; justify-content: flex-end; }
@media (max-width: 1100px) {
    .inbox__head { display: none; }
    .inbox__row { grid-template-columns: 28px 48px minmax(0, 1fr) 100px; }
    .inbox__from, .inbox__target, .inbox__size, .inbox__date { display: none; }
    .inbox .files__meta-m { display: inline; }
}

/* --- Zweispalter (Benutzer, Links, Einstellungen) ------------------------------ */
.twocol { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.twocol--links { grid-template-columns: minmax(0, 1fr) 360px; }
.twocol--settings { grid-template-columns: minmax(0, 1fr) 420px; }
.twocol__list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.twocol__detail { min-width: 0; }
@media (max-width: 1100px) { .twocol, .twocol--links, .twocol--settings { grid-template-columns: 1fr; } }

.usercard { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 2px solid var(--line); color: var(--ink); }
.usercard:hover { border-color: var(--ink); color: var(--ink); }
.usercard.is-active { border-color: var(--ink); background: var(--yellow-soft); }
.usercard.is-inactive { opacity: .6; }
.usercard__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.usercard__name { font-weight: 600; font-size: 15px; }
.usercard__meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar--coral { background: var(--coral); }

.matrix { display: flex; flex-direction: column; }
.matrix__title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.matrix__title .hint { margin: 0; }
.matrix__head, .matrix__row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 100px 100px; gap: 10px; align-items: center; }
.matrix__head { padding: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); }
.matrix__head span:not(:first-child), .matrix__cell { text-align: center; display: flex; justify-content: center; }
.matrix__row { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.matrix__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matrix__name--d2 { padding-left: 18px; } .matrix__name--d3 { padding-left: 36px; } .matrix__name--d4 { padding-left: 54px; }
.matrix__path { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
@media (max-width: 700px) { .matrix__head, .matrix__row { grid-template-columns: minmax(0, 1fr) 60px 60px 60px; } .matrix__head { font-size: 9px; } }

.linkcard { padding: 18px 20px; border-radius: var(--radius); border: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.linkcard--active { border-color: var(--ink); }
.linkcard.is-new { background: var(--yellow-soft); border-color: var(--yellow); }
.linkcard--expired, .linkcard--revoked { opacity: .6; }
.linkcard__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.linkcard__title { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.linkcard__spacer { flex: 1; }
.linkcard__expiry { font-size: 12px; font-weight: 600; color: var(--muted); }
.linkcard__meta { font-size: 13px; color: var(--muted); }
.linkcard__meta a { text-decoration: underline; }
.linkcard__url { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.linkcard__url .field__input { flex: 1; min-width: 200px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--soft); border-color: var(--soft); }

.log { list-style: none; margin: 0; padding: 8px 16px; max-height: 70vh; overflow: auto; }
.log__item { display: grid; grid-template-columns: 74px 84px auto 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12px; align-items: baseline; }
.log__time { color: var(--muted); white-space: nowrap; }
.log__who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log__action { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--soft); white-space: nowrap; }
.log__action--login_failed, .log__action--link_failed, .log__action--delete, .log__action--rmdir { background: #fdecea; color: var(--err); }
.log__action--approve, .log__action--upload { background: #e6f5ec; color: var(--ok); }
.log__target { color: var(--muted); overflow-wrap: anywhere; }

/* --- Browser: Dateiliste passt sich der verfügbaren Breite an (Container Query) --- */
.browse__main { container-type: inline-size; min-width: 0; }
.tile-wrap .tile__label { padding-right: 34px; }
.files__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 780px) {
    .files__head { display: none; }
    .files__row { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; }
    .files__size, .files__date, .files__status { display: none; }
    .files__meta-m { display: inline; }
    .fileicon, .thumb { width: 48px; height: 36px; }
    .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .tile { min-height: 92px; padding: 14px; }
    .tile__name { font-size: 17px; }
    .popover--row { grid-column: 1 / -1; }
}
@container (max-width: 520px) {
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Segmented in Formular-Rastern volle Breite */
.field .segmented { width: 100%; }
.field .segmented__opt span { padding: 9px 8px; }
