/* === Theme toggle system === */
:root[data-theme='light'], :root:not([data-theme]) {
  color-scheme: light;
}
:root[data-theme='dark'] {
  color-scheme: dark;
}

/* Deine bestehenden Farbvariablen mit Defaults (light) */
:root {
  --bg:#ffffff;
  --fg:#111111;
  --muted:#666;
  --acc:#2563eb;
  --ok:#16a34a;
  --warn:#ca8a04;
  --err:#dc2626;
  --card:#f7f7f8;
}
:root[data-theme='dark'] {
  --bg:#0b0c10;
  --fg:#e6e6e6;
  --muted:#9aa1a9;
  --acc:#60a5fa;
  --ok:#22c55e;
  --warn:#facc15;
  --err:#f87171;
  --card:#13141a;
}

/* Bootstrap überschreiben */
body {
  background: var(--bg) !important;
  color: var(--fg) !important;
}

:root[data-theme='dark'] body {
  background: var(--bg) !important;
  color: var(--fg) !important;
}

:root[data-theme='dark'] .card,
:root[data-theme='dark'] .list-group,
:root[data-theme='dark'] .dropdown-menu {
  background: var(--card) !important;
  color: var(--fg) !important;
}

/* kleiner Button in der Navigation */
.small-btn {
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  margin-left: 8px;
}

/* === Theme Toggle (Slider) === */
.nav { display:flex; gap:12px; align-items:center; }
.theme-toggle { display:flex; align-items:center; margin-left:8px; }

.theme-switch { 
  position:absolute; 
  opacity:0; 
  pointer-events:none; 
}

.theme-switch-ui{
  --w:56px; --h:28px; --p:3px;
  position:relative;
  width:var(--w); height:var(--h);
  border-radius:999px;
  background:var(--toggle-track);
  border:1px solid var(--toggle-track-border);
  display:inline-flex; align-items:center; justify-content:space-between;
  padding:0 6px;
  cursor:pointer;
  user-select:none;
  transition:background .25s ease, border-color .25s ease, box-shadow .2s ease;
  box-shadow:inset 0 1px 0 rgba(0,0,0,.04);
}

.theme-switch-ui .icon{
  font-size:14px;
  line-height:1;
  opacity:.75;
}

.theme-switch-ui .thumb{
  position:absolute;
  top:var(--p);
  left:var(--p);
  width:calc(var(--h) - var(--p)*2);
  height:calc(var(--h) - var(--p)*2);
  border-radius:999px;
  background:var(--toggle-thumb);
  box-shadow:0 1px 2px rgba(0,0,0,.2);
  transform:translateX(0);
  transition:transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.theme-switch:focus-visible + .theme-switch-ui{
  outline:2px solid var(--toggle-focus);
  outline-offset:3px;
}

@media (prefers-reduced-motion: reduce){
  .theme-switch-ui, .theme-switch-ui .thumb{ transition:none; }
}

/* checked -> dark: thumb nach rechts */
.theme-switch:checked + .theme-switch-ui .thumb{
  transform:translateX(calc(56px - (28px - 3px*2) - 3px*2)); /* trackWidth - knobWidth - padding*2 */
}

/* kleine Button-Variante angleichen */
.small-btn { padding:4px 8px; font-size:14px; line-height:1; }

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  background: var(--bg);
  color: var(--fg)
}

a {
  color: var(--acc);
  text-decoration: none
}

a:hover {
  text-decoration: underline
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .06)
}

.title {
  font-weight: 700;
  font-size: 20px
}

nav a {
  margin-right: 12px
}

.card {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap
}

.col {
  flex: 1 1 260px
}

label {
  display: block;
  font-size: 14px;
  margin: 8px 0 4px;
  color: var(--muted)
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=url],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 10px;
  background: transparent;
  color: inherit
}

textarea {
  min-height: 96px
}

/* button,
.btn {
  display: inline-block;
  border: none;
  background: var(--acc);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600
}

.btn.secondary {
  background: #6b7280
}

.btn.ok {
  background: var(--ok)
}

.btn.warn {
  background: var(--warn)
}

.btn.danger {
  background: var(--err)
}

button:disabled {
  opacity: .6;
  cursor: not-allowed
} */

form {
  margin: 0
}

.flash {
  padding: 10px 12px;
  border-radius: 10px;
  margin: 8px 0;
  font-size: 14px
}

.flash.success {
  background: rgba(22, 163, 74, .15);
  border: 1px solid rgba(22, 163, 74, .35)
}

.flash.error {
  background: rgba(220, 38, 38, .15);
  border: 1px solid rgba(220, 38, 38, .35)
}

.table {
  width: 100%;
  border-collapse: collapse
}

.table th,
.table td {
  padding: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  text-align: left;
  vertical-align: top
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(0, 0, 0, .15);
  color: var(--muted)
}

.list {
  list-style: none;
  margin: 0;
  padding: 0
}

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, .08)
}

.small {
  font-size: 12px;
  color: var(--muted)
}

hr {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, .08);
  margin: 16px 0
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.mt-1 {
  margin-top: 8px
}

.mt-2 {
  margin-top: 12px
}

.mt-3 {
  margin-top: 16px
}

.mt-4 {
  margin-top: 24px
}

/* eigene Hervorhebungen in der Zuteilungs-Tabelle */
:root[data-theme='light'] .me-giver {
  background: rgba(4, 247, 93, 0.332); /* hellgrün */
  font-weight: 600;
}
:root[data-theme='light'] .me-receiver {
  background: rgba(255, 0, 128, 0.332); /* hellpink */
  font-weight: 600;
}

/* im Dark-Theme etwas kräftiger, aber immer noch dezent */
:root[data-theme='dark'] .me-giver {
  background: rgba(4, 247, 93, 0.599);
}
:root[data-theme='dark'] .me-receiver {
  background: rgba(255, 0, 128, 0.594);
}

/* -------------------------
   Floating Flash Overlay
   ------------------------- */
.flash-overlay {
  position: fixed;
  inset: 0;                /* top:0; right:0; bottom:0; left:0 */
  display: flex;
  align-items: flex-start; /* Meldung oben zentriert */
  justify-content: center;
  z-index: 9999;
  pointer-events: none;    /* blockiert keine Klicks darunter */
}

.flash-message {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: .5rem;
  font-weight: 500;
  color: #fff;
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: auto;
  animation:
    flash-in 0.35s ease-out forwards,
    flash-stay 2.5s linear 0.35s forwards,
    flash-out 0.4s ease-in 2.85s forwards;
}

/* Farbvarianten */
.flash-success { background: rgba(34,197,94,0.92); }
.flash-error   { background: rgba(239,68,68,0.92); }
.flash-warning { background: rgba(234,179,8,0.92); }

/* Animationen */
@keyframes flash-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes flash-stay {
  from { opacity: 1; }
  to   { opacity: 1; }
}
@keyframes flash-out {
  to { opacity: 0; transform: translateY(-8px); }
}

/* Dark Mode: matter Hintergrund */
:root[data-theme='dark'] .flash-message {
  background: rgba(25,25,28,0.95);
  color: #eee;
}

/* Logo im Titelbereich */
.logo-icon {
  height: 48px;
  width: 48px;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.25s ease, filter 0.3s ease;
}

/* sanfter Hover */
.logo-icon:hover {
  transform: scale(1.05);
}

/* Dark Theme etwas aufhellen */
:root[data-theme='dark'] .logo-icon {
  filter: brightness(1.2);
}

/* ----------------------------
   Bevellier Font Definition
----------------------------- */
@font-face {
  font-family: 'Bevellier';
  src: url('fonts/Bevellier-Black.woff2') format('woff2'),
       url('fonts/Bevellier-Black.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Überschriften-Styling */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Bevellier', system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--fg);
}

/* Optional: sanfte Übergänge bei Theme-Wechsel */
h1, h2, h3, h4, h5, h6 {
  transition: color 0.3s ease;
}