:root {
  --bg-card: #ffffff;
  --text-main: #363636;
  --border-color: #dbdbdb;
  --overlay-bg: rgba(0, 0, 0, 0.65);
}

body {
  max-width: 500px;
  margin: 0 auto;
  padding: 12px;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}
.is-hidden-custom { display: none !important; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.custom-quota-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

/* UNIFORME FELDGRÖSSEN (40px) */
.input, .select select, .button {
  height: 40px !important;
}
.button.is-small {
  height: 32px !important;
}
.btn-coin {
  height: 44px !important;
}

/* Quick-Clear "X" Buttons Styling */
.control.has-icons-right .icon.is-clear-btn {
  pointer-events: auto !important;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s ease-in-out;
  font-weight: bold;
  font-size: 1.1rem;
  user-select: none;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.control.has-icons-right .icon.is-clear-btn:hover {
  opacity: 1.0;
}

/* Bargeld-Grids (Münzen & Scheine) */
.cash-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bulma-text-weak, #7a7a7a);
  margin-bottom: 0.25rem;
}

.coin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  justify-items: center;
}
.btn-coin {
  width: 44px;
  height: 44px !important;
  border-radius: 50% !important;
  font-weight: bold;
  font-size: 0.8rem;
  border: 1px solid rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  transition: transform 0.1s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.btn-coin:active { transform: scale(0.92); }

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.btn-note {
  font-weight: bold !important;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.15);
  padding: 0.45rem 0.2rem !important;
  font-size: 0.85rem;
  text-shadow: 0px 1px 2px rgba(0,0,0,0.3);
  transition: transform 0.1s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  height: 40px !important;
}
.btn-note:active { transform: scale(0.95); }

.cash-copper { background: linear-gradient(135deg, #c87d55, #a0522d) !important; color: #ffffff !important; }
.cash-brass { background: linear-gradient(135deg, #e6ca65, #c59b27) !important; color: #2b2100 !important; text-shadow: none !important; }
.cash-bimetal-1 { background: radial-gradient(circle, #e6ca65 55%, #d0d0d0 56%) !important; border: 2px solid #b0b0b0 !important; color: #1a1a1a !important; text-shadow: none !important; }
.cash-bimetal-2 { background: radial-gradient(circle, #d0d0d0 55%, #e6ca65 56%) !important; border: 2px solid #c59b27 !important; color: #1a1a1a !important; text-shadow: none !important; }
.cash-5euro { background: linear-gradient(135deg, #9ab0b9, #788d96) !important; color: #ffffff !important; }
.cash-10euro { background: linear-gradient(135deg, #e66b67, #c93b37) !important; color: #ffffff !important; }
.cash-20euro { background: linear-gradient(135deg, #4a90e2, #2b6cb0) !important; color: #ffffff !important; }
.cash-50euro { background: linear-gradient(135deg, #f3a649, #d97706) !important; color: #ffffff !important; }
.cash-100euro { background: linear-gradient(135deg, #52c41a, #2f855a) !important; color: #ffffff !important; }
.cash-200euro { background: linear-gradient(135deg, #fadb14, #d4b106) !important; color: #222222 !important; text-shadow: none !important; }

/* VISUAL FINISH: ABSOLUTER SEITENSCHUTZ & OVERFLOW-FREE SLIDER */
.chart-card-carousel {
  position: relative;
  width: 100% !important;
  overflow: hidden !important;
  touch-action: pan-y;
  box-sizing: border-box !important;
}
.chart-carousel-track {
  display: flex;
  transition: transform 0.3s ease-in-out;
  width: 200%;
  box-sizing: border-box;
}
.chart-carousel-slide {
  width: 50% !important;
  min-width: 50% !important;
  max-width: 50% !important;
  flex-shrink: 0;
  flex-grow: 0;
  padding: 0 12px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: relative;
}
.chart-carousel-slide canvas {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* HÄNDLER-LISTE DESIGN & TRENNLINIEN */
.stats-vendor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px;
  box-sizing: border-box;
}
.stats-vendor-row:last-child {
  border-bottom: none;
}

.chart-carousel-slide::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.chart-carousel-slide, .no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.chart-nav-btn {
  padding: 0 8px !important;
  height: 28px !important;
  font-size: 0.75rem !important;
}

/* Navigation */
.nav-tabs-custom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 4px;
  margin-bottom: 1rem;
  border-bottom: 2px solid #ededed;
}
.nav-tabs-custom a {
  padding: 6px 10px;
  color: #4a4a4a;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.85rem;
}
.nav-tabs-custom a.is-active {
  color: #485fc7;
  border-bottom-color: #485fc7;
}

/* HISTORIE & STATS FILTER-DESIGN */
.hist-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1rem;
}
.hist-filter-bar .select,
.hist-filter-bar .select select {
  height: 40px !important;
  border-radius: 6px !important;
}

/* ADMIN SUBMENÜ GRID */
.admin-subtabs-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}
.admin-subtab-btn {
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
.admin-subtab-btn.active {
  background: #3273dc;
  color: #ffffff;
  border-color: #3273dc;
}

.chip-grid .button.is-outlined {
  background-color: #f5f5f5 !important;
  color: #363636 !important;
  border-color: #485fc7 !important;
  font-weight: 600;
}
.chip-grid .button.is-outlined:hover {
  background-color: #485fc7 !important;
  color: #ffffff !important;
}

.chip-grid .button.top3-fav-btn {
  background-color: rgba(62, 142, 208, 0.12) !important;
  border-color: #3e8ed0 !important;
  font-weight: 700 !important;
}
.chip-grid .button.top3-fav-btn:hover {
  background-color: #3e8ed0 !important;
  color: #ffffff !important;
}

.password-copy-box {
  background: rgba(0,0,0,0.05);
  border: 1px dashed #485fc7;
  padding: 10px;
  font-family: monospace;
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  margin: 12px 0;
  word-break: break-all;
  border-radius: 4px;
}

/* SPEICHER-OVERLAY */
#fancySaveOverlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}
#fancySaveOverlay.is-active {
  opacity: 1;
  pointer-events: auto;
}
.save-card-content {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 24px 32px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  text-align: center;
  max-width: 90%;
}
.save-progress-bar {
  height: 4px;
  width: 100%;
  background: rgba(128,128,128,0.2);
  border-radius: 2px;
  margin-top: 16px;
  overflow: hidden;
  position: relative;
}
.save-progress-bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #485fc7, #00d1b2);
}
#fancySaveOverlay.is-active .save-progress-bar-fill {
  animation: fillProgress var(--overlay-time, 3s) linear forwards;
}
@keyframes fillProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* DB Inspector Scroll-Table */
.table-container-inspector {
  max-height: 400px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

/* DARK MODE OVERRIDES */
body.theme-dark {
  --bg-card: #1e1e1e;
  --text-main: #ffffff;
  --border-color: #2d2d2d;
  --overlay-bg: rgba(0, 0, 0, 0.85);

  background-color: #121212 !important;
  color: #e0e0e0 !important;
}
body.theme-dark .nav-tabs-custom { border-bottom-color: #2a2a2a; }
body.theme-dark .nav-tabs-custom a { color: #a0a0a0; }
body.theme-dark .nav-tabs-custom a.is-active { color: #3e8ed0; border-bottom-color: #3e8ed0; }
body.theme-dark .card, body.theme-dark .box, body.theme-dark .modal-card-head, body.theme-dark .modal-card-body, body.theme-dark .modal-card-foot {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #2d2d2d !important;
}
body.theme-dark .password-copy-box { background: rgba(255,255,255,0.05); border-color: #3e8ed0; }
body.theme-dark .title, body.theme-dark .label, body.theme-dark strong, body.theme-dark .modal-card-title { color: #ffffff !important; }
body.theme-dark .input, body.theme-dark .select select {
  background-color: #2a2a2a !important;
  color: #ffffff !important;
  border-color: #444444 !important;
}
body.theme-dark .input::placeholder { color: #888888 !important; }
body.theme-dark .chip-grid .button.is-outlined {
  background-color: #2a2a2a !important;
  color: #ffffff !important;
  border-color: #3e8ed0 !important;
}
body.theme-dark .chip-grid .button.top3-fav-btn {
  background-color: rgba(62, 142, 208, 0.25) !important;
  border-color: #3e8ed0 !important;
  color: #ffffff !important;
}
body.theme-dark .tag.is-light {
  background-color: #333333 !important;
  color: #ffffff !important;
  border: 1px solid #555555;
}
body.theme-dark .user-banner-btn {
  background-color: #2d2d2d !important;
  border: 1px solid #444444 !important;
  color: #ffffff !important;
}

body.theme-dark .notification.is-info.is-light {
  background-color: rgba(62, 142, 208, 0.2) !important;
  color: #90cdf4 !important;
  border: 1px solid rgba(62, 142, 208, 0.3);
}
body.theme-dark .notification.is-info.is-light strong,
body.theme-dark .notification.is-info.is-light .title {
  color: #ffffff !important;
}

body.theme-dark .notification.is-warning.is-light {
  background-color: rgba(255, 221, 87, 0.15) !important;
  color: #fef08a !important;
  border: 1px solid rgba(255, 221, 87, 0.3);
}
body.theme-dark .notification.is-warning.is-light strong,
body.theme-dark .notification.is-warning.is-light .title {
  color: #ffffff !important;
}

body.theme-light {
  --bg-card: #ffffff;
  --text-main: #363636;
  --border-color: #dbdbdb;
  --overlay-bg: rgba(0, 0, 0, 0.45);

  background-color: #ffffff !important;
  color: #363636 !important;
}
body.theme-light .card, body.theme-light .box, body.theme-light .modal-card-head, body.theme-light .modal-card-body, body.theme-light .modal-card-foot {
  background-color: #ffffff !important;
  color: #363636 !important;
}
