/* IBM Plex Sans – lokal eingebunden (SIL Open Font License) */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-700.woff2") format("woff2"); }

/* Farben im Stil von scooter-center.com */
:root {
  --bg: #f8f8f8;
  --card: #fff;
  --text: #1d1d1b;
  --muted: #6f6f6f;
  --border: #e3e3e3;
  --primary: #d5161b;
  --primary-dark: #b01116;
  --dark: #363636;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 "IBM Plex Sans", Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.85rem; line-height: 1.15; margin: 0 0 .5rem; color: var(--primary); text-transform: uppercase; font-weight: 700; letter-spacing: .01em; }
h3 { font-size: .95rem; margin: 0 0 .9rem; text-transform: uppercase; font-weight: 700; letter-spacing: .02em; }
.kicker { text-transform: uppercase; color: var(--muted); font-size: .9rem; font-weight: 500; letter-spacing: .03em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 28px; padding-bottom: 28px; min-height: 70vh; }

/* Servicezeile, Header, Navigation */
.servicebar { background: #fff; border-bottom: 1px solid var(--border); font-size: .82rem; color: #555; padding: 6px 0; }
.site-header { background: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 40px; width: auto; }
.brand-sub { border-left: 2px solid var(--border); padding-left: 14px; color: var(--dark); font-weight: 700; text-transform: uppercase; font-size: 1rem; letter-spacing: .03em; }
.header-right { display: flex; align-items: center; gap: 14px; font-size: .9rem; }
.header-user { color: var(--muted); }
.header-user strong { color: var(--text); font-weight: 600; }
.header-link { color: var(--text); font-weight: 500; }
.mainnav { background: var(--dark); }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.mainnav li { border-right: 1px solid #4a4a4a; }
.mainnav li:first-child { border-left: 1px solid #4a4a4a; }
.mainnav a { display: block; color: #f8f8f8; padding: 0 24px; line-height: 58px; font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.mainnav a:hover { background: #2b2b2b; text-decoration: none; }
.mainnav li.active a { background: var(--primary); }
.footer { color: var(--muted); font-size: .85rem; padding: 24px 20px; text-align: center; border-top: 1px solid var(--border); }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.narrow { max-width: 440px; margin: 40px auto; border-top: 4px solid var(--primary); }
.card.center, .center { text-align: center; }
.table-card { padding: 0; overflow-x: auto; }
.pad { padding: 20px 20px 12px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.hero { margin-bottom: 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.text-danger { color: #c62828; font-weight: 600; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.big-check { width: 64px; height: 64px; line-height: 64px; margin: 10px auto; border-radius: 50%; background: #e7f6ec; color: #1e8e3e; font-size: 2rem; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
ul.plain li { padding: 3px 0; }
.legend { list-style: none; padding: 0; margin: 0 0 16px; }
.legend li { padding: 5px 0; font-size: .9rem; display: flex; gap: 8px; align-items: baseline; }
.legend .badge { min-width: 70px; text-align: center; }

/* Forms */
.form label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 14px; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=date],
.form select, .form textarea, .filters input, .filters select, .row-inline select {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #cfcfcf; border-radius: var(--radius);
  font: inherit; background: #fff; color: var(--text);
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .filters select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(213, 22, 27, .12);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-inline select { width: auto; margin: 0; }
.row-inline .check { margin: 0; flex: 1; }
.check { font-weight: 400 !important; display: flex !important; gap: 6px; align-items: center; }
.radio-group { display: flex; gap: 8px; flex-wrap: wrap; margin: -8px 0 14px; }
.radio { display: flex !important; align-items: center; gap: 6px; margin: 0 !important; padding: 7px 12px; border: 1px solid #cfcfcf; border-radius: var(--radius); cursor: pointer; font-weight: 400 !important; }
.radio:has(input:checked) { border-color: var(--primary); background: #fff5f5; }
.hp { position: absolute; left: -9999px; }

/* Buttons */
.btn { display: inline-block; background: var(--primary); color: #fff; border: 1px solid var(--primary); border-radius: var(--radius); padding: 9px 18px; font: inherit; font-size: .95rem; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; cursor: pointer; text-align: center; }
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; }
.btn-outline { background: #fff; color: var(--text); border-color: #cfcfcf; }
.btn-outline:hover { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-block { display: block; width: 100%; margin-bottom: 10px; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid #cfcfcf; text-transform: none; }
.btn-ghost:hover { background: #f0f0f0; border-color: #bdbdbd; }
.btn-danger { background: transparent; color: #c62828; border: 1px solid #f0c4c4; }
.btn-danger:hover { background: #fdecec; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: #e7f6ec; border-color: #b7e1c4; color: #1b5e20; }
.alert-error { background: #fdecec; border-color: #f4c2c2; color: #8e1b1b; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.st-neu { background: #e3f0ff; color: #0b57d0; }
.st-in_bearbeitung { background: #fff3d6; color: #8a5a00; }
.st-wartet { background: #f1e7ff; color: #6b2fbf; }
.st-erledigt { background: #e3f5e8; color: #1e7b34; }
.st-geschlossen { background: #eceff3; color: #5c6473; }
.pr-niedrig { background: #eceff3; color: #5c6473; }
.pr-normal { background: #e3f0ff; color: #0b57d0; }
.pr-hoch { background: #ffe9d6; color: #b45309; }
.pr-kritisch { background: #fde1e1; color: #b71c1c; }
.radio.pr-niedrig, .radio.pr-normal, .radio.pr-hoch, .radio.pr-kritisch { background: #fff; color: var(--text); }
.badge-internal { background: #fff3c4; color: #7a5b00; margin-left: 6px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); font-size: .85rem; box-shadow: var(--shadow); }
.stat { text-transform: uppercase; font-weight: 500; letter-spacing: .02em; }
.stat span { display: block; font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat:hover { text-decoration: none; border-color: var(--primary); }
.stat-accent span { color: var(--primary); }

/* Filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px; }
.filters input, .filters select { width: auto; margin: 0; }
.filters input[type=search] { flex: 1; min-width: 220px; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #f8f8f8; padding: 12px 14px; background: var(--dark); font-weight: 700; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fafafa; }

/* Ticket detail */
.ticket-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.badges { display: flex; gap: 6px; flex-shrink: 0; }
.msg { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.msg-meta { font-size: .8rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.msg-body { white-space: normal; word-wrap: break-word; }
.msg-user { background: #fafafa; }
.msg-it { background: #f0f6ff; border-color: #cfe0fb; margin-left: 30px; }
.msg-internal { background: #fffbea; border-color: #f3e2a2; border-style: dashed; margin-left: 30px; }
.reply { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
dl.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: .9rem; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; word-break: break-word; }

/* Tasks */
.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar h1 { margin: 0; margin-right: auto; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: #fff; }
.seg a { padding: 6px 14px; color: var(--text); }
.seg a.active { background: var(--primary); color: #fff; }
.seg a:hover { text-decoration: none; }
.tasklist { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.task:last-child { border-bottom: 0; }
.task form { margin: 0; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; }
.task-desc { font-size: .9rem; color: #444b5a; margin: 2px 0; }
.task-actions { display: flex; gap: 4px; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task.overdue { background: linear-gradient(90deg, #fff5f5, transparent 60%); }
.checkbox { width: 24px; height: 24px; border: 2px solid #b8c0cf; border-radius: 6px; background: #fff; cursor: pointer; color: #fff; font-weight: 700; padding: 0; line-height: 1; margin-top: 1px; }
.checkbox:hover { border-color: var(--primary); }
.task.done .checkbox { background: #1e8e3e; border-color: #1e8e3e; }
.tasklist-mini li.done { color: var(--muted); text-decoration: line-through; }

@media (max-width: 860px) {
  .servicebar, .header-user, .brand-sub { display: none; }
  .mainnav a { padding: 0 14px; line-height: 48px; }
  .grid-2-1, .row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .msg-it, .msg-internal { margin-left: 0; }
  .ticket-head { flex-direction: column; }
}

/* Ticket-Titel nicht in Großbuchstaben */
.ticket-head h1 { color: var(--text); text-transform: none; font-size: 1.5rem; letter-spacing: 0; }
.radio:has(input:checked) { border-color: var(--primary); background: #fdf1f1; }
.stat:hover { border-color: var(--primary); }
.filters .btn, .row-inline .btn { white-space: nowrap; }

/* Rollen */
.role-user { background: #eceff3; color: #4a4a4a; }
.role-it { background: var(--primary); color: #fff; }
.header-user .badge { margin-left: 6px; vertical-align: 1px; }
form.inline { display: inline; }
.role-choice { display: grid; gap: 8px; margin: -8px 0 16px; }
.radio-card { display: flex !important; gap: 10px; align-items: flex-start; margin: 0 !important; padding: 10px 12px; border: 1px solid #cfcfcf; border-radius: var(--radius); cursor: pointer; font-weight: 400 !important; }
.radio-card input { margin-top: 4px; }
.radio-card small { display: block; color: var(--muted); font-size: .82rem; }
.radio-card:has(input:checked) { border-color: var(--primary); background: #fdf1f1; }
.toolbar .kicker + h1 { margin: 0; }

/* Footer mit Bereichswechsel */
.footer { padding: 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 20px; }
.footer-switch { background: var(--dark); color: #f8f8f8; padding: 8px 16px; border-radius: var(--radius); font-weight: 700; text-transform: uppercase; font-size: .8rem; letter-spacing: .03em; }
.footer-switch:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* Getrennte Formulare: Antwort / interne Notiz */
.reply .row-inline { justify-content: flex-end; }
.note-form { margin-top: 18px; padding: 16px; background: #fffbea; border: 1px dashed #e6cf73; border-radius: var(--radius); }
.note-form label { margin-bottom: 10px; }
.note-form textarea { background: #fff; }
.btn-dark { background: var(--dark); border-color: var(--dark); }
.btn-dark:hover { background: #222; border-color: #222; }

/* Einstellungen */
.settings-table input[type=text], .settings-table input[type=number] { width: 100%; padding: 7px 9px; border: 1px solid #cfcfcf; border-radius: var(--radius); font: inherit; font-size: .9rem; }
.settings-table input.num { width: 70px; }
.settings-table input.mt { margin-top: 6px; font-size: .85rem; }
.settings-table input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid #cfcfcf; border-radius: var(--radius); background: #fff; cursor: pointer; }
.settings-table td { vertical-align: middle; }
.settings-table tr.inactive td { opacity: .55; }
.settings-table .preview { margin-top: 6px; }
.settings-table .check { margin: 0; }
.form input[type=color] { display: block; width: 60px; height: 38px; margin-top: 5px; padding: 2px; border: 1px solid #cfcfcf; border-radius: var(--radius); }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* Dateianhänge */
.attachments { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--border); }
aside .attachments { border-top: 0; padding-top: 0; margin-top: 0; }
.attachments li { padding: 3px 0; word-break: break-all; }
.attachments a { font-weight: 500; }
.form input[type=file] { display: block; width: 100%; margin-top: 6px; padding: 10px; border: 1px dashed #bdbdbd; border-radius: var(--radius); background: #fafafa; font: inherit; font-size: .9rem; cursor: pointer; }
.form input[type=file]:hover { border-color: var(--primary); }

/* Passwortverwaltung */
.vault-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.folders { list-style: none; margin: 0 0 14px; padding: 0; }
.folders a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius); color: var(--text); }
.folders a span { color: var(--muted); font-size: .85rem; }
.folders a:hover { background: #f2f2f2; text-decoration: none; }
.folders li.active a { background: var(--primary); color: #fff; font-weight: 600; }
.folders li.active a span { color: #fff; }
.folder-add { display: flex; gap: 6px; }
.folder-add input { flex: 1; margin: 0 !important; padding: 7px 9px !important; }
.folder-add .btn { font-size: 1.1rem; line-height: 1; padding: 0 12px; }
.vault-search input { padding: 8px 11px; border: 1px solid #cfcfcf; border-radius: var(--radius); font: inherit; min-width: 220px; }
.vault-table td { vertical-align: middle; }
.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: .92rem; }
.pw-mask { display: inline-block; min-width: 90px; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; cursor: pointer; font-size: .95rem; color: var(--muted); }
.icon-btn:hover { border-color: var(--border); background: #f2f2f2; color: var(--text); }
.pw-field { display: flex; gap: 6px; align-items: center; margin-top: 5px; }
.pw-field input { margin: 0 !important; flex: 1; font-family: Consolas, Menlo, monospace; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--dark); color: #fff; padding: 10px 18px; border-radius: var(--radius); opacity: 0; pointer-events: none; transition: all .2s; font-weight: 500; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--primary); }
@media (max-width: 860px) { .vault-grid { grid-template-columns: 1fr; } }
.hidden { display: none !important; }

/* Schalter (An/Aus) */
.toggle-list { list-style: none; margin: 0 0 16px; padding: 0; }
.toggle-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.toggle-list li:last-child { border-bottom: 0; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; margin: 0 !important; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch .slider { position: absolute; inset: 0; background: #c6c6c6; border-radius: 24px; transition: background .18s; }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked ~ .slider { background: #1e8e3e; }
.switch input:checked ~ .slider::before { transform: translateX(20px); }
.switch input:focus-visible ~ .slider { box-shadow: 0 0 0 3px rgba(30,142,62,.3); }

/* Inventar */
.row-low td { background: #fff5f5; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper .icon-btn { font-size: 1.1rem; line-height: 1; padding: 2px 9px; border-color: var(--border); }
.stepper .qty { min-width: 28px; text-align: center; font-size: 1.05rem; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .row-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .row-4 { grid-template-columns: 1fr; } }

/* Zwei-Faktor-Anmeldung */
.code-input { font-family: Consolas, Menlo, monospace; letter-spacing: .25em; text-align: center; }
.code-input.big { font-size: 1.5rem; padding: 12px !important; }
.qr-box { display: flex; justify-content: center; padding: 16px 0; }
.qr-box svg { max-width: 260px; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.secret-box { background: #fafafa; border: 1px dashed #cfcfcf; border-radius: var(--radius); padding: 10px 12px; text-align: center; letter-spacing: .08em; word-break: break-all; }
.codes-card { border-top: 4px solid var(--primary); }
.codes { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.codes li { font-family: Consolas, Menlo, monospace; font-size: 1.05rem; letter-spacing: .08em; background: #fafafa; border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; text-align: center; }
@media print { .servicebar, .site-header, .mainnav, .footer, .row-inline, .toolbar { display: none !important; } }
.trust-check { margin: -4px 0 14px !important; font-size: .9rem; align-items: flex-start !important; }
.trust-check input { margin-top: 3px; }
