/* ==========================================================================
   Zellreform Verwaltung – Resona-Markenwelt über Bootstrap 4.5
   Wird auf jeder Seite NACH bootstrap.min.css geladen. Selektoren mit
   "html body" schlagen die alten Inline-<style>-Blöcke der Seiten.
   ========================================================================== */

:root {
  --bg:        #1e0922;   /* tiefe Aubergine */
  --bg-soft:   #2a0f2f;   /* leicht erhöhte Fläche (Hover, Inputs) */
  --card:      #2c1131;   /* Panels / Karten */
  --card-2:    #371640;   /* Tabellenkopf, abgesetzte Flächen */
  --fg:        #f4ead9;   /* Creme (Text) */
  --muted:     #c2a7c8;   /* gedämpftes Mauve */
  --line:      #4a2452;   /* Rahmen */
  --line-soft: #3a1b40;   /* feine Linien / Gitter */
  --primary:   #e9a62e;   /* Gold (Hauptakzent) */
  --primary-hi:#f4bb4e;   /* Gold hell (Hover) */
  --primary-fg:#2a0f2e;   /* dunkel auf Gold */
  --magenta:   #d6418a;   /* Magenta-Akzent */
  --error:     #ff8a8a;   /* weiches Rot */
  --ok:        #7fd6a0;   /* weiches Grün */
  --info:      #9bc0ff;   /* weiches Blau */
  color-scheme: dark;
}

/* ---------- Grundfläche ---------- */
html body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(214, 65, 138, 0.20), transparent 60%),
    radial-gradient(820px 460px at 50% -4%, rgba(233, 166, 46, 0.12), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html body .container,
html body .container-fluid {
  max-width: 1140px;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  padding-bottom: 3rem;
}
html body h1, html body h2, html body h3, html body h4, html body h5 {
  color: var(--fg);
  font-weight: 600;
  letter-spacing: 0.01em;
}
html body h1, html body h2 { font-size: 1.6rem; margin-bottom: 1rem; }
a { color: var(--primary); }
a:hover { color: var(--primary-hi); }
hr { border-color: var(--line); }
::selection { background: rgba(233, 166, 46, 0.35); }
.text-muted, .form-text, small.text-muted { color: var(--muted) !important; }
.text-secondary { color: var(--muted) !important; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--error) !important; }
.text-primary { color: var(--primary) !important; }
.bg-light { background-color: var(--card-2) !important; }
.bg-white { background-color: var(--card) !important; }
.shadow-sm { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important; }

/* ---------- Kopfzeile ---------- */
.zr-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0.55rem 1.25rem;
  background: rgba(26, 8, 30, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.5rem;
}
.zr-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg) !important;
  text-decoration: none !important;
  padding: 0;
}
.zr-brand svg { width: 38px; height: 38px; flex: 0 0 auto; filter: drop-shadow(0 0 6px rgba(233, 166, 46, 0.45)); }
.zr-brand .zr-word { display: flex; flex-direction: column; line-height: 1.05; }
.zr-brand .zr-name { font-weight: 700; letter-spacing: 0.18em; font-size: 1rem; }
.zr-brand .zr-sub { font-size: 0.72rem; color: var(--primary); letter-spacing: 0.12em; text-transform: uppercase; }
.zr-topbar .navbar-nav { gap: 0.15rem; }
.zr-topbar .nav-link {
  color: var(--muted) !important;
  padding: 0.4rem 0.75rem !important;
  border-radius: 8px;
  font-size: 0.93rem;
  white-space: nowrap;
}
.zr-topbar .nav-link:hover { background: var(--bg-soft); color: var(--fg) !important; }
.zr-topbar .nav-item.active .nav-link {
  color: var(--primary) !important;
  font-weight: 600;
  background: rgba(233, 166, 46, 0.14);
}
.zr-topbar .nav-link.zr-logout { color: var(--error) !important; }
.zr-topbar .navbar-toggler { border-color: var(--line); }
@media (max-width: 991px) {
  .zr-topbar .navbar-collapse { padding-top: 0.6rem; }
  .zr-topbar .nav-link { padding: 0.55rem 0.75rem !important; }
}

/* ---------- Karten ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--fg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.30);
}
.card-header {
  background: var(--card-2);
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
.card-header:first-child { border-radius: 11px 11px 0 0; }
.card-footer { background: var(--card-2); border-top: 1px solid var(--line); }
.accordion > .card { overflow: hidden; }

/* ---------- Tabellen ---------- */
.table {
  color: var(--fg);
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
}
.table th, .table td { border-color: var(--line-soft) !important; vertical-align: middle; }
.table-bordered { border: 1px solid var(--line) !important; border-collapse: separate; border-spacing: 0; }
.table-bordered th, .table-bordered td { border-width: 0 0 1px 0 !important; }
.table-bordered tbody tr:last-child td { border-bottom: none !important; }
.table thead th,
.table .thead-light th {
  background: var(--card-2) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(255, 255, 255, 0.025); }
.table tbody tr:hover { background-color: rgba(233, 166, 46, 0.07); }

/* ---------- Buttons ---------- */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:focus, .btn.focus { box-shadow: 0 0 0 3px rgba(233, 166, 46, 0.25) !important; }
.btn-primary, .btn-primary:not(:disabled):not(.disabled):active {
  background: var(--primary); border-color: var(--primary); color: var(--primary-fg); font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus { background: var(--primary-hi); border-color: var(--primary-hi); color: var(--primary-fg); }
.btn-primary:disabled, .btn-primary.disabled { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); opacity: 0.45; }

.btn-secondary, .btn-dark, .btn-light, .btn-info {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--fg);
}
.btn-secondary:hover, .btn-dark:hover, .btn-light:hover, .btn-info:hover,
.btn-secondary:focus, .btn-dark:focus, .btn-light:focus, .btn-info:focus {
  background: var(--card-2); border-color: #6a3a72; color: var(--fg);
}
/* "Aufladen & Buchen" und "Anzeigen" sind die häufigsten Wege – leicht gold betont */
.btn-dark { border-color: rgba(233, 166, 46, 0.55); color: var(--primary); }
.btn-dark:hover, .btn-dark:focus { color: var(--primary-hi); border-color: var(--primary); }
/* In den Kundenzeilen ist "Aufladen & Buchen" der Hauptweg: voll gold,
   die Einzelbuchung tritt dafür als Umriss zurück */
.action-buttons .btn-dark { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); font-weight: 600; }
.action-buttons .btn-dark:hover, .action-buttons .btn-dark:focus { background: var(--primary-hi); border-color: var(--primary-hi); color: var(--primary-fg); }
.action-buttons .btn-primary { background: transparent; border-color: rgba(233, 166, 46, 0.55); color: var(--primary); font-weight: 500; }
.action-buttons .btn-primary:hover, .action-buttons .btn-primary:focus { background: rgba(233, 166, 46, 0.14); border-color: var(--primary); color: var(--primary-hi); }

.btn-success {
  background: rgba(127, 214, 160, 0.14); border: 1px solid rgba(127, 214, 160, 0.45); color: var(--ok);
}
.btn-success:hover, .btn-success:focus { background: rgba(127, 214, 160, 0.24); border-color: var(--ok); color: #a9ebc2; }
.btn-warning {
  background: rgba(233, 166, 46, 0.12); border: 1px solid rgba(233, 166, 46, 0.45); color: var(--primary);
}
.btn-warning:hover, .btn-warning:focus { background: rgba(233, 166, 46, 0.22); border-color: var(--primary); color: var(--primary-hi); }
.btn-danger, .btn-outline-danger {
  background: rgba(255, 138, 138, 0.10); border: 1px solid rgba(255, 138, 138, 0.45); color: var(--error);
}
.btn-danger:hover, .btn-outline-danger:hover, .btn-danger:focus, .btn-outline-danger:focus {
  background: rgba(255, 138, 138, 0.22); border-color: var(--error); color: #ffb3b3;
}
.btn-outline-secondary { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn-outline-secondary:hover, .btn-outline-secondary:focus,
.btn-outline-secondary:not(:disabled):not(.disabled):active {
  background: var(--bg-soft); border-color: #6a3a72; color: var(--fg);
}
html body .btn-link { color: var(--primary); text-decoration: none; }
html body .btn-link:hover, html body .btn-link:focus { color: var(--primary-hi); text-decoration: none; box-shadow: none !important; }
.close { color: var(--fg); text-shadow: none; opacity: .7; }

/* ---------- Formulare ---------- */
.form-control, .custom-select, select, textarea, input[type="text"], input[type="number"], input[type="date"], input[type="password"] {
  background-color: var(--bg-soft);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.form-control:focus, .custom-select:focus {
  background-color: var(--bg-soft);
  color: var(--fg);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 166, 46, 0.22);
}
.form-control::placeholder { color: #9c84a2; }
.form-control:disabled, .form-control[readonly] { background-color: var(--bg); color: var(--muted); }
.form-control-plaintext { color: var(--fg); }
select.form-control option { background: var(--bg-soft); color: var(--fg); }
label, .form-check-label { color: var(--muted); }
.form-group label { font-size: 0.9rem; }
input[type="file"].form-control-file { color: var(--muted); }

/* ---------- Hinweise ---------- */
.alert { border-radius: 10px; border-width: 1px; }
.alert-success { background: rgba(127, 214, 160, 0.12); border-color: rgba(127, 214, 160, 0.4); color: #bff0d2; }
.alert-danger  { background: rgba(255, 138, 138, 0.12); border-color: rgba(255, 138, 138, 0.4); color: #ffc4c4; }
.alert-warning { background: rgba(233, 166, 46, 0.12); border-color: rgba(233, 166, 46, 0.45); color: #f6d08a; }
.alert-info    { background: rgba(155, 192, 255, 0.12); border-color: rgba(155, 192, 255, 0.4); color: #cddcff; }
.alert a { color: var(--primary-hi); }

/* ---------- Listen / Suche ---------- */
.list-group-item {
  background: var(--card);
  border-color: var(--line);
  color: var(--fg);
}
.list-group-item-action:hover, .list-group-item-action:focus { background: var(--card-2); color: var(--fg); }
.list-group-item.active {
  background: rgba(233, 166, 46, 0.18);
  border-color: var(--line);
  color: var(--primary-hi);
}

/* ---------- Seitenwahl ---------- */
.pagination { gap: 0.3rem; flex-wrap: wrap; }
.page-link {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px !important;
  margin-left: 0 !important;
}
.page-link:hover { background: var(--card-2); border-color: #6a3a72; color: var(--fg); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); font-weight: 600; }
.page-link:focus { box-shadow: 0 0 0 3px rgba(233, 166, 46, 0.22); }

/* ---------- Sonstiges ---------- */
.spinner-border { color: var(--primary); }
.badge-success { background: rgba(127, 214, 160, 0.2); color: var(--ok); }
.badge-danger  { background: rgba(255, 138, 138, 0.2); color: var(--error); }
.badge-secondary { background: var(--card-2); color: var(--muted); }
.lightbox { background: rgba(10, 2, 12, 0.85) !important; }
.lightbox img { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important; border: 1px solid var(--line); }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.8; cursor: pointer; }

/* ---------- Anmeldung ---------- */
.zr-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.zr-login .card { width: min(380px, 92vw); padding: 1.75rem 1.5rem 1.5rem; }
.zr-login .zr-logo { display: block; width: 120px; height: 120px; margin: 0 auto 0.6rem; filter: drop-shadow(0 0 18px rgba(233, 166, 46, 0.45)); }
.zr-login .zr-title { text-align: center; font-weight: 700; letter-spacing: 0.22em; font-size: 1.35rem; margin: 0; }
.zr-login .zr-tagline { text-align: center; color: var(--primary); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.75rem; margin: 0.2rem 0 1.4rem; }
.zr-login .rule { height: 1px; margin: 0 auto 1.3rem; width: 80%; background: linear-gradient(90deg, transparent, var(--primary), transparent); }

@media (max-width: 760px) {
  html body .container, html body .container-fluid { padding-left: 0.8rem; padding-right: 0.8rem; }
  html body h1, html body h2 { font-size: 1.3rem; }
}
