:root {
    --bg:        #eef1f5;
    --card:      #ffffff;
    --ink:       #1c2430;
    --muted:     #6b7585;
    --line:      #dce1e9;
    --accent:    #1f4e79;   /* ruhiges, vertrauenswürdiges Blau */
    --accent-2:  #2c6aa0;
    --danger:    #b3261e;
    --ok:        #1f7a3d;
    --ok-bg:     #e6f4ea;
    --err:       #fde8e6;
    --radius:    10px;
    --shadow:    0 1px 3px rgba(20,30,45,.08), 0 6px 24px rgba(20,30,45,.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

/* ---------- Kopfzeile ---------- */
.topbar {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    padding: 0 20px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(20,30,45,.18);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; }
.brand .lock { font-size: 1.15rem; }
.topnav { display: flex; align-items: center; gap: 18px; font-size: .92rem; }
.topnav a { color: #e8eef6; text-decoration: none; }
.topnav a:hover { color: #fff; text-decoration: underline; }
.topnav .logout { color: #ffd9d4; }
.who { display: flex; flex-direction: column; line-height: 1.1; opacity: .95; }
.who small { font-size: .72rem; opacity: .8; }

/* ---------- Layout ---------- */
.container {
    max-width: 760px;
    margin: 28px auto;
    padding: 0 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }

h1 { font-size: 1.4rem; margin: 0 0 14px; }
h2 { font-size: 1.1rem; margin: 0 0 14px; }

.muted { color: var(--muted); font-size: .9rem; }

/* ---------- Formulare ---------- */
label { display: block; margin-bottom: 14px; font-size: .9rem; font-weight: 500; }
input[type=text], input[type=password], input[type=file], select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    color: var(--ink);
    font-weight: 400;
}
input:focus, select:focus, button:focus {
    outline: 3px solid rgba(44,106,160,.35);
    outline-offset: 1px;
    border-color: var(--accent-2);
}
.grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 18px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--accent-2); }
.btn.small { padding: 7px 12px; font-size: .85rem; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #8f1d17; }
.inline { display: inline; margin: 0; }

/* ---------- Dateibox ---------- */
.file-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f9fc;
}
.file-icon { font-size: 2rem; }
.file-name { font-weight: 600; word-break: break-all; }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }

/* ---------- Meldungen ---------- */
.error, .notice {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: .92rem;
    margin: 0 0 14px;
}
.error { background: var(--err); color: var(--danger); border: 1px solid #f3b9b3; }
.notice { background: var(--ok-bg); color: var(--ok); border: 1px solid #b7dcc2; }
.error.standalone, .notice { margin-bottom: 20px; }

/* ---------- Tabelle ---------- */
table.users { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.users th, table.users td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
table.users th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.tag { background: var(--accent); color: #fff; font-size: .68rem; padding: 1px 7px; border-radius: 20px; vertical-align: middle; }
.row-actions { display: flex; flex-direction: column; gap: 8px; }
.row-actions details summary { cursor: pointer; color: var(--accent-2); font-size: .85rem; }
.pw-form { display: flex; gap: 6px; margin-top: 8px; }
.pw-form input { margin-top: 0; }

/* ---------- Fortschrittsbalken ---------- */
.progress-wrap { margin: 4px 0 16px; }
.progress-track {
    width: 100%;
    height: 14px;
    background: #e6eaf1;
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 20px;
    transition: width .15s ease;
}
.progress-fill.processing {
    background: repeating-linear-gradient(
        45deg, var(--accent-2), var(--accent-2) 10px,
        var(--accent) 10px, var(--accent) 20px);
    background-size: 28px 28px;
    animation: stripes 1s linear infinite;
}
@keyframes stripes { to { background-position: 28px 0; } }
.progress-label { margin-top: 6px; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
    .progress-fill { transition: none; }
    .progress-fill.processing { animation: none; }
}

/* ---------- Fußzeile ---------- */
.foot { text-align: center; padding: 18px; font-size: .82rem; }
.foot .secure { color: var(--ok); }
.foot .insecure { color: var(--danger); font-weight: 600; }

/* ---------- Mobil ---------- */
@media (max-width: 560px) {
    .grid { grid-template-columns: 1fr; }
    .topnav { gap: 12px; font-size: .85rem; }
    .who { display: none; }
    table.users th:nth-child(3), table.users td:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
