/* =============================================================================
   AURORA — Kunden-Portal (moderne Design-Alternative)
   Glas-UI mit Gradient-Mesh, Emerald→Lime-Akzent, Glow + Micro-Motion.
   Zwei Themes: Dark (Standard) und Light – umschaltbar, via CSS-Variablen.
   Gleiche Selektoren/Funktionen wie das Original – nur die Optik ist neu.
   ============================================================================= */

:root {
  --bg: #07090d;
  --card: rgba(255, 255, 255, .045);
  --card-border: rgba(255, 255, 255, .08);
  --surface-2: rgba(255, 255, 255, .03);   /* ruhige Flächen (Listen, Karten in Karten) */
  --surface-3: rgba(255, 255, 255, .06);   /* Ghost-Buttons, Datei-Chips */
  --hover-bg: rgba(255, 255, 255, .06);
  --popover-bg: #131a23;                   /* Dropdowns, Tooltips, Autofill */
  --thumb-bg: rgba(0, 0, 0, .3);
  --editor-bg: rgba(0, 0, 0, .28);
  --icon-ink: #c2ccd9;
  --ink: #eef2f7;
  --muted: #8b96a8;
  --placeholder: #c8d1dc;                  /* im Dunkelmodus hell/gut lesbar (Editor + alle Felder) */
  --line: rgba(255, 255, 255, .09);
  --brand: #34d399;          /* Emerald 400 */
  --brand-2: #a3e635;        /* Lime 400 */
  --brand-grad: linear-gradient(135deg, #34d399, #a3e635);
  --brand-ink: #052e16;      /* dunkler Text auf hellem Verlaufs-Button */
  --h-grad: linear-gradient(180deg, #ffffff, #b9c4d2);
  --nav-bg: rgba(10, 13, 18, .72);
  --nav-ink: #9aa6b5;
  --nav-hover-ink: #ffffff;
  --brand-title-ink: #ffffff;
  --danger: #f87171;
  --ok-bg: rgba(52, 211, 153, .12);
  --ok-ink: #6ee7b7;
  --err-bg: rgba(248, 113, 113, .12);
  --err-ink: #fca5a5;
  --warn-bg: rgba(251, 191, 36, .14);
  --warn-ink: #fbbf24;
  --info-bg: rgba(96, 165, 250, .16);
  --info-ink: #93c5fd;
  --orange-bg: rgba(251, 146, 60, .16);
  --orange-ink: #fdba74;
  --purple-bg: rgba(192, 132, 252, .16);
  --purple-ink: #d8b4fe;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 8px 30px -12px rgba(0, 0, 0, .55);
  --glow: 0 0 0 1px rgba(52, 211, 153, .25), 0 10px 30px -10px rgba(52, 211, 153, .45);
  --tap: 42px;
  --focus-ring: 0 0 0 3px rgba(52, 211, 153, .22);
  --field-bg: rgba(255, 255, 255, .045);
  --field-border: rgba(255, 255, 255, .13);
  --scroll-thumb: rgba(255, 255, 255, .14);
  --scroll-thumb-hover: rgba(255, 255, 255, .25);
  --mesh:
    radial-gradient(640px 420px at 88% -8%, rgba(52, 211, 153, .14), transparent 62%),
    radial-gradient(760px 520px at -12% 28%, rgba(6, 182, 212, .10), transparent 60%),
    radial-gradient(900px 640px at 50% 112%, rgba(163, 230, 53, .08), transparent 60%);
}

/* ===== Light-Theme: gleiche Architektur, helle Werte ===== */
html[data-theme="light"] {
  --bg: #f4f6fa;
  --card: rgba(255, 255, 255, .82);
  --card-border: rgba(15, 23, 42, .08);
  --surface-2: rgba(15, 23, 42, .03);
  --surface-3: rgba(15, 23, 42, .055);
  --hover-bg: rgba(15, 23, 42, .06);
  --popover-bg: #ffffff;
  --thumb-bg: #e8edf4;
  --editor-bg: #ffffff;
  --icon-ink: #475569;
  --ink: #16202b;
  --muted: #64748b;
  --placeholder: #94a3b8;
  --line: rgba(15, 23, 42, .09);
  --brand: #10b981;          /* Emerald 500: genug Kontrast auf Weiß */
  --brand-2: #84cc16;
  --brand-grad: linear-gradient(135deg, #10b981, #84cc16);
  --brand-ink: #052e16;
  --h-grad: linear-gradient(180deg, #0f172a, #46566b);
  --nav-bg: rgba(255, 255, 255, .78);
  --nav-ink: #5b6779;
  --nav-hover-ink: #0f172a;
  --brand-title-ink: #0f172a;
  --danger: #dc2626;
  --ok-bg: rgba(16, 185, 129, .12);
  --ok-ink: #047857;
  --err-bg: rgba(220, 38, 38, .1);
  --err-ink: #b91c1c;
  --warn-bg: rgba(217, 119, 6, .12);
  --warn-ink: #92400e;
  --info-bg: rgba(37, 99, 235, .1);
  --info-ink: #1d4ed8;
  --orange-bg: rgba(234, 88, 12, .1);
  --orange-ink: #9a3412;
  --purple-bg: rgba(147, 51, 234, .1);
  --purple-ink: #6b21a8;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 8px 30px -14px rgba(16, 24, 40, .18);
  --glow: 0 0 0 1px rgba(16, 185, 129, .35), 0 10px 30px -12px rgba(16, 185, 129, .3);
  --focus-ring: 0 0 0 3px rgba(16, 185, 129, .18);
  --field-bg: #ffffff;
  --field-border: #c7ced9;
  --scroll-thumb: rgba(15, 23, 42, .18);
  --scroll-thumb-hover: rgba(15, 23, 42, .32);
  --mesh:
    radial-gradient(640px 420px at 88% -8%, rgba(16, 185, 129, .1), transparent 62%),
    radial-gradient(760px 520px at -12% 28%, rgba(14, 165, 233, .08), transparent 60%),
    radial-gradient(900px 640px at 50% 112%, rgba(132, 204, 22, .07), transparent 60%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Gradient-Mesh: ruhige Farbnebel hinter allem */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--mesh);
}
img { max-width: 100%; height: auto; }
::selection { background: rgba(52, 211, 153, .32); }

/* dezente Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); border: 2px solid transparent; background-clip: content-box; }

/* ===== Topbar: schwebendes Glas ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap;
  padding: 13px 26px;
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--card-border);
}
.brand {
  display: inline-flex; align-items: center; font-weight: 800; color: var(--brand-title-ink);
  text-decoration: none; font-size: 17px; letter-spacing: -.02em;
}
.brand::before {
  content: ""; width: 11px; height: 11px; border-radius: 4px; margin-right: 10px;
  background: var(--brand-grad);
  box-shadow: 0 0 14px rgba(52, 211, 153, .85);
}
.topbar nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
  color: var(--nav-ink); text-decoration: none; padding: 7px 11px; border-radius: 9px;
  transition: color .15s, background .15s;
}
.topbar nav a:hover { color: var(--nav-hover-ink); background: var(--hover-bg); }
.who { color: var(--muted); padding: 7px 4px; }

/* Theme-Umschalter (Sonne/Mond) */
.theme-toggle {
  background: var(--surface-3); color: var(--ink); border: 1px solid var(--card-border);
  border-radius: 999px; width: 34px; height: 34px; min-height: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 15px; line-height: 1; box-shadow: none;
}
.theme-toggle:hover { border-color: rgba(52, 211, 153, .55); background: var(--hover-bg); filter: none; transform: none; box-shadow: none; }
.theme-toggle .tt-sun { display: none; }
.theme-toggle .tt-moon { display: inline; }
html[data-theme="light"] .theme-toggle .tt-sun { display: inline; }
html[data-theme="light"] .theme-toggle .tt-moon { display: none; }

.wrap { max-width: 980px; margin: 0 auto; padding: 30px 22px 72px; }
.login { max-width: 400px; margin: 11vh auto 0; }
.login .card { box-shadow: var(--shadow), 0 0 80px -30px rgba(52, 211, 153, .35); }
.login h1 { text-align: center; }

/* ===== Typografie ===== */
h1 {
  font-size: 27px; margin: 0 0 20px; font-weight: 800; letter-spacing: -.03em;
  background: var(--h-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2 { font-size: 18px; margin: 0 0 14px; font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: 15px; margin: 22px 0 10px; font-weight: 700; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin-top: 14px; }
.crumbs { color: var(--muted); margin: 0 0 16px; font-size: 13px; }
.crumbs a { color: var(--brand); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ===== Meldungen ===== */
.ok, .error { padding: 11px 15px; border-radius: var(--radius-sm); margin: 0 0 18px; border: 1px solid transparent; }
.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: rgba(52, 211, 153, .25); }
.error { background: var(--err-bg); color: var(--err-ink); border-color: rgba(248, 113, 113, .25); }

/* ===== Buttons ===== */
button, .btn, .btn-save, .btn-danger, .btn-secondary {
  display: inline-block; cursor: pointer; border: 0; border-radius: 12px;
  background: var(--brand-grad); color: var(--brand-ink); padding: 9px 18px; font-size: 14px;
  font-weight: 700; text-decoration: none; line-height: 1.2; letter-spacing: .01em;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, .3), 0 8px 22px -10px rgba(52, 211, 153, .55);
  transition: transform .15s, filter .15s, box-shadow .15s, background .15s;
}
button:hover, .btn:hover, .btn-save:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--glow); }
button:active, .btn:active, .btn-save:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface-3); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--field-border);
}
.btn-secondary:hover { background: var(--hover-bg); filter: none; box-shadow: inset 0 0 0 1px var(--field-border); }
.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #ef4444); color: #fff;
  box-shadow: 0 0 0 1px rgba(244, 63, 94, .3), 0 8px 22px -10px rgba(244, 63, 94, .5);
}
.btn-danger:hover { filter: brightness(1.07); box-shadow: 0 0 0 1px rgba(244, 63, 94, .45), 0 10px 26px -10px rgba(244, 63, 94, .6); }
.btn-link { color: var(--brand); text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.small { padding: 5px 12px; font-size: 13px; }

.page-head { display: flex; align-items: center; justify-content: space-between; }

/* ===== Cards / Projektliste ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.project-card {
  display: flex; flex-direction: column; gap: 6px; padding: 20px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  text-decoration: none; color: var(--ink);
}
.project-card:hover { border-color: rgba(52, 211, 153, .5); }
.project-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }

/* ===== Formulare ===== */
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 22px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px;
}
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=tel], input[type=search], input[type=date],
input:not([type]), select, textarea {
  font: inherit; padding: 9px 12px; border: 1px solid var(--field-border); border-radius: 10px;
  background: var(--field-bg); color: var(--ink);
}
/* Chrome-Autofill nicht weiß aufblitzen lassen */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--popover-bg) inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
select option { background: var(--popover-bg); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
/* Datei-Auswahl: an Felder/Dropdowns angepasst statt nativem weißem Button */
input[type=file] {
  font: inherit; color: var(--muted); cursor: pointer; max-width: 100%;
  padding: 6px 10px; border: 1px solid var(--field-border); border-radius: 10px; background: var(--field-bg);
}
input[type=file]::file-selector-button {
  font: inherit; font-weight: 700; cursor: pointer; margin: 0 12px 0 0; padding: 7px 14px;
  border: 0; border-radius: 8px; background: var(--surface-3); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--field-border); transition: background .15s, box-shadow .15s;
}
input[type=file]::file-selector-button:hover { background: var(--hover-bg); box-shadow: inset 0 0 0 1px var(--brand); }
.field { margin-bottom: 14px; font-weight: 600; }
.inline { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.inline input[type=text] { flex: 1; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.actions .updated { margin-left: auto; font-size: 12px; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
legend { font-size: 12px; color: var(--muted); padding: 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); }

/* ===== Tabellen / Panels ===== */
.panel {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 22px; margin-bottom: 24px;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
td.right, .right { text-align: right; }
td form { display: inline; }

details.user {
  border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 11px 15px;
  margin-bottom: 10px; background: var(--surface-2);
}
details.user summary { cursor: pointer; }
details.user .card { margin-top: 14px; border: 0; padding: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }

/* ===== Baum ===== */
.treebox {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 16px 20px;
}
ul.tree { list-style: none; margin: 0; padding-left: 0; }
ul.tree ul.tree { padding-left: 22px; border-left: 1px dashed var(--line); margin-left: 6px; }
ul.tree li { padding: 4px 0; }
ul.tree a { color: var(--ink); text-decoration: none; padding: 3px 7px; border-radius: 7px; }
ul.tree a:hover { background: var(--hover-bg); }
ul.tree a.active { background: var(--brand-grad); color: var(--brand-ink); font-weight: 700; }
.add-sub {
  color: var(--brand) !important; font-weight: 700; font-size: 13px;
  padding: 1px 7px !important; background: rgba(52, 211, 153, .12);
}

/* ===== Editor (Quill, themed) ===== */
.editor { display: block; }
#editor {
  display: none; background: var(--editor-bg); color: var(--ink);
  min-height: 320px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--line); }
.ql-toolbar.ql-snow { border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-2); }
.ql-editor { color: var(--ink); }
.ql-editor.ql-blank::before { color: var(--placeholder); font-style: normal; }
.ql-snow .ql-stroke { stroke: var(--icon-ink); }
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill { fill: var(--icon-ink); }
.ql-snow .ql-picker { color: var(--icon-ink); }
/* Dunkelmodus: Toolbar-Icons + Platzhalter klar WEISS (Hover/aktiv bleibt grün, da spezifischer). */
[data-theme="dark"] .ql-editor.ql-blank::before { color: rgba(255, 255, 255, .82); }
[data-theme="dark"] .ql-snow .ql-stroke { stroke: #ffffff; }
[data-theme="dark"] .ql-snow .ql-fill, [data-theme="dark"] .ql-snow .ql-stroke.ql-fill { fill: #ffffff; }
[data-theme="dark"] .ql-snow .ql-picker { color: #ffffff; }
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow.ql-toolbar button:focus .ql-stroke { stroke: var(--brand); }
.ql-snow.ql-toolbar button:hover .ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-fill,
.ql-snow.ql-toolbar button:focus .ql-fill { fill: var(--brand); }
.ql-snow .ql-picker-label:hover, .ql-snow .ql-picker-label.ql-active,
.ql-snow .ql-picker-item:hover, .ql-snow .ql-picker-item.ql-selected { color: var(--brand); }
.ql-snow .ql-picker-label:hover .ql-stroke, .ql-snow .ql-picker-label.ql-active .ql-stroke { stroke: var(--brand); }
.ql-snow .ql-picker-options { background: var(--popover-bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.ql-snow .ql-picker.ql-expanded .ql-picker-label, .ql-snow .ql-picker.ql-expanded .ql-picker-options { border-color: var(--line); }
.ql-snow .ql-tooltip {
  background: var(--popover-bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
}
.ql-snow .ql-tooltip input[type=text] { background: var(--field-bg); border: 1px solid var(--field-border); color: var(--ink); border-radius: 7px; }
.ql-snow .ql-tooltip a.ql-action, .ql-snow .ql-tooltip a.ql-remove { color: var(--brand); }
.ql-editor a { color: var(--brand); }
.ql-editor blockquote { border-left: 4px solid rgba(52, 211, 153, .5); }
.content-fallback { font: inherit; padding: 10px 12px; border: 1px solid var(--field-border); border-radius: 10px; width: 100%; background: var(--field-bg); color: var(--ink); }

/* ===== Workspace (zweispaltig) ===== */
body.workspace-page .wrap { max-width: 1200px; }
.workspace { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
@media (max-width: 820px) { .workspace { grid-template-columns: 1fr; } .tree-sidebar { position: static !important; } }

.tree-sidebar {
  position: sticky; top: 80px; align-self: start;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 16px 18px; max-height: calc(100vh - 130px); overflow: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tree-sidebar .treebox { border: 0; padding: 0; background: transparent; box-shadow: none; }
.editor-pane {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 24px;
}
.empty-hint h2 { margin-top: 0; }
.exports { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.exports a { color: var(--brand); text-decoration: none; }
.exports a:hover { text-decoration: underline; }

/* ===== Baum (details/summary + leaf) ===== */
details.node, .leaf { margin: 1px 0; }
details.node > summary {
  list-style: none; display: flex; align-items: center; gap: 6px;
  padding: 3px 4px; border-radius: 7px; cursor: default;
}
details.node > summary::-webkit-details-marker { display: none; }
details.node > summary::before {
  content: "▸"; color: var(--muted); font-size: 11px; cursor: pointer;
  display: inline-block; width: 12px; transition: transform .14s;
}
details.node[open] > summary::before { transform: rotate(90deg); }
.leaf { display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 20px; border-radius: 7px; }
.children { padding-left: 18px; border-left: 1px dashed var(--line); margin-left: 11px; }

.node-title { color: var(--ink); text-decoration: none; padding: 2px 7px; border-radius: 7px; }
.node-title:hover { background: var(--hover-bg); }
.node-title.active { background: var(--brand-grad); color: var(--brand-ink); font-weight: 700; }

/* Drag & Drop im Baum */
[draggable=true] { cursor: grab; }
.dnd-dragging { opacity: .35; }
.dnd-before { box-shadow: 0 -2px 0 0 var(--brand) !important; }
.dnd-after  { box-shadow: 0  2px 0 0 var(--brand) !important; }
.dnd-inside { background: rgba(52, 211, 153, .14) !important; outline: 1px dashed var(--brand); outline-offset: -1px; border-radius: 7px; }

.badge {
  font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  white-space: nowrap; letter-spacing: .02em;
}
.badge-leistung  { background: var(--ok-bg); color: var(--ok-ink); }
.badge-kategorie { background: var(--info-bg); color: var(--info-ink); }
.badge-produkt   { background: var(--orange-bg); color: var(--orange-ink); }

.node-actions { display: flex; gap: 1px; margin-left: auto; opacity: 0; transition: opacity .14s; }
summary:hover .node-actions, .leaf:hover .node-actions, .node-actions:focus-within { opacity: 1; }
@media (hover: none) { .node-actions { opacity: 1; } }
@media (max-width: 820px) { .node-actions { opacity: 1; } }
.node-actions .tb { display: inline; margin: 0; }
.tree-btn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 2px 5px; font-size: 12px; line-height: 1; border-radius: 6px; box-shadow: none;
}
.tree-btn:hover { background: var(--hover-bg); color: var(--ink); filter: none; transform: none; box-shadow: none; }

/* ===== Editor-Formular ===== */
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
details.seo { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 15px; margin-bottom: 14px; background: var(--surface-2); }
details.seo summary { cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; }
details.seo .field { margin-top: 12px; }
details.seo textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--field-border); border-radius: 10px; resize: vertical; background: var(--field-bg); color: var(--ink); }
@media (max-width: 820px) { .field-row { flex-direction: column; gap: 0; } }

/* ===== Bild-Galerie ===== */
.img-area { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.img-area h3 { margin: 0 0 12px; }
.img-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.img-card { border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.img-card img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; background: var(--thumb-bg); }
.img-card .img-meta { display: flex; flex-direction: column; gap: 6px; }
.img-card .img-meta input { font: inherit; padding: 6px 9px; border: 1px solid var(--field-border); border-radius: 8px; background: var(--field-bg); color: var(--ink); }
.img-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.img-card-actions form { display: inline; margin: 0; }

/* ===== Pills (Status) ===== */
.pill-ok, .pill-warn { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill-ok   { background: var(--ok-bg); color: var(--ok-ink); }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); }

/* ===== Checkliste (Sidebar) ===== */
.checklist { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.checklist ul { list-style: none; margin: 8px 0 0; padding: 0; }
.checklist li { font-size: 13px; padding: 3px 0; display: flex; align-items: baseline; gap: 6px; }
.checklist li.ok   { color: var(--ink); }
.checklist li.open { color: var(--warn-ink); }
.checklist .cl-detail { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ===== Agentur-Dashboard (Bento-Stats) ===== */
.dash-stats { display: flex; gap: 14px; margin: 0 0 24px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 16px 24px; display: flex; flex-direction: column; gap: 2px; min-width: 130px;
}
.stat::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--brand-grad); opacity: .65;
}
.stat-num {
  font-size: 30px; font-weight: 800; letter-spacing: -.03em;
  background: var(--h-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-cust {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 20px 22px; margin-bottom: 16px;
}
.dash-cust-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-cust-head h2 { margin: 0; font-size: 17px; }
.dash-proj { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dash-proj-name { font-weight: 700; color: var(--brand); text-decoration: none; min-width: 160px; }
.dash-proj-name:hover { text-decoration: underline; }
.dash-progress { font-size: 12px; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); border-radius: 999px; padding: 2px 10px; }
.dash-progress.done { color: var(--ok-ink); background: var(--ok-bg); }
.dash-open { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }

/* =========================================================
   Tiefe, Motion + volle Responsivität
   ========================================================= */
.card, .panel, .project-card, .tree-sidebar, .editor-pane,
.dash-cust, .stat, .img-card { box-shadow: var(--shadow); }
.project-card, .stat, .tk-row, .cust-row { transition: border-color .18s, box-shadow .18s, transform .18s, background .18s; }
.project-card:hover { box-shadow: var(--glow); transform: translateY(-2px); }
details.user { box-shadow: var(--shadow-sm); transition: box-shadow .15s; }
details.user[open] { box-shadow: var(--shadow); }

/* sanftes Hereingleiten der Seiteninhalte */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wrap > * { animation: rise .45s cubic-bezier(.16, 1, .3, 1) both; }
.wrap > *:nth-child(2) { animation-delay: .04s; }
.wrap > *:nth-child(3) { animation-delay: .08s; }
.wrap > *:nth-child(4) { animation-delay: .12s; }
.wrap > *:nth-child(5) { animation-delay: .16s; }
.wrap > *:nth-child(6) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Touch-freundliche Bedienelemente */
button, .btn, .btn-secondary, .btn-save, .btn-danger { min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; }
.small, button.small, .btn.small, .btn-secondary.small, .btn-save.small, .btn-danger.small, .tree-btn, .ki-btn, .tk-filter, .img-card .btn-danger, .img-card-actions button { min-height: 0; }
input, select, textarea { min-height: var(--tap); border-radius: 10px; }
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
/* Quill-Toolbar von den globalen Button-Styles ausnehmen (sonst riesige Icons) */
.ql-toolbar.ql-snow button { min-height: 0; width: 28px; height: 24px; padding: 3px 5px; background: transparent; border: 0; display: inline-block; box-shadow: none; transform: none; }
.ql-toolbar.ql-snow button:hover { background: var(--hover-bg); border-radius: 6px; filter: none; }
.ql-toolbar.ql-snow button svg { width: 18px; height: 18px; }
.ql-toolbar.ql-snow .ql-picker { min-height: 0; font-size: 14px; }
.ql-toolbar.ql-snow .ql-picker-label { display: inline-flex; }
a, button { -webkit-tap-highlight-color: transparent; }

/* Grid-/Flex-Kinder dürfen unter Inhaltsbreite schrumpfen (kein H-Überlauf) */
.workspace > * { min-width: 0; }
.dash-proj, .dash-open, .field-row, .img-card { min-width: 0; }
.img-card img, .img-card .img-meta input { width: 100%; min-width: 0; max-width: 100%; }
.tree-sidebar .treebox { overflow-x: auto; }
.checklist li { flex-wrap: wrap; }
.checklist .cl-detail { margin-left: 0; }

/* ---- Tablet ---- */
@media (max-width: 820px) {
  .wrap, body.workspace-page .wrap { max-width: 100%; }
  .tree-sidebar { max-height: none; }
}

/* ---- Großes Handy / kleines Tablet ---- */
@media (max-width: 640px) {
  .wrap { padding: 18px 14px 56px; }
  .topbar { padding: 10px 14px; }
  h1 { font-size: 22px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head .btn { width: 100%; }
  .dash-stats { gap: 10px; }
  .stat { flex: 1; min-width: 0; padding: 12px 14px; align-items: center; text-align: center; }
  .stat-num { font-size: 24px; }
  .panel, .dash-cust, .editor-pane { padding: 16px; }
  .field-row { flex-direction: column; gap: 0; }
  .dash-proj { align-items: flex-start; }
  .dash-proj-name { min-width: 0; }
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .cards { grid-template-columns: 1fr 1fr; }
  /* lange Status-Chips dürfen umbrechen statt aus der Karte zu ragen */
  .pill-ok, .pill-warn, .dash-progress { white-space: normal; }
}

/* ---- Handy ---- */
@media (max-width: 460px) {
  .topbar { gap: 8px 12px; }
  .topbar nav { gap: 2px; font-size: 14px; }
  .who { display: none; }
  .cards { grid-template-columns: 1fr; }
  .actions { width: 100%; }
  .actions button, .actions .btn, .actions .btn-secondary { flex: 1; }
  .actions .updated { flex-basis: 100%; margin-left: 0; }
  .inline { flex-direction: column; align-items: stretch; }
  .img-grid { grid-template-columns: 1fr; }
}

@media (min-width: 1280px) {
  body.workspace-page .wrap { max-width: 1260px; }
}

/* =========================================================
   Kontakt-Maske, Material-Felder, Badges
   ========================================================= */
.btn-save { background: var(--brand-grad); color: var(--brand-ink); }
.btn-save:hover { filter: brightness(1.08); }

/* „Als Benutzer ansehen" (Impersonation) */
.imp-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  background: var(--warn-bg); color: var(--warn-ink); padding: 9px 24px;
  border-bottom: 1px solid rgba(251, 191, 36, .25); font-size: 14px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.imp-bar .imp-text strong { font-weight: 700; }
.imp-bar form { margin: 0; }
.imp-bar button {
  background: #f59e0b; color: #422006; min-height: 0; padding: 7px 14px; font-size: 13px;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .4);
}
.imp-bar button:hover { filter: brightness(1.08); }
.imp-start { margin-top: 8px; }

/* ===== Lexoffice-Panel (Suche, Sync, Belege) ===== */
.lex-panel {
  max-width: 620px; background: rgba(52, 211, 153, .06); border: 1px solid rgba(52, 211, 153, .22);
  border-radius: var(--radius); padding: 17px 19px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.lex-panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lex-panel-head h4 { margin: 0; font-size: 15px; }
.mock-badge { font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); }
.lex-search { position: relative; }
.lex-search input { width: 100%; font: inherit; padding: 11px 13px; border: 1px solid var(--field-border); border-radius: 10px; min-height: var(--tap); background: var(--field-bg); color: var(--ink); }
.lex-search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.lex-results { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.lex-result { background: var(--surface-3); border: 1px solid var(--card-border); border-radius: 10px; padding: 10px 13px; cursor: pointer; font-size: 14px; transition: border-color .15s, background .15s; }
.lex-result:hover { border-color: rgba(52, 211, 153, .55); background: rgba(52, 211, 153, .08); }
.lex-loading, .lex-empty, .lex-ok { font-size: 13px; padding: 8px 4px; color: var(--muted); }
.lex-ok { color: var(--ok-ink); }
.lex-linked { margin: 12px 0 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lex-actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.lex-actions-row form { margin: 0; }

.lex-vouchers { margin-top: 14px; border-top: 1px solid rgba(52, 211, 153, .2); padding-top: 10px; }
.lex-vouchers-head { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.lex-voucher { display: flex; align-items: baseline; gap: 8px 12px; padding: 6px 0; border-bottom: 1px solid rgba(52, 211, 153, .12); font-size: 14px; flex-wrap: wrap; }
.lex-voucher:last-child { border-bottom: 0; }
.lv-type { font-weight: 700; min-width: 80px; }
.lv-num { color: var(--ink); }
.lv-status { font-size: 12px; color: var(--muted); }
.lv-amt { margin-left: auto; font-weight: 700; }

@media (max-width: 460px) {
  .lex-panel, .lex-search input { max-width: 100%; }
  .lv-amt { margin-left: 0; }
}

/* ===== Helpdesk ===== */
.nav-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px;
  background: linear-gradient(135deg, #fb7185, #f43f5e); color: #fff; font-size: 11px; font-weight: 700;
  text-align: center; line-height: 18px; box-shadow: 0 0 10px rgba(244, 63, 94, .6);
}
.stat-link { text-decoration: none; color: var(--ink); }
.stat-link:hover { border-color: rgba(52, 211, 153, .55); box-shadow: var(--glow); transform: translateY(-2px); }

.tk-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tk-filter {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--card-border);
  background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: 13px;
  transition: border-color .15s, background .15s;
}
.tk-filter:hover { border-color: rgba(52, 211, 153, .5); }
.tk-filter.active { background: var(--brand-grad); color: var(--brand-ink); border-color: transparent; font-weight: 700; }

.tk-list { display: flex; flex-direction: column; gap: 8px; }
.tk-row {
  display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-sm); padding: 13px 15px; box-shadow: var(--shadow-sm);
}
.tk-row:hover { border-color: rgba(52, 211, 153, .5); transform: translateY(-1px); }
.tk-row-main { min-width: 0; }
.tk-id { color: var(--muted); font-weight: 700; margin-right: 4px; }
.tk-meta { font-size: 12px; margin-top: 3px; }
.tk-row-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.tk-status, .tk-prio { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tk-neu          { background: var(--info-bg); color: var(--info-ink); }
.tk-in_arbeit    { background: var(--warn-bg); color: var(--warn-ink); }
.tk-warte_kunde  { background: var(--purple-bg); color: var(--purple-ink); }
.tk-erledigt     { background: var(--ok-bg); color: var(--ok-ink); }
.tk-geschlossen  { background: var(--surface-3); color: var(--muted); }
.tk-prio-niedrig  { background: var(--surface-3); color: var(--muted); }
.tk-prio-normal   { background: var(--info-bg); color: var(--info-ink); }
.tk-prio-hoch     { background: var(--orange-bg); color: var(--orange-ink); }
.tk-prio-dringend { background: var(--err-bg); color: var(--err-ink); }

.page-head .tk-head-badges, .tk-head-badges { display: flex; gap: 6px; align-items: center; }
.tk-subhead { margin-top: -6px; }

.tk-detail { grid-template-columns: 1fr 300px; }
@media (max-width: 820px) { .tk-detail { grid-template-columns: 1fr; } }
.tk-thread { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tk-msg { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 13px 15px; box-shadow: var(--shadow-sm); }
.tk-msg-agency { border-left: 3px solid var(--brand); background: rgba(52, 211, 153, .06); }
.tk-msg-head { font-size: 13px; margin-bottom: 6px; }
.tk-tag-agency { background: var(--brand-grad); color: var(--brand-ink); font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.tk-msg-body { font-size: 15px; line-height: 1.6; word-wrap: break-word; }
.tk-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tk-att-img img { height: 90px; width: auto; border-radius: 8px; border: 1px solid var(--card-border); display: block; }
.tk-att-file { display: inline-block; padding: 6px 11px; background: var(--surface-3); border-radius: 8px; font-size: 13px; color: var(--brand); text-decoration: none; }
.tk-att-file:hover { background: var(--hover-bg); }

.tk-reply { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 13px 15px; box-shadow: var(--shadow-sm); }
.tk-reply textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--field-border); border-radius: 10px; resize: vertical; background: var(--field-bg); color: var(--ink); }
.tk-reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tk-file { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

.tk-side .tk-controls h3 { margin-top: 0; }
.tk-ctl { margin-bottom: 12px; }
.tk-form select, .tk-form textarea, .tk-form input { font: inherit; }

/* ===== Modul 4: Briefing / Asset-Locker ===== */
.proj-links { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.proj-links a { color: var(--brand); text-decoration: none; font-size: 13px; }
.proj-links a:hover { text-decoration: underline; }

.ba-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ba-row input[type=text] { font: inherit; padding: 8px 11px; border: 1px solid var(--field-border); border-radius: 10px; background: var(--field-bg); color: var(--ink); }
.ba-row .ba-name { flex: 0 0 150px; }
.ba-row .ba-hex { flex: 1; }
.ba-pick { width: 32px; height: 32px; padding: 0; flex-shrink: 0; cursor: pointer; border: 1px solid var(--card-border); border-radius: 8px; background: none; box-shadow: 0 0 8px rgba(0, 0, 0, .25); }
.ba-pick::-webkit-color-swatch-wrapper { padding: 2px; }
.ba-pick::-webkit-color-swatch { border: none; border-radius: 6px; }
.ba-pick::-moz-color-swatch { border: none; border-radius: 6px; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.asset-card { border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.asset-card img { width: 100%; height: 100px; object-fit: contain; background: rgba(255, 255, 255, .9); border-radius: 8px; border: 1px solid var(--card-border); }
.asset-ext { width: 100%; height: 100px; display: flex; align-items: center; justify-content: center; background: var(--surface-3); border-radius: 8px; font-weight: 800; color: var(--muted); letter-spacing: .05em; }
.asset-name { font-size: 13px; color: var(--brand); text-decoration: none; word-break: break-word; }
.asset-name:hover { text-decoration: underline; }
.asset-card form { margin: 0; }

/* ===== Modul 5: KI-Textassistent ===== */
.ki-panel { display: none; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.ki-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.ki-label::before { content: "✦ "; color: var(--brand); }
.ki-btn {
  background: var(--surface-3); color: var(--ink); border: 1px solid var(--card-border);
  border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 500; min-height: 0; cursor: pointer;
  box-shadow: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.ki-btn:hover { border-color: rgba(52, 211, 153, .55); background: rgba(52, 211, 153, .08); filter: none; transform: none; box-shadow: 0 0 14px -4px rgba(52, 211, 153, .5); }
.ki-result { flex-basis: 100%; }
.ki-suggestion { margin-top: 8px; border: 1px solid rgba(52, 211, 153, .45); border-radius: var(--radius-sm); padding: 13px 15px; background: rgba(52, 211, 153, .06); box-shadow: 0 0 30px -12px rgba(52, 211, 153, .4); }
.ki-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; max-height: 320px; overflow: auto; }
.ki-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ki-err { color: var(--danger); font-size: 13px; }

/* ===== Offene-Punkte-Seite ===== */
.op-items { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.dash-cust-head h2 a { color: var(--brand); text-decoration: none; }
.dash-cust-head h2 a:hover { text-decoration: underline; }

/* ===== Agentur-Badges ===== */
.ag-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.ag-emektar { background: var(--info-bg); color: var(--info-ink); }
.ag-bbmedia { background: var(--orange-bg); color: var(--orange-ink); }

/* ===== Material-Felder (Label floatet IM Feld – modern, kein Rand-Durchbruch) ===== */
.lex-form { max-width: 620px; }
.lex-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.lex-head h1 { margin: 0; }
.lex-section {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm); padding: 20px 20px 22px; margin-bottom: 16px;
}
.lex-section h4 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }

.mfield { position: relative; margin-bottom: 14px; }
.mfield > input, .mfield > select, .mfield > textarea {
  width: 100%; font: inherit; padding: 22px 13px 7px; border: 1px solid var(--field-border); border-radius: 12px;
  background: var(--field-bg); color: var(--ink); min-height: 56px;
}
.mfield > textarea { min-height: 72px; resize: vertical; }
.mfield > label {
  position: absolute; left: 13px; top: 17px; color: var(--muted); font-size: 15px; pointer-events: none;
  background: transparent; padding: 0; font-weight: 500;
  transition: top .14s, font-size .14s, color .14s;
}
.mfield > input:focus, .mfield > select:focus, .mfield > textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
/* gefloatetes Label bleibt IM Feld (Material 3 Filled-Stil) */
.mfield > input:not(:placeholder-shown) + label,
.mfield > textarea:not(:placeholder-shown) + label,
.mfield > input:focus + label,
.mfield > textarea:focus + label,
.mfield.has-select > label {
  top: 7px; font-size: 11px; letter-spacing: .03em; text-transform: uppercase;
}
.mfield > input:focus + label,
.mfield > textarea:focus + label,
.mfield.has-select > select:focus ~ label {
  color: var(--brand);
}
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 17px; height: 17px; min-height: 17px; }

.kind-toggle, .check-row { display: flex; gap: 22px; margin: 4px 0 14px; flex-wrap: wrap; }
.mradio, .mcheck { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--ink); }
.mcheck { margin: 0 0 12px; }

.person-row { border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 12px 12px 6px; margin-bottom: 12px; background: var(--surface-2); }
.link-remove { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 13px; padding: 2px 0; min-height: 0; box-shadow: none; }
.link-remove:hover { background: none; text-decoration: underline; filter: none; transform: none; box-shadow: none; }

.lex-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.lex-actions .btn-save { margin-left: 4px; }

/* ===== Kunden-Liste in der Verwaltung ===== */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cust-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.cust-row {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; text-decoration: none; color: var(--ink);
  border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 13px 15px;
  background: var(--surface-2); box-shadow: var(--shadow-sm);
}
.cust-row:hover { border-color: rgba(52, 211, 153, .5); transform: translateY(-1px); }
.cust-main { display: inline-flex; align-items: center; gap: 8px; }
.cust-sub { flex: 1; }

@media (max-width: 460px) {
  .mfield > input, .mfield > select, .mfield > textarea { padding: 21px 12px 6px; }
  .lex-actions { justify-content: stretch; }
  .lex-actions .btn-save, .lex-actions .btn-danger { flex: 1; }
  .lex-actions .btn-secondary { flex: 1; }
}
