/* ============================================================================
   DWL Studio — Decide with Light · Design-System
   Idee: Login = „Laden bei Nacht" (Ink), App = helle Arbeitsfläche mit
   Ink-Sidebar. Signatur: der leuchtende LED-Punkt als Statusanzeige und
   als Punkt der Wortmarke DWL·Studio. Akzent: LED-Bernstein.
   ========================================================================== */

:root {
  /* Farbwelt */
  --ink-950: #101216;         /* Login-Hintergrund */
  --ink-900: #15171c;         /* Sidebar */
  --ink-800: #1e2128;         /* Karten auf Ink, Hover */
  --ink-700: #2a2e37;         /* Linien auf Ink */
  --paper:   #f5f5f2;         /* Arbeitsfläche */
  --card:    #ffffff;
  --line:    #e5e5df;
  --text:    #1d2025;
  --text-mut:#68707e;
  --text-inv:#f2f3f5;         /* Text auf Ink */
  --text-inv-mut:#9aa1ad;

  /* LED-Bernstein = Marke + Primäraktion */
  --amber:      #e79a1b;
  --amber-deep: #c07f0e;
  --amber-glow: rgba(231, 154, 27, .45);
  --on-amber:   #201400;

  /* LED-Status */
  --led-on:   #35b268;
  --led-glow: rgba(53, 178, 104, .5);

  --danger:      #d6494f;
  --danger-deep: #b93a40;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-card: 0 1px 2px rgba(20, 22, 26, .06), 0 4px 16px rgba(20, 22, 26, .05);
  --shadow-pop:  0 8px 40px rgba(16, 18, 22, .35);

  --font: 'Noto Sans', -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.25; }
a { color: inherit; }
button { font-family: inherit; }
/* Inline-Textlinks in der Arbeitsfläche dauerhaft als Link erkennbar (nicht erst bei Hover) */
.main a:not(.btn):not(.subtab):not(.iconbtn):not(.rowlink) { color: var(--amber-deep); text-decoration: underline; text-underline-offset: 2px; }
.page-head .sub a { color: var(--amber-deep); text-decoration: underline; text-underline-offset: 2px; }
.rowlink { text-underline-offset: 2px; }

/* Sichtbarer Tastatur-Fokus überall */
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

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

/* ============================================================================
   Marke: Bildmarke „Regalreihe" (Tile) + Wortmarke DWL Studio.
   Drei Produkte im Regal — das Licht entscheidet.
   ========================================================================== */
.brand { display: flex; align-items: center; gap: 13px; user-select: none; }
.brand .brandmark { width: 46px; height: 46px; flex: 0 0 auto; }
.brand .brandmark .ledpulse { animation: ledpulse 3.2s ease-in-out infinite; }
@keyframes ledpulse {
  0%, 100% { opacity: .65; }
  50%      { opacity: 1; }
}
.brand .mark { display: flex; align-items: baseline; gap: 7px; }
.brand .mark b {
  font-size: 22px; font-weight: 700; letter-spacing: .04em; color: var(--text-inv);
}
.brand .mark span {
  font-size: 22px; font-weight: 300; letter-spacing: .02em; color: var(--text-inv-mut);
}
.brand .claim {
  font-size: 10.5px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-inv-mut); margin-top: 1px;
}

/* ============================================================================
   LED-Statuspunkt (Signatur-Element): Aktiv/Inaktiv als leuchtende LED.
   Als <button class="led-toggle"> schaltbar, mit Text-Label daneben —
   Status hängt nie an Farbe allein.
   ========================================================================== */
.led-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: none; padding: 6px 8px; margin: -6px -8px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; color: var(--text-mut);
}
.led-toggle:hover { background: rgba(20, 22, 26, .05); }
.led-toggle .led {
  width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
  background: var(--led-on);
  box-shadow: 0 0 8px 2px var(--led-glow);
}
.led-toggle.off .led {
  background: transparent;
  border: 2px solid #c3c6c1;
  box-shadow: none;
  width: 6px; height: 6px;
}
.led-toggle[disabled] { cursor: default; opacity: .55; }
.led-toggle[disabled]:hover { background: none; }

/* ============================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border: 0; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s ease, transform .1s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amber); color: var(--on-amber); }
.btn-primary:hover { background: var(--amber-deep); }
.btn-ghost {
  background: none; color: var(--text); font-weight: 400;
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(20, 22, 26, .04); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-deep); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn[disabled]:hover { background: var(--amber); }
.btn-ghost[disabled]:hover { background: none; }
.btn .spin { display: none; }
.btn.busy .spin { display: inline-block; }
.btn.busy .btn-label { opacity: .6; }
.spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Icon-Knopf in Tabellenzeilen */
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-mut); cursor: pointer; font-size: 15px;
}
.iconbtn:hover { background: rgba(20, 22, 26, .06); color: var(--text); }
.iconbtn.danger:hover { background: rgba(214, 73, 79, .1); color: var(--danger); }
.iconbtn svg { width: 16px; height: 16px; }

/* ============================================================================
   Formulare
   ========================================================================== */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 700; color: var(--text);
}
.field .hint { font-size: 12.5px; color: var(--text-mut); margin-top: 5px; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field select {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text);
  font-family: inherit; font-size: 14.5px;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(231, 154, 27, .18);
}
.field input.mono { font-family: var(--mono); font-size: 13.5px; }
.field .error-text { font-size: 12.5px; color: var(--danger); margin-top: 5px; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--amber); cursor: pointer; }

.formmsg {
  display: none; margin-bottom: 16px; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: 13.5px;
}
.formmsg.error { display: block; background: rgba(214, 73, 79, .1); color: #b23238; }

/* ============================================================================
   Login — „Laden bei Nacht"
   ========================================================================== */
body.login-page {
  background: var(--ink-950);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--ink-800);
  border: 1px solid var(--ink-700);
  border-radius: 14px;
  padding: 36px 36px 30px;
  box-shadow: var(--shadow-pop);
}
.login-card .brand { margin-bottom: 30px; }
.login-card h1 { font-size: 16px; font-weight: 400; color: var(--text-inv-mut); margin-bottom: 22px; }
.login-card .field label { color: var(--text-inv); }
.login-card .field input {
  background: var(--ink-900); border-color: var(--ink-700); color: var(--text-inv);
}
.login-card .field input:focus { border-color: var(--amber); }
.login-card .btn-primary { width: 100%; margin-top: 6px; }
.login-card .formmsg.error { background: rgba(214, 73, 79, .16); color: #f0a2a5; }
.login-foot {
  margin-top: 26px; text-align: center;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-inv-mut); opacity: .7;
}

/* ============================================================================
   App-Shell: Ink-Sidebar + helle Arbeitsfläche
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex: 0 0 236px;
  background: var(--ink-900); color: var(--text-inv);
  display: flex; flex-direction: column;
  padding: 22px 14px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 0 10px 22px; gap: 10px; }
.sidebar .brand .brandmark { width: 38px; height: 38px; }
.sidebar .brand .mark b, .sidebar .brand .mark span { font-size: 17px; }
.sidebar .brand .claim { font-size: 8.5px; }

.nav-group {
  margin: 14px 10px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-inv-mut);
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 10px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-inv-mut); text-decoration: none; font-size: 14px;
}
.nav a svg { width: 17px; height: 17px; flex: 0 0 auto; }
.nav a:hover { background: var(--ink-800); color: var(--text-inv); }
.nav a.active { background: var(--ink-800); color: var(--text-inv); font-weight: 700; }
.nav a.active svg { color: var(--amber); }

.sidebar .foot { margin-top: auto; border-top: 1px solid var(--ink-700); padding-top: 12px; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.userchip .avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
  background: var(--ink-700); color: var(--text-inv);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.userchip .who { min-width: 0; }
.userchip .who .n {
  font-size: 13.5px; color: var(--text-inv);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.userchip .who .r { font-size: 11.5px; color: var(--text-inv-mut); }
.foot-actions { display: flex; gap: 2px; padding: 6px 6px 0; }
.foot-actions button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-inv-mut); font-size: 12.5px; cursor: pointer;
}
.foot-actions button:hover { background: var(--ink-800); color: var(--text-inv); }
.foot-actions svg { width: 14px; height: 14px; }

.main { flex: 1; min-width: 0; padding: 34px 40px 60px; }
/* Platz für das Übernahme-Banner schaffen, wenn aktiv */
body.imp-on .main { padding-top: 60px; }

/* Benutzer-Übernahme-Banner (fixiert am oberen Rand) */
.imp-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 10px 18px; background: #7a3ea8; color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  font-size: 14px;
}
.imp-txt { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; justify-content: center; }
.imp-sub { opacity: .8; font-size: 12.5px; }
.btn-small { padding: 6px 12px; font-size: 13px; background: rgba(255,255,255,.16); color: #fff; }
.btn-small:hover { background: rgba(255,255,255,.28); }

/* Optional-Label + Projekt-Zuordnung im Benutzerformular */
.lbl-opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.proj-assign { display: flex; flex-direction: column; gap: 6px; margin-top: 6px;
  max-height: 180px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.proj-check { margin: 0; }

/* Produkt-zu-Produkt-Navigation im Editor */
.prodnav { display: flex; align-items: center; gap: 10px; }
.prodnav .iconbtn { font-size: 16px; font-weight: 700; }
.prodnav .iconbtn.disabled { opacity: .3; pointer-events: none; }
.prodnav-pos { font-size: 13px; color: var(--muted); min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }

/* Setup-Sub-Tabs: Funktionen / Design */
.subtabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 22px;
  background: var(--surface-2, #f1f1ec); border-radius: 10px; }
.subtab { border: 0; background: none; cursor: pointer; padding: 8px 18px; border-radius: 7px;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--muted); transition: background .12s ease, color .12s ease; }
.subtab:hover { color: var(--text); }
.subtab.active { background: var(--card, #fff); color: var(--text); box-shadow: 0 1px 3px rgba(16,18,22,.12); }
.subsec { display: none; }
.subsec.active { display: block; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 24px;
}
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head .sub { font-size: 14px; color: var(--text-mut); margin-top: 4px; }

/* ============================================================================
   Karten, Tabellen, Badges
   ========================================================================== */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 12px 18px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-mut); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  vertical-align: middle; font-size: 14px;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafaf7; }
.table .t-actions { text-align: right; white-space: nowrap; width: 1%; }
.table .t-num { color: var(--text-mut); }

.cell-main { font-weight: 700; }
.cell-sub { font-size: 12.5px; color: var(--text-mut); margin-top: 1px; }

.chip {
  display: inline-block; padding: 2px 8px;
  font-family: var(--mono); font-size: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 5px;
  color: var(--text-mut);
}

.badge {
  display: inline-block; padding: 3px 10px;
  font-size: 12px; font-weight: 700; border-radius: 20px;
}
.badge.superadmin { background: rgba(231, 154, 27, .14); color: #a06a08; }
.badge.admin { background: rgba(20, 22, 26, .08); color: var(--text); }
.badge.editor { background: rgba(20, 22, 26, .05); color: var(--text-mut); }

/* Leerer Zustand: einladen, nicht nur konstatieren */
.empty {
  padding: 56px 24px; text-align: center; color: var(--text-mut);
}
.empty .led-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.empty .led-row i {
  width: 8px; height: 8px; border-radius: 50%;
  background: transparent; border: 2px solid #c3c6c1;
}
.empty .led-row i.on { background: var(--amber); border: 0; width: 12px; height: 12px; box-shadow: 0 0 10px 2px var(--amber-glow); }
.empty h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty p { margin: 0 0 18px; font-size: 14px; }

/* Kacheln (Übersicht) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tile { padding: 22px; }
.tile .v { font-size: 32px; font-weight: 700; line-height: 1.1; }
.tile .l { font-size: 13px; color: var(--text-mut); margin-top: 4px; }
.fl-tile.ok { border-top: 3px solid #35b268; }
.fl-tile.warn { border-top: 3px solid var(--amber); }

/* Status-Chips (Fleet & Freigabe) */
.chip.ok { background: rgba(53, 178, 104, .16); color: #2e7d46; }
.chip.warn { background: rgba(231, 154, 27, .18); color: #9a6a10; }

/* Upload-Fortschritt (floating unten rechts) */
.upload-progress {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 320px; max-width: calc(100vw - 40px);
  background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(16,18,22,.22); padding: 14px 16px;
}
.upload-progress .up-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.upload-progress .up-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress .up-count { font-size: 12px; color: var(--muted); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.upload-progress .up-bar { height: 8px; background: var(--paper, #f1f1ec); border-radius: 6px; overflow: hidden; }
.upload-progress .up-fill { height: 100%; background: var(--amber); border-radius: 6px; transition: width .15s ease; }
.upload-progress .up-sub { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* Freigabe-Diff */
.diff-box .diff-sec { margin-bottom: 14px; }
.diff-box .diff-h { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.diff-box ul { margin: 0; padding-left: 20px; }
.diff-box li { font-size: 14px; color: var(--text-mut); margin: 2px 0; }

.note {
  margin-top: 24px; padding: 16px 18px;
  border-left: 3px solid var(--amber);
}
.note h3 { font-size: 14px; margin-bottom: 4px; }
.note p { margin: 0; font-size: 13.5px; color: var(--text-mut); }

/* ============================================================================
   Inhalte: Produkte + Eigenschaften
   ========================================================================== */
.head-actions { display: flex; align-items: center; gap: 12px; }
.co-select {
  height: 40px; padding: 0 12px; min-width: 180px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); font-family: inherit; font-size: 14px;
}
.co-select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(231, 154, 27, .18); }

.thumb {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  background: var(--paper); border: 1px solid var(--line);
}
.thumb.empty { color: #c3c6c1; }
.thumb.empty svg { width: 20px; height: 20px; }
.table .t-thumb { width: 1%; padding-right: 6px; }
.table .t-grip { width: 1%; padding: 0 2px 0 10px; }
.drag-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 34px; color: #c3c6c1; cursor: grab;
}
.drag-handle svg { width: 15px; height: 15px; }
tr.dragging { opacity: .45; }
.table .t-chips { max-width: 340px; }
.chip.soft { background: rgba(20, 22, 26, .04); border-color: transparent; font-family: var(--font); font-size: 12.5px; }
.chip.deakt, .deakt > .chip { opacity: .45; }

/* Produkt-Formular (eigene Seite) */
.form-page { padding: 26px 28px; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
@media (max-width: 1000px) { .form-cols { grid-template-columns: 1fr; } }
.form-foot {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px;
}
.foot-spacer { flex: 1 1 auto; }

/* Zeitsteuerung (Dayparting) */
.wd-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.wd-btn { border: 1px solid var(--line); background: var(--paper); cursor: pointer;
  width: 44px; height: 40px; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-mut); }
.wd-btn.on { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }
.iconbtn.on-amber { color: var(--amber); }
.chip.soft svg { width: 12px; height: 12px; vertical-align: -2px; }
.hint-inline { font-weight: 400; font-size: 12px; color: var(--text-mut); }

.imgbox {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); min-height: 120px; max-height: 280px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.imgbox img { max-width: 100%; max-height: 280px; object-fit: contain; }
.img-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #c3c6c1; font-size: 13px; padding: 30px; }
.img-empty svg { width: 28px; height: 28px; }
.img-actions { display: flex; gap: 10px; margin-top: 10px; }

.attr-wrap {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px;
  column-width: 190px; column-gap: 26px;   /* mehrspaltig statt scrollen — alles auf einen Blick */
}
.attr-group { break-inside: avoid; margin-bottom: 16px; }
.attr-group-name { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mut); margin-bottom: 6px; }
.attr-group .check { margin: 3px 0; }
.attr-group.deakt .attr-group-name { opacity: .5; }
.check.deakt { opacity: .5; }

.datarow {
  display: grid; grid-template-columns: 170px 1fr 34px; gap: 8px; align-items: start;
  margin-bottom: 8px;
}
.datarow input, .datarow textarea {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px; font-family: inherit; font-size: 14px; background: var(--card); color: var(--text);
  width: 100%; resize: vertical;
}
.datarow input { height: 38px; padding: 0 10px; }
.datarow input:focus, .datarow textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(231, 154, 27, .18); }

.attrrow { display: grid; grid-template-columns: 1fr 34px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.attrrow .a-name {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; background: var(--card); color: var(--text);
}
.attrrow .a-name:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(231, 154, 27, .18); }
.attrrow .check { justify-content: center; }

/* Sprach-Tabs: sprachabhängige Abschnitte werden über [data-langsec] umgeschaltet */
.lang-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.lang-tab {
  padding: 7px 15px; border-radius: 20px; border: 1px solid var(--line);
  background: none; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--text-mut);
}
.lang-tab:hover { background: rgba(20, 22, 26, .04); }
.lang-tab.active { background: var(--ink-900); color: var(--text-inv); border-color: var(--ink-900); }
[data-langsec] { display: none; }
[data-langsec].active { display: block; }

/* ============================================================================
   Standorte: Sub-Tabs, Zuordnungsleiste, Setup
   ========================================================================== */
.subtabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.subtab {
  display: inline-block; padding: 8px 16px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 700; color: var(--text-mut); text-decoration: none;
}
.subtab:hover { background: rgba(20, 22, 26, .04); }
.subtab.active { background: var(--ink-900); color: var(--text-inv); border-color: var(--ink-900); }

.assign-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; margin-bottom: 16px; flex-wrap: wrap;
}
.assign-bar .co-select { flex: 1; min-width: 220px; }

.rowlink { text-decoration: none; }
.rowlink:hover { text-decoration: underline; }

.led-select { min-width: 220px; max-width: 280px; height: 38px; }
.led-select.warn { border-color: var(--amber); }
.led-select option.used { color: var(--danger); }
.warn-text { color: #a06a08; font-size: 12.5px; }

.setup-h {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-mut); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.setrow { display: flex; align-items: center; gap: 10px; }
.setrow input { flex: 1; }

/* Farbwähler: nativer Picker (mit Pipette) + Deckkraft-Regler */
.set-colorpick {
  flex: 0 0 auto !important; width: 44px; height: 40px; padding: 3px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer;
}
.alpha-wrap { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.alpha-wrap input[type=range] { width: 90px; accent-color: var(--amber); cursor: pointer; }
.alpha-val { font-size: 12px; color: var(--text-mut); min-width: 42px; }
.i18n-stack { display: flex; flex-direction: column; gap: 8px; }
.i18n-stack input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; font-size: 14.5px; background: var(--card); color: var(--text); }
.i18n-stack input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(231, 154, 27, .18); }
.imgbox.small { min-height: 80px; max-height: 160px; }
.imgbox.small img { max-height: 160px; }

/* Bild-Setting je Sprache: kompakte Zeile mit Mini-Vorschau */
.imgrow { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.imgrow .langtag { flex: 0 0 auto; text-transform: uppercase; }
.imgbox.mini { flex: 1; min-height: 64px; max-height: 84px; }
.imgbox.mini img { max-height: 84px; }
.imgbox.mini .img-empty { padding: 10px; flex-direction: row; gap: 8px; font-size: 12px; }
.imgbox.mini .img-empty svg { width: 18px; height: 18px; }

/* ============================================================================
   Medienbibliothek
   ========================================================================== */
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px; padding: 18px;
}
.media-card {
  position: relative; margin: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--card);
}
.media-card .media-img {
  height: 110px; background: var(--paper);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.media-card .media-img img,
.media-card .media-img video { width: 100%; height: 100%; object-fit: contain; }
.media-card .media-img { position: relative; }
.vid-badge { position: absolute; right: 6px; bottom: 6px; background: rgba(16,18,22,.7); color: #fff; border-radius: 6px; padding: 2px; display: inline-flex; }
.vid-badge svg { width: 15px; height: 15px; }
.imgbox.mini video { max-width: 100%; }
.media-card figcaption { padding: 8px 10px; }
.media-card .media-name {
  font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-card .media-meta { font-size: 11.5px; color: var(--text-mut); }
.media-card .media-actions {
  position: absolute; top: 6px; right: 6px; display: none; gap: 2px;
  background: rgba(255, 255, 255, .92); border-radius: var(--radius-sm); padding: 2px;
}
.media-card:hover .media-actions { display: flex; }
.media-card.pick { cursor: pointer; }
.media-card.pick:hover { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(231, 154, 27, .18); }

.picker-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.imp-grid { display: grid; grid-template-columns: 220px 1fr; gap: 18px; margin-top: 6px; }
.imp-grid .imgbox { min-height: 140px; }
@media (max-width: 640px) { .imp-grid { grid-template-columns: 1fr; } }

/* Produkt-Suche */
.list-search { padding: 14px 18px 0; }
.list-search input {
  width: 100%; height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14.5px; background: var(--card); color: var(--text);
}
.list-search input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(231, 154, 27, .18); }

/* Sprach-Checkboxen (Standort) */
.lang-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.lang-checks .check { font-weight: 700; }

/* Assistent */
.wiz-steps { display: flex; gap: 8px; margin-bottom: 18px; }
.wiz-dot {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: var(--paper); color: var(--text-mut); border: 1px solid var(--line);
}
.wiz-dot.on { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }
.wiz-dot.done { background: var(--ink-900); color: var(--text-inv); border-color: var(--ink-900); }
.wiz-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.wiz-list .check { margin: 5px 0; }

/* Gruppen-Assistent */
.wiz-step { padding: 5px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 700;
  background: var(--paper); color: var(--text-mut); border: 1px solid var(--line); }
.wiz-step.active { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }
.wiz-step.done { background: var(--ink-900, #1e2128); color: #fff; border-color: var(--ink-900, #1e2128); }
.wiz-templates { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 1px solid var(--line); background: var(--paper); cursor: pointer; border-radius: 18px;
  padding: 6px 14px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text); transition: background .12s ease; }
.chip-btn:hover { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }
.wiz-values { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px; line-height: 1.6;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); resize: vertical; }

/* Statistik-Dashboard */
.st-daterange { display: inline-flex; align-items: center; gap: 8px; }
.st-daterange input[type=date] { max-width: 160px; height: 40px; }
.stats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .stats-cols { grid-template-columns: 1fr; } }
.pie-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pie-legend { flex: 1; min-width: 180px; }
.pie-leg { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 13px; }
.pie-sw { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.pie-lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pie-val { color: var(--text-mut); font-size: 12.5px; }
.barlist { display: flex; flex-direction: column; gap: 8px; }
.barrow { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.barlbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bartrack { background: var(--paper); border-radius: 5px; height: 16px; overflow: hidden; }
.barfill { height: 100%; background: var(--amber); border-radius: 5px; }
.barval { text-align: right; color: var(--text-mut); }
.daybars { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 10px; }
.daybar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.daybar-fill { width: 70%; background: var(--amber); border-radius: 4px 4px 0 0; min-height: 2px; }
.daybar-lbl { font-size: 10px; color: var(--text-mut); margin-top: 4px; white-space: nowrap; }

/* Qualitätscheck */
.hc-ok { color: #2e7d46; font-weight: 700; font-size: 14px; }
.hc-item { font-size: 13.5px; padding: 6px 10px; border-radius: var(--radius-sm); margin-bottom: 5px; }
.hc-err { background: rgba(214, 73, 79, .1); color: #b23238; }
.hc-warn { background: rgba(231, 154, 27, .12); color: #97670c; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-bar { position: relative; background: var(--paper); border-radius: 6px; height: 30px; overflow: hidden; }
.funnel-fill { height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-deep)); border-radius: 6px; min-width: 2px; }
.funnel-num { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 700; color: var(--text); }
.funnel-lbl { font-size: 12.5px; color: var(--text-mut); margin-top: 3px; }

/* Player-Status */
.beat { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.beat.on { background: rgba(53, 178, 104, .16); color: #2e7d46; }
.beat.off { background: rgba(20, 22, 26, .06); color: var(--text-mut); }

/* Medien-Ordner */
.folder-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 18px 0; }
.folder-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 13px; color: var(--text);
}
.folder-chip:hover { background: rgba(20, 22, 26, .04); }
.folder-chip.active { background: var(--ink-900); color: var(--text-inv); border-color: var(--ink-900); }
.folder-chip .fc-count { opacity: .6; font-size: 12px; }
.folder-chip svg { width: 14px; height: 14px; }
.modal.wide { max-width: 760px; }
.modal .media-grid { padding: 0; max-height: 50vh; overflow-y: auto; }

/* ============================================================================
   Modal + Toast
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(16, 18, 22, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 24px 24px;
}
.modal {
  width: 100%; max-width: 460px;
  background: var(--card); border-radius: 14px;
  box-shadow: var(--shadow-pop);
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } }
.modal header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal header h2 { font-size: 17px; }
.modal .body { padding: 18px 24px 8px; }
.modal footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 8px 24px 22px;
}
.modal .body p { margin: 0 0 8px; font-size: 14.5px; }

#toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink-900); color: var(--text-inv);
  padding: 11px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; box-shadow: var(--shadow-pop);
  animation: toast-in .2s ease;
}
.toast .led { width: 8px; height: 8px; border-radius: 50%; background: var(--led-on); box-shadow: 0 0 8px 2px var(--led-glow); }
.toast.error .led { background: var(--danger); box-shadow: 0 0 8px 2px rgba(214, 73, 79, .5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ============================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; padding-bottom: 8px; }
  .sidebar .foot { margin-top: 8px; }
  .main { padding: 22px 18px 48px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .card { overflow-x: auto; }
}

/* ── Lizenz ───────────────────────────────────────────────────────────────
   Die Sperrseite ersetzt die ganze Oberfläche: Halb bedienbar wäre schlimmer als zu, weil dann
   an jeder Ecke Fehlermeldungen aufschlagen. Der dunkle Grund ist derselbe wie beim Login —
   „hier geht es erst weiter, wenn etwas erledigt ist". */
.lic-block {
  position: fixed; inset: 0; z-index: 100; overflow-y: auto;
  background: var(--ink-950); color: var(--text-inv);
  display: flex; justify-content: center; align-items: flex-start;
  padding: max(6vh, 32px) 18px 48px;
}
.lic-card {
  width: min(620px, 100%); background: var(--ink-900); border: 1px solid var(--ink-700);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-pop);
}
.lic-card h1 { font-size: 21px; margin: 14px 0 8px; line-height: 1.3; }
.lic-card p { margin: 0 0 6px; color: var(--text-inv-mut); font-size: 15px; line-height: 1.55; }
.lic-card p.error { color: var(--danger); }
.lic-icon { width: 34px; height: 34px; color: var(--amber); }
.lic-icon svg { width: 100%; height: 100%; }

.lic-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-mut); margin-bottom: 7px; }
.lic-block .lic-label { color: var(--text-inv-mut); }

/* Die Kennung ist zum Ablesen und Weitergeben da — deshalb groß, mit Umbruch an jeder Stelle
   und in einem Rutsch markierbar. */
.lic-uuid { margin-top: 20px; }
.lic-uuid code {
  display: block; font-size: 17px; font-weight: 600; line-height: 1.5; letter-spacing: .01em;
  word-break: break-all; user-select: all;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--paper); border: 1px solid var(--line); color: var(--text);
}
.lic-block .lic-uuid code { background: var(--ink-800); border-color: var(--ink-700); color: var(--text-inv); }

.lic-form { margin-top: 20px; }
.lic-form textarea {
  width: 100%; min-height: 104px; resize: vertical;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5;
  padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.lic-block .lic-form textarea { background: var(--ink-800); border-color: var(--ink-700); color: var(--text-inv); }
.lic-block .hint { color: var(--text-inv-mut); }
.lic-block .hint.error, .hint.error { color: var(--danger); }

.lic-status .lic-status-head { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.lic-status.ok   .lic-status-head { color: var(--led-on); }
.lic-status.warn .lic-status-head { color: var(--amber-deep); }
.lic-status.bad  .lic-status-head { color: var(--danger); }
.lic-row { display: flex; gap: 14px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.lic-row .k { width: 190px; flex: 0 0 190px; color: var(--text-mut); font-size: 13px; }
.lic-row .v { word-break: break-word; }

/* Kulanz-Streifen: gleiche Bauart wie das Übernahme-Banner, andere Farbe. */
.lic-banner { background: var(--amber-deep); color: var(--on-amber); }
.lic-banner a { color: var(--on-amber); font-weight: 700; }

@media (max-width: 560px) {
  .lic-card { padding: 20px; }
  .lic-uuid code { font-size: 15px; }
  .lic-row { flex-direction: column; gap: 2px; }
  .lic-row .k { width: auto; flex: none; }
}
