/* ShareGuard – CI netzwerk-arzt */
:root {
  --red: #E2001A;
  --red-dark: #B8001A;
  --cream: #F5F1EA;
  --cream-100: #EDE9E1;
  --ink: #1a1a1a;
  --panel: #2a2a2a;
  --border: #e5e7eb;
  --muted: #6b7280;
  --muted-light: #9ca3af;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
code { background: var(--cream-100); padding: 1px 5px; border-radius: 4px; font-size: .85em; }

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

.sidebar {
  width: 240px; flex-shrink: 0; background: var(--panel); color: #d1d5db;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px; padding: 0 20px; height: 64px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-logo {
  width: 32px; height: 32px; border-radius: 7px; background: var(--red);
  color: #fff; font-weight: 800; display: grid; place-items: center;
}
.brand-logo-img { width: 36px; height: 36px; object-fit: contain; display: block; }
.brand-logo-img.lg { width: 56px; height: 56px; }
.brand-title { color: #fff; font-weight: 600; font-size: 14px; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--muted-light); }
.nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  font-weight: 500; color: #d1d5db; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--red); color: #fff; }
.nav svg { width: 18px; height: 18px; }
.sidebar .foot { padding: 12px 20px; font-size: 11px; color: #6b7280; border-top: 1px solid rgba(255,255,255,.1); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 0 24px;
}
.topbar .who { text-align: right; }
.topbar .who .n { font-weight: 500; line-height: 1.2; }
.topbar .who .e { font-size: 11px; color: var(--muted-light); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--cream-100);
  border: 1px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.content { flex: 1; padding: 24px; }
.container { max-width: 1900px; margin: 0 auto; }

/* Mobile-Navigation (Hamburger). Auf Desktop ausgeblendet. */
.nav-burger { display: none; margin-right: auto; }
.nav-overlay { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.head-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 6px; font-weight: 600; font-size: 14px; padding: 9px 16px;
  cursor: pointer; border: 1px solid transparent; transition: all .18s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(226,0,26,.3); }
.btn-danger { background: var(--red-dark); color: #fff; }
.btn-danger:hover { background: #8f0015; }
.btn-ghost { background: #fff; color: #374151; border-color: var(--border); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--muted-light); padding: 6px; border-radius: 6px; transition: color .15s; }
.icon-btn:hover { color: var(--red); }
.icon-btn svg { width: 16px; height: 16px; display: block; }

/* ---------- Cards ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.06); }
.card.pad { padding: 20px; }
.card-hover { transition: all .2s; }
.card-hover:hover { border-color: var(--red); box-shadow: 0 6px 24px rgba(226,0,26,.1); transform: translateY(-2px); }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Stat ---------- */
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .lbl { color: var(--muted); font-size: 14px; }
.stat .ico { width: 36px; height: 36px; border-radius: 8px; background: var(--cream-100); color: var(--muted); display: grid; place-items: center; }
.stat .ico.accent { background: #fef2f2; color: var(--red); }
.stat .val { font-size: 26px; font-weight: 700; margin-top: 12px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 500; padding: 12px 20px; background: var(--cream-100);
}
table.tbl thead th.r, table.tbl td.r { text-align: right; }
table.tbl tbody td { padding: 12px 20px; border-top: 1px solid #f0f0f0; }
table.tbl tbody tr:hover { background: rgba(245,241,234,.5); }
.cell-title { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--muted-light); }
.contact-cell svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Aufmerksamkeits-Puls (z. B. anonyme Freigaben) */
@keyframes pulse-attention {
  0%   { box-shadow: 0 0 0 0 rgba(226,0,26,.55); transform: scale(1); }
  50%  { transform: scale(1.05); }
  70%  { box-shadow: 0 0 0 14px rgba(226,0,26,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,0,26,0); transform: scale(1); }
}
.pulse { animation: pulse-attention 1.6s ease-in-out infinite; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.red { background: #fef2f2; color: var(--red-dark); }
.badge.amber { background: #fef3c7; color: #b45309; }
.badge.orange { background: #ffedd5; color: #c2410c; }
.badge.gray { background: #f3f4f6; color: #6b7280; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 500; color: #374151; margin-bottom: 6px; font-size: 14px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid #d1d5db; border-radius: 6px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); transition: border .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(226,0,26,.12); }
textarea.input { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 16px; }
.row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; accent-color: var(--red); }

/* ---------- Filter bar ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; align-items: center; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted-light); }
.search .input { padding-left: 36px; }
.w-auto { width: auto; }

/* ---------- Filter-Dropdown (Mehrfachauswahl) ---------- */
.filter-dropdown { position: relative; }
.filter-dropdown summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  white-space: nowrap; user-select: none;
}
.filter-dropdown summary::-webkit-details-marker { display: none; }
.filter-dropdown summary svg { width: 14px; height: 14px; color: var(--muted-light); flex-shrink: 0; }
.filter-dropdown[open] summary { border-color: var(--red); }
.filter-dropdown-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 280px; max-height: 280px;
  overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 6px;
}
.filter-dropdown-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px;
  font-size: 13px; cursor: pointer;
}
.filter-dropdown-item:hover { background: var(--cream-100); }
.filter-dropdown-item input { width: 15px; height: 15px; accent-color: var(--red); flex-shrink: 0; }

/* ---------- Empty ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 24px; }
.empty .ec { width: 48px; height: 48px; border-radius: 50%; background: var(--cream-100); display: grid; place-items: center; margin-bottom: 16px; color: var(--muted-light); }
.empty .et { font-weight: 600; }
.empty .eh { font-size: 14px; color: var(--muted); margin-top: 4px; max-width: 420px; }

/* ---------- Alert ---------- */
.alert { display: flex; gap: 8px; padding: 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert.err { background: #fef2f2; border: 1px solid #fecaca; color: var(--red-dark); }
.alert.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ---------- Banner (dunkel) ---------- */
.banner { background: var(--panel); color: #fff; border-radius: 10px; padding: 20px; display: flex; align-items: center; justify-content: space-between; }
.banner .l { color: #d1d5db; font-size: 14px; }
.banner .big { font-size: 30px; font-weight: 700; margin-top: 4px; }
.banner .r { text-align: right; color: #d1d5db; font-size: 14px; }

/* ---------- Dry-Run-Banner ---------- */
.dryrun-banner {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px;
  padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600;
  margin-bottom: 20px;
}
.dryrun-banner svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-top { position: fixed; top: 0; left: 0; right: 0; height: 6px; background: var(--red); }
.login-card { width: 100%; max-width: 420px; }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.login-logo .t { font-size: 20px; font-weight: 700; }
.tabs { display: flex; background: var(--cream-100); border-radius: 8px; padding: 4px; margin-bottom: 24px; }
.tabs a { flex: 1; text-align: center; padding: 8px; border-radius: 6px; font-weight: 500; color: var(--muted); }
.tabs a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mb-4 { margin-bottom: 16px; }
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; } .gap-2 { gap: 8px; }
.hide-sm { }
@media (max-width: 768px) {
  .hide-sm { display: none; }
  /* Sidebar als einblendbare Schublade */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 60;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.3);
  }
  .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
  /* Abdunkelung hinter der Schublade */
  .nav-toggle:checked ~ .nav-overlay {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.4);
  }
  /* Hamburger im Topbar zeigen */
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 8px; cursor: pointer; color: var(--ink);
  }
  .nav-burger svg { width: 22px; height: 22px; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; position: sticky; top: 0; z-index: 50; }
  .page-head h1 { font-size: 20px; }
  .head-actions { flex-wrap: wrap; }
  .banner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .banner .r { text-align: left; }
}
.list-divide > * { padding: 10px 0; border-top: 1px solid #f0f0f0; }
.list-divide > *:first-child { border-top: none; }
.bar { height: 8px; border-radius: 4px; background: var(--red); }
