/* PrintNerds Inventar – Farben wie im Shop (Lila #7217E8, Neongrün #96FA00, Dunkel #0D0B1A) */
:root {
    --bg: #0d0b1a;
    --surface: #161229;
    --surface-2: #1f1938;
    --border: #2d2550;
    --text: #ece9f7;
    --muted: #9c95b8;
    --primary: #7217e8;
    --primary-2: #8f45ff;
    --accent: #96fa00;
    --danger: #ff5c7a;
    --warn: #ffb547;
    --radius: 12px;
    color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(ellipse at 80% -10%, rgba(114, 23, 232, .25), transparent 50%), var(--bg);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
h2 .small { margin-left: auto; font-weight: 400; }
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }

/* Kopfzeile */
.top {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    padding: 10px 16px;
    background: rgba(13, 11, 26, .92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}
.brand { color: var(--text); font-weight: 600; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand b { color: var(--accent); }
.brand small { color: var(--muted); font-weight: 400; }
.brand.big { font-size: 1.6rem; justify-content: center; margin-bottom: 20px; }
.cube { width: 18px; height: 18px; background: linear-gradient(135deg, var(--primary-2), var(--primary)); border-radius: 4px; transform: rotate(45deg) scale(.85); box-shadow: 0 0 12px rgba(114, 23, 232, .7); }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.top nav a { color: var(--muted); padding: 6px 12px; border-radius: 999px; }
.top nav a.on, .top nav a:hover { color: var(--text); background: var(--surface-2); }
.me { display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.me form { margin: 0; }

/* Karten & Layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card.narrow { max-width: 640px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.cards .card { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.head h1, .head h2 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); display: flex; flex-direction: column; }
.stat b { font-size: 1.7rem; color: var(--accent); }
.stat span { color: var(--muted); font-size: .9rem; }
.stat.warn b { color: var(--warn); }
.stat:hover { border-color: var(--primary); color: var(--text); }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); color: var(--text); margin: 0; }
.row:last-child { border-bottom: 0; }
.row small { color: var(--muted); }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }
tbody tr:hover { background: rgba(114, 23, 232, .07); }
tr.inactive td { opacity: .55; }
.num { text-align: right; white-space: nowrap; }
.neg { color: var(--danger); }
.pos { color: var(--accent); }
.ok { color: var(--accent); font-weight: 700; }
.bar { height: 4px; background: var(--surface-2); border-radius: 2px; margin-top: 4px; min-width: 70px; }
.bar span { display: block; height: 100%; background: var(--primary-2); border-radius: 2px; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 1px solid rgba(255, 255, 255, .35); margin-right: 8px; vertical-align: -2px; }
.tag { font-size: .72rem; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tag.off { color: var(--warn); }

/* Formulare */
label { display: block; margin-bottom: 12px; color: var(--muted); font-size: .88rem; }
label input, label select, label textarea { margin-top: 4px; }
input, select, textarea {
    width: 100%; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
input[type=color] { padding: 2px; height: 42px; cursor: pointer; }
input[type=checkbox] { width: auto; accent-color: var(--primary); margin-right: 6px; }
label.check { display: flex; align-items: center; color: var(--text); padding-top: 22px; }
.cols, .cols4 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cols4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
form.inline { display: flex; gap: 6px; align-items: center; margin: 0; }
.w4 { width: 72px; } .w6 { width: 100px; }
.stack .actions { margin-top: 4px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 14px; white-space: nowrap;
}
.btn:hover { border-color: var(--primary-2); color: var(--text); }
.btn.primary { background: var(--primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(255, 92, 122, .4); margin-left: auto; }
.btn.sm { padding: 6px 10px; font-size: .85rem; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
button.link:hover { color: var(--accent); }

.status { width: auto; padding: 5px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.s-bereit { color: var(--accent); }
.s-druckt { color: var(--primary-2); }
.s-wartung { color: var(--warn); }
.s-defekt, .s-außer-Betrieb { color: var(--danger); }
.printer-card select { margin: 6px 0; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; background: rgba(150, 250, 0, .1); border: 1px solid rgba(150, 250, 0, .35); color: var(--text); }
.flash.error { background: rgba(255, 92, 122, .1); border-color: rgba(255, 92, 122, .4); }
.log { list-style: none; padding: 0; margin: 14px 0 0; }
.log li { padding: 8px 0; border-top: 1px solid var(--border); }

/* Login */
body.bare main { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: 100%; max-width: 380px; }

@media (max-width: 640px) {
    h1 { font-size: 1.35rem; }
    .cols { grid-template-columns: 1fr; }
    label.check { padding-top: 0; }
    .top { gap: 8px; }
    .top nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
    th, td { padding: 8px 6px; }
}

/* Kalkulator */
.calc tr.sum td { font-weight: 700; border-top: 2px solid var(--border); }
.calc tr.accent td { color: var(--accent); font-size: 1.1rem; }

/* Einstellungen */
#benutzer h2:not(:first-child) { margin-top: 26px; }
