/* ═══════════════════════════════════════════════════════════
   Tenkan Shared CSS — wird von allen Modulen VOR dem eigenen
   CSS geladen. Modul-CSS überschreibt nur was abweicht.
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS-Variablen ─────────────────────────────────────────── */
:root {
  --primary:      #6B7A52;
  --primary-dark: #556040;
  --accent:       #E8C542;
  --bg:           #faf8f8;
  --bg-side:      #f0eee8;
  --border:       #d9d4c4;
  --text:         #1a1a1a;
  --text-soft:    #666;
  --ok:           #2e7d4a;
  --warn:         #c0392b;
  --danger:       #c0392b;
  --shadow:       0 1px 3px rgba(0,0,0,0.06);
}

/* ─── Reset ─────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Body ──────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Source Sans Pro", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  padding-bottom: 34px;
}

/* ─── Topbar ────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 48px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0 1.2rem;
  box-shadow: var(--shadow);
}
.topbar-brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-size: 0.95rem; white-space: nowrap;
  color: var(--text); text-decoration: none;
}
.topbar-brand .logo { width: 28px; height: 28px; border-radius: 50%; }
.topbar-nav { flex: 1; display: flex; gap: 1.2rem; align-items: center; }
.topbar-nav a { color: var(--text-soft); text-decoration: none; font-size: 0.82rem; font-weight: 600; }
.topbar-nav a:hover { color: var(--primary); }
.topbar-nav .topnav-active { color: var(--primary); font-weight: 700; font-size: 0.82rem; }
.user-bar { display: flex; gap: 0.8rem; align-items: center; font-size: 0.82rem; }
.user-bar .user-name, .user-name { color: var(--text-soft); }
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

/* ─── Main ──────────────────────────────────────────────────── */
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

/* ─── Footer (Layout-Override im Modul-CSS) ─────────────────── */
.site-footer {
  height: 34px;
  background: white;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-soft);
  box-shadow: 0 -1px 3px rgba(0,0,0,0.05);
}
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }
.site-footer .version-link { color: var(--primary); font-weight: 600; }
.site-footer .version-link:hover { text-decoration: underline; }

/* ─── Buttons ────────────────────────────────────────────────── */
.primary {
  background: var(--primary); color: white; border: none;
  padding: 0.55rem 1rem; border-radius: 6px; cursor: pointer;
  font-weight: 600; font-size: 0.85rem;
}
.primary:hover { background: var(--primary-dark); }
.primary:disabled { opacity: 0.6; cursor: wait; }
.primary.danger { background: var(--danger); }
.primary.danger:hover { background: #9c2c1f; }

.secondary {
  background: transparent; color: var(--primary); border: 1px solid var(--border);
  padding: 0.55rem 1rem; border-radius: 6px; cursor: pointer;
  font-weight: 600; font-size: 0.85rem;
}
.secondary:hover { background: var(--bg-side); }

.small { padding: 0.3rem 0.7rem !important; font-size: 0.78rem !important; }

/* ─── Panels ─────────────────────────────────────────────────── */
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.panel-head h2 { font-size: 1.05rem; font-weight: 700; }

/* ─── Tables ─────────────────────────────────────────────────── */
.data { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data th, .data td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data th {
  background: var(--bg-side);
  font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-soft);
}
.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data tr:last-child td { border-bottom: none; }
.data tbody tr:hover td { background: #faf8f0; }
.data tfoot td { background: var(--bg-side); font-weight: 700; border-top: 2px solid var(--border); }

/* ─── Formular-Felder ────────────────────────────────────────── */
form label {
  display: block; font-size: 0.75rem; color: var(--text-soft);
  margin-bottom: 0.25rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
form input, form select, form textarea {
  width: 100%; padding: 0.5rem 0.7rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.9rem; font-family: inherit; background: white;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none; border-color: var(--primary);
}

/* ─── Checkboxen ─────────────────────────────────────────────── */
.check-opt { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; }
.check-opt input { margin: 0; width: 1rem; height: 1rem; cursor: pointer; accent-color: var(--primary); }
.bool-toggle { display: flex; gap: 1.5rem; margin: 0.3rem 0; }
.bool-opt { display: flex; align-items: center; gap: 0.45rem; cursor: pointer; font-size: 0.9rem; }
.bool-opt input { margin: 0; width: 1rem; height: 1rem; cursor: pointer; accent-color: var(--primary); }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; background: var(--bg-side); color: var(--text-soft); }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
}
.modal[hidden] { display: none; }
.modal-card {
  background: white; border-radius: 12px; padding: 1.5rem;
  width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal h3 { margin-bottom: 1rem; font-size: 1.1rem; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.modal label { display: block; margin-top: 0.9rem; font-size: 0.82rem; font-weight: 600; }
.modal input, .modal textarea, .modal select {
  width: 100%; margin-top: 0.3rem; padding: 0.55rem 0.8rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.9rem; font-family: inherit;
}
.modal textarea { font-family: ui-monospace, "SF Mono", monospace; font-size: 0.82rem; min-height: 140px; resize: vertical; }
.modal .checks { display: flex; gap: 1rem; margin-top: 0.5rem; flex-wrap: wrap; }
.modal .checks label { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-weight: 400; cursor: pointer; }
.modal .checks input { width: auto; margin: 0; }
.modal .hint { color: var(--text-soft); font-size: 0.78rem; margin-top: 0.4rem; }
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: none; border-color: var(--primary); }

/* ─── Utilities ──────────────────────────────────────────────── */
.hidden  { display: none !important; }
.muted   { color: var(--text-soft); font-weight: 400; font-size: 0.85rem; }
.empty   { color: var(--text-soft); padding: 2rem; text-align: center; font-size: 0.9rem; }
.error   { color: var(--warn); font-size: 0.85rem; margin-top: 0.5rem; }
.hint    { color: var(--text-soft); font-size: 0.78rem; }
code     { font-family: ui-monospace, "SF Mono", monospace; font-size: 0.85em; background: var(--bg-side); padding: 0.1rem 0.3rem; border-radius: 3px; }
