/* ADVEMA Studio — dunkles Admin-Design. Eigenständig (nicht das Kunden-Template).
   Kontraste auf WCAG 2.1 AA geprüft (heller Text auf dunklem Grund). */

:root {
  --bg: #0b0d10;
  --flaeche: #14181d;
  --flaeche-2: #1b2027;
  --linie: #2b323b;
  --text: #eaedf1;      /* ~15:1 auf --bg */
  --text-leise: #a7b0ba; /* ~7:1 auf --bg — AA */
  --akzent: #5aa9e6;     /* Links/Fokus, hell genug für dunklen Grund */
  --akzent-text: #8ec5f0;
  --ok: #3ecf8e;
  --warnung: #f0b34e;
  --fehler: #ff6b6b;
  --radius: 12px;
  --radius-s: 8px;
  --touch: 44px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

a { color: var(--akzent-text); }
a:hover { color: #fff; }

:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; color: var(--text-leise); }

/* --- Kopf/Nav --- */
.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 10;
}
.kopf__logo img { display: block; height: 26px; width: auto; }
.kopf__nav { display: flex; align-items: center; gap: 0.5rem; }
.kopf__nav a {
  display: inline-flex; align-items: center; min-height: var(--touch);
  padding: 0 0.9rem; border-radius: var(--radius-s); text-decoration: none;
  color: var(--text); font-weight: 600;
}
.kopf__nav a:hover { background: var(--flaeche-2); }
.kopf__logout { margin: 0; }

.inhalt { max-width: 62rem; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--touch); padding: 0 1.1rem; gap: 0.4rem;
  border-radius: var(--radius-s); border: 1px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn--hell { background: #fff; color: #12151a; }
.btn--hell:hover { background: #e6e9ee; color: #12151a; }
.btn--geist { background: transparent; color: var(--text); border-color: var(--linie); }
.btn--geist:hover { background: var(--flaeche-2); color: #fff; }
.btn--klein { min-height: 36px; padding: 0 0.75rem; font-size: 0.9rem; background: var(--flaeche-2); color: var(--text); border-color: var(--linie); }
.btn--klein:hover { background: #232a33; color: #fff; }

/* --- Login (Vollbild) --- */
.login {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: 1.5rem; overflow: hidden;
  background:
    radial-gradient(90% 60% at 50% -15%, #121a24 0%, transparent 60%),
    radial-gradient(80% 50% at 85% 115%, #0d1622 0%, transparent 55%),
    #05070a;
}
/* Feines Raster über dem ganzen Hintergrund. */
.login::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 0%, transparent 85%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 0%, transparent 85%);
}
/* Blauer Glow oben. */
.login__glanz {
  position: absolute; inset: -25% 0 auto 0; height: 70vh; pointer-events: none;
  background: radial-gradient(46% 60% at 50% 0%, rgba(90,169,230,0.22) 0%, transparent 72%);
  filter: blur(6px);
}
.login__karte {
  position: relative; width: 100%; max-width: 25.5rem;
  background:
    linear-gradient(180deg, rgba(90,169,230,0.12), transparent 22%),
    linear-gradient(180deg, #191f27 0%, #10141a 100%);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 20px;
  padding: 2.75rem 2.4rem 2.4rem;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 50px 100px -35px rgba(0,0,0,0.9),
    0 0 0 1px rgba(0,0,0,0.4);
}
.login__logo { display: block; height: 34px; width: auto; margin-bottom: 1.6rem; }
.login__titel { font-size: 1.5rem; margin: 0 0 0.4rem; letter-spacing: -0.02em; line-height: 1.2; }
.login__unter { color: var(--text-leise); margin: 0 0 1.9rem; font-size: 0.95rem; }
.login__unter strong { color: var(--text); }
.login__form { display: flex; flex-direction: column; gap: 1.05rem; }
.login__form input { background: rgba(12,16,22,0.7); }
.login__form input:focus-visible { background: #0c1016; }
.login__form .btn { width: 100%; margin-top: 0.6rem; height: 3rem; }

/* --- Felder/Formulare --- */
.feld { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.feld label { font-weight: 600; color: #d7dde3; font-size: 0.92rem; }
input, textarea, select {
  font: inherit; color: var(--text);
  background: var(--flaeche-2); border: 1px solid var(--linie);
  border-radius: var(--radius-s); padding: 0.6rem 0.7rem; min-height: var(--touch);
}
input:hover, textarea:hover, select:hover { border-color: #3a434e; }
textarea { min-height: auto; resize: vertical; line-height: 1.5; }
textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85rem; }
select { appearance: none; }
.feld--check { flex-direction: row; align-items: center; gap: 0.6rem; }
.feld--check input { min-height: auto; width: 1.2rem; height: 1.2rem; }
.feld--check label { font-weight: 500; color: var(--text); }

.formular { margin: 1.5rem 0; }
fieldset {
  border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1.25rem; margin: 0 0 1.25rem; background: var(--flaeche);
}
legend { padding: 0 0.5rem; font-weight: 700; color: #fff; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1rem; }
.aktionen { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hinweis { color: var(--text-leise); font-size: 0.9rem; }

.roh { margin-top: 1.5rem; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); }
.roh > summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 700; }
.roh > .formular { padding: 0 1.25rem 1.25rem; margin: 0; }

/* --- Kopfzeile/Überschriften --- */
.seitenkopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
h1 { font-size: 1.8rem; margin: 0.2rem 0; letter-spacing: -0.01em; }
.krumen { color: var(--text-leise); font-size: 0.9rem; margin: 0; }
.krumen a { color: var(--text-leise); }
.kunde-id { color: var(--text-leise); font-size: 0.9rem; margin: 0.2rem 0 0; }

/* --- Tabelle --- */
.tabelle-wrap { overflow-x: auto; border: 1px solid var(--linie); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; min-width: 40rem; }
.tabelle th, .tabelle td { text-align: left; padding: 0.8rem 1rem; border-bottom: 1px solid var(--linie); }
.tabelle thead th { background: var(--flaeche-2); color: var(--text-leise); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle tbody tr:hover { background: var(--flaeche); }
.tabelle__name { font-weight: 700; text-decoration: none; color: #fff; display: block; }
.tabelle__name:hover { color: var(--akzent-text); }
.tabelle__id { color: var(--text-leise); font-size: 0.8rem; }
.tabelle__aktion { text-align: right; }

/* --- Tags/Meldungen --- */
.tag { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.tag--ok { background: rgba(62,207,142,0.15); color: var(--ok); }
.tag--warnung { background: rgba(240,179,78,0.15); color: var(--warnung); }
.tag--fehler { background: rgba(255,107,107,0.15); color: var(--fehler); }

/* --- Build/Deploy-Panel --- */
.panel {
  border: 1px solid var(--linie); border-radius: var(--radius);
  background: var(--flaeche); padding: 1.25rem; margin: 0 0 1.5rem;
}
.panel h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.panel .tabelle-wrap { margin-top: 1rem; }
.panel .tabelle { min-width: 34rem; }
.log {
  margin: 0.5rem 0 0; max-height: 16rem; overflow: auto;
  background: var(--bg); border: 1px solid var(--linie); border-radius: var(--radius-s);
  padding: 0.75rem; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem; color: var(--text-leise); white-space: pre-wrap; word-break: break-word;
}
details summary { cursor: pointer; color: var(--akzent-text); }
.meldung { padding: 0.8rem 1rem; border-radius: var(--radius-s); border: 1px solid var(--linie); font-weight: 600; margin: 0 0 1.25rem; }
.meldung--ok { background: rgba(62,207,142,0.12); border-color: rgba(62,207,142,0.4); color: var(--ok); }
.meldung--fehler { background: rgba(255,107,107,0.1); border-color: rgba(255,107,107,0.4); color: var(--fehler); }
.leer { color: var(--text-leise); }

@media (max-width: 40rem) {
  .kopf { padding: 0.75rem 1rem; }
  .inhalt { padding: 1.25rem 1rem 3rem; }
}
