@font-face { font-family: 'Monocraft'; src: url('/fonts/monocraft-bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
h1, h2, h3, .logo, .side-brand { font-family: 'Monocraft', 'Outfit', monospace; }

:root {
  --bg: #0e0f13;
  --panel: #16181f;
  --panel2: #1d2029;
  --line: #2a2e3a;
  --text: #e9ebf2;
  --muted: #8b90a0;
  --primary: #f97316;
  --secondary: #ff4fa3;
  --danger: #ef4444;
  --ok: #22c55e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 'Outfit', system-ui, sans-serif; }
[hidden] { display: none !important; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0 0 12px; }
h2 { font-size: 1.5rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; white-space: pre-line; }
code { background: var(--panel2); padding: 1px 6px; border-radius: 5px; font-size: .9em; }

.logo {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--secondary), var(--primary));
}

.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; padding: 9px 16px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--secondary), var(--primary)); border: 0; color: #fff; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { color: var(--text); background: var(--panel2); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); border-color: transparent; }
textarea { resize: vertical; min-height: 90px; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; min-height: 360px; }
input[type="color"] { padding: 2px; height: 40px; width: 56px; cursor: pointer; }
input[type="checkbox"] { width: auto; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 20% 20%, #ff4fa333, transparent 50%), radial-gradient(circle at 80% 80%, #f9731633, transparent 50%), var(--bg); }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px; display: grid; gap: 14px; text-align: center; }
.login-card .logo { margin: 0 auto; width: 54px; height: 54px; font-size: 1.2rem; }
.login-card h1 { margin: 0; }
.login-card p { margin: 0; }

/* Layout */
.panel { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; padding: 0 6px; }
#tabs { display: grid; gap: 4px; }
#tabs button { text-align: left; font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
#tabs button:hover { color: var(--text); background: var(--panel2); }
#tabs button.active { color: var(--text); background: var(--panel2); box-shadow: inset 3px 0 0 var(--primary); }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.main { padding: 0 32px 60px; min-width: 0; }
.savebar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  padding: 14px 0; margin-bottom: 18px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.savebar #save-state { margin-right: auto; }
.savebar.dirty #save-state { color: var(--primary); font-weight: 600; }

.box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 18px; }
.box > h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.season-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.season-tabs button { display: flex; align-items: center; gap: 8px; }
.season-tabs button.active { border-color: var(--primary); }
.season-tabs .dot { width: 12px; height: 12px; border-radius: 50%; }

.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.color-field { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px 6px; }
.color-field span { font-size: .85rem; font-weight: 600; }
.color-field small { display: block; color: var(--muted); font-family: ui-monospace, monospace; font-size: .75rem; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.preset { display: flex; align-items: center; gap: 8px; }
.preset i { width: 34px; height: 14px; border-radius: 4px; display: inline-block; }
.theme-preview { border-radius: 12px; padding: 18px; margin-top: 14px; border: 1px solid var(--line); }
.theme-preview .tp-btn { display: inline-block; padding: 8px 14px; border-radius: 9px; color: #fff; font-weight: 700; margin-right: 8px; }

.list-item { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.list-item .item-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.list-item .item-head strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feature-row { display: grid; grid-template-columns: 70px 1fr 2fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.badge { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { color: var(--ok); }
.badge.err { color: var(--danger); }

.pages-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; }
.page-list button { display: block; width: 100%; text-align: left; margin-bottom: 6px; }
.page-list button.active { border-color: var(--primary); }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.preview { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 4px 18px; overflow: auto; max-height: 520px; }

.file-table { width: 100%; border-collapse: collapse; }
.file-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.file-table tr:hover td { background: var(--panel2); }
.file-table .name { cursor: default; word-break: break-all; }
.file-table .name.dir { cursor: pointer; font-weight: 600; }
.file-table .actions { text-align: right; white-space: nowrap; }
.crumbs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.crumbs button { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 2px 4px; }

.job { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--secondary), var(--primary)); transition: width .5s; }
.bar.indeterminate > div { width: 30% !important; animation: slide 1.4s infinite ease-in-out; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.callout { border-left: 3px solid var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); padding: 12px 16px; border-radius: 0 10px 10px 0; margin-bottom: 16px; }
.callout p { margin: 4px 0; }

.modal { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 680px; max-height: 85vh; overflow: auto; padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--text); color: var(--bg); font-weight: 700; padding: 10px 20px; border-radius: 10px; transition: .25s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--danger); color: #fff; }

@media (max-width: 900px) {
  .panel { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  #tabs { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .main { padding: 0 16px 40px; }
  .grid2, .grid3, .editor, .pages-layout { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 60px 1fr auto; }
  .feature-row textarea, .feature-row input:nth-child(3) { grid-column: 1 / -1; }
}

/* Downloads-Tab */
.dl-list { display: grid; gap: 10px; }
.dl-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.dl-card.open { border-color: var(--primary); }
.dl-card.hidden-card { opacity: .6; }
.dl-summary { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.dl-icon { flex: none; width: 48px; height: 48px; display: grid; place-items: center; font-size: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.dl-main { flex: 1; min-width: 0; cursor: pointer; }
.dl-desc { color: var(--muted); font-size: .92rem; margin: 2px 0 6px; }
.dl-desc.empty { font-style: italic; opacity: .6; }
.dl-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dl-path { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.dl-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.dl-form { border-top: 1px solid var(--line); padding: 16px; }
.badge.warn { color: #fbbf24; }

/* Wartung */
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.mode-card { text-align: left; font: inherit; color: var(--text); background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; display: grid; gap: 6px; }
.mode-card span { color: var(--muted); font-size: .88rem; }
.mode-card.active { border-color: var(--ok); }
.mode-card.active.banner { border-color: #fbbf24; }
.mode-card.active.full { border-color: var(--danger); }
#tabs button.maint-on::after { content: attr(data-state); margin-left: 8px; font-size: .72rem; padding: 1px 7px; border-radius: 99px; background: var(--danger); color: #fff; }

@media (max-width: 900px) {
  .dl-summary { flex-wrap: wrap; }
  .dl-actions { width: 100%; justify-content: flex-end; }
  .mode-cards { grid-template-columns: 1fr; }
}

/* Freigabe */
.release-row { display: grid; grid-template-columns: 160px minmax(260px, 1fr) minmax(280px, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.release-row:last-of-type { border-bottom: 0; }
.release-row strong { display: flex; align-items: center; gap: 8px; }
.release-row .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.release-from { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.release-from span { white-space: nowrap; }
.release-from input { flex: 1; min-width: 0; }
@media (max-width: 900px) { .release-row { grid-template-columns: 1fr; } }
