/* CCU Planner: Design von Crew Alert. Hell: „Gerät“, Dunkel: Aegis. */

:root {
    --casing: #c9d1d6;
    --plate: #e4e9ec;
    --plate-edge: #ffffff;
    --plate-shadow: 0 1px 0 #00000022, 0 6px 14px -10px #1d232766;
    --ink: #1d2327;
    --mist: #5d6a72;
    --glass: #0f2a33;
    --glass-edge: #ffffff14;
    --readout: #bff3ff;
    --readlabel: #7fb3c2;
    --signal: #ff8a3d;
    --signal-hover: #ff9a57;
    --signal-ink: #1d1208;
    --nav-on: #1d2327;
    --nav-on-ink: #e4e9ec;
    --highlight: #1d2327;
    --rule: #0000001a;
    --field: #f4f7f8;
    --field-line: #9aa7af;
    --disabled: #b6bfc5;
    --disabled-ink: #5d6a72;
    --ok: #1f8a4c;
    --busy: #a8690f;
    --bad: #c2412d;
    --chart: #d4572a;
    --planned: #f0b840;
    --owned: #1f8a4c;
    --r: 4px;

    --display: "Big Shoulders Text", "Bahnschrift", "Segoe UI", sans-serif;
    --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

    color-scheme: light;
}

:root[data-theme="dark"] {
    --casing: #1d242b;
    --plate: #262f38;
    --plate-edge: #ffffff0f;
    --plate-shadow: inset 0 0 0 1px #ffffff0f;
    --ink: #e3e8ec;
    --mist: #8796a3;
    --glass: #0d1216;
    --glass-edge: #ffffff12;
    --readout: #f2f5f7;
    --readlabel: #7d8e9b;
    --signal: #d23c32;
    --signal-hover: #e0483d;
    --signal-ink: #ffffff;
    --nav-on: #e3e8ec;
    --nav-on-ink: #1d242b;
    --highlight: #e3e8ec;
    --rule: #ffffff12;
    --field: #1a2128;
    --field-line: #3b4855;
    --disabled: #323d48;
    --disabled-ink: #8796a3;
    --ok: #4cc38a;
    --busy: #e0b341;
    --bad: #f0a33c;
    --chart: #e0683b;
    --planned: #e0b341;
    --owned: #4cc38a;
    --r: 2px;

    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    min-height: 100vh;
    background: var(--casing);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.5;
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--mist); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--ink); }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px 32px; }
.wrap.wide { max-width: none; }

.head { padding: 20px 0 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.title { font-size: 38px; margin: 0; letter-spacing: 0.01em; }
.title a { text-decoration: none; }
.subtitle { color: var(--mist); font-size: 15px; margin: 2px 0 0; }
.who { color: var(--mist); font-size: 15px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.who strong { color: var(--ink); font-weight: 600; }

/* Twitch-Knopf: Farbe von Twitch, nicht die Signalfarbe, er führt aus der Seite heraus */
.twitch {
    display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: calc(var(--r) - 1px);
    background: #9146ff; color: #fff; font-weight: 600; font-size: 15px; text-decoration: none;
}
.twitch:hover { background: #a970ff; }
.twitch:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }

.theme-toggle {
    position: relative; display: inline-flex; align-items: center; justify-content: space-between;
    width: 64px; height: 30px; padding: 0 8px; border-radius: 15px; cursor: pointer;
    background: var(--glass); border: 0; box-shadow: inset 0 0 0 1px var(--glass-edge), inset 0 3px 8px #00000066;
    color: var(--readlabel); font-size: 14px;
}
.theme-toggle .knob {
    position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--plate); box-shadow: 0 1px 2px #00000066; transition: transform 0.2s ease;
}
:root[data-theme="dark"] .theme-toggle .knob { transform: translateX(34px); }
.theme-toggle:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }

nav.tabs {
    display: flex; flex-wrap: wrap; gap: 2px; width: max-content; max-width: 100%;
    margin-bottom: 16px; padding: 3px; background: var(--plate); border-radius: var(--r);
    box-shadow: var(--plate-shadow);
}
nav.tabs a { padding: 6px 13px; border-radius: calc(var(--r) - 1px); color: var(--mist); text-decoration: none; font-weight: 500; }
nav.tabs a:hover { color: var(--ink); }
nav.tabs a.active { background: var(--nav-on); color: var(--nav-on-ink); }

.card {
    position: relative; padding: 18px 20px; margin-bottom: 14px;
    background: var(--plate); border-radius: var(--r);
    box-shadow: inset 0 1px 0 var(--plate-edge), var(--plate-shadow);
}
.card h2 { font-size: 26px; margin: 0 0 6px; }
.muted { color: var(--mist); }

:root[data-theme="dark"] .card { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }

.screen {
    margin-top: 12px; padding: 12px 14px; border-radius: calc(var(--r) - 1px);
    background: var(--glass); color: var(--readout);
    box-shadow: inset 0 0 0 1px var(--glass-edge), inset 0 10px 30px #00000066;
}
.screen.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 16px; }
.screen .k { font-size: 12px; color: var(--readlabel); }
.screen .v { font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.1; color: var(--readout); overflow-wrap: anywhere; }

/* Knöpfe: einzige Stelle mit der Signalfarbe */
.btn { background: var(--signal); color: var(--signal-ink); }
.btn {
    display: inline-block; font-family: var(--body); font-size: 15px; font-weight: 600;
    padding: 9px 16px; border: 0; border-radius: calc(var(--r) - 1px);
    cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--signal-hover); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--field-line); }
.btn.secondary:hover { background: var(--rule); }
.btn.small { font-size: 13px; padding: 4px 10px; }
.btn:disabled, .btn.secondary:disabled { background: var(--disabled); color: var(--disabled-ink); box-shadow: none; cursor: not-allowed; }

form.inline { display: inline; }

input[type=number], input[type=text], input[type=search], select {
    font-family: var(--body); font-size: 15px; padding: 8px 10px; max-width: 100%;
    background: var(--field); color: var(--ink); border: 1px solid var(--field-line); border-radius: calc(var(--r) - 1px);
}
input[type=file] { font-family: var(--body); font-size: 15px; max-width: 100%; }
input:focus, select:focus { outline: 2px solid var(--highlight); outline-offset: 1px; }
label { font-size: 14px; color: var(--mist); }
code { font-size: 0.92em; background: var(--rule); padding: 1px 5px; border-radius: 3px; }

.flash {
    background: var(--plate); border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px;
    box-shadow: inset 4px 0 0 var(--busy), var(--plate-shadow);
}
.flash.ok { box-shadow: inset 4px 0 0 var(--ok), var(--plate-shadow); }

.foot {
    margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--rule);
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    color: var(--mist); font-size: 13px;
}
