/* Klikka – Verwaltungsoberfläche (neutral, ohne Schulbezug) */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1c2430;
    --muted: #677080;
    --line: #e2e5ea;
    --accent: #2f5bd3;
    --accent-dark: #2448ad;
    --danger: #c63a32;
    --success-bg: #e7f5ec;
    --success-text: #1d6b3a;
    --error-bg: #fbeaea;
    --error-text: #9b2b25;
    --info-bg: #e9effc;
    --info-text: #284a9a;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 16px rgba(20, 30, 50, .05);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
h1 { font-size: 1.25rem; margin: 0 0 1rem; letter-spacing: -.01em; }
code { background: #eef0f3; padding: .05em .35em; border-radius: 4px; font-size: .92em; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .85rem; }

/* Kopfzeile */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .8rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.3rem; color: var(--text); text-decoration: none; letter-spacing: -.03em; }
.topnav { display: flex; gap: 1rem; align-items: center; }
.topnav form { margin: 0; }

.container { max-width: 860px; margin: 1.5rem auto; padding: 0 1rem; }

.card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.4rem 1.5rem; margin-bottom: 1.25rem;
}
.card.narrow { max-width: 420px; margin: 3rem auto; }

/* Meldungen */
.flash { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; }
.flash-success { background: var(--success-bg); color: var(--success-text); }
.flash-error   { background: var(--error-bg);   color: var(--error-text); }
.flash-info    { background: var(--info-bg);    color: var(--info-text); }

/* Formulare */
.form, .upload { display: grid; gap: .9rem; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
input[type=text], input[type=password] {
    font: inherit; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; width: 100%;
    background: #fff;
}
input[type=text]:focus, input[type=password]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font: inherit; font-weight: 600; padding: .55rem 1rem; border-radius: 8px;
    border: 1px solid var(--line); background: #fff; color: var(--text);
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button:hover { border-color: #c9ced6; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); }
.button.danger { color: var(--danger); }
.button:disabled { opacity: .6; cursor: progress; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }

/* Upload-Fläche */
.dropzone {
    position: relative; display: block; border: 2px dashed #cdd3dc; border-radius: var(--radius);
    padding: 1.6rem; text-align: center; cursor: pointer; font-weight: normal; transition: .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--info-bg); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-text { display: grid; gap: .2rem; }

/* Liste */
.plist { list-style: none; margin: 0; padding: 0; }
.pitem {
    display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between;
    padding: .9rem 0; border-top: 1px solid var(--line);
}
.pitem:first-child { border-top: 0; }
.pinfo { display: grid; gap: .15rem; min-width: 0; }
.ptitle { font-weight: 700; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.ptitle:hover { color: var(--accent); }
.pactions { display: flex; gap: .5rem; align-items: flex-start; flex-shrink: 0; }

.more { position: relative; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more-panel {
    position: absolute; right: 0; top: calc(100% + .4rem); z-index: 10; width: min(360px, 90vw);
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: .9rem; display: grid; gap: .7rem;
}
.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }
.inline input[type=text] { flex: 1; min-width: 140px; }
.inline input[type=file] { flex: 1; min-width: 0; font-size: .85rem; }
.inline form { margin: 0; }

@media (max-width: 600px) {
    .pitem { flex-direction: column; }
    .pactions { width: 100%; }
    .pactions > .button { flex: 1; }
    .more-panel { right: auto; left: 0; }
}
