:root {
  --bg: #0b1020;
  --panel: rgba(17, 24, 39, .84);
  --panel-solid: #111827;
  --panel-2: rgba(30, 41, 59, .86);
  --line: rgba(226, 232, 240, .13);
  --text: #f8fafc;
  --muted: #a8b3c7;
  --primary: #2f80ed;
  --primary-2: #1d4ed8;
  --cyan: #06b6d4;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #f59e0b;
  --radius: 8px;
  --shadow: 0 22px 70px rgba(0,0,0,.34);
  --soft-shadow: 0 12px 32px rgba(2, 6, 23, .24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(47,128,237,.20), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(6,182,212,.16), transparent 32%),
    linear-gradient(145deg, #08111f, #0b1020 46%, #111827);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(37, 99, 235, .28); }
button.secondary { background: rgba(51, 65, 85, .88); box-shadow: none; }
button.secondary:hover { background: rgba(71, 85, 105, .96); box-shadow: none; }
button.danger { background: var(--red); }
button.success { background: var(--green); }
button.ghost {
  background: rgba(15, 23, 42, .34);
  border: 1px solid var(--line);
  box-shadow: none;
}
button.icon {
  width: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
button.action-chip {
  width: auto;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  white-space: nowrap;
  font-size: 13px;
}
button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, .72);
  color: var(--text);
  font-size: 16px;
  padding: 9px 11px;
  outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(59, 130, 246, .8);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
  background: rgba(15, 23, 42, .88);
}
textarea { min-height: 86px; resize: vertical; }
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
}
.boot {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(rgba(8,17,31,.68), rgba(8,17,31,.92)), url("./assets/login_bg.jpg") center / cover;
}
.brand-mark {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: url("./assets/icon-512.png") center / cover, linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: var(--shadow);
  font-weight: 900;
  color: transparent;
  overflow: hidden;
}
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(rgba(8,17,31,.58), rgba(8,17,31,.93)), url("./assets/login_bg.jpg") center / cover;
}
.login-panel {
  width: min(440px, 100%);
  background: rgba(15,23,42,.76);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 26px;
  backdrop-filter: blur(18px);
}
.login-panel h1 { margin: 12px 0 4px; }
.login-panel p { margin: 0 0 20px; color: var(--muted); }
.login-support-link {
  display: block;
  margin-top: 14px;
  font-size: 12px;
  color: rgba(168, 179, 199, .55);
  text-decoration: none;
  text-align: center;
  letter-spacing: .2px;
  transition: color .2s;
}
.login-support-link:hover { color: rgba(168, 179, 199, .9); }
.login-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.login-legal-btn {
  font-size: 11.5px;
  color: rgba(168, 179, 199, .45);
  background: none;
  border: none;
  box-shadow: none;
  padding: 2px 4px;
  min-height: auto;
  font-weight: 500;
  transition: color .18s;
  cursor: pointer;
}
.login-legal-btn:hover { color: rgba(168, 179, 199, .85); transform: none; box-shadow: none; }
.login-legal-sep { color: rgba(168, 179, 199, .25); font-size: 11px; }
.legal-modal { width: min(700px, 100%); }
.legal-modal .legal-preview { max-height: 70vh; overflow-y: auto; }

/* Recht-Bereich: klare Trennung App-Texte / eigene Texte / Daten */
.legal-intro {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  border-left: 3px solid var(--primary);
}
.legal-intro p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text); }
.legal-tabgroups {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.legal-tabgroup { display: flex; flex-direction: column; gap: 6px; }
.legal-tabgroup + .legal-tabgroup { padding-left: 18px; border-left: 1px solid var(--line); }
.legal-tabgroup-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .75;
}
.legal-tabgroup-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.legal-owner {
  grid-column: 1 / -1;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid var(--line);
}
.legal-owner.mine {
  background: rgba(34, 197, 94, .10);
  border-color: rgba(34, 197, 94, .38);
}
.legal-owner.app {
  background: rgba(59, 130, 246, .10);
  border-color: rgba(59, 130, 246, .38);
}
@media (max-width: 640px) {
  .legal-tabgroups { flex-direction: column; align-items: stretch; gap: 12px; }
  .legal-tabgroup + .legal-tabgroup { padding-left: 0; border-left: 0; padding-top: 12px; border-top: 1px solid var(--line); }
}

/* Einstellungen: Aufklapp-Abschnitte (native <details>) */
.settings-section > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  user-select: none;
  padding: 13px 2px;
}
.settings-section > summary::-webkit-details-marker { display: none; }
.settings-section > summary::after {
  content: "▸";
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  transition: transform .2s ease;
}
.settings-section[open] > summary::after { transform: rotate(90deg); }
.settings-section .sec-ico { font-size: 17px; line-height: 1; }
.settings-section .sec-hint { font-size: 12px; font-weight: 500; color: var(--muted); }
.settings-section > .form-grid,
.settings-section > form { padding: 4px 2px 16px; }
.settings-accordion > .settings-section + .settings-section { border-top: 1px solid var(--line); }
.settings-save { width: 100%; margin-top: 16px; }
.settings-section.card[open] > summary { margin-bottom: 8px; border-bottom: 1px solid var(--line); }

/* Kundenakte: Belege als Karten-Raster (mobil 1 Spalte) */
.customer-docs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
  align-items: start;
}

.layout {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.side {
  border-right: 1px solid var(--line);
  background: rgba(8, 17, 31, .78);
  padding: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
}
.nav { flex: 1; }
.side-support {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.side-support a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.side-support a:hover {
  color: var(--text);
  background: rgba(255,255,255,.06);
}
.side-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.side-brand strong { display: block; }
.side-brand small { color: var(--muted); }
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
  overflow-y: auto;
}
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.nav-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .6;
  padding: 7px 10px 3px;
}
.nav button {
  justify-content: flex-start;
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: center;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  min-height: 36px;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 600;
  font-size: 14px;
  padding: 0 10px;
}
.nav .nav-ico { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav button.active,
.nav button:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, .30);
  background: linear-gradient(135deg, rgba(59,130,246,.22), rgba(6,182,212,.10));
  transform: none;
}

/* Mobile-Tableiste + „Mehr"-Sheet (per Media-Query eingeblendet) */
.tabbar { display: none; }
.nav-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .62);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity .2s ease;
}
.nav-sheet-backdrop.open { opacity: 1; }
.nav-sheet {
  width: 100%;
  background: var(--panel-solid);
  border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  max-height: 82vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .22s ease;
}
.nav-sheet-backdrop.open .nav-sheet { transform: translateY(0); }
.nav-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.nav-sheet-head strong { font-size: 16px; }
.nav-sheet-group { margin-bottom: 14px; }
.nav-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.nav-sheet-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 66px;
  background: rgba(15, 23, 42, .6);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}
.nav-sheet-btn .nav-ico { font-size: 20px; }
.nav-sheet-btn.active {
  border-color: rgba(59, 130, 246, .5);
  background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(6,182,212,.12));
}
.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
}
.admin-thread-list .support-thread {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 8px;
  width: 100%;
  background: rgba(15, 23, 42, .55);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
  border-radius: var(--radius);
  min-height: auto;
}
.admin-thread-list .support-thread:hover {
  border-color: rgba(59, 130, 246, .45);
  transform: none;
}
.admin-thread-list .support-thread.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, .18);
}
.admin-thread-list .support-thread.unread strong::after {
  content: " ●";
  color: var(--cyan);
}
.admin-thread-list .support-thread small {
  color: var(--muted);
  font-size: 11px;
}
.admin-chat-panel .admin-chat-head {
  margin-bottom: 10px;
}
.admin-chat-messages {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 2px;
  margin-bottom: 10px;
}
.support-msg {
  padding: 8px 12px;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, .55);
  border: 1px solid var(--line);
  max-width: 85%;
}
.support-msg.from-admin {
  background: rgba(37, 99, 235, .18);
  border-color: rgba(59, 130, 246, .45);
  align-self: flex-end;
}
.support-msg small {
  color: var(--muted);
  font-size: 11px;
  display: block;
  margin-top: 4px;
}
.support-msg p {
  margin: 4px 0;
  white-space: pre-wrap;
}
#admin-reply-form {
  gap: 8px;
}
#admin-reply-form input {
  flex: 1;
}
.tagline {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cyan);
  margin: -4px 0 12px;
  font-weight: 700;
}
.audience-notice {
  background: rgba(6, 182, 212, .12);
  border: 1px solid rgba(6, 182, 212, .30);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  margin: 8px 0 4px;
  text-align: left;
}
.audience-notice strong {
  color: var(--cyan);
}
.legal-preview h3 {
  margin: 18px 0 8px;
  font-size: 14px;
  color: var(--text);
}
.legal-preview p, .legal-preview ul, .legal-preview ol {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.legal-preview ul, .legal-preview ol {
  padding-left: 18px;
}
.legal-preview code {
  background: rgba(15, 23, 42, .6);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 12px;
}
.link-button:hover {
  color: #93c5fd;
  transform: none;
}
.main {
  min-width: 0;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.13), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.015), transparent 260px);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.topbar h1 { margin: 0; font-size: 24px; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.doc-actions {
  gap: 7px;
  align-items: center;
  overflow: visible;
}
.grid {
  display: grid;
  gap: 14px;
}
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-title {
  margin: 22px 0 12px;
  color: var(--text);
  font-size: 18px;
}
.dashboard-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.dashboard-menu.dashboard-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 4px;
}
.dashboard-tile {
  min-height: 132px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  text-align: left;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}
.dashboard-primary .dashboard-tile {
  min-height: 150px;
}
.dashboard-tile.primary {
  background: linear-gradient(135deg, rgba(59,130,246,.92), rgba(37,99,235,.72));
  border-color: rgba(147,197,253,.42);
}
.dashboard-tile.accent {
  background: linear-gradient(135deg, rgba(20,184,166,.88), rgba(6,182,212,.60));
  border-color: rgba(153,246,228,.42);
}
.dashboard-tile.primary small,
.dashboard-tile.accent small {
  color: rgba(255,255,255,.82);
}
.dashboard-tile span {
  font-size: 28px;
  line-height: 1;
}
.dashboard-tile strong {
  font-size: 17px;
}
.dashboard-tile small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.25;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
}
.logo-settings {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.logo-preview {
  width: 118px;
  height: 82px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight: 900;
}
.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.document-head {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
.doc-logo {
  max-width: 136px;
  max-height: 76px;
  object-fit: contain;
}
.protocol {
  margin-top: 18px;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
}
.protocol ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.card h2, .card h3 { margin: 0 0 12px; }
.stat {
  min-height: 122px;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
}
button.stat {
  width: 100%;
  color: var(--text);
  text-align: left;
  background: var(--panel);
}
.stat::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.34), transparent 66%);
}
.stat small { color: var(--muted); }
.stat strong { font-size: 28px; }
.muted { color: var(--muted); }
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid .wide { grid-column: 1 / -1; }
.editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 16px;
  align-items: start;
  max-width: 1480px;
}
.editor-left,
.editor-right {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.editor-right {
  position: sticky;
  top: 20px;
}
.editor-summary {
  display: grid;
  gap: 14px;
}
.editor-summary #document-total {
  font-size: 22px;
}
.position-composer h2 { color: #60a5fa; }
.deadline-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.deadline-chips button {
  background: rgba(15, 23, 42, .52);
  border: 1px solid rgba(148, 163, 184, .28);
  box-shadow: none;
}
.line-items {
  display: grid;
  gap: 10px;
}
.line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.line-item:last-child { border-bottom: 0; }
.line-item span {
  display: block;
  margin-top: 3px;
}
.line-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.line-actions .icon {
  width: 34px;
  height: 34px;
  min-height: 34px;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(2, 6, 23, .16);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}
th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(148,163,184,.15);
  color: #dbe4ef;
  font-size: 12px;
  font-weight: 700;
}
.badge.green { background: rgba(22,163,74,.18); color: #86efac; }
.badge.red { background: rgba(220,38,38,.18); color: #fca5a5; }
.badge.amber { background: rgba(245,158,11,.18); color: #fde68a; }
.document-preview {
  background: white;
  color: #111827;
  width: min(780px, 100%);
  margin: 0 auto;
  padding: 40px;
  border-radius: 2px;
  min-height: 860px;
}
.document-preview h1 { color: #2563eb; text-align: right; margin: 0; }
.doc-lines { border-top: 1px solid #cbd5e1; margin-top: 24px; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2,6,23,.78);
  padding: 20px;
  z-index: 30;
}
.modal {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 16px;
}
#toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 50;
}
.toast {
  background: #020617;
  color: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.hidden { display: none !important; }
.danger-zone { border-color: rgba(220,38,38,.45); }
.ghost-maintenance {
  opacity: .24;
  transform: scale(.96);
}
.ghost-maintenance:hover,
.ghost-maintenance:focus-visible {
  opacity: 1;
  transform: scale(1);
}

/* "Zugang anfragen" – Interessenten-CTA auf dem Login-Screen */
.interest-cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cyan), var(--primary));
  color: #fff;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 12px 30px rgba(6, 182, 212, .32);
}
.interest-cta::after {
  content: "";
  position: absolute;
  top: 0;
  left: -65%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-18deg);
  animation: interest-shine 3.4s ease-in-out infinite;
}
.interest-cta:hover { box-shadow: 0 16px 38px rgba(6, 182, 212, .45); }
@keyframes interest-shine {
  0% { left: -65%; }
  60% { left: 135%; }
  100% { left: 135%; }
}

.interest-modal {
  width: min(430px, 100%);
  position: relative;
  text-align: center;
  padding: 28px 24px 22px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(6,182,212,.16), transparent 60%),
    var(--panel-solid);
}
.interest-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 14px;
  background: rgba(51, 65, 85, .7);
  box-shadow: none;
}
.interest-badge {
  width: 66px;
  height: 66px;
  margin: 2px auto 12px;
  display: grid;
  place-items: center;
  font-size: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(6,182,212,.55), rgba(47,128,237,.25));
  box-shadow: 0 0 0 1px var(--line), 0 14px 34px rgba(6, 182, 212, .4);
  animation: interest-pulse 2.6s ease-in-out infinite;
}
@keyframes interest-pulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 0 0 1px var(--line), 0 12px 28px rgba(6,182,212,.30); }
  50% { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line), 0 20px 44px rgba(6,182,212,.55); }
}
.interest-hero h2 { margin: 0 0 6px; }
.interest-hero p {
  margin: 0 auto 18px;
  max-width: 38ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.interest-modal form.grid { gap: 12px; text-align: left; }
.interest-send {
  margin-top: 4px;
  background: linear-gradient(135deg, var(--cyan), var(--primary));
}
.interest-direct {
  margin-top: 16px;
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}
@media (prefers-reduced-motion: reduce) {
  .interest-cta::after, .interest-badge { animation: none; }
}

/* Speicherbelegung im Admin-Panel */
.storage-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .85);
  border: 1px solid var(--line);
  overflow: hidden;
}
.storage-bar-fill {
  height: 100%;
  min-width: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  box-shadow: 0 0 14px rgba(34, 197, 94, .45);
  transition: width .6s ease;
}
.storage-bar-fill.warn {
  background: linear-gradient(90deg, #d97706, #fbbf24);
  box-shadow: 0 0 14px rgba(251, 191, 36, .45);
}
.storage-bar-fill.danger {
  background: linear-gradient(90deg, #dc2626, #f87171);
  box-shadow: 0 0 14px rgba(248, 113, 113, .5);
}

/* § 19 UStG Badge im Editor */
.editor-total-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.badge-§19 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #22c55e;
  background: rgba(34, 197, 94, .12);
  border: 1px solid rgba(34, 197, 94, .35);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

/* § 19 Toggle-Block in den Einstellungen */
.smallbiz-toggle-block {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, .5);
  transition: border-color .2s, background .2s;
}
.smallbiz-toggle-block.is-smallbiz {
  border-color: rgba(34, 197, 94, .4);
  background: rgba(34, 197, 94, .06);
}

/* E-Rechnung */
.action-chip.erechnung-chip {
  background: rgba(6, 182, 212, .16);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, .42);
  box-shadow: none;
}
.action-chip.erechnung-chip:hover {
  background: rgba(6, 182, 212, .28);
  box-shadow: none;
  transform: translateY(-1px);
}
.readiness-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.readiness-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text);
}
.readiness-list li.missing { color: var(--muted); }
.readiness-list .rl-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.readiness-list li.ok .rl-mark { background: rgba(34, 197, 94, .18); color: #22c55e; }
.readiness-list li.missing .rl-mark { background: rgba(245, 158, 11, .16); color: #f59e0b; }
.kanban-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.doc-column {
  align-content: start;
  display: grid;
  gap: 10px;
}
.doc-mini-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(2, 6, 23, .18);
  padding: 12px;
  min-width: 0;
}
.doc-status-line {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 700;
}
.doc-mini-card .toolbar {
  width: 100%;
  min-width: 0;
}
.document-detail-modal {
  width: min(620px, 100%);
}
.detail-card {
  padding: 14px;
  color: var(--text);
}
.detail-head h2 {
  color: #14b8a6;
  margin: 0;
  font-size: clamp(22px, 4vw, 30px);
}
.detail-card p {
  margin: 8px 0;
  font-size: 18px;
}
.detail-actions {
  margin: 26px 0;
  gap: 18px;
}
.detail-actions button {
  min-width: 132px;
}
.protocol-list {
  list-style: none;
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}
.clickable-row { cursor: pointer; }
.selected-row { background: rgba(59, 130, 246, .14); }
.wide-panel { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: none; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    gap: 4px;
    z-index: 40;
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background: rgba(8, 17, 31, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(18px);
  }
  .tabbar button {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 50px;
    background: transparent;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: none;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 2px;
    white-space: nowrap;
  }
  .tabbar .nav-ico { font-size: 18px; }
  .tabbar button.active {
    color: var(--text);
    background: linear-gradient(135deg, rgba(59,130,246,.22), rgba(6,182,212,.10));
    border-color: rgba(59, 130, 246, .3);
  }
  .main { padding: 20px 16px calc(76px + env(safe-area-inset-bottom)); }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .form-grid, .kanban-grid, .dashboard-menu, .editor-workspace { grid-template-columns: 1fr; }
  .editor-right { position: static; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .document-preview { padding: 22px; min-height: auto; }
}

@media (max-width: 640px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  button { min-height: 42px; }
  .login { padding: 16px; }
  .login-panel { padding: 20px; border-radius: 16px; }
  .main { padding: 16px 12px calc(78px + env(safe-area-inset-bottom)); }
  .tabbar { grid-template-columns: repeat(5, 1fr); }
  .topbar h1 { font-size: 22px; }
  .toolbar { width: 100%; }
  .toolbar button { flex: 0 0 auto; }
  .doc-actions button {
    flex: 1 1 calc(50% - 8px);
    min-width: 92px;
  }
  .doc-actions button.icon {
    flex: 0 0 44px;
    min-width: 44px;
  }
  .card { padding: 14px; border-radius: 14px; }
  .stat { min-height: 104px; }
  .stat strong { font-size: 24px; }
  .deadline-chips { grid-template-columns: 1fr; }
  .line-item {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  .line-sum {
    justify-self: start;
  }
  .line-actions {
    justify-content: flex-start;
  }
  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  thead { display: none; }
  tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(17, 24, 39, .78);
    margin-bottom: 10px;
    overflow: hidden;
  }
  td {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }
  td:last-child { border-bottom: 0; }
  td.toolbar,
  td .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  td.toolbar button,
  td .toolbar button {
    flex: 0 0 auto;
  }
  .modal-backdrop {
    padding: 10px;
    align-items: end;
  }
  .modal {
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
  }
}

@media print {
  body { background: white; }
  .layout, .side, .topbar, .modal .toolbar { display: none !important; }
  .modal-backdrop, .modal {
    display: block;
    position: static;
    background: white;
    border: 0;
    padding: 0;
    max-height: none;
    overflow: visible;
  }
  .document-preview {
    width: 100%;
    min-height: auto;
    padding: 20mm;
  }
}
