/* EmpCo Checker — zentrales CI
   Wird in ALLEN Seiten via <link rel="stylesheet" href="/theme.css"> eingebunden.
   Farbschema: Orange-Akzent (Bastian), neutrales Grau/Weiß, klare Ampeln. */

:root {
  /* Marke */
  --primary:      #FF6B35;   /* Orange — Bastian-Akzent, Buttons, Links */
  --primary-hi:   #ff8158;   /* helleres Orange — Hover */
  --primary-lo:   #e5551b;   /* dunkleres Orange — Active */
  --primary-soft: #fff2ec;   /* helles Orange — Hover-Chips */

  /* Text & Flächen */
  --ink:          #111111;   /* Haupttext */
  --ink-2:        #334155;   /* Sekundärtext */
  --muted:        #64748b;   /* Sekundärtext hell */
  --line:         #e5e7eb;   /* Rahmen/Trenner */
  --bg:           #f8fafc;   /* Seitenhintergrund */
  --card:         #ffffff;   /* Karten */
  --hover:        #f1f5f9;   /* Zeilen-Hover */

  /* Ampel/Status */
  --ok:           #16a34a;
  --ok-soft:      #dcfce7;
  --warn:         #f59e0b;
  --warn-soft:    #fef3c7;
  --danger:       #dc2626;
  --danger-soft:  #fee2e2;

  /* Form */
  --radius:       10px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 2px rgba(15, 23, 42, .06);
  --shadow:       0 1px 3px rgba(15, 23, 42, .08), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg:    0 10px 30px rgba(15, 23, 42, .18);

  --font: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset & Basis ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-lo); text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- Typography ---------- */
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }
p  { color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- Wortmarke: "I'm Bastian" + oranger Strich ---------- */
/* Verwendung: <span class="wordmark">I<i>&#39;</i>m Bastian</span>
   Der Strich links wird per ::before erzeugt. */
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; letter-spacing: -.01em;
  color: var(--ink);
}
.wordmark::before {
  content: "";
  display: inline-block;
  width: 4px; height: 22px; border-radius: 2px;
  background: var(--primary);
}
.wordmark i { font-style: normal; color: var(--primary); }
.wordmark small {
  color: var(--muted); font-size: 13px; font-weight: 500;
  padding-left: 10px; border-left: 1px solid var(--line);
  margin-left: 4px;
}

/* ---------- Layout-Utilities ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.container-narrow { max-width: 460px; margin: 0 auto; padding: 24px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1 1 auto; }
.center { display: flex; align-items: center; justify-content: center; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  position: sticky; top: 0; z-index: 40;
}
.site-header .inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  max-width: 1400px; margin: 0 auto;
}
.site-header .center-name {
  text-align: center; color: var(--ink-2); font-weight: 600;
}
.site-header .right { justify-self: end; position: relative; }

/* User-Dropdown */
.user-menu-btn {
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px 6px 6px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink);
}
.user-menu-btn:hover { background: var(--hover); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 50;
}
.user-menu-panel .head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.user-menu-panel .head .name { font-weight: 600; }
.user-menu-panel .head .email { color: var(--muted); font-size: 12px; margin-top: 2px; }
.user-menu-panel a, .user-menu-panel button {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; color: var(--ink); background: transparent;
  border: none; border-radius: 6px; font-size: 13px;
}
.user-menu-panel a:hover, .user-menu-panel button:hover {
  background: var(--hover); text-decoration: none;
}

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card .card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.card .card-sub { color: var(--muted); font-size: 12px; margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; line-height: 1;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-lo); border-color: var(--primary-lo); color: #fff; }
.btn-ghost {
  background: #fff; color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) { background: var(--hover); }
.btn-danger {
  background: #fff; color: var(--danger); border-color: var(--line);
}
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* Link-Look (Text-Button) */
.linkbtn {
  background: none; border: none; color: var(--primary);
  font-size: 13px; padding: 0; cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }

/* ---------- Inputs ---------- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="url"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, .15);
}
textarea { resize: vertical; min-height: 90px; font-family: inherit; }
.field { margin-bottom: 14px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.field .err { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ---------- Table ---------- */
.table-wrap {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden;
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th {
  text-align: left; padding: 10px 12px;
  background: #f8fafc;
  color: var(--muted); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .03em;
}
table.tbl tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--hover); }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl td.center, table.tbl th.center { text-align: center; }
table.tbl td.right, table.tbl th.right { text-align: right; }

/* Zeilen-Status */
tr.row-crawling td { background: #f8fafc; color: var(--muted); }
tr.row-checking td { background: #fffbeb; }
tr.row-error td    { background: #fef2f2; }

/* ---------- Badges + Ampel-Kreise ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
}
.badge-ok      { color: var(--ok);     background: var(--ok-soft);     border-color: transparent; }
.badge-warn    { color: #92400e;       background: var(--warn-soft);   border-color: transparent; }
.badge-danger  { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge-muted   { color: var(--muted);  background: #f1f5f9;            border-color: transparent; }

.risk-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.risk-high   { background: var(--danger); }
.risk-medium { background: var(--warn); }
.risk-low    { background: var(--ok); }
.risk-none   { background: var(--line); }

/* Chip für Emails/User */
.chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-lo);
  font-size: 11px; font-weight: 500;
}
.chip + .chip { margin-left: 4px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .12s ease;
}
.modal-card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 720px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: popIn .14s ease;
}
.modal-card.modal-lg { max-width: 960px; }
.modal-card.modal-sm { max-width: 460px; }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: transparent; border: none; font-size: 22px; color: var(--muted); cursor: pointer;
  line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { background: var(--hover); color: var(--ink); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  padding: 12px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end;
  background: #fafbfc;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn  { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }

/* ---------- Toast/Banner ---------- */
.banner {
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.banner-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.banner-ok      { background: var(--ok-soft); border-color: transparent; color: #166534; }
.banner-warn    { background: var(--warn-soft); border-color: transparent; color: #92400e; }
.banner-danger  { background: var(--danger-soft); border-color: transparent; color: #991b1b; }

.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--ink); color: #fff;
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; box-shadow: var(--shadow-lg);
  animation: slideIn .18s ease;
  max-width: 340px;
}
.toast-ok { background: var(--ok); }
.toast-err { background: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Findings-spezifische Kästen (Modal-Content) ---------- */
.finding {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 16px; background: #fff;
}
.finding + .finding { margin-top: 0; }
.finding-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.finding-head .title { font-weight: 600; font-size: 14px; }
.finding-head .actions { display: flex; gap: 8px; align-items: center; }
.finding-head select { padding: 4px 8px; font-size: 12px; width: auto; }
.finding-block { margin-bottom: 12px; }
.finding-block-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 6px;
}
.quote-orig {
  background: #fef9c3; border-left: 4px solid #eab308;
  padding: 10px 12px; border-radius: 6px;
  font-size: 13px; color: #713f12;
  white-space: pre-wrap;
}
.quote-alt {
  background: #f0fdf4; border-left: 4px solid var(--ok);
  padding: 10px 12px; border-radius: 6px;
  font-size: 13px; color: #166534;
  white-space: pre-wrap;
  margin-bottom: 6px;
}
.quote-alt .alt-label {
  display: block; font-size: 11px; font-weight: 700; color: var(--ok);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 4px;
}
.evidence-list {
  list-style: none; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.evidence-list li {
  background: #eff6ff; color: #1e40af; padding: 3px 10px; border-radius: 999px; font-size: 12px;
}
.foot-note {
  font-size: 12px; color: var(--muted);
  padding: 8px 12px; background: #f8fafc; border-radius: 6px;
  margin-top: 8px; line-height: 1.55;
}
.foot-note b { color: var(--ink-2); }
.foot-note .src { display: block; margin-top: 4px; word-break: break-all; }

/* ---------- App-Layout mit Sidebar ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 60px);
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 60px);
  position: sticky; top: 60px;
}
.sidebar h4 {
  font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 8px;
}
.sheet-item {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; background: transparent;
  display: block; text-align: left; width: 100%;
  transition: background .1s;
}
.sheet-item:hover { background: var(--hover); }
.sheet-item.active { background: var(--primary-soft); border-color: var(--primary); }
.sheet-item .name { font-weight: 600; font-size: 13px; color: var(--ink); word-break: break-word; }
.sheet-item .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sheet-item .meta .badge { margin-left: 4px; }

.main-pane {
  padding: 20px 24px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}
.main-pane .pane-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.main-pane .pane-head h2 { color: var(--ink); }

.empty-state {
  padding: 60px 20px; text-align: center; color: var(--muted);
}
.empty-state h3 { color: var(--ink-2); margin-bottom: 8px; }

.coming-soon {
  margin-top: auto;
  padding: 12px; border-radius: 8px;
  background: linear-gradient(135deg, #fff2ec, #fef3c7);
  border: 1px dashed var(--primary);
  font-size: 12px; color: var(--ink-2);
}
.coming-soon b { color: var(--primary-lo); }

/* ---------- Toggle-Switch ---------- */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 32px; height: 18px; background: var(--line); border-radius: 999px;
  position: relative; transition: background .12s;
}
.switch .track::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 14px; height: 14px; background: #fff; border-radius: 50%;
  transition: transform .12s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(14px); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--line); }
  .site-header .inner { grid-template-columns: auto 1fr auto; }
  .site-header .center-name { text-align: right; font-size: 12px; }
}
