/* ═══ ViCore Control Center — eigenständiges Plattform-Layout (Inter, Forest CI) ═══ */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); }

:root {
  --forest: #1A3025; --forest-2: #24422F; --forest-deep: #0E2018;
  --sage: #3D6B4F; --sage-2: #E4EDE7; --mint: #4a9d6f;
  --gold: #C9A24B; --cream: #F6F5F1; --ink: #16221B; --muted: #6b7a70; --line: #e2e7e3;
  --danger: #b3352f; --warn: #b8860b; --ok: #2e7d4f; --info: #35637f;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(20,40,30,.08), 0 6px 20px rgba(20,40,30,.06);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1,h2,h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
a { color: var(--sage); }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ── Login ─────────────────────────────────────────────────────────────── */
.login-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 50% -10%, #1f3a2b, var(--forest-deep)); padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 14px; }
.login-brand { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.brand-sub { color: var(--muted); font-weight: 500; font-size: 14px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--forest); color: #fff; font-weight: 800; }
.login-intro { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: #48564d; }
.field input, .field select, .field textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); font-weight: 500; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(61,107,79,.14); }
.login-error, .form-error { background: #fdecea; color: var(--danger); border: 1px solid #f3c9c6; border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; font-weight: 500; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 9px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: .12s; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--forest-2); }
.btn-secondary { background: #fff; color: var(--forest); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--sage); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(0,0,0,.04); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #922923; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }

/* ── App shell ─────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.sidebar { background: var(--forest); color: #d8e6dd; display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100dvh; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.brand-name { font-weight: 750; color: #fff; font-size: 15px; }
.brand-sub2 { font-size: 11px; color: #8fb39e; letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm); color: #c4d6cb; font-weight: 550; font-size: 13.5px; cursor: pointer; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--sage); color: #fff; }
.nav a .ico { width: 17px; text-align: center; opacity: .9; }
.nav a .count { margin-left: auto; background: rgba(255,255,255,.14); border-radius: 20px; padding: 1px 8px; font-size: 11px; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; display: flex; align-items: center; gap: 8px; }
.who { flex: 1; min-width: 0; }
.who-name { color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { color: #8fb39e; font-size: 11px; }
.sidebar-foot .btn-ghost { color: #c4d6cb; }
.sidebar-foot .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.crumbs .cur { color: var(--ink); font-weight: 650; font-size: 16px; }
.crumbs a { cursor: pointer; text-decoration: none; }
.topbar-actions { display: flex; gap: 9px; }
.view { padding: 26px 28px 60px; max-width: 1200px; width: 100%; }

/* ── Cards / KPI ───────────────────────────────────────────────────────── */
.cards { display: grid; gap: 14px; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.kpi { padding: 16px 18px; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .val { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi .val.warn { color: var(--warn); } .kpi .val.danger { color: var(--danger); } .kpi .val.ok { color: var(--ok); }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 26px 0 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px){ .app{grid-template-columns:1fr} .sidebar{position:fixed;z-index:20;transform:translateX(-100%)} .grid-2{grid-template-columns:1fr} }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 650; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fbfcfb; white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #f7faf8; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-link { cursor: pointer; }
.mono { font-variant-numeric: tabular-nums; color: #46554c; }

/* ── Status chips ──────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 650; line-height: 1.5; }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.active { background: #e5f3ea; color: var(--ok); }
.chip.test { background: #e7f0f6; color: var(--info); }
.chip.maintenance { background: #fbf1d8; color: var(--warn); }
.chip.suspended, .chip.error { background: #fdecea; color: var(--danger); }
.chip.provisioning { background: #eee9f6; color: #6a4fa3; }
.chip.archived, .chip.pending_deletion { background: #eceeec; color: #6b7a70; }
.chip.core { background: var(--sage-2); color: var(--sage); }
.chip.on { background:#e5f3ea;color:var(--ok);} .chip.off{background:#eceeec;color:#8a978e;}
/* Feedback-Status-Chips (13 Zustände) */
.chip.fb-neu, .chip.fb-in_pruefung, .chip.fb-bestaetigt, .chip.fb-geplant { background: #e7f0f6; color: var(--info); }
.chip.fb-rueckfrage_erforderlich { background: #fbf1d8; color: var(--warn); }
.chip.fb-in_bearbeitung, .chip.fb-technisch_umgesetzt, .chip.fb-im_test { background: var(--sage-2); color: var(--sage); }
.chip.fb-behoben, .chip.fb-veroeffentlicht { background: #e5f3ea; color: var(--ok); }
.chip.fb-abgelehnt, .chip.fb-duplikat, .chip.fb-nicht_reproduzierbar { background: #eceeec; color: #6b7a70; }

/* Feedback: Filterleiste, Timeline, Detailkopf */
.fb-filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.fb-filterbar input[type=search] { flex: 1 1 220px; min-width: 160px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.fb-filterbar select { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.fb-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.fb-det-head { margin-bottom: 14px; }
.fb-tl { list-style: none; margin: 0; padding: 0; }
.fb-tl li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.fb-tl li:last-child { border-bottom: none; }
/* KPI-Wert „Neu" in Info-Blau (analog warn/danger/ok) */
.kpi .val.info { color: var(--info); }
/* Screenshot-/Anhang-Galerie im Detail — angemessen große Vorschau */
.fb-att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.fb-att-item { display: flex; flex-direction: column; gap: 6px; }
.fb-att-img { width: 100%; max-height: 460px; object-fit: contain; background: var(--cream, #f3f0ea); border: 1px solid var(--line); border-radius: 10px; cursor: zoom-in; }
.fb-att-file { display: inline-block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--sage); text-decoration: none; font-weight: 600; }
.fb-att-file:hover { background: var(--sage-2); }
.fb-att-cap { font-size: 12.5px; color: var(--muted); }
/* Claude-Arbeitsauftrag-Prompts (kopierbar) */
.fb-prompt-ta { width: 100%; min-height: 150px; margin-top: 6px; padding: 10px 12px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.fb-prompt-block .btn { margin-top: 8px; }

/* ── Detail tabs ───────────────────────────────────────────────────────── */
.tabbar { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabbar a { padding: 11px 15px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabbar a:hover { color: var(--ink); }
.tabbar a.active { color: var(--forest); border-bottom-color: var(--forest); }

/* Definition rows */
.dl { display: grid; grid-template-columns: 200px 1fr; gap: 0; }
.dl > dt { color: var(--muted); font-weight: 600; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.dl > dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.dl > dt:last-of-type, .dl > dd:last-of-type { border-bottom: none; }

/* ── Wizard ────────────────────────────────────────────────────────────── */
.wizard { max-width: 760px; }
.wsteps { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.wstep { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wstep .n { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.wstep.done .n { background: var(--sage); border-color: var(--sage); color: #fff; }
.wstep.cur .n { border-color: var(--forest); color: var(--forest); }
.wstep.cur { color: var(--ink); }
.wsep { flex: 1; height: 2px; background: var(--line); min-width: 12px; align-self: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.wizard-foot { display: flex; justify-content: space-between; margin-top: 24px; }
.preview-url { background: var(--forest-deep); color: #b9d3c4; font-family: inherit; padding: 8px 12px; border-radius: 8px; font-size: 13px; }

/* module cards */
.mod-cat { margin-top: 18px; }
.mod-cat h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.mod-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 10px; }
.mod-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: #fff; display: flex; gap: 10px; align-items: flex-start; }
.mod-item .mi-body { flex: 1; min-width: 0; }
.mod-item .mi-name { font-weight: 650; font-size: 13.5px; }
.mod-item .mi-desc { color: var(--muted); font-size: 12px; }
.mod-item .mi-deps { font-size: 11px; color: #93a19a; margin-top: 3px; }

/* switch */
.switch { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl { position: absolute; inset: 0; background: #cfd8d2; border-radius: 20px; transition: .15s; }
.switch .sl::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .sl { background: var(--sage); }
.switch input:checked + .sl::before { transform: translateX(18px); }
.switch input:disabled + .sl { opacity: .5; cursor: not-allowed; }

/* empty / loading */
.empty { text-align: center; color: var(--muted); padding: 46px 20px; }
.empty .big { font-size: 15px; font-weight: 600; color: #55635a; margin-bottom: 6px; }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--line); border-top-color: var(--sage); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 40px; justify-content: center; }

/* provisioning progress */
.prov-steps { display: flex; flex-direction: column; gap: 4px; }
.prov-step { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.prov-step .mk { width: 20px; text-align: center; }
.prov-step.done .mk { color: var(--ok); }
.prov-step.cur .mk { color: var(--sage); }
.prov-step.pending { color: var(--muted); }
.progressbar { height: 8px; background: var(--line); border-radius: 20px; overflow: hidden; margin: 12px 0; }
.progressbar > i { display: block; height: 100%; background: var(--sage); border-radius: 20px; transition: width .3s; }

/* ── Modal / Toast ─────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(14,32,24,.5); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 100; }
.modal { background: #fff; border-radius: 14px; max-width: 520px; width: 100%; box-shadow: 0 24px 70px rgba(0,0,0,.35); max-height: 88vh; overflow-y: auto; }
.modal-head { padding: 20px 22px 8px; font-size: 17px; font-weight: 700; }
.modal-body { padding: 6px 22px 8px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.callout { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; }
.callout.warn { background: #fbf3e0; color: #7a5b12; border: 1px solid #ecd9a8; }
.callout.danger { background: #fdecea; color: #8a2822; border: 1px solid #f1c7c3; }
.callout.ok { background: #e6f4ec; color: #1f6b43; border: 1px solid #bfe2cd; }
.cred-box { background: var(--forest-deep); color: #cfe6d9; border-radius: 10px; padding: 14px 16px; font-size: 14px; }
.cred-box b { color: #fff; }
.toast-root { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.3); font-size: 13.5px; font-weight: 500; max-width: 360px; animation: rise .2s; }
.toast.ok { background: #1f6b43; } .toast.err { background: var(--danger); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* misc */
.rowflex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.kebab { position: relative; }
.kebab-cell { cursor: pointer; font-size: 18px; line-height: 1; color: var(--muted); user-select: none; }
.kebab-cell:hover { color: var(--ink); }
/* Menü fixiert am Viewport (nicht in der Tabelle) → wird NICHT vom overflow abgeschnitten. */
.menu { position: fixed; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 36px rgba(20,40,30,.24); min-width: 214px; max-height: 72vh; overflow-y: auto; z-index: 9999; }
.menu button { display: block; width: 100%; text-align: left; padding: 9px 14px; background: none; border: none; font: inherit; cursor: pointer; color: var(--ink); }
.menu button:hover { background: #f2f6f3; }
.menu button.danger { color: var(--danger); }
.menu .sep { height: 1px; background: var(--line); }
.tag { font-size: 11px; background: #eef2ef; color: #5c6b62; border-radius: 5px; padding: 2px 7px; font-weight: 600; }
label.chk { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; cursor: pointer; }

/* ── Testzugang (Cloudflare-Test-URL) ──────────────────────────────────────── */
.tz-card { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.tz-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tz-lbl { flex: 0 0 160px; color: var(--muted); font-weight: 600; font-size: 13px; }
.tz-url { flex: 1; min-width: 240px; user-select: all; word-break: break-all; }
.tz-sel { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); font-weight: 500; }
.tz-sel:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(61,107,79,.14); }

/* ── Dezente Hilfe-Tooltips (Hover/Fokus) für Felder ───────────────────────── */
.help { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 5px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 700; font-style: normal; line-height: 1; cursor: help; position: relative; vertical-align: middle; user-select: none; }
.help:hover, .help:focus-visible { border-color: var(--sage); color: var(--sage); outline: none; }
.help .tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.5; text-align: left; letter-spacing: 0; padding: 9px 11px; border-radius: 8px; width: max-content; max-width: 280px; box-shadow: 0 6px 22px rgba(20,40,30,.28); opacity: 0; visibility: hidden; transition: opacity .12s ease; z-index: 60; pointer-events: none; white-space: normal; }
.help .tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--ink); }
.help:hover .tip, .help:focus .tip, .help:focus-visible .tip { opacity: 1; visibility: visible; }
/* Am linken Rand nicht abschneiden */
.field .help .tip { left: 0; transform: none; }
.field .help .tip::after { left: 8px; transform: none; }
