/* ============================================================
   Bitxafe DMS – Admin-Konsole (Operator UI)
   Basierend auf dem DMS-Design, Akzentfarbe: Teal/Cyan
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ——— Design Tokens ——— */
:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);

  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --surface-glass: rgba(255, 255, 255, 0.72);

  --accent: #0f766e;
  --accent-2: #0d9488;
  --accent-soft: #f0fdfa;
  --accent-glow: rgba(13, 148, 136, 0.28);

  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #e11d48;
  --danger-soft: #fff1f2;
  --info: #0284c7;
  --info-soft: #e0f2fe;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 10px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -12px rgba(15, 23, 42, 0.18), 0 8px 12px -6px rgba(15, 23, 42, 0.08);
  --ring: 0 0 0 3px rgba(13, 148, 136, 0.18);

  --sidebar-w: 264px;
  --topbar-h: 64px;
  --content-max: 1240px;
}

/* ——— Reset & Base ——— */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }

body.app {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 88% -8%, rgba(13, 148, 136, 0.10), transparent 55%),
    radial-gradient(900px 520px at 4% 18%, rgba(8, 145, 178, 0.07), transparent 52%),
    linear-gradient(165deg, #f8fafc 0%, #f0fdfa 46%, #f1f5f9 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.app.app--guest { background: #020617; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-2); }

h1, h2, h3, h4 {
  font-family: inherit;
  letter-spacing: -0.02em;
  color: var(--ink);
}

small { color: var(--muted); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

/* ——— Layout ——— */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #0b1020 0%, #111827 48%, #0f172a 100%);
  color: #e2e8f0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #818cf8 0%, #4f46e5 55%, #4338ca 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  letter-spacing: -0.03em;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.45);
  flex-shrink: 0;
}
.sidebar-brand__text {
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  min-width: 0;
}
.sidebar-brand__text span {
  display: block;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.5rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.sidebar-section {
  padding: 0.75rem 0.65rem 0.3rem;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #64748b;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.2rem 0.5rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}
.sidebar-nav a svg {
  flex-shrink: 0;
  opacity: 0.78;
  width: 18px;
  height: 18px;
}
.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.sidebar-nav a:hover svg { opacity: 1; }
.sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(79, 70, 229, 0.12) 100%);
  color: #fff;
  border-color: rgba(129, 140, 248, 0.3);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.sidebar-nav a.active svg { opacity: 1; color: #a5b4fc; }

.sidebar-user {
  padding: 0.85rem 0.95rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 0.65rem;
  align-items: center;
}
.sidebar-user__avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.sidebar-user__info { min-width: 0; flex: 1; line-height: 1.2; }
.sidebar-user__name {
  display: block;
  color: #f1f5f9;
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user__role {
  display: block;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}
.sidebar-user__logout {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1 !important;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.sidebar-user__logout:hover {
  background: rgba(225, 29, 72, 0.12);
  border-color: rgba(225, 29, 72, 0.3);
  color: #fda4af !important;
}

.main-wrap {
  flex: 1;
  min-width: 0;
  padding: 1.75rem 2rem 3rem;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}

/* ——— Page head ——— */
.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin: 0 0 1.75rem;
}
.page-head__text { min-width: 0; flex: 1; }
.page-head h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  max-width: 62ch;
}
.page-head__actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ——— Breadcrumb ——— */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0 0 1rem;
}
.breadcrumb a {
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.12s, color 0.12s;
}
.breadcrumb a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.breadcrumb .sep {
  color: var(--muted-2);
  display: inline-flex;
}
.breadcrumb .sep svg { width: 14px; height: 14px; }
.breadcrumb .current {
  color: var(--ink);
  font-weight: 700;
  padding: 0.15rem 0.4rem;
}

/* ——— Toolbar ——— */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 1rem;
}
.toolbar__spacer { flex: 1; }

/* ——— Cards & Sections ——— */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card--compact { padding: 1rem 1.15rem; }
.card--flush { padding: 0; overflow: hidden; }

.card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--line);
}
.card--flush > .card__head + .card__body { padding: 1.25rem 1.35rem; }
.card__body { padding: 1.25rem 1.35rem; }
.card__body--flush { padding: 0; }

.card__title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.card__title .icon-chip { width: 30px; height: 30px; border-radius: 9px; }
.card__subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.card__actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.card h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Sektion (Abschnitt) – Titel über einer Karte oder Gruppe */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 1.5rem 0 0.85rem;
}
.section-title:first-child { margin-top: 0; }

/* Icon-Chip (rundliche farbige Fläche für Icons) */
.icon-chip {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
}
.icon-chip--indigo { background: #eef2ff; color: #4f46e5; }
.icon-chip--sky    { background: #e0f2fe; color: #0284c7; }
.icon-chip--emerald{ background: #ecfdf5; color: #059669; }
.icon-chip--amber  { background: #fffbeb; color: #d97706; }
.icon-chip--rose   { background: #fff1f2; color: #e11d48; }
.icon-chip--slate  { background: #f1f5f9; color: #475569; }
.icon-chip--teal   { background: #f0fdfa; color: #0f766e; }
.icon-chip svg { width: 18px; height: 18px; }

/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
}
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background 0.12s ease; }
table.data tbody tr:hover td { background: rgba(79, 70, 229, 0.035); }
table.data td a { font-weight: 600; color: var(--ink); }
table.data td a:hover { color: var(--accent); }
table.data td.t-num { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
table.data td.t-muted { color: var(--muted); }
table.data td.t-actions {
  text-align: right;
  white-space: nowrap;
}
table.data td.t-actions a,
table.data td.t-actions button {
  font-size: 0.82rem;
}

.card--flush .table-wrap { border-radius: 0; }
.card--flush table.data th:first-child,
.card--flush table.data td:first-child { padding-left: 1.35rem; }
.card--flush table.data th:last-child,
.card--flush table.data td:last-child { padding-right: 1.35rem; }

/* ——— Badges / Pills / Status ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.2);
  line-height: 1;
}
.badge--success { background: var(--success-soft); color: #047857; border-color: #a7f3d0; }
.badge--warning { background: var(--warning-soft); color: #b45309; border-color: #fde68a; }
.badge--danger  { background: var(--danger-soft); color: #be123c; border-color: #fecdd3; }
.badge--info    { background: var(--info-soft); color: #0369a1; border-color: #bae6fd; }
.badge--muted   { background: var(--surface-3); color: var(--ink-soft); border-color: var(--line); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}
.status--ok { color: #047857; }
.status--ok::before { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.status--off { color: var(--muted); }
.status--off::before { background: #cbd5e1; box-shadow: 0 0 0 3px rgba(203, 213, 225, 0.3); }
.status--warn { color: #b45309; }
.status--warn::before { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.05rem;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.86rem;
  font-family: inherit;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn--sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 9px;
  gap: 0.3rem;
}
.btn--sm svg { width: 14px; height: 14px; }
.btn--icon {
  padding: 0.5rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.btn--block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
  color: #fff !important;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover {
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.4);
  filter: brightness(1.05);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft) !important;
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover {
  border-color: rgba(79, 70, 229, 0.25);
  background: var(--surface-2);
  color: var(--ink) !important;
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger) !important;
  border-color: #fecdd3;
}
.btn-danger:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.btn-subtle {
  background: var(--surface-3);
  color: var(--ink-soft) !important;
  border-color: transparent;
}
.btn-subtle:hover { background: var(--surface-2); color: var(--ink) !important; }

/* ——— Flash ——— */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1.05rem;
  border-radius: 14px;
  margin-bottom: 1.15rem;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  background: var(--surface);
}
.flash svg { flex-shrink: 0; margin-top: 1px; width: 18px; height: 18px; }
.flash.ok {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #047857;
  border-color: #a7f3d0;
}
.flash.err {
  background: linear-gradient(135deg, #fef2f2 0%, #ffe4e6 100%);
  color: #be123c;
  border-color: #fecdd3;
}
.flash.warn {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #b45309;
  border-color: #fde68a;
}

/* ——— Forms ——— */
.form-group { margin-bottom: 1.05rem; }
.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.form-group .hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.form-group input[type='text'],
.form-group input[type='email'],
.form-group input[type='password'],
.form-group input[type='search'],
.form-group input[type='number'],
.form-group input[type='url'],
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 460px;
  padding: 0.62rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--muted-2); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.55);
  box-shadow: var(--ring);
  background: var(--surface);
}
.form-group textarea { min-height: 112px; max-width: 100%; resize: vertical; }

.form-group input[type='file'] {
  display: block;
  width: 100%;
  max-width: 460px;
  padding: 0.45rem;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.form-group input[type='file']:hover {
  border-color: rgba(79, 70, 229, 0.45);
  background: var(--accent-soft);
}
.form-group input[type='file']::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  box-shadow: 0 4px 10px var(--accent-glow);
}

/* Inline Checkbox label */
.form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.92rem;
  cursor: pointer;
}
.form-check input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* 2-Spalten-Formular */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}
.form-grid .form-group { margin: 0; }
.form-grid .form-group input,
.form-grid .form-group select,
.form-grid .form-group textarea { max-width: 100%; }
.form-grid .span-2 { grid-column: span 2; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

/* Inline form (single-row) */
.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.form-inline input,
.form-inline select { max-width: 280px; }

/* ——— Empty state ——— */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2.25rem 1.25rem;
  color: var(--muted);
}
.empty-state__icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--muted-2);
}
.empty-state__icon svg { width: 24px; height: 24px; }
.empty-state__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.empty-state p { margin: 0; max-width: 48ch; }
.empty-state .btn { margin-top: 0.5rem; }

/* ——— Dashboard ——— */
.dash-hero {
  position: relative;
  padding: 1.75rem 1.85rem;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(14, 165, 233, 0.05) 100%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute;
  top: -45%;
  right: -10%;
  width: 55%;
  height: 170%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 65%);
  pointer-events: none;
}
.dash-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
}
.dash-hero__text { min-width: 0; }
.dash-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 2.6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}
.dash-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 56ch;
}
.dash-hero__meta {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.dash-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(79, 70, 229, 0.08);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.18);
}
.dash-hero__cta { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  position: relative;
  padding: 1.05rem 1.15rem 1.15rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(79, 70, 229, 0.18);
}
.stat-card__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.stat-card .lbl {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.stat-card .num {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.stat-card__icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.stat-card__icon svg { width: 16px; height: 16px; }
.stat-card--sky .stat-card__icon     { background: #e0f2fe; color: #0284c7; }
.stat-card--emerald .stat-card__icon { background: #ecfdf5; color: #059669; }
.stat-card--amber .stat-card__icon   { background: #fffbeb; color: #d97706; }

/* Quick-Action-Cards – kompakte Handlungsoptionen auf dem Dashboard */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  color: inherit !important;
  text-decoration: none !important;
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s;
}
.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(79, 70, 229, 0.22);
}
.quick-action__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.quick-action__text { min-width: 0; flex: 1; }
.quick-action__title {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.quick-action__desc {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.quick-action__arrow {
  color: var(--muted-2);
  transition: transform 0.18s, color 0.18s;
}
.quick-action:hover .quick-action__arrow {
  transform: translateX(2px);
  color: var(--accent);
}

/* ——— Tree (Akten) ——— */
.tree { list-style: none; padding-left: 0; margin: 0; }
.tree ul {
  list-style: none;
  padding-left: 1.1rem;
  margin: 0.2rem 0 0.2rem 0.2rem;
  border-left: 1px dashed var(--line-strong);
}
.tree li { margin: 0.15rem 0; padding-left: 0.2rem; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.55rem;
  border-radius: 9px;
  transition: background 0.12s;
}
.tree-row:hover { background: var(--surface-2); }
.tree-row__name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--ink);
}
.tree-row__name svg { color: var(--accent); width: 16px; height: 16px; }
.tree-row__actions {
  display: inline-flex;
  gap: 0.3rem;
  margin-left: auto;
}
.tree-inline-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 0.55rem 0.6rem;
}

/* ——— Dokument-Vorschau ——— */
#vorschau { scroll-margin-top: 1.25rem; }
.doc-preview-card { overflow: hidden; }
.doc-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.doc-preview-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.doc-preview-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.22);
}
.doc-preview {
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--line);
}
.doc-preview--pdf iframe {
  display: block;
  width: 100%;
  min-height: min(78vh, 900px);
  height: 78vh;
  border: none;
  background: #334155;
}
.doc-preview--image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: min(78vh, 900px);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.doc-preview--image img {
  max-width: 100%;
  max-height: min(78vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
}
.doc-preview-hint {
  margin: 0.85rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* Detail-Liste (Dokument-Metadaten) */
.detail-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem 1.25rem;
  margin: 0;
}
@media (min-width: 640px) {
  .detail-list { grid-template-columns: max-content 1fr; }
}
.detail-list dt {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  align-self: center;
}
.detail-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.doc-actions__form { display: inline; }

.search-preview-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 6px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  vertical-align: middle;
}

/* ——— Pagination ——— */
.pager {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.pager__info { margin-right: auto; }

/* ——— Login (Glass + Landschaft) ——— */
.login-page {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background-color: #0c1222;
  background-image:
    radial-gradient(ellipse 110% 75% at 50% 105%, rgba(2, 6, 23, 0.88) 0%, transparent 58%),
    radial-gradient(ellipse 90% 60% at 50% -15%, rgba(99, 102, 241, 0.35), transparent 52%),
    radial-gradient(ellipse 70% 55% at 100% 30%, rgba(56, 189, 248, 0.22), transparent 48%),
    radial-gradient(ellipse 65% 50% at 0% 70%, rgba(167, 139, 250, 0.2), transparent 46%),
    linear-gradient(168deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 27, 75, 0.72) 42%, rgba(15, 23, 42, 0.9) 100%),
    url('../img/login-landscape.jpg');
  background-position: center, center, center, center, center, center;
  background-size: cover, cover, cover, cover, cover, cover;
  background-repeat: no-repeat;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 75% 55%, rgba(99, 102, 241, 0.1) 0%, transparent 38%),
    repeating-linear-gradient(-14deg, transparent, transparent 3px, rgba(255, 255, 255, 0.018) 3px, rgba(255, 255, 255, 0.018) 4px);
  pointer-events: none;
  opacity: 0.85;
}
.login-page::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 100% 55% at 50% 100%, rgba(2, 6, 23, 0.55), transparent 62%);
  pointer-events: none;
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2.25rem;
  border-radius: 28px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.52) 45%, rgba(248, 250, 252, 0.62) 100%);
  backdrop-filter: blur(32px) saturate(175%);
  -webkit-backdrop-filter: blur(32px) saturate(175%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.06),
    0 24px 48px -12px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.45) inset,
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}
.login-card__brand {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(129, 140, 248, 0.95) 0%, rgba(79, 70, 229, 0.98) 55%, rgba(67, 56, 202, 1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 12px 32px rgba(79, 70, 229, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
.login-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.login-card .sub {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  line-height: 1.55;
}
.login-card .flash.err {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.92) 0%, rgba(255, 228, 230, 0.88) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(252, 165, 165, 0.65);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
.login-card .form-group input[type='email'],
.login-card .form-group input[type='password'] {
  max-width: 100%;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}
.login-card .form-group input[type='email']:focus,
.login-card .form-group input[type='password']:focus {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

/* ——— Error pages ——— */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.25rem;
  gap: 1rem;
}
.error-page__code {
  font-size: clamp(3.5rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  color: var(--accent);
  line-height: 1;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.error-page h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
}
.error-page p { margin: 0; color: var(--muted); max-width: 52ch; }

/* ——— Utility ——— */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-05 { gap: 0.5rem; }
.gap-075 { gap: 0.75rem; }
.gap-1 { gap: 1rem; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0 !important; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.86rem; }
.text-xs { font-size: 0.78rem; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }

/* ——— Responsive ——— */
@media (max-width: 960px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-height: auto;
    max-height: none;
    position: relative;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .sidebar-scroll {
    padding: 0.5rem;
    overflow: visible;
  }
  .sidebar-section { padding-top: 0.55rem; }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .sidebar-nav a {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 130px;
  }
  .sidebar-user {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  .main-wrap { padding: 1.25rem 1rem 2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head__actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .doc-preview--pdf iframe {
    height: 60vh;
    min-height: 320px;
  }
  .dash-hero__inner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Admin-Konsole – spezifische Erweiterungen
   ============================================================ */

/* Admin-Badge im Brand (macht optisch klar: Admin, nicht DMS) */
.sidebar-brand__text::after {
  content: 'Operator Console';
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(160, 255, 240, 0.55);
  margin-top: 2px;
}

/* Umgebungs-Badge INT / PROD */
.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1;
}
.env-badge--int {
  color: #0369a1;
  background: #e0f2fe;
  border-color: rgba(3, 105, 161, 0.22);
}
.env-badge--prod {
  color: #92400e;
  background: #fffbeb;
  border-color: rgba(146, 64, 14, 0.28);
}

/* Schlanker Code-Block (DSNs, Config-Snippets) */
.code-block {
  margin: 0;
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: #e2e8f0;
  background: #0f172a;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  white-space: pre;
}
.code-block .c-comment { color: #94a3b8; }
.code-block .c-key     { color: #67e8f9; }
.code-block .c-val     { color: #fde68a; }

/* Callout (z. B. Initial-Passwort anzeigen) */
.callout {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.callout__icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  flex: 0 0 auto;
}
.callout__body { flex: 1; min-width: 0; }
.callout__title { font-weight: 700; margin-bottom: 0.2rem; color: var(--ink); }
.callout__text  { color: var(--ink-soft); font-size: 14px; }
.callout--warn  { border-color: rgba(217, 119, 6, 0.35); background: #fffbeb; }
.callout--warn .callout__icon { background: #fef3c7; color: #b45309; }
.callout--danger { border-color: rgba(225, 29, 72, 0.28); background: #fff1f2; }
.callout--danger .callout__icon { background: #ffe4e6; color: #be123c; }
.callout--success { border-color: rgba(5, 150, 105, 0.3); background: #ecfdf5; }
.callout--success .callout__icon { background: #d1fae5; color: #047857; }

/* Event-Timeline (Instanz-View) */
.event-list { display: flex; flex-direction: column; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.event-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.event-item__dot {
  width: 22px; height: 22px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.event-item__dot--info    { background: #0284c7; }
.event-item__dot--success { background: #059669; }
.event-item__dot--warn    { background: #d97706; }
.event-item__dot--error   { background: #e11d48; }
.event-item__body { min-width: 0; }
.event-item__msg { color: var(--ink-soft); font-size: 14px; word-break: break-word; }
.event-item__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.event-item__time { font-size: 12px; color: var(--muted); white-space: nowrap; font-family: var(--font-mono); }

/* Kompakte Kennzahl-Zeile */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}
.kv {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.kv__label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kv__value { font-weight: 600; color: var(--ink); margin-top: 2px; font-size: 14.5px; word-break: break-word; }
.kv__value .mono { font-family: var(--font-mono); font-size: 13.5px; }

/* Gefahren-Formularbereich */
.danger-zone {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px dashed rgba(225, 29, 72, 0.4);
  border-radius: var(--radius);
  background: #fff5f6;
}
.danger-zone h3 {
  margin: 0 0 0.25rem;
  font-size: 14px;
  color: #be123c;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.danger-zone p { margin: 0 0 0.75rem; color: var(--ink-soft); font-size: 14px; }

/* Suche oberhalb der Kundenliste */
.list-filter {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.85rem;
}
.list-filter input[type="text"],
.list-filter input[type="search"] {
  flex: 1;
  max-width: 360px;
}
