/* OPERATION X – Sound-Werkstatt. Dunkel wie ein Mischpult, eine Akzentfarbe (Bernstein), Status in eigenen Farben. */
:root {
  --bg: #0c0f12; --bg2: #12161b; --panel: #161b21; --panel2: #1c222a; --line: #262e38; --line2: #323c48;
  --text: #e6eaef; --dim: #8a96a5; --faint: #5b6673;
  --accent: #f5b83d; --accent2: #ffd27a; --accentbg: rgba(245, 184, 61, .12);
  --ok: #4fc98a; --warn: #f08a4b; --bad: #ef5d6c; --blue: #5aa9ff; --violet: #b18cff; --teal: #3ec9c9;
  --wave: #3a4757; --wave2: #f5b83d; --waveB: #5aa9ff;
  --r: 8px; --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent2); }
::selection { background: rgba(245, 184, 61, .35); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--dim); }

/* ── Layout ── */
.shell { display: grid; grid-template-rows: 56px 1fr; height: 100vh; }
.top { display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; }
.brand small { display: block; font-weight: 500; color: var(--dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.nav { display: flex; gap: 2px; margin-left: 10px; }
.nav button { background: none; border: 0; padding: 8px 12px; border-radius: 6px; color: var(--dim); cursor: pointer; font-weight: 600; }
.nav button:hover { color: var(--text); background: var(--panel); }
.nav button.on { color: var(--text); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--accent); }
.nav .badge { margin-left: 6px; }
.search { flex: 1; max-width: 520px; position: relative; }
.search input { width: 100%; padding-right: 34px !important; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 8px 34px; outline: none; }
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--faint); }
.search kbd { position: absolute; right: 8px; top: 7px; }
.spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 8px; color: var(--dim); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; vertical-align: middle; flex: none; place-items: center; font-weight: 700; font-size: 12px; color: #111; }

.main { display: grid; grid-template-columns: 260px 1fr 460px; min-height: 0; }
.main.nodetail { grid-template-columns: 260px 1fr; }
.side { border-right: 1px solid var(--line); overflow: auto; padding: 12px 8px 40px; background: var(--bg2); }
.side h4 { margin: 14px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.fitem { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; cursor: pointer; color: var(--dim); user-select: none; }
.fitem:hover { background: var(--panel); color: var(--text); }
.fitem.on { background: var(--accentbg); color: var(--accent2); }
.fitem .n { margin-left: auto; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.fitem.on .n { color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tree .fitem { padding-left: calc(10px + var(--d, 0) * 14px); }
.tree .caret { width: 12px; color: var(--faint); font-size: 10px; flex: none; text-align: center; }

/* ── Liste ── */
.listwrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.listhead { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-height: 50px; }
.listhead .title { font-weight: 700; }
.listhead .sub { color: var(--dim); font-size: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line2); background: var(--panel); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--dim); }
.chip.on { border-color: var(--accent); color: var(--accent2); background: var(--accentbg); }
.cols { display: grid; grid-template-columns: 40px minmax(180px, 1.6fr) minmax(120px, 1fr) 70px 150px 90px 92px; gap: 10px; align-items: center; padding: 0 16px; }
.colhead { height: 30px; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.colhead span { cursor: pointer; user-select: none; }
.colhead span.sorted { color: var(--accent); }
.scroller { flex: 1; overflow: auto; position: relative; }
.row { position: absolute; left: 0; right: 0; height: 44px; border-bottom: 1px solid rgba(38, 46, 56, .55); cursor: pointer; }
.row:hover { background: rgba(28, 34, 42, .7); }
.row.sel { background: var(--accentbg); box-shadow: inset 3px 0 0 var(--accent); }
.row.fresh .name::after { content: "neu"; margin-left: 8px; font-size: 10px; font-weight: 700; color: #111; background: var(--accent); border-radius: 4px; padding: 0 5px; vertical-align: 1px; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .layer { margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--faint); }
.row .path { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; }
.row .dur { color: var(--dim); font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
.row .who { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .acts { display: flex; gap: 4px; justify-content: flex-end; opacity: .55; }
.row:hover .acts, .row.sel .acts { opacity: 1; }
.empty { padding: 60px 20px; text-align: center; color: var(--dim); }

.pbtn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line2); background: var(--panel2); display: grid; place-items: center; cursor: pointer; color: var(--text); padding: 0; }
.pbtn:hover { border-color: var(--accent); color: var(--accent2); }
.pbtn.playing { background: var(--accent); color: #111; border-color: var(--accent); }
.pbtn svg { width: 12px; height: 12px; }
.ibtn { width: 28px; height: 28px; border-radius: 6px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--dim); padding: 0; text-decoration: none; }
.ibtn:hover { background: var(--panel2); color: var(--text); }
.ibtn svg { width: 16px; height: 16px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--panel2); color: var(--dim); }
.pill .dot { width: 6px; height: 6px; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #111; font-size: 11px; font-weight: 800; text-align: center; line-height: 18px; }
.vcount { font-size: 11px; color: var(--accent2); font-weight: 700; margin-left: 6px; }

/* Statusfarben */
.s-original { --sc: var(--faint); } .s-todo { --sc: var(--bad); } .s-wip { --sc: var(--warn); } .s-review { --sc: var(--blue); }
.s-approved { --sc: var(--ok); } .s-ingame { --sc: var(--teal); } .s-idea { --sc: var(--violet); }
.pill[class*="s-"] { color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, transparent); }
.dot[class*="s-"] { background: var(--sc); }

/* ── Detail ── */
.detail { border-left: 1px solid var(--line); overflow: auto; background: var(--bg2); min-width: 0; }
.dhead { padding: 16px 18px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg2); z-index: 2; }
.dhead h2 { margin: 0 0 2px; font-size: 18px; word-break: break-word; }
.dhead .id { font-family: var(--mono); font-size: 11px; color: var(--faint); word-break: break-all; cursor: copy; }
.dhead .id:hover { color: var(--dim); }
.dsec { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dsec h3 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.wavebox { position: relative; height: 120px; background: var(--panel); border-radius: var(--r); overflow: hidden; cursor: pointer; border: 1px solid var(--line); }
.wavebox canvas { width: 100%; height: 100%; display: block; }
.wavebox .ph { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.6); pointer-events: none; }
.wavebox .msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.wavebox .lab { position: absolute; left: 8px; top: 6px; font-size: 11px; font-weight: 700; color: var(--dim); background: rgba(12,15,18,.7); padding: 1px 6px; border-radius: 4px; }
.transport { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.transport .time { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-left: 4px; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; }
.seg button { background: var(--panel); border: 0; padding: 5px 9px; white-space: nowrap; cursor: pointer; color: var(--dim); font-weight: 700; font-size: 12px; }
.seg button.on { background: var(--accent); color: #111; }
.seg button:disabled { opacity: .35; cursor: default; }
.vol { width: 90px; accent-color: var(--accent); }
.meters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.meter { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 11.5px; }
.meter b { display: block; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.meter .vals { font-family: var(--mono); color: var(--dim); }
.meter .vals em { font-style: normal; color: var(--text); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; font-size: 13px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--dim); word-break: break-word; }
.kv dd code { font-family: var(--mono); font-size: 12px; }

.vlist { display: flex; flex-direction: column; gap: 6px; }
.ver { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.ver.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accentbg) inset; }
.ver.disc { opacity: .45; }
.ver .vt { font-weight: 700; font-size: 13px; }
.ver .vm { font-size: 12px; color: var(--dim); }
.ver .vc { font-size: 12px; color: var(--text); margin-top: 3px; white-space: pre-wrap; }
.ver .va { display: flex; gap: 2px; }

.drop { display: block; border: 1.5px dashed var(--line2); border-radius: 10px; padding: 16px; text-align: center; color: var(--dim); cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent2); background: var(--accentbg); }
.drop input { display: none; }
.drop .file { color: var(--text); font-weight: 600; margin-top: 6px; }
.progress { height: 4px; background: var(--panel2); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 12px; color: var(--dim); }
.in, textarea.in, select.in { background: var(--panel); border: 1px solid var(--line2); border-radius: 7px; padding: 7px 10px; outline: none; width: 100%; }
.in:focus { border-color: var(--accent); }
textarea.in { resize: vertical; min-height: 70px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 7px; padding: 7px 12px; cursor: pointer; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--dim); }
.btn.pri { background: var(--accent); color: #111; border-color: var(--accent); }
.btn.pri:hover { background: var(--accent2); }
.btn.ghost { background: none; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }
.btn:disabled { opacity: .5; cursor: default; }

.comments { display: flex; flex-direction: column; gap: 10px; }
.cmt { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.cmt .cb { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.cmt .ch { font-size: 12px; color: var(--dim); margin-bottom: 2px; }
.cmt .ch b { color: var(--text); }
.cmt .ct { white-space: pre-wrap; word-break: break-word; }

/* ── Übersicht / Aktivität ── */
.page { overflow: auto; padding: 22px 26px 60px; }
.page h1 { margin: 0 0 4px; font-size: 22px; }
.page .lead { color: var(--dim); margin-bottom: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; }
.card:hover { border-color: var(--line2); }
.card .big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.card .lbl { color: var(--dim); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--panel2); margin: 6px 0 24px; }
.bar i { display: block; height: 100%; background: var(--sc); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.box h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.feed { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
.ev:last-child { border-bottom: 0; }
.ev .et { font-size: 13px; }
.ev .et a { color: var(--text); cursor: pointer; text-decoration: none; }
.ev .et a:hover { color: var(--accent2); text-decoration: underline; }
.ev .em { font-size: 11px; color: var(--faint); white-space: nowrap; }
.ev.unseen { background: linear-gradient(90deg, var(--accentbg), transparent 60%); }
.ev .ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--panel2); color: var(--dim); }
.ev .ic svg { width: 14px; height: 14px; }
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

/* ── Modals ── */
.modal { position: fixed; inset: 0; background: rgba(5, 7, 9, .7); display: grid; place-items: center; z-index: 50; padding: 20px; }
.mbox { background: var(--bg2); border: 1px solid var(--line2); border-radius: 14px; width: min(860px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.mhead { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg2); z-index: 1; }
.mhead h2 { margin: 0; font-size: 17px; }
.mbody { padding: 18px 20px; }
.mfoot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--bg2); }
.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tpl { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; }
.tpl:hover { border-color: var(--accent); }
.tpl b { display: block; margin-bottom: 4px; }
.tpl span { color: var(--dim); font-size: 12px; }
.hint { font-size: 12px; color: var(--dim); background: var(--panel); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 0 6px 6px 0; margin-bottom: 14px; }

/* ── Login ── */
.login { display: grid; place-items: center; height: 100vh; background: radial-gradient(1200px 600px at 20% 0%, #1a2028, var(--bg)); }
.login form { width: min(380px, 92vw); background: var(--bg2); border: 1px solid var(--line2); border-radius: 14px; padding: 28px; }
.login h1 { margin: 10px 0 4px; font-size: 20px; }
.login p { color: var(--dim); margin: 0 0 18px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* ── Mini-Player unten ── */
.mini { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 20; max-width: 640px; }
.mini .mt { font-weight: 600; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .mb { width: 160px; height: 4px; background: var(--line2); border-radius: 2px; overflow: hidden; cursor: pointer; }
.mini .mb i { display: block; height: 100%; background: var(--accent); width: 0; }

.toast { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast div { background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 8px; max-width: 380px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: tin .2s ease-out; }
.toast div.bad { border-left-color: var(--bad); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--dim); background: var(--panel); }
.keys { color: var(--faint); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 1300px) { .main { grid-template-columns: 220px 1fr 400px; } .cols { grid-template-columns: 40px minmax(160px, 1.6fr) minmax(100px, 1fr) 60px 130px 0 80px; } .cols > :nth-child(6) { display: none; } }
@media (max-width: 1000px) {
  .main, .main.nodetail { grid-template-columns: 1fr; }
  .side { display: none; }
  .detail { position: fixed; inset: 56px 0 0 0; z-index: 30; }
  .cols { grid-template-columns: 40px 1fr 60px 90px; } .cols > :nth-child(3), .cols > :nth-child(5), .cols > :nth-child(6) { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .nav button span.t { display: none; }
}
