/* ==========================================================================
   Dateifreigaben - Verwaltung (/dateien/) und oeffentliche Links (/share/...)
   Greift den Farbverlauf der Startseite auf, ist aber auf Listen und
   Formulare ausgelegt statt auf eine reine Knopfseite.
   ========================================================================== */

:root {
    --cyan: #00f7ff;
    --lila: #8b5cf6;
    --blau: #3b82f6;
    --text: #1f2937;
    --grau: #6b7280;
    --rand: #e5e7eb;
    --hell: #f9fafb;
    --gruen: #059669;
    --rot: #dc2626;
    --gelb: #d97706;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, var(--cyan) 0%, var(--lila) 100%) fixed;
    min-height: 100vh;
}

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

/* ------------------------------------------------------------- Kopfbereich */
.kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
    margin-bottom: 20px;
}

.kopf h1 {
    margin: 0;
    font-size: 1.8rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.kopf .unter {
    margin: 4px 0 0;
    opacity: .9;
    font-size: .95rem;
}

.kopf-links { display: flex; gap: 10px; flex-wrap: wrap; }

.kopf-links a {
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, .22);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: .9rem;
    transition: background .2s;
}

.kopf-links a:hover { background: rgba(255, 255, 255, .38); }

/* ------------------------------------------------------------------ Karten */
.karte {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .16);
}

.karte h2 {
    margin: 0 0 14px;
    font-size: 1.2rem;
    color: var(--text);
}

.karte h2 .klein {
    font-weight: normal;
    font-size: .85rem;
    color: var(--grau);
    margin-left: 8px;
}

/* --------------------------------------------------------------- Formulare */
label.feld {
    display: block;
    margin-bottom: 14px;
    font-size: .9rem;
    font-weight: bold;
}

label.feld .hinweis {
    display: block;
    font-weight: normal;
    color: var(--grau);
    font-size: .82rem;
    margin-top: 3px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid var(--rand);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--blau);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}

textarea { min-height: 70px; resize: vertical; }

label.schalter {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    font-size: .9rem;
    cursor: pointer;
}

label.schalter input { margin-top: 3px; width: auto; }

.zeile {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.zeile > * { flex: 1 1 220px; }

/* ----------------------------------------------------------------- Knoepfe */
.btn {
    display: inline-block;
    background: var(--blau);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: .98rem;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: filter .2s, transform .1s;
}

.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.98); }

.btn.grau { background: #6b7280; }
.btn.gruen { background: var(--gruen); }
.btn.rot { background: var(--rot); }
.btn.klein { padding: 6px 12px; font-size: .85rem; }

/* -------------------------------------------------------------- Link-Kasten */
.linkkasten {
    background: #ecfeff;
    border: 2px dashed var(--blau);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.linkkasten .beschriftung {
    font-size: .82rem;
    color: var(--grau);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}

.linkkasten .zeile { align-items: center; gap: 10px; }

.linkkasten input {
    font-family: Consolas, "Courier New", monospace;
    font-size: .9rem;
    margin-top: 0;
    flex: 3 1 300px;
}

.linkkasten .btn { flex: 0 0 auto; }

/* ---------------------------------------------------------------- Tabellen */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
}

th, td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--rand);
    vertical-align: middle;
}

th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--grau);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--hell); }

td.rechts, th.rechts { text-align: right; white-space: nowrap; }
td.zahl { font-variant-numeric: tabular-nums; color: var(--grau); white-space: nowrap; }

td a.datei {
    color: var(--blau);
    text-decoration: none;
    font-weight: bold;
    word-break: break-all;
}

td a.datei:hover { text-decoration: underline; }

/* --------------------------------------------------------------- Abzeichen */
.tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: bold;
    white-space: nowrap;
}

.tag.gruen { background: #d1fae5; color: #065f46; }
.tag.gelb  { background: #fef3c7; color: #92400e; }
.tag.rot   { background: #fee2e2; color: #991b1b; }
.tag.grau  { background: #f3f4f6; color: #374151; }

/* ---------------------------------------------------- Fortschritt (Upload) */
.fortschritt {
    margin-top: 16px;
    padding: 14px;
    background: var(--hell);
    border: 1px solid var(--rand);
    border-radius: 10px;
}

.fortschritt .balken {
    height: 14px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.fortschritt .fuellung {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--blau), var(--lila));
    transition: width .25s ease;
}

/* Schraffur, solange es laeuft - dann sieht man auch bei 100 % noch, dass der
   Server gerade schreibt. */
.fortschritt:not(.fertig):not(.fehlgeschlagen) .fuellung {
    background-image: linear-gradient(90deg, var(--blau), var(--lila)),
                      repeating-linear-gradient(45deg,
                          rgba(255, 255, 255, .22) 0 8px,
                          rgba(255, 255, 255, 0) 8px 16px);
    background-blend-mode: overlay;
    animation: fortschritt-laeuft 1s linear infinite;
}

@keyframes fortschritt-laeuft {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 0, 32px 0; }
}

.fortschritt.fertig .fuellung { background: var(--gruen); }
.fortschritt.fehlgeschlagen .fuellung { background: var(--rot); }

.fortschritt-zeile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.fortschritt-text {
    font-size: .88rem;
    color: var(--grau);
    font-variant-numeric: tabular-nums;
}

.fortschritt.fertig .fortschritt-text { color: #065f46; font-weight: bold; }
.fortschritt.fehlgeschlagen .fortschritt-text { color: #991b1b; font-weight: bold; }

@media (max-width: 640px) {
    .fortschritt-zeile { flex-direction: column; align-items: stretch; }
    .fortschritt-zeile .btn { width: 100%; }
}

/* --------------------------------------------------------------- Meldungen */
.meldung {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .93rem;
}

.meldung.ok    { background: #d1fae5; color: #065f46; border-left: 4px solid var(--gruen); }
.meldung.fehler{ background: #fee2e2; color: #991b1b; border-left: 4px solid var(--rot); }
.meldung.info  { background: #e0f2fe; color: #075985; border-left: 4px solid var(--blau); }

.leer {
    text-align: center;
    color: var(--grau);
    padding: 30px 10px;
    font-size: .95rem;
}

/* ------------------------------------------------------- Schmale Loginseite */
.schmal { max-width: 420px; margin: 0 auto; }

.schmal .karte { margin-top: 8vh; }

/* --------------------------------------------------------------- Trennlinie */
hr.trenn {
    border: none;
    border-top: 1px solid var(--rand);
    margin: 20px 0;
}

.fusszeile {
    text-align: center;
    color: rgba(255, 255, 255, .85);
    font-size: .82rem;
    margin-top: 8px;
}

/* ------------------------------------------------------------- Mobilgeraete */
@media (max-width: 640px) {
    .wrap { padding: 16px 10px 40px; }
    .kopf h1 { font-size: 1.4rem; }
    .karte { padding: 15px; }
    .zeile { flex-direction: column; gap: 0; }
    .linkkasten .zeile { flex-direction: column; align-items: stretch; }
    .linkkasten .btn { width: 100%; }

    /* Tabellen als Bloecke, damit nichts abgeschnitten wird */
    table.stapel thead { display: none; }
    table.stapel tr {
        display: block;
        border-bottom: 1px solid var(--rand);
        padding: 10px 0;
    }
    table.stapel td {
        display: block;
        border: none;
        padding: 3px 0;
    }
    table.stapel td.rechts { text-align: left; margin-top: 6px; }
}
