/* Hersteller-Verwaltung – ruhig, übersichtlich, für den Schreibtisch (geht auch auf dem Tablet) */
:root {
  --ink: #1d2329; --ink2: #4a535d; --muted: #7a828c; --line: #e2e5e9; --line2: #cfd5db; --bg: #f3f4f6; --card: #fff;
  --green: #1f6f43; --green-bg: #e7f3ec; --red: #b03a2e; --red-bg: #fbe9e7; --amber: #9a6200; --amber-bg: #fff3d6; --blue: #245c8f; --blue-bg: #e6f0f9;
  --brand: #c0392b; --top: #1f262d;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.4 system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font: 13px ui-monospace, "Consolas", monospace; }
.a-muted { color: var(--muted); }
.r { text-align: right; }
.a-boot, .a-empty { display: grid; place-items: center; min-height: 40vh; color: var(--muted); }

/* Knöpfe */
.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line2); background: #fff; border-radius: 7px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); }
.a-btn:hover { background: #f5f6f8; }
.a-btn:disabled { opacity: .5; cursor: default; }
.a-btn.primary { background: var(--green); border-color: #195c37; color: #fff; font-weight: 600; }
.a-btn.primary:hover:not(:disabled) { background: #195c37; }
.a-btn.danger { background: var(--red); border-color: #93302a; color: #fff; font-weight: 600; }
.a-btn.big { padding: 11px 20px; font-size: 15px; }
.a-btn.small { padding: 3px 9px; font-size: 12.5px; }
.a-btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .25); color: #e8ecef; }
.a-btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.a-x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 8px; border-radius: 6px; }
.a-x:hover { background: #f0f2f4; color: var(--ink); }
.a-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.a-row.end { justify-content: flex-end; }

/* Formulare */
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink2); min-width: 0; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { padding: 8px 10px; border: 1px solid var(--line2); border-radius: 7px; background: #fff; font-size: 14px; font-weight: 400; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: transparent; }
input.bad { outline: 2px solid var(--red); outline-offset: -1px; }
label .a-muted { font-weight: 400; font-size: 12px; }
.a-grid2, .a-grid3 { display: grid; gap: 12px; }
.a-grid2 { grid-template-columns: 1fr 1fr; }
.a-grid3 { grid-template-columns: repeat(3, 1fr); }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.a-full { margin: 10px 0; }
.a-mini { display: flex; gap: 4px; }
.a-mini button { border: 1px solid var(--line2); background: #f7f8f9; border-radius: 5px; padding: 1px 7px; font-size: 12px; cursor: pointer; font-weight: 400; }
.a-mini button:hover { background: #eef0f2; }
.a-err { background: var(--red-bg); color: #8e2a20; padding: 9px 12px; border-radius: 8px; font-size: 13px; }
.a-hint { padding: 9px 12px; border-radius: 8px; background: var(--blue-bg); color: var(--blue); margin: 12px 0 0; font-size: 13px; }
.a-hint.warn { background: var(--amber-bg); color: var(--amber); }

/* Anmeldung */
.a-login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1100px 560px at 15% 0%, #e3e8ee 0%, transparent 60%), #eef0f3; }
.a-login { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 20px 50px rgba(20, 30, 40, .14); display: flex; flex-direction: column; gap: 14px; }
.a-login.wide { max-width: 560px; }
.a-login p { margin: 0; color: var(--ink2); }
.a-logo { display: flex; align-items: center; gap: 12px; }
.a-logo img { width: 44px; height: 44px; }
.a-logo b { display: block; font-size: 21px; letter-spacing: -.3px; }
.a-logo small { color: var(--brand); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; font-size: 11px; }
.a-foot { text-align: center; font-size: 12px; color: var(--muted) !important; }
.a-totp { display: flex; gap: 16px; align-items: flex-start; background: #f7f8fa; border-radius: 12px; padding: 14px; }
.a-qr { width: 180px; height: 180px; flex: none; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.a-key { display: inline-block; margin-top: 4px; padding: 3px 6px; background: #fff; border: 1px solid var(--line); border-radius: 5px; word-break: break-all; }
.a-code { display: block; margin-top: 6px; font-size: 22px !important; letter-spacing: 6px; text-align: center; max-width: 180px; }

/* Rahmen */
.a-shell { min-height: 100vh; display: flex; flex-direction: column; }
.a-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 54px; background: var(--top); color: #e8ecef; }
.a-brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.a-brand img { width: 28px; height: 28px; }
.a-brand b { font-size: 16px; }
.a-brand span { color: #9aa5b0; font-size: 13px; padding-left: 8px; border-left: 1px solid #3c4650; }
.a-top nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.a-top nav button { border: 0; background: none; color: #c3ccd4; padding: 8px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.a-top nav button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.a-top nav button.on { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; }
.a-me { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: #c3ccd4; }
.a-main { flex: 1; }
.a-page { padding: 20px; max-width: 1400px; margin: 0 auto; }
.a-page.narrow { max-width: 900px; }
.a-card { background: var(--card); border-radius: 14px; padding: 22px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(20, 30, 40, .05); }
.a-card h2 { margin: 0 0 14px; font-size: 19px; }
.a-card h3 { margin: 20px 0 8px; font-size: 14px; color: var(--ink2); }

/* Kennzahlen */
.a-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.a-kpi { display: flex; flex-direction: column; gap: 2px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
button.a-kpi { cursor: pointer; }
button.a-kpi:hover { border-color: var(--line2); }
.a-kpi span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.a-kpi b { font-size: 26px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.a-kpi small { color: var(--muted); font-size: 12px; }
.a-kpi.alert { border-color: #efc7c1; background: #fff8f7; }
.a-kpi.alert b { color: var(--red); }

/* Liste */
.a-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.a-seg { display: flex; background: #e6e9ec; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.a-seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: var(--ink2); }
.a-seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.a-search { flex: 1; min-width: 200px; max-width: 380px; }
.a-tablewrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.a-table { width: 100%; border-collapse: collapse; }
.a-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
.a-table td { padding: 10px 12px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
.a-table th.r, .a-table td.r { text-align: right; font-variant-numeric: tabular-nums; }
.a-table tbody tr:not(.static):not(.a-none) { cursor: pointer; }
.a-table tbody tr:not(.static):not(.a-none):hover { background: #f7f9fa; }
.a-table tbody tr:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table.small td, .a-table.small th { padding: 7px 8px; }
.a-none td { text-align: center; color: var(--muted); padding: 30px; }
.a-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.s-active { background: var(--green-bg); color: var(--green); }
.s-trial { background: var(--blue-bg); color: var(--blue); }
.s-suspended { background: var(--red-bg); color: var(--red); }
.s-cancelled { background: #eceef0; color: #66707a; }
.a-flag { display: inline-block; margin: 0 4px 3px 0; padding: 1px 7px; border-radius: 5px; font-size: 12px; background: #eceef0; color: #59626b; white-space: nowrap; }
.a-flag.rot { background: var(--red-bg); color: var(--red); }
.a-flag.gelb { background: var(--amber-bg); color: var(--amber); }
.a-flags { margin-bottom: 4px; }

/* Seitenleiste mit einem Betrieb */
.a-drawer-back { position: fixed; inset: 0; z-index: 40; background: rgba(20, 28, 36, .32); }
.a-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(760px, 100vw); background: var(--bg); display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0, 0, 0, .18); }
.a-drawer-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.a-drawer-head > div { flex: 1; min-width: 0; }
.a-drawer-head b { display: block; font-size: 18px; }
.a-drawer-head small { color: var(--muted); }
.a-drawer-head a { color: var(--blue); }
.a-drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.a-sec { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.a-sec h3 { margin: 0 0 10px; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.a-sec h3 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.a-sec > p.a-muted { margin: 10px 0 0; font-size: 12.5px; }
.a-savebar { display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: #fff; border-top: 1px solid var(--line); }
.a-savebar span { flex: 1; color: var(--muted); font-size: 13px; }
.a-savebar.dirty { background: #fffbea; }
.a-savebar.dirty span { color: var(--amber); font-weight: 600; }
.a-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.a-check { flex-direction: row; align-items: flex-start; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; color: var(--ink); background: #fafbfc; }
.a-check.on { background: var(--green-bg); border-color: #c3e0cf; }
.a-check input { margin-top: 2px; accent-color: var(--green); }
.a-check span { display: flex; flex-direction: column; min-width: 0; }
.a-check b { font-size: 13px; }
.a-check small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.a-langs { display: flex; flex-wrap: wrap; gap: 6px; }
.a-lang { flex-direction: row; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; font-weight: 400; color: var(--ink); cursor: pointer; background: #fafbfc; }
.a-lang.on { background: var(--green-bg); border-color: #c3e0cf; }
.a-lang input { accent-color: var(--green); margin: 0; }
.a-usage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.a-bars { display: flex; gap: 8px; align-items: flex-end; height: 104px; }
.a-bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.a-bars i { display: block; width: 100%; max-width: 34px; background: var(--green); border-radius: 4px 4px 0 0; }
.a-bars b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; order: -1; }
.a-usage dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.a-usage dt { color: var(--muted); }
.a-usage dd { margin: 0; }
.a-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.a-log time { color: var(--muted); font-variant-numeric: tabular-nums; }
.a-log .a-muted { font-size: 12px; margin-top: 1px; }

/* Neuer Kunde */
.a-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.a-plan { position: relative; gap: 4px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; color: var(--ink); background: #fafbfc; }
.a-plan input { position: absolute; opacity: 0; }
.a-plan b { font-size: 16px; }
.a-plan small { color: var(--ink2); font-size: 12.5px; line-height: 1.35; }
.a-plan em { font-style: normal; color: var(--muted); font-size: 12px; }
.a-plan.on { border-color: var(--green); background: var(--green-bg); box-shadow: 0 0 0 2px #c3e0cf; }
.a-plan:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.a-secret { background: #f7f8fa; border: 1px dashed var(--line2); border-radius: 12px; padding: 14px 16px; }
.a-secret table { border-collapse: collapse; }
.a-secret th { text-align: left; padding: 4px 18px 4px 0; color: var(--muted); font-weight: 600; font-size: 13px; }
.a-secret td code { font-size: 16px; font-weight: 600; letter-spacing: .3px; }
.a-secret p { font-size: 12.5px; margin: 10px 0 0; }

/* Hinweis an alle – Vorschau wie in der Kasse */
.a-preview { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.le-banner { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; border-radius: 10px; background: #e8f1fa; color: #1d4f7a; border: 1px solid #c5dbef; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); max-width: 460px; font-size: 13.5px; }
.le-banner p { margin: 0; flex: 1; }
.le-banner button { border: 0; background: none; font-size: 18px; color: inherit; opacity: .7; cursor: pointer; }
.le-banner.warnung { background: #fff3d6; color: #7a4d00; border-color: #f0d9a0; }

/* Dialog */
.a-modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(20, 28, 36, .4); display: grid; place-items: center; padding: 16px; }
.a-modal { width: min(460px, 100%); background: #fff; border-radius: 14px; padding: 16px 18px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.a-modal.wide { width: min(640px, 100%); }
.a-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.a-modal-head b { font-size: 16px; }
.a-modal p { color: var(--ink2); margin: 6px 0 12px; }
.a-modal .a-check { margin-bottom: 4px; }

.a-toast { position: fixed; left: 50%; top: 66px; transform: translateX(-50%); z-index: 80; background: var(--green); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: 92vw; }
.a-toast.err { background: var(--red); }

@media (max-width: 900px) {
  .a-top { flex-wrap: wrap; height: auto; padding: 8px 12px 6px; gap: 6px 12px; }
  .a-top nav { order: 3; flex-basis: 100%; margin: 0 -6px; }
  .a-me { margin-inline-start: auto; }
  .a-kpis { grid-template-columns: repeat(2, 1fr); }
  .a-grid3, .a-plans, .a-usage { grid-template-columns: 1fr 1fr; }
  .a-checks { grid-template-columns: 1fr; }
  .a-brand span, .a-me span { display: none; }
}
@media (max-width: 560px) {
  .a-grid2, .a-grid3, .a-plans, .a-usage { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .a-page { padding: 12px; }
  .a-totp { flex-direction: column; }
}
@media print {
  body { background: #fff; }
  .a-top, .a-row, .a-x, .a-toast, .a-drawer-back { display: none !important; }
  .a-card, .a-modal { box-shadow: none; }
  /* Offener Dialog (z. B. neues Startpasswort): nur ihn drucken */
  body:has(.a-modal-back) * { visibility: hidden; }
  body:has(.a-modal-back) .a-modal-back, body:has(.a-modal-back) .a-modal-back * { visibility: visible; }
  .a-modal-back { position: absolute; inset: 0 auto auto 0; background: none; display: block; padding: 0; }
}
