/* AMBOSS Owner-Dashboard — Werkstatt-Skin v7 (1:1 aus der App: AMBOSS_APP).
   Neon-Yellow + Ink + Silber, Light-Surfaces auf poliertem Stahl. Zero-dependency. */
@font-face {
  font-family: 'Akira Expanded';
  src: url('./assets/AkiraExpanded.otf') format('opentype');
  font-weight: 700 900; font-style: normal; font-display: swap;
}
:root {
  --neon: #e8ff00; --neon-deep: #c4d800; --neon-light: #f4ff5e;
  --ink: #0a0a0a; --ink-2: #1a1a1a;
  --silver: #c0c0c0; --mid-grey: #808080; --light-silver: #e8e8e8; --off-white: #f5f5f7;
  --surface: #fafafa; --surface-low: #ffffff; --surface-mid: #f4f4f5; --surface-high: #ececee;
  --text-primary: #0a0a0a; --text-soft: #404040; --text-muted: #555; --text-faint: #888;
  --hairline: rgba(10,10,10,0.06); --outline-variant: rgba(10,10,10,0.10); --outline: #bdbdbd;
  --success: #22c55e; --danger: #d23b3b;
  --r: 12px; --r-small: 8px;
  --ease-std: cubic-bezier(0.2, 0, 0, 1); --ease-snap: cubic-bezier(0.3, 1.5, 0.5, 1);
  --shadow-card: 0 10px 30px -12px rgba(10,10,10,0.28), 0 2px 6px rgba(10,10,10,0.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif; color: var(--text-primary);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh;
  background:
    linear-gradient(180deg, #6e7378 0%, #9ea3a8 8%, #c8cdd2 18%, #e6e9ec 28%, #f4f6f8 38%,
      #d9dde1 50%, #aab0b5 62%, #7a8086 74%, #5d6368 82%, #8d9398 90%, #c2c7cc 96%, #e0e4e8 100%) fixed;
}
.hidden { display: none !important; }
.muted { color: var(--text-faint); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.err { color: var(--danger); min-height: 18px; font-size: 13px; margin-top: 10px; font-weight: 500; }
.wordmark { font-family: 'Akira Expanded', 'Inter', sans-serif; font-weight: 800; letter-spacing: 0.005em; }

/* Brand */
.brand { display: flex; align-items: center; gap: 12px; }
.anvil { height: 30px; width: auto; }
/* anvil-mark.svg ist weiss → fuer Light-Surfaces per Filter auf Ink schwaerzen. */
.anvil.ink { filter: brightness(0) saturate(100%); }
.brand .name { font-size: 24px; color: var(--ink); }

/* Buttons (Skin: Space Grotesk, radius 12, neon-primary) */
button { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: -0.005em; border-radius: var(--r); border: 1px solid transparent; cursor: pointer; transition: background 140ms var(--ease-std), border-color 140ms, transform 100ms var(--ease-snap); }
button:active { transform: scale(0.985); }
.btn-primary { width: 100%; padding: 12px; background: var(--neon); color: var(--ink); border: none; }
.btn-primary:hover { background: var(--neon-light); }
.btn-neon { background: var(--neon); color: var(--ink); border: none; padding: 8px 14px; }
.btn-neon:hover { background: var(--neon-light); }
.btn-dark { background: var(--ink); color: #fff; border: none; padding: 8px 14px; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--outline-variant); padding: 7px 12px; }
.btn-ghost:hover { border-color: var(--ink); background: rgba(10,10,10,0.04); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(210,59,59,0.3); padding: 7px 12px; }
.btn-danger:hover { background: rgba(210,59,59,0.08); }

/* Login */
.login-wrap { max-width: 460px; margin: 9vh auto; padding: 0 20px; }
.login-card { background: var(--surface-low); border: 1px solid var(--hairline); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow-card); }
.login-card .brand { justify-content: center; margin-bottom: 16px; }
.login-card h1 { font-family: 'Akira Expanded', sans-serif; font-size: 22px; text-align: center; margin-bottom: 8px; letter-spacing: 0.01em; }
.login-card p.lead { color: var(--text-muted); text-align: center; font-size: 13.5px; margin-bottom: 22px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
input[type="text"], input[type="password"] { width: 100%; padding: 12px 13px; border-radius: var(--r-small); background: var(--surface-mid); border: 1px solid var(--outline-variant); color: var(--ink); font-size: 14px; font-family: 'Space Grotesk', monospace; letter-spacing: 0.02em; }
input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(232,255,0,0.45); }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 12px; padding: 13px 24px; background: rgba(250,250,250,0.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--hairline); position: sticky; top: 0; z-index: 20; }
.topbar .name { font-size: 18px; }
.topbar .anvil { height: 24px; }
.tag { font-family: 'Space Grotesk', sans-serif; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); background: var(--neon); border-radius: 999px; padding: 3px 10px; }
.spacer { flex: 1; }
.topbar select { background: var(--surface-low); color: var(--ink); border: 1px solid var(--outline-variant); border-radius: var(--r-small); padding: 7px 10px; font-family: inherit; font-size: 13px; }

/* Layout */
.content { max-width: 1040px; margin: 0 auto; padding: 24px 24px 72px; }
.panel { background: var(--surface-low); border: 1px solid var(--hairline); border-radius: var(--r); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-card); }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.panel-head h2 { font-family: 'Akira Expanded', sans-serif; font-size: 13px; letter-spacing: 0.02em; }
.panel .sub { color: var(--text-faint); font-size: 12.5px; margin-bottom: 14px; }

/* Onboarding */
.onboard { background: linear-gradient(180deg, rgba(232,255,0,0.16), rgba(232,255,0,0.05)); border: 1px solid rgba(196,216,0,0.45); border-radius: var(--r); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow-card); }
.onboard h3 { font-family: 'Akira Expanded', sans-serif; font-size: 13px; margin-bottom: 10px; letter-spacing: 0.02em; }
.onboard ol { margin: 0 0 2px 18px; }
.onboard li { margin: 5px 0; color: var(--text-soft); font-size: 13.5px; }
.onboard .dismiss { float: right; margin-top: -4px; }

/* Onboarding-Checkliste */
.ob-prog { font-family: 'Space Grotesk', sans-serif; font-size: 12px; background: var(--ink); color: var(--neon); border-radius: 999px; padding: 2px 10px; vertical-align: middle; margin-left: 6px; }
.ob-intro { color: var(--text-soft); font-size: 13px; margin: 4px 0 12px; max-width: 720px; }
.ob-list { list-style: none; display: grid; gap: 8px; }
.ob-step { display: flex; align-items: flex-start; gap: 11px; padding: 10px 12px; background: var(--surface-low); border: 1px solid var(--hairline); border-radius: var(--r-small); }
.ob-step.ob-done { opacity: 0.62; }
.ob-check { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; font-size: 12px; font-weight: 700; background: var(--surface-high); color: var(--text-faint); }
.ob-step.ob-done .ob-check { background: var(--neon); color: var(--ink); }
.ob-text { display: flex; flex-direction: column; gap: 2px; }
.ob-text b { font-size: 13.5px; }
.ob-detail { color: var(--text-faint); font-size: 12px; }

/* Segmented Tabs (in der Topbar) */
.seg { display: inline-flex; gap: 2px; background: var(--surface-mid); border: 1px solid var(--outline-variant); border-radius: 999px; padding: 3px; }
.seg .tab { background: transparent; border: none; color: var(--text-muted); padding: 6px 16px; border-radius: 999px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 12.5px; letter-spacing: -0.005em; transition: background 150ms var(--ease-std), color 150ms; }
.seg .tab:hover { color: var(--ink); }
.seg .tab.active { background: var(--ink); color: #fff; box-shadow: 0 1px 4px rgba(10,10,10,0.18); }
.view { animation: viewin .18s var(--ease-std); }
@keyframes viewin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) { .topbar { flex-wrap: wrap; } .seg { order: 3; } }

/* Key-Tab (KI-Zugänge) */
.keys-intro .sub { max-width: 760px; }
.keycards { margin-top: 2px; align-items: stretch; }
.keycard { background: var(--surface-low); border: 1px solid var(--hairline); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; }
.keycard-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.keycard-top b { font-size: 15px; }
.keycard-desc { color: var(--text-soft); font-size: 12.5px; line-height: 1.6; margin-bottom: 18px; flex: 1; }
.keycard-foot { margin-bottom: 16px; }
.keycard-foot a { text-decoration: none; }
.key-mono { font-family: 'Space Grotesk', monospace; font-size: 12px; color: var(--text-faint); background: var(--surface-mid); border-radius: 6px; padding: 2px 7px; }
.key-field { display: block; position: relative; }
.key-field > span:first-child { display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.key-input { width: 100%; opacity: 0.6; cursor: not-allowed; }
.key-lock { position: absolute; right: 10px; bottom: 10px; font-family: 'Space Grotesk', sans-serif; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); background: var(--surface-high); border-radius: 999px; padding: 3px 9px; }
.key-gate { margin-top: 14px; background: rgba(232,255,0,0.16); border: 1px solid rgba(196,216,0,0.45); border-radius: var(--r-small); padding: 12px 14px; font-size: 12.5px; color: var(--text-soft); }
.key-gate b { color: var(--ink); }
.key-note { margin-top: 14px; background: var(--surface-mid); border: 1px solid var(--hairline); border-radius: var(--r-small); padding: 12px 14px; font-size: 12.5px; color: var(--text-soft); line-height: 1.55; }
.key-note b { color: var(--ink); }

/* KI-Zugänge: Verteilen + Status pro Sitz + Verlauf */
.key-distribute { margin-top: 10px; align-self: flex-start; }
.key-result { margin-top: 8px; font-size: 12.5px; min-height: 16px; }
.kr-ok { color: #18794e; font-weight: 600; }
.kr-err { color: var(--danger); font-weight: 500; }
.rotate-new { font-size: 12.5px; color: var(--text-soft); }
.rotate-new b { color: var(--ink); }
.rotate-code { font-size: 13px !important; }
.kb-hint { font-size: 12.5px; color: var(--text-soft); background: rgba(232,255,0,0.16); border: 1px solid rgba(196,216,0,0.45); border-radius: var(--r-small); padding: 9px 12px; margin-bottom: 12px; }
.kb-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 11px 13px; border: 1px solid var(--hairline); border-radius: var(--r-small); background: var(--surface); margin: 8px 0; }
.kb-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kb-name { font-weight: 700; font-size: 14px; }
.kb-fp { font-family: 'Space Grotesk', monospace; font-size: 11px; color: var(--text-faint); background: var(--surface-mid); border-radius: 6px; padding: 2px 7px; }
.kb-prov { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kb-prov-lbl { font-size: 11px; color: var(--text-muted); }
.kb-badge { font-family: 'Space Grotesk', sans-serif; font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.kb-badge.ok { background: rgba(34,197,94,0.16); color: #18794e; }
.kb-badge.none { background: var(--surface-high); color: var(--text-muted); }
.kb-badge.stale { background: var(--neon); color: var(--ink); }
.kb-badge.wait { background: rgba(210,59,59,0.12); color: var(--danger); }
.audit-list { display: flex; flex-direction: column; }
.audit-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: baseline; padding: 7px 4px; border-bottom: 1px solid var(--hairline); font-size: 12.5px; }
.audit-row:last-child { border-bottom: none; }
.audit-when { color: var(--text-faint); font-size: 11.5px; }
.audit-act { color: var(--ink); font-weight: 600; }
.audit-who { color: var(--text-muted); font-size: 11.5px; }
@media (max-width: 600px) { .audit-row { grid-template-columns: 1fr; gap: 1px; } }

/* Verbrauch pro Cutter */
.team-totals { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 12px; background: var(--ink); color: #fff; border-radius: var(--r-small); margin-bottom: 12px; font-size: 13px; }
.team-totals b { color: var(--neon); font-variant-numeric: tabular-nums; }
.cutter { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-small); padding: 12px 14px; margin: 9px 0; }
.cutter-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.cutter-name { font-weight: 700; font-size: 14px; }
.badge { font-family: 'Space Grotesk', sans-serif; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge.warn { background: var(--neon); color: var(--ink); }
.badge.danger { background: rgba(210,59,59,0.14); color: var(--danger); }
.badge.revoked { background: rgba(210,59,59,0.12); color: var(--danger); }
.badge.muted { background: var(--surface-high); color: var(--text-muted); }
.cutter-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 780px) { .cutter-metrics { grid-template-columns: repeat(2, 1fr); } }
.metric { background: var(--surface-low); border: 1px solid var(--hairline); border-radius: 7px; padding: 9px 10px; }
.metric-val { font-family: 'Space Grotesk', sans-serif; font-size: 16px; font-weight: 700; }
.metric-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.metric-sub { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }

/* Hero */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin: 4px 0 20px; }
.hero .agency-name { font-family: 'Akira Expanded', sans-serif; font-size: 26px; letter-spacing: 0.01em; }
.hero .agency-meta { color: var(--text-faint); font-size: 12.5px; margin-top: 5px; }
.kpis { display: flex; gap: 12px; }
.kpi { background: var(--ink); color: #fff; border-radius: var(--r); padding: 12px 16px; min-width: 104px; text-align: center; }
.kpi-val { font-family: 'Akira Expanded', sans-serif; font-size: 21px; }
.kpi-val .accent { color: var(--neon); }
.kpi-lbl { font-size: 10.5px; color: #b9b9bd; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; }

/* Tooltip */
.info { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--outline); color: var(--text-muted); font-size: 11px; font-weight: 700; cursor: help; position: relative; flex-shrink: 0; font-family: 'Space Grotesk', sans-serif; }
.info:hover { color: var(--ink); background: var(--neon); border-color: var(--neon-deep); }
.info::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 280px; background: var(--ink); color: #f2f2f2; padding: 9px 11px; border-radius: var(--r-small); font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left; box-shadow: var(--shadow-card); opacity: 0; pointer-events: none; transition: opacity .14s; z-index: 50; }
.info:hover::after { opacity: 1; }

/* Seats */
.seat { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--hairline); border-radius: var(--r); background: var(--surface); margin: 9px 0; }
.seat.is-revoked { opacity: 0.5; }
.seat-main { min-width: 0; }
.seat-name-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.seat-name { background: var(--surface-low); border: 1px solid var(--outline-variant); color: var(--ink); font-size: 14.5px; font-weight: 600; font-family: 'Inter', sans-serif; padding: 5px 9px; border-radius: var(--r-small); min-width: 150px; max-width: 320px; }
.seat-name:hover { border-color: var(--outline); }
.seat-name:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(232,255,0,0.4); }
.seat-sub { color: var(--text-faint); font-size: 12px; margin-top: 5px; padding-left: 2px; }
.pill { font-family: 'Space Grotesk', sans-serif; font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.pill.free { background: var(--neon); color: var(--ink); }
.pill.active { background: rgba(34,197,94,0.14); color: #18794e; }
.pill.revoked { background: rgba(210,59,59,0.12); color: var(--danger); }
.seat-quota { color: var(--text-soft); font-size: 12px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Usage */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 780px) { .grid2 { grid-template-columns: 1fr; } .seat { grid-template-columns: 1fr auto; } .seat-actions { grid-column: 1 / -1; } }
.bar-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 10px; margin: 9px 0; }
.bar-label { font-size: 12.5px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--surface-high); border-radius: 6px; height: 9px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--neon-deep), var(--neon)); border-radius: 6px; }
.bar-val { font-variant-numeric: tabular-nums; font-size: 12.5px; min-width: 64px; text-align: right; color: var(--text-soft); }
.stat { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-small); padding: 12px; margin: 8px 0; }
.stat-head { display: flex; justify-content: space-between; align-items: baseline; }
.stat-head strong { text-transform: capitalize; }
.stat-body { font-size: 15px; margin-top: 4px; color: var(--ink); font-weight: 600; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,10,10,0.5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--surface-low); border: 1px solid var(--hairline); border-radius: 18px; padding: 26px; max-width: 470px; width: calc(100% - 40px); box-shadow: var(--shadow-card); }
.modal h3 { font-family: 'Akira Expanded', sans-serif; font-size: 15px; margin-bottom: 6px; letter-spacing: 0.01em; }
.modal p { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.keybox { display: flex; gap: 8px; align-items: center; }
.keybox code { flex: 1; background: var(--ink); border-radius: var(--r-small); padding: 13px; font-family: 'Space Grotesk', monospace; font-size: 16px; letter-spacing: 0.06em; color: var(--neon); user-select: all; word-break: break-all; font-weight: 600; }
.warn { color: #8a6d00; background: rgba(232,255,0,0.18); border-radius: var(--r-small); padding: 9px 11px; font-size: 12px; margin-top: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

footer { text-align: center; color: var(--text-soft); font-size: 12px; margin-top: 26px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r-small); box-shadow: var(--shadow-card); font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 200; }
.toast.show { opacity: 1; }
