/* Gestaltung nach dem Dashboard des Werkstatttools.
   Farben und Variablennamen aus frontend/src/store/settingsStore.ts (DEFAULTS.theme),
   Hintergrundbild, Blur und Panel-Optik aus applyTheme() bzw. Header.tsx:
   fixierter Bildlayer mit blur(20px), darueber halbtransparente Flaechen. */
:root {
  --wt-bg: #ffffff;
  --wt-card: #ffffff;
  --wt-text: #0b213c;
  --wt-muted: #000000;
  --wt-border: #c4c4c4;
  --wt-accent: #ffae00;
  --wt-accent2: #42d0ff;
  --wt-success: #00a862;
  --wt-danger: #d92d20;
  --wt-radius: 0.75rem;

  /* Glasflaechen: entsprechen .bg-white/5 und .bg-white/10 nach applyTheme */
  --wt-panel: rgb(255 255 255 / .60);
  --wt-panel-strong: rgb(255 255 255 / .90);
  --wt-hairline: rgb(11 33 60 / .10);
}

* { box-sizing: border-box; }

/* Bildlayer wie in der App: inset = -2 x Blur, damit die Raender nicht ausfransen.
   Bewusst ein echtes Element mit z-index 0 statt ::before mit z-index -1: negative
   Werte verschwinden hinter dem Wurzelhintergrund, sobald irgendein Elternelement
   einen Stapelkontext aufmacht. Der Inhalt liegt per z-index 1 darueber. */
.bg-layer {
  position: fixed;
  inset: -40px;
  z-index: 0;
  background-image: url('/hintergrund.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(20px);
  pointer-events: none;
}
/* Ebenen einzeln setzen statt pauschal ueber body > *: eine Sammelregel haette
   hoehere Spezifitaet als .header und dessen position:sticky ueberschrieben. */
main, .footer { position: relative; z-index: 1; }

body {
  margin: 0;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--wt-text);
  font-weight: 400;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
}
code, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── Kopfzeile: halbtransparent mit Weichzeichnung wie Header.tsx ── */
.header {
  position: sticky; top: 0; z-index: 41;
  height: 4rem;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--wt-panel-strong);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--wt-hairline);
}
.brand { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.brand .a { color: var(--wt-accent); }
.brand .b { color: var(--wt-accent2); }
.header nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.header nav a {
  color: var(--wt-text); text-decoration: none; font-weight: 500; opacity: .7;
  padding: .25rem 0; border-bottom: 2px solid transparent;
}
.header nav a:hover { opacity: 1; }
.header nav a.active { opacity: 1; border-bottom-color: var(--wt-accent); }

main { flex: 1; width: 100%; max-width: 58rem; margin: 0 auto; padding: 2.5rem 1.5rem 3rem; }
main.wide { max-width: 80rem; }

h1 { font-size: 2rem; font-weight: 600; margin: 0 0 .5rem; letter-spacing: -0.025em; }
h2 { font-size: 1.1875rem; font-weight: 600; margin: 2.25rem 0 .875rem; letter-spacing: -0.01em; }
.lead { color: rgb(11 33 60 / .70); margin: 0 0 2rem; font-size: 1.0625rem; max-width: 44rem; }

/* ── Flaechen: Glasoptik wie die Board-Spalten, mit Akzentstreifen oben ── */
.card {
  position: relative;
  background: var(--wt-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--wt-hairline);
  border-radius: var(--wt-radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgb(11 33 60 / .07);
  overflow: hidden;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
/* Farbiger Streifen am oberen Rand – wie der Spaltenkopf im Board */
.card.accent::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--wt-accent), var(--wt-accent2));
}
.card.accent { padding-top: 1.75rem; }

label { display: block; font-weight: 500; margin-bottom: .375rem; font-size: .9375rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%;
  padding: .6875rem .875rem;
  border: 1px solid var(--wt-border);
  border-radius: .5rem;
  background: rgb(255 255 255 / .92);
  color: var(--wt-text);
  font-family: inherit;
  font-size: 1rem;
}
textarea { min-height: 10rem; resize: vertical; font-family: 'JetBrains Mono', monospace; font-size: .875rem; line-height: 1.65; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--wt-accent); outline-offset: 1px;
  border-color: var(--wt-accent); background: #fff;
}
.field { margin-bottom: 1.25rem; }
.hint { font-size: .8125rem; color: rgb(11 33 60 / .60); margin-top: .375rem; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6875rem 1.25rem;
  border: 1px solid transparent; border-radius: .5rem;
  background: var(--wt-accent); color: #0b213c;
  font-family: inherit; font-size: .9375rem; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: filter .15s, transform .05s;
}
button:hover, .btn:hover { filter: brightness(.93); }
button:active, .btn:active { transform: translateY(1px); }
.btn-secondary { background: rgb(255 255 255 / .75); border-color: var(--wt-border); color: var(--wt-text); }
.btn-danger { background: var(--wt-danger); color: #fff; }
.btn-sm { padding: .4375rem .8125rem; font-size: .8125rem; }
button:disabled { opacity: .45; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: .8125rem .625rem; border-bottom: 1px solid var(--wt-hairline); vertical-align: middle; }
th { font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: rgb(11 33 60 / .55); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgb(255 255 255 / .45); }
.table-wrap { overflow-x: auto; margin: 0 -1.5rem -1.5rem; padding: 0 1.5rem; }

.badge { display: inline-block; padding: .1875rem .5625rem; border-radius: 9999px; font-size: .75rem; font-weight: 600; }
.badge-ok { background: rgb(0 168 98 / .14); color: #00713f; }
.badge-warn { background: rgb(255 174 0 / .22); color: #8a5d00; }
.badge-danger { background: rgb(217 45 32 / .12); color: var(--wt-danger); }

.notice {
  border-radius: var(--wt-radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem;
  border: 1px solid; background: var(--wt-panel-strong);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.notice-ok { border-color: rgb(0 168 98 / .40); }
.notice-err { border-color: rgb(217 45 32 / .40); }
.notice-warn { border-color: rgb(255 174 0 / .55); }
.notice p:first-child { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }

.creds {
  background: rgb(255 255 255 / .85);
  border: 1px solid rgb(255 174 0 / .45);
  border-left: 4px solid var(--wt-accent);
  border-radius: var(--wt-radius); padding: 1.25rem 1.5rem; margin: 1.5rem 0;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.creds dl { display: grid; grid-template-columns: auto 1fr; gap: .625rem 1.5rem; margin: 0; }
.creds dt { font-weight: 600; color: rgb(11 33 60 / .70); }
.creds dd { margin: 0; font-family: 'JetBrains Mono', monospace; font-size: .9375rem; word-break: break-all; }

.footer {
  padding: 1.25rem 1.5rem;
  font-size: .875rem;
  background: var(--wt-panel-strong);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid var(--wt-hairline);
  color: rgb(11 33 60 / .65);
  display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap;
}
.footer a { color: inherit; text-decoration: none; border-bottom: 1px solid rgb(11 33 60 / .25); }
.footer a:hover { color: var(--wt-accent); border-bottom-color: var(--wt-accent); }

.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
/* Spaltenraster wie das Board */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.cols .card { margin-bottom: 0; }
.stat { font-size: 2.25rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
.stat-label { font-size: .8125rem; color: rgb(11 33 60 / .65); margin-top: .25rem; }
ul.plain { margin: .5rem 0 0; padding-left: 1.25rem; }
ul.plain li { margin-bottom: .375rem; }

@media (max-width: 40rem) {
  main { padding: 1.5rem 1rem 2rem; }
  .header { padding: 0 1rem; }
  h1 { font-size: 1.625rem; }
  .creds dl { grid-template-columns: 1fr; gap: .25rem; }
  .creds dt { margin-top: .625rem; }
  .table-wrap { margin: 0 -1rem -1rem; padding: 0 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  button, .btn { transition: none; }
}
