/* Ticketsystem – Jugendtreff-Farben, Aufbau wie ein Mailprogramm */
@font-face { font-family: "Bricolage"; src: url("/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
:root {
  --nacht: #0f2416; --nacht-2: #173420; --tinte: #0d1a11; --papier: #f5f6ec; --weiss: #fff; --linie: #dfe3d8; --linie-d: #0d1a11;
  --lime: #a6e22e; --lime-d: #4d7c0f; --himmel: #5ec2ff; --pink: #ff6fae; --gelb: #ffd43b; --orange: #ff9a3c; --lila: #b197fc; --grau: #5a6b5e;
  --rund: 12px; color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 "Bricolage", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tinte); background: var(--papier); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
.leise { color: var(--grau); } .klein { font-size: 13px; }
code, kbd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: #eef1e6; padding: 1px 5px; border-radius: 5px; }
:focus-visible { outline: 3px solid var(--himmel); outline-offset: 2px; }

.knopf { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--linie-d); background: var(--weiss); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.knopf:hover { background: #eef1e6; }
.knopf.primaer { background: var(--lime); } .knopf.primaer:hover { background: #b6ec4a; }
.knopf.klein { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.knopf.gefahr { background: #ffe1e1; }
.knopf:disabled { opacity: .55; cursor: wait; }
.link-knopf { background: none; border: 0; padding: 0; font-weight: 700; font-size: 13px; color: var(--grau); text-decoration: underline; cursor: pointer; }
.link-knopf.rot { color: #b42318; }
.haken { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; cursor: pointer; }
.haken input { accent-color: var(--lime-d); width: 16px; height: 16px; }
input:not([type=checkbox]):not([type=file]), select, textarea { border: 1.5px solid #c9d2c3; border-radius: 9px; padding: 7px 10px; background: var(--weiss); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lime-d); box-shadow: 0 0 0 3px rgba(166, 226, 46, .4); }
textarea { width: 100%; resize: vertical; line-height: 1.5; }

/* Farben für Kategorien */
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: #c3cbd4; }
.gelb { --f: #ffd43b; } .gruen { --f: #a6e22e; } .blau { --f: #5ec2ff; } .lila { --f: #b197fc; } .pink { --f: #ff6fae; } .orange { --f: #ff9a3c; } .grau { --f: #c3cbd4; }
.punkt.gelb, .punkt.gruen, .punkt.blau, .punkt.lila, .punkt.pink, .punkt.orange, .punkt.grau { background: var(--f); }
.chip { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--f, #e3e7de); line-height: 20px; white-space: nowrap; }

/* ---------------------------------------------------------------- Anmelden */
body.login { display: grid; place-items: center; min-height: 100%; padding: 16px; background: var(--nacht); }
.login-kasten { width: min(400px, 100%); background: var(--weiss); border-radius: 18px; padding: 30px; display: grid; gap: 14px; box-shadow: 6px 6px 0 var(--lime); }
.login-kasten img { border-radius: 14px; }
.login-kasten h1 { font-size: 30px; }
.login-kasten label { display: grid; gap: 5px; font-weight: 700; }
.login-kasten input { width: 100%; padding: 11px 13px !important; font-size: 16px; }
.login-kasten .code { font-size: 28px !important; letter-spacing: .4em; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.login-kasten button { padding: 12px; border-radius: 12px; border: 2px solid var(--linie-d); background: var(--lime); font-weight: 800; font-size: 16px; cursor: pointer; }
.fehler { background: #ffe1e1; border-radius: 10px; padding: 9px 12px; font-weight: 700; margin: 0; }

/* ---------------------------------------------------------------- Rahmen */
body.app { display: flex; flex-direction: column; overflow: hidden; }
.leiste { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--nacht); color: var(--weiss); flex: none; }
.marke { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; font-size: 18px; line-height: 1; }
.marke img { border-radius: 9px; }
.marke small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-top: 2px; }
.suche { flex: 1; max-width: 560px; margin-left: 10px; }
.suche input { width: 100%; border: 0 !important; background: rgba(255, 255, 255, .12) !important; color: var(--weiss); padding: 9px 14px !important; border-radius: 10px !important; }
.suche input::placeholder { color: rgba(255, 255, 255, .6); }
.suche input:focus { background: var(--weiss) !important; color: var(--tinte); }
.leiste .knopf.primaer { border-color: var(--lime); }
.postfach { width: 12px; height: 12px; border-radius: 50%; background: #9aa59d; flex: none; margin-left: auto; }
.postfach.ok { background: #4ade80; } .postfach.fehler { background: #f87171; } .postfach.aus { background: #fbbf24; }
.wer { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; font-size: 14px; }
.wer .knopf { background: transparent; color: var(--weiss); border-color: rgba(255, 255, 255, .45); }
.rahmen { flex: 1; display: grid; grid-template-columns: 230px minmax(320px, 400px) 1fr; min-height: 0; }

/* Ordner */
.ordner { background: var(--nacht-2); color: var(--weiss); padding: 12px 10px; overflow-y: auto; display: flex; flex-direction: column; }
.ordner ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ordner a { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: 14.5px; }
.ordner a:hover { background: rgba(255, 255, 255, .08); }
.ordner a.aktiv { background: var(--lime); color: var(--tinte); }
.ordner a b { margin-left: auto; font-size: 12.5px; opacity: .8; }
.ordner a b.neu { background: var(--pink); color: var(--tinte); opacity: 1; padding: 0 7px; border-radius: 999px; }
.ordner h2 { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .6; margin: 20px 11px 6px; }
.einst-link { margin-top: auto; }

/* Liste */
.liste { background: var(--weiss); border-right: 1px solid var(--linie); display: flex; flex-direction: column; min-height: 0; }
.liste-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--linie); }
.liste-kopf h1 { font-size: 20px; }
.tickets { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.ticket-zeile { display: flex; gap: 11px; padding: 11px 14px 11px 12px; border-bottom: 1px solid #eef0ea; text-decoration: none; border-left: 4px solid transparent; }
.ticket-zeile:hover { background: #f7f8f3; }
.ticket-zeile.aktiv { background: #eef7dc; border-left-color: var(--lime-d); }
.ticket-zeile.ungelesen { border-left-color: var(--pink); }
.ticket-zeile.ungelesen .wer, .ticket-zeile.ungelesen .betreff { font-weight: 800; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; color: var(--tinte); }
.avatar.klein { width: 32px; height: 32px; font-size: 12px; }
.zeile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.zeile-oben { display: flex; justify-content: space-between; gap: 8px; }
.zeile-oben .wer { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile-oben time { font-size: 12px; color: var(--grau); flex: none; }
.betreff { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; }
.vorschau { font-size: 13px; color: var(--grau); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.zeile-unten { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; margin-top: 3px; }
.nr { color: var(--grau); }
.zu { color: var(--grau); }
.status { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 0 7px; border-radius: 6px; line-height: 19px; background: #e3e7de; }
.status.neu { background: var(--pink); } .status.offen { background: var(--himmel); } .status.wartet { background: var(--gelb); } .status.erledigt { background: var(--lime); }
.leer-liste { padding: 40px 20px; text-align: center; color: var(--grau); }

/* Lesefenster */
.lesen { overflow-y: auto; min-height: 0; padding: 0 0 30px; }
.leer-lesen { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--grau); text-align: center; padding: 20px; }
.leer-lesen img { opacity: .5; border-radius: 16px; }
.lesen-kopf { display: flex; gap: 10px; align-items: flex-start; padding: 18px 22px 8px; }
.lesen-kopf h2 { font-size: 22px; cursor: text; }
.lesen-kopf .titel { display: grid; gap: 4px; min-width: 0; }
.lesen-kopf .titel .leise { font-size: 13px; }
.werkzeug { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 8px 22px 10px; border-bottom: 1px solid var(--linie); position: sticky; top: 0; background: var(--papier); z-index: 2; }
.werkzeug label { display: grid; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--grau); text-transform: uppercase; letter-spacing: .05em; }
.werkzeug select { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--tinte); padding: 5px 8px; }
.werkzeug-rechts { margin-left: auto; display: flex; gap: 6px; }
.kat-menue { position: relative; }
.kat-menue summary { list-style: none; cursor: pointer; padding: 6px 10px; border: 1.5px solid #c9d2c3; border-radius: 9px; background: var(--weiss); font-size: 14px; font-weight: 600; }
.kat-menue summary::-webkit-details-marker { display: none; }
.kat-menue > div { position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; background: var(--weiss); border: 1px solid var(--linie); border-radius: 12px; padding: 10px; display: grid; gap: 8px; min-width: 200px; box-shadow: 0 10px 30px rgba(13, 26, 17, .15); }
.kat-zeile { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 22px 0; }
.kat-zeile:empty { display: none; }

.verlauf { list-style: none; margin: 0; padding: 14px 22px; display: grid; gap: 12px; }
.nachricht { background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; }
.nachricht.aus { background: #f3f9e6; border-color: #cfe5a4; margin-left: 40px; }
.nachricht.notiz { background: #fff8d6; border-color: #f0dc7a; border-style: dashed; }
.n-kopf { display: flex; gap: 10px; align-items: flex-start; }
.n-wer { display: flex; flex-direction: column; min-width: 0; flex: 1; font-weight: 700; }
.n-wer .leise { font-weight: 500; }
.n-wer small { font-weight: 500; font-size: 12px; overflow-wrap: anywhere; }
.n-kopf time { font-size: 12px; color: var(--grau); flex: none; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.zitat summary { cursor: pointer; font-size: 13px; color: var(--grau); font-weight: 700; }
.zitat .text { color: var(--grau); border-left: 3px solid var(--linie); padding-left: 10px; margin-top: 6px; font-size: 13.5px; }
.ereignis { text-align: center; font-size: 12px; color: var(--grau); }
.ereignis span { background: #eceee6; padding: 2px 10px; border-radius: 999px; }
.anhaenge { display: flex; flex-wrap: wrap; gap: 8px; }
.anhaenge:empty { display: none; }
.anhang { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px; border: 1px solid var(--linie); background: #fafbf7; text-decoration: none; font-size: 13px; font-weight: 600; }
.anhang small { color: var(--grau); font-weight: 500; }
.anhang button { border: 0; background: none; cursor: pointer; color: var(--grau); padding: 0 2px; }

/* Antworten */
.antwort { margin: 6px 22px 0; background: var(--weiss); border: 1.5px solid var(--linie-d); border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; box-shadow: 4px 4px 0 var(--lime); }
.antwort[data-modus=notiz] { background: #fffcea; box-shadow: 4px 4px 0 var(--gelb); }
.antwort[data-modus=notiz] .nur-antwort, .antwort[data-modus=antwort] .nur-notiz { display: none !important; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--grau); }
.tabs button.aktiv { background: var(--nacht); color: var(--weiss); }
.an-zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.an-zeile label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--grau); }
.an-zeile input { flex: 1; min-width: 0; }
.baustein-zeile { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.antwort textarea { min-height: 140px; border-color: var(--linie); }
.antwort-fuss { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.antwort-fuss .leer { flex: 1; }
.antwort-fuss > span:not(.leer) { display: flex; gap: 8px; }
.antwort-fuss label.knopf { cursor: pointer; }

/* Einstellungen */
.einst { display: grid; gap: 4px; padding-bottom: 20px; }
.einst section { padding: 12px 22px; display: grid; gap: 10px; }
.einst h3 { font-size: 17px; }
.edit-zeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.edit-zeile input { flex: 1; min-width: 140px; }
.edit-block { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--linie); border-radius: 12px; background: var(--weiss); }
.edit-block .link-knopf { justify-self: start; }
.einst-fuss { padding: 6px 22px; }

/* Fenster */
.fenster { border: 0; border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.fenster.gross { width: min(1000px, calc(100vw - 24px)); }
.fenster::backdrop { background: rgba(13, 26, 17, .5); }
.fenster form.neu-form { display: grid; gap: 12px; padding: 18px 20px; }
.fenster label { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.fenster-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fenster.gross .fenster-kopf, .fenster.gross > p { padding: 14px 18px 0; margin: 0; }
.x { border: 0; background: #eef1e6; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 15px; }
.fenster-fuss { display: flex; justify-content: flex-end; gap: 8px; }
.kat-wahl { display: flex; flex-wrap: wrap; gap: 12px; }
.fenster iframe { width: 100%; height: min(70vh, 800px); border: 0; border-top: 1px solid var(--linie); margin-top: 10px; background: var(--weiss); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--nacht); color: var(--weiss); padding: 10px 18px; border-radius: 12px; font-weight: 700; z-index: 100; transition: opacity .5s; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); }
.toast.fehler { background: #b42318; }
.toast.weg { opacity: 0; }

.nur-handy { display: none; }
@media (max-width: 1100px) { .rahmen { grid-template-columns: 200px minmax(280px, 340px) 1fr; } .nur-breit { display: none; } }
@media (max-width: 820px) {
  .nur-handy { display: inline-grid; place-items: center; }
  .menue-knopf, .zurueck { border: 0; background: rgba(255, 255, 255, .12); color: inherit; width: 38px; height: 38px; border-radius: 10px; font-size: 18px; cursor: pointer; flex: none; }
  .zurueck { background: #e3e7de; }
  .leiste { flex-wrap: wrap; gap: 8px; }
  .marke span { display: none; }
  .suche { order: 5; flex: 1 0 100%; margin: 0; max-width: none; }
  .wer > span { display: none; }
  .rahmen { grid-template-columns: 1fr; }
  .ordner, .liste, .lesen { display: none; }
  body[data-ansicht=ordner] .ordner, body[data-ansicht=liste] .liste, body[data-ansicht=lesen] .lesen { display: flex; }
  body[data-ansicht=lesen] .lesen { display: block; }
  .lesen-kopf, .werkzeug, .verlauf { padding-left: 14px; padding-right: 14px; }
  .antwort { margin: 6px 10px 0; }
  .werkzeug-rechts { margin-left: 0; }
  .werkzeug { position: static; }
  .nachricht.aus { margin-left: 14px; }
  .an-zeile { grid-template-columns: 1fr; }
}
.avatar.f0 { background: #a6e22e; } .avatar.f1 { background: #5ec2ff; } .avatar.f2 { background: #ffd43b; } .avatar.f3 { background: #ff6fae; } .avatar.f4 { background: #b197fc; } .avatar.f5 { background: #ff9a3c; }
.avatar.wir { background: var(--nacht); color: var(--lime); }
.band { background: #fde68a; color: var(--tinte); font-weight: 700; font-size: 14px; padding: 7px 16px; text-align: center; flex: none; }
.code-feld { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px !important; line-height: 1.45; }
.zeile-knoepfe { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sig-vorschau { width: 100%; height: 230px; border: 1px solid var(--linie); border-radius: 12px; background: var(--weiss); }
