/* =========================================================
   SHANOVA ADMIN — Control Panel
   admin.shanova.win
   Optisch und technisch getrennt von der öffentlichen Website.
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --bg:          #0A0D13;
  --bg-2:        #0E121A;
  --panel:       #121722;
  --panel-2:     #161C28;
  --panel-3:     #1B2230;
  --line:        rgba(255, 255, 255, 0.08);
  --line-2:      rgba(255, 255, 255, 0.14);

  --text:        #E7EAF0;
  --text-soft:   #AEB6C4;
  --text-muted:  #7C8598;

  --gold:        #C9A66B;
  --gold-light:  #E6D2A8;
  --gold-deep:   #A8854D;
  --grad-gold:   linear-gradient(135deg, #EDDCB6 0%, #C9A66B 45%, #A8854D 100%);

  --ok:          #3FB950;
  --ok-bg:       rgba(63, 185, 80, 0.13);
  --warn:        #D29922;
  --warn-bg:     rgba(210, 153, 34, 0.13);
  --err:         #F85149;
  --err-bg:      rgba(248, 81, 73, 0.13);
  --info:        #58A6FF;
  --info-bg:     rgba(88, 166, 255, 0.13);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --sidebar-w: 252px;
  --topbar-h: 62px;
  --radius: 11px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(201, 166, 107, 0.3); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); background-clip: content-box; }

/* =========================================================
   2. LOGIN
   ========================================================= */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(201, 166, 107, 0.11), transparent 62%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 404px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 38px 34px 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.login-head { text-align: center; margin-bottom: 30px; }
.login-head img { width: 62px; margin: 0 auto 16px; }
.login-head h1 {
  font-size: 1.04rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-head p { margin: 6px 0 0; font-size: 0.85rem; color: var(--text-muted); letter-spacing: 0.04em; }

.login-foot {
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 0.8rem; color: var(--text-muted);
}
.login-foot a:hover { color: var(--gold-light); }

.demo-hint {
  margin-top: 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.demo-hint code { color: var(--gold-light); font-family: var(--font-mono); }

/* =========================================================
   3. FORMULARE
   ========================================================= */
.field { margin-bottom: 17px; }
.field:last-child { margin-bottom: 0; }

.label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.input, .select, .textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 0.93rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: #5D6678; }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255,255,255,.22); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--panel);
}
.input[readonly], .input:disabled, .select:disabled {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
  cursor: not-allowed;
}
.input.is-invalid { border-color: var(--err); }

.textarea { min-height: 120px; resize: vertical; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.6; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C8598' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
  padding-right: 34px;
}

.hint { margin-top: 6px; font-size: 0.79rem; color: var(--text-muted); }
.error-text { margin-top: 6px; font-size: 0.79rem; color: var(--err); }

.field-preview {
  margin-top: 8px;
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px;
  background: rgba(201, 166, 107, 0.07);
  border: 1px solid rgba(201, 166, 107, 0.28);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--gold-light);
  word-break: break-all;
}
.field-preview .k {
  font-family: var(--font-sans);
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); flex: none;
}

.switch { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 40px; height: 22px; border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid var(--line-2);
  position: relative; flex: none;
  transition: background-color .18s ease, border-color .18s ease;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #9AA3B2; transition: transform .18s ease, background-color .18s ease;
}
.switch input:checked + .switch-track { background: rgba(63,185,80,.3); border-color: var(--ok); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--ok); }

/* =========================================================
   4. BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.885rem; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--grad-gold); color: #17120A; font-weight: 700; }
.btn--primary:not(:disabled):hover { filter: brightness(1.07); }

.btn--secondary { background: var(--panel-3); border-color: var(--line-2); color: var(--text); }
.btn--secondary:not(:disabled):hover { background: #222B3B; border-color: rgba(255,255,255,.22); }

.btn--ghost { border-color: var(--line-2); color: var(--text-soft); background: transparent; }
.btn--ghost:not(:disabled):hover { color: var(--text); border-color: rgba(255,255,255,.26); background: rgba(255,255,255,.04); }

.btn--danger { background: rgba(248,81,73,.12); border-color: rgba(248,81,73,.42); color: #FF8A82; }
.btn--danger:not(:disabled):hover { background: rgba(248,81,73,.2); }

.btn--sm { padding: 6px 11px; font-size: 0.81rem; border-radius: 7px; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg { padding: 12px 20px; font-size: 0.95rem; }
.btn--block { width: 100%; }

.btn--icon { padding: 7px; width: 32px; height: 32px; }
.btn--icon svg { width: 16px; height: 16px; }

.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 15px; height: 15px;
  border: 2px solid rgba(0,0,0,.25); border-top-color: rgba(0,0,0,.7);
  border-radius: 50%; animation: spin .6s linear infinite;
}
.btn--secondary.is-loading::after, .btn--ghost.is-loading::after, .btn--danger.is-loading::after {
  border-color: rgba(255,255,255,.25); border-top-color: #fff;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   5. APP-LAYOUT
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---- Sidebar ---- */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  z-index: 40;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.sidebar-brand img { width: 26px; }
.sidebar-brand .t { line-height: 1.2; }
.sidebar-brand .n {
  display: block;
  font-size: 0.9rem; letter-spacing: 0.17em; text-transform: uppercase;
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sidebar-brand .s { display: block; font-size: 0.66rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-group + .nav-group { margin-top: 22px; }
.nav-group h5 {
  font-size: 0.67rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 8px; padding-inline: 10px;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.9rem; font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
  cursor: pointer;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.045); color: var(--text); }
.nav-item.is-active {
  background: rgba(201,166,107,.12);
  color: var(--gold-light);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--gold);
}
.nav-item .badge { margin-left: auto; }

.sidebar-foot { flex: none; border-top: 1px solid var(--line); padding: 12px; }
.sidebar-foot .server {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--line);
  font-size: 0.78rem; color: var(--text-muted);
  font-family: var(--font-mono);
}
.sidebar-foot .server svg { width: 16px; height: 16px; flex: none; }

/* ---- Topbar ---- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(16px, 2.4vw, 28px);
  background: rgba(10, 13, 19, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 0.87rem; min-width: 0; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: #4C5566; }
.crumbs .cur { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.83rem;
  color: var(--text-soft);
}
.user-chip .av {
  width: 25px; height: 25px; border-radius: 50%;
  background: var(--grad-gold); color: #17120A;
  display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 800;
}

.menu-btn {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; color: var(--text);
  flex: none;
}
.menu-btn svg { width: 18px; height: 18px; }

/* ---- Content ---- */
.content { padding: clamp(20px, 2.6vw, 30px) clamp(16px, 2.4vw, 28px) 56px; flex: 1; min-width: 0; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px;
  margin-bottom: 24px;
}
.page-head .txt { min-width: 0; }
.page-head h1 { font-size: 1.42rem; }
.page-head p { margin: 5px 0 0; font-size: 0.89rem; color: var(--text-muted); }
.page-head .acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 9px; }

/* =========================================================
   6. BAUSTEINE
   ========================================================= */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.015);
}
.panel-head h2, .panel-head h3 { font-size: 0.95rem; }
.panel-head .acts { margin-left: auto; display: flex; gap: 8px; }
.panel-body { padding: 18px; }
.panel-body--flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }

/* ---- KPI-Kachel ---- */
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 18px;
  display: flex; align-items: flex-start; gap: 14px;
}
.kpi-ico {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(201,166,107,.1);
  border: 1px solid rgba(201,166,107,.26);
  color: var(--gold-light);
}
.kpi-ico svg { width: 18px; height: 18px; }
.kpi-ico.is-ok  { background: var(--ok-bg);  border-color: rgba(63,185,80,.35);  color: var(--ok); }
.kpi-ico.is-err { background: var(--err-bg); border-color: rgba(248,81,73,.35); color: var(--err); }
.kpi .v { font-size: 1.68rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.kpi .k { font-size: 0.79rem; color: var(--text-muted); letter-spacing: 0.04em; margin-top: 2px; }

/* ---- Status ---- */
.dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(255,255,255,.05);
}
.dot--ok   { background: var(--ok);   box-shadow: 0 0 0 3px var(--ok-bg); }
.dot--err  { background: var(--err);  box-shadow: 0 0 0 3px var(--err-bg); }
.dot--warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.dot--info { background: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; white-space: nowrap; }
.status--ok   { color: #7EE787; }
.status--err  { color: #FF9A93; }
.status--warn { color: #E8C877; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.735rem; font-weight: 650;
  letter-spacing: .02em;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line-2);
  color: var(--text-soft);
}
.badge--ok   { background: var(--ok-bg);   border-color: rgba(63,185,80,.35);  color: #7EE787; }
.badge--err  { background: var(--err-bg);  border-color: rgba(248,81,73,.35);  color: #FF9A93; }
.badge--warn { background: var(--warn-bg); border-color: rgba(210,153,34,.35); color: #E8C877; }
.badge--info { background: var(--info-bg); border-color: rgba(88,166,255,.35); color: #90CAFF; }
.badge--gold { background: rgba(201,166,107,.12); border-color: rgba(201,166,107,.4); color: var(--gold-light); }
.badge svg { width: 13px; height: 13px; flex: none; }

/* Textlink in Tabellen (nicht monospace) */
.link { color: var(--gold-light); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.mono { font-family: var(--font-mono); font-size: 0.855rem; }
.muted { color: var(--text-muted); }
.path { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); }

.url-link { color: var(--gold-light); font-family: var(--font-mono); font-size: 0.85rem; }
.url-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Tabelle ---- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.885rem; }
table.tbl th {
  text-align: left;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-muted);
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.015);
  white-space: nowrap;
}
table.tbl td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background-color .13s ease; }
table.tbl tbody tr:hover { background: rgba(255,255,255,.028); }
table.tbl .col-actions { text-align: right; white-space: nowrap; }
table.tbl .row-title { font-weight: 620; color: var(--text); }
table.tbl .row-sub { font-size: 0.8rem; color: var(--text-muted); }
table.tbl tr.is-clickable { cursor: pointer; }

.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }

/* ---- Webapp-Karten ---- */
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 15px; }
.app-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 18px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .16s ease, background-color .16s ease;
  cursor: pointer;
}
.app-card:hover { border-color: rgba(201,166,107,.38); background: var(--panel-2); }
.app-card .top { display: flex; align-items: flex-start; gap: 10px; }
.app-card h3 { font-size: 1rem; }
.app-card .top .badge { margin-left: auto; }
.app-card .meta { display: grid; gap: 5px; font-size: 0.82rem; }
.app-card .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

/* ---- Systemliste ---- */
.svc-list { display: grid; }
.svc {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.svc:last-child { border-bottom: 0; }
.svc .n { font-weight: 600; }
.svc .d { font-size: 0.8rem; color: var(--text-muted); }
.svc .r { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.meter { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--grad-gold); }
.meter i.is-warn { background: linear-gradient(90deg, #D29922, #E8C877); }
.meter i.is-err { background: linear-gradient(90deg, #F85149, #FF9A93); }

.metric { display: grid; gap: 8px; }
.metric .row { display: flex; align-items: baseline; gap: 8px; font-size: 0.83rem; }
.metric .row .v { margin-left: auto; font-family: var(--font-mono); color: var(--text); }

/* ---- Logs ---- */
.logs {
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.85;
  max-height: 320px;
  overflow: auto;
  padding: 14px 18px;
  background: #080B10;
}
.logs .ln { display: flex; gap: 12px; white-space: pre-wrap; word-break: break-word; }
.logs .ts { color: #566072; flex: none; }
.logs .lv { flex: none; width: 46px; }
.logs .lv--info { color: var(--info); }
.logs .lv--ok { color: var(--ok); }
.logs .lv--warn { color: var(--warn); }
.logs .lv--err { color: var(--err); }
.logs .msg { color: var(--text-soft); }

/* ---- Dateiverwaltung ---- */
.fm-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.015);
}
.fm-path {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.84rem;
  min-width: 0; flex-wrap: wrap;
}
.fm-path a { color: var(--text-muted); }
.fm-path a:hover { color: var(--gold-light); }
.fm-path .sep { color: #4C5566; }
.fm-path .cur { color: var(--text); }
.fm-bar .acts { margin-left: auto; display: flex; gap: 8px; }

.fm-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fm-name svg { width: 17px; height: 17px; flex: none; }
.fm-name .dir { color: var(--gold); }
.fm-name .file { color: var(--text-muted); }
.fm-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drop-zone {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.87rem;
  transition: border-color .15s ease, background-color .15s ease;
}
.drop-zone.is-over { border-color: var(--gold); background: rgba(201,166,107,.07); color: var(--gold-light); }

/* ---- Editor ---- */
.code-editor {
  width: 100%;
  min-height: 46vh;
  background: #080B10;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.7;
  tab-size: 2;
  resize: vertical;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}
.code-editor:focus { outline: none; border-color: var(--gold); }

/* ---- Leerzustand ---- */
.empty { text-align: center; padding: 52px 24px; }
.empty svg { width: 40px; height: 40px; color: var(--text-muted); margin: 0 auto 14px; opacity: .55; }
.empty h3 { font-size: 1rem; margin-bottom: 5px; }
.empty p { font-size: 0.87rem; color: var(--text-muted); max-width: 42ch; margin-inline: auto; }
.empty .btn { margin-top: 18px; }

/* ---- Skeleton ---- */
.skel { border-radius: 7px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.1), rgba(255,255,255,.05)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-row { height: 52px; margin: 0 0 1px; }

/* ---- Hinweisbox ---- */
.callout {
  display: flex; gap: 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 0.855rem;
  color: var(--text-soft);
  background: rgba(255,255,255,.025);
}
.callout svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.callout--info { border-color: rgba(88,166,255,.32); background: var(--info-bg); }
.callout--info svg { color: var(--info); }
.callout--warn { border-color: rgba(210,153,34,.32); background: var(--warn-bg); }
.callout--warn svg { color: var(--warn); }
.callout strong { color: var(--text); }

/* ---- Beschreibungsliste ---- */
.dl { display: grid; gap: 0; }
.dl .r { display: flex; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.dl .r:last-child { border-bottom: 0; }
.dl dt { flex: none; width: 150px; font-size: 0.82rem; color: var(--text-muted); }
.dl dd { margin: 0; min-width: 0; word-break: break-word; }

/* =========================================================
   7. MODAL / TOAST
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 30px 70px rgba(0,0,0,.6);
  margin: auto;
  animation: pop .16s ease-out;
}
.modal--wide { max-width: 880px; }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }

.modal-head { display: flex; align-items: center; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 1rem; }
.modal-head .x {
  margin-left: auto; width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-muted);
  border-radius: 7px; cursor: pointer;
}
.modal-head .x:hover { background: rgba(255,255,255,.07); color: var(--text); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; padding: 15px 20px; border-top: 1px solid var(--line); background: rgba(255,255,255,.015); }

.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: grid; gap: 9px; max-width: min(380px, calc(100vw - 36px));
}
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 15px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 34px rgba(0,0,0,.5);
  font-size: 0.87rem;
  animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { transform: translateX(14px); opacity: 0; } }
.toast--ok   { border-left-color: var(--ok); }
.toast--err  { border-left-color: var(--err); }
.toast--info { border-left-color: var(--info); }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.toast--ok svg { color: var(--ok); }
.toast--err svg { color: var(--err); }
.toast--info svg { color: var(--info); }

/* =========================================================
   8. RESPONSIVE
   ========================================================= */
.scrim { display: none; }

@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--main { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: 272px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.5);
  }
  .sidebar.is-open { transform: translateX(0); }

  .scrim {
    display: block;
    position: fixed; inset: 0; z-index: 35;
    background: rgba(4,6,10,.6);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  .scrim.is-visible { opacity: 1; pointer-events: auto; }

  .menu-btn { display: inline-flex; }
  .user-chip .nm { display: none; }
}

@media (max-width: 680px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }

  /* Kopfzeile entschlacken: nur die aktuelle Ebene, keine Nebenaktionen */
  .crumbs > *:not(.cur) { display: none; }
  .crumbs .cur { font-size: 0.95rem; }
  .topbar-actions .badge,
  .topbar-actions .btn--ghost.btn--sm { display: none; }
  .user-chip { border: 0; padding: 0; }

  .page-head .acts { margin-left: 0; width: 100%; }
  .page-head .acts .btn { flex: 1; }
  table.tbl th, table.tbl td { padding-inline: 13px; }
  .content { padding-bottom: 40px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .toasts { left: 14px; right: 14px; bottom: 14px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
