:root {
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-card: #020617;
  --bg-sidebar: #020617;
  --accent: #22c55e;
  --accent-soft: rgba(34,197,94,0.18);
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --border: #1f2937;
  --danger: #ef4444;
}

/* ==============
   Base / Global
   ============== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, #1f2937 0, transparent 50%),
    radial-gradient(circle at 80% 0%, #0f766e 0, transparent 55%),
    radial-gradient(circle at 0% 100%, #7c2d12 0, transparent 55%),
    #020617;
  color: var(--text);
}
/* Globale Seite: scrollen erlauben, aber Scrollbar verstecken */
html, body {
  overflow-y: auto;
}

/* WebKit-Browser (Chrome, Edge, Safari): Scrollbar unsichtbar */
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}
body::-webkit-scrollbar-track {
  background: transparent;
}
body::-webkit-scrollbar-thumb {
  background: transparent;
}

/* Firefox: Scrollbar ausblenden, aber Scroll behalten */
body {
  scrollbar-width: none;
}

/* =========
   Layout
   ========= */

.app-shell {
  display: flex;
  min-height: 100vh;
  backdrop-filter: blur(18px);
}

/* Sidebar */

.sidebar {
  width: 250px;
  background: linear-gradient(to bottom, rgba(15,23,42,0.98), rgba(3,7,18,0.98));
  border-right: 1px solid rgba(15,23,42,0.9);
  display: flex;
  flex-direction: column;
  padding: 0.9rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.2s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.2rem 0.4rem 0.8rem;
  border-bottom: 1px solid rgba(31,41,55,0.8);
  margin-bottom: 0.8rem;
}

.logo-circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #22c55e, #16a34a 45%, #052e16 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #022c22;
  box-shadow: 0 8px 22px rgba(34,197,94,0.55);
}

.sidebar-title {
  display: flex;
  flex-direction: column;
}

.sidebar-title strong {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.sidebar-title span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-toggle {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: auto;
  font-size: 0.95rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.6rem;
}

.sidebar-section-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  margin-top: 0.35rem;
}

.sidebar-link {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.45rem 0.55rem;
  border-radius: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.sidebar-link:hover {
  background: rgba(15,23,42,0.95);
  color: #e5e7eb;
  transform: translateX(1px);
}

.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.4);
}

.sidebar-link-icon {
  width: 18px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.5rem 0.6rem 0.2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
}
.catalog-row td {
  padding: 0;
  border-bottom: none;
}
.catalog-card {
  margin: 0.5rem 0;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  background: radial-gradient(circle at top left, rgba(56,189,248,0.15), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,184,0.25);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
/* === Inventory als Shopping-Grid === */

#tobacco-list-body.inventory-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.25rem 0 0.75rem;
}

/* einzelne Karte im Grid */
.inventory-card {
  flex: 1 1 calc(50% - 1rem);
  min-width: 260px;
}

/* auf kleineren Screens nur eine Karte pro Reihe */
@media (max-width: 900px) {
  .inventory-card {
    flex-basis: 100%;
  }
}

/* Karte soll die gesamte Höhe des Wrappers füllen */
.inventory-card .catalog-card {
  height: 100%;
}

/* Expanded-Zustand: volle Breite wie vorher */
.inventory-card.expanded {
  flex-basis: 100%;
}

.catalog-row td {
  padding: 0;
  border-bottom: none;
}

.catalog-card {
  margin: 0.5rem 0;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: radial-gradient(circle at top left, rgba(56,189,248,0.15), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,184,0.35);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.catalog-main {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.catalog-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.catalog-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(15,23,42,0.9);
  color: var(--text-muted);
}

.catalog-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.catalog-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.catalog-card h4 {
  margin: 0;
  font-size: 1rem;
}

.catalog-man {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.catalog-flavors,
.catalog-profile {
  font-size: 0.78rem;
  color: var(--accent);
}

.catalog-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}

.catalog-badge.empty {
  background: rgba(239,68,68,0.15);
  color: #f97373;
}

.catalog-main {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.catalog-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.catalog-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(15,23,42,0.9);
  color: var(--text-muted);
}

.catalog-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.catalog-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.catalog-card h4 {
  margin: 0;
  font-size: 1rem;
}

.catalog-man {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.catalog-flavors,
.catalog-profile {
  font-size: 0.78rem;
  color: var(--accent);
}

.catalog-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}

.catalog-badge.empty {
  background: rgba(239,68,68,0.15);
  color: #f87171;
}

.catalog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.btn-danger {
  border-color: rgba(239,68,68,0.8) !important;
  color: #fecaca !important;
}

/* Collapsed Sidebar (Desktop) */

.app-shell.collapsed .sidebar {
  width: 60px;
}

.app-shell.collapsed .sidebar-title span,
.app-shell.collapsed .sidebar-title strong {
  display: none;
}

.app-shell.collapsed .sidebar-section-label {
  display: none;
}

.app-shell.collapsed .sidebar-link-label {
  display: none;
}

.app-shell.collapsed .sidebar-link {
  justify-content: center;
}

.app-shell.collapsed .sidebar-toggle {
  margin-left: 0;
}

/* Main Content */

.main {
  flex: 1;
  padding: 1.25rem 1.4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.main-header-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.main-header-title h1 {
  margin: 0;
  font-size: 1.4rem;
}

.main-header-title span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

/* Grid Layouts */

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ===============
   Cards & Content
   =============== */

.card {
  background: linear-gradient(to bottom right, rgba(15,23,42,0.96), rgba(3,7,18,0.98));
  border-radius: 0.95rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(31,41,55,0.85);
  box-shadow:
    0 18px 40px rgba(0,0,0,0.7),
    0 0 0 1px rgba(15,23,42,0.75);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(34,197,94,0.22), transparent 55%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.card-header span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Stats */

.stat-value {
  font-size: 1.6rem;
  font-weight: 600;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--accent);
}
.catalog-card {
  background: rgba(10,15,25,0.85);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.05);
}

.catalog-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.catalog-man {
  display: block;
  color: var(--text-muted);
  margin-top: -4px;
}

.catalog-flavors {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
}

.catalog-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-danger {
  background: #b30000 !important;
}

/* =========
   Forms
   ========= */

.form-grid {
  display: grid;
  gap: 0.75rem;
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: rgba(3,7,18,0.95);
  color: var(--text);
  font-size: 0.85rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.45);
}

textarea {
  resize: vertical;
  min-height: 46px;  /* etwas kompakter */
}

.mix-components-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mix-component-row {
  display: grid;
  grid-template-columns: 1.7fr 0.7fr auto;
  gap: 0.4rem;
  align-items: center;
}

.mix-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.6);
  color: var(--accent);
}

.hint-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.btn-danger {
  border-color: rgba(239,68,68,0.8) !important;
  color: #fecaca !important;
}

/* Geschmacksprofil-Tags */

.flavor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.flavor-tags label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.9);
}

.flavor-tags input[type="checkbox"] {
  accent-color: var(--accent);
}

/* =========
   Buttons
   ========= */

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent);
  color: #022c22;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(34,197,94,0.45);
  transition: transform 0.08s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 16px 40px rgba(34,197,94,0.6);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 20px rgba(34,197,94,0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  box-shadow: none;
}

.btn-danger {
  background: var(--danger);
  color: #fee2e2;
  box-shadow: 0 10px 30px rgba(239,68,68,0.5);
}

.btn-small {
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  box-shadow: none;
}

/* =========
   Tabellen
   ========= */

.table-wrapper {
  max-height: 420px;
  overflow: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

th,
td {
  padding: 0.4rem 0.55rem;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: #020617;
  z-index: 1;
  font-weight: 500;
  color: var(--text-muted);
}

tbody tr:nth-child(odd) {
  background: rgba(15,23,42,0.85);
}

tbody tr:nth-child(even) {
  background: rgba(12,20,38,0.95);
}

/* Hover für Tabak-Reihen */

.tobacco-row:hover {
  background: rgba(34,197,94,0.08) !important;
}

td.actions {
  width: 1%;
  white-space: nowrap;
}

/* Sort-Select in Card-Header */

.card-header select {
  background: #020617;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
}

/* Thumbnail in Tabak-Tabelle */

.tobacco-thumb {
  width: 56px;
  height: 56px;
  border-radius: 0.6rem;
  object-fit: cover;
  border: 1px solid var(--border);
}

.tobacco-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: rgba(15,23,42,0.9);
}

/* Low-Stock Farben */

.stock-green {
  color: #22c55e;
  font-weight: 600;
}

.stock-yellow {
  color: #eab308;
  font-weight: 600;
}

.stock-red {
  color: #ef4444;
  font-weight: 600;
}

/* =========
   Detail-Ansicht Tabak
   ========= */

/* =========
   Detail-Ansicht Tabak
   ========= */

.tobacco-detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  align-items: flex-start;
}

.tobacco-image-wrapper {
  display: flex;
  justify-content: flex-start;
}

/* Bild im Katalog-Detail: etwas kleiner & immer gleich groß */
.tobacco-image {
  width: 190px;          /* vorher 260px */
  height: 190px;         /* vorher 260px */
  max-width: 35vw;       /* falls Fenster sehr klein ist */
  max-height: 35vh;
  object-fit: contain;   /* Dose komplett sichtbar, nicht abgeschnitten */
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  box-shadow: 0 14px 35px rgba(0,0,0,0.6);
}

.tobacco-attrs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.tobacco-attr-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.tobacco-attr-label {
  color: var(--text-muted);
}

.tobacco-attr-value {
  font-weight: 500;
  text-align: right;
}

.tobacco-description-block {
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

.tobacco-description-block h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* =========
   Chips / Tags
   ========= */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(31,41,55,0.9);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(31,41,55,0.9);
  font-size: 0.75rem;
  margin: 0 0.25rem 0.25rem 0;
}

/* =========
   Floating Action Button
   ========= */

.fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  border: none;
  background: var(--accent);
  color: #022c22;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 18px 40px rgba(34,197,94,0.7);
  cursor: pointer;
  z-index: 50;
}

/* =========
   Modals
   ========= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.85);
  display: flex;
  align-items: flex-start;     /* oben statt genau mittig */
  justify-content: center;
  z-index: 60;
  padding: 2rem 1rem;          /* Abstand nach oben/unten */
  overflow-y: auto;            /* Overlay kann scrollen */

  /* Scrollbar unsichtbar machen */
  scrollbar-width: none;       /* Firefox */
}

.modal-overlay::-webkit-scrollbar {
  width: 0;
  height: 0;                   /* Chrome/Edge/Safari */
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: rgba(15,23,42,0.98);
  border-radius: 1rem;
  border: 1px solid rgba(31,41,55,0.9);
  padding: 1.1rem 1.2rem;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.8);
}

.modal h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}
/* ===== Katalog-Detail Modal ===== */
/* ===== Katalog-Detail Modal ===== */
/* ===== Katalog-Detail Modal (breiter & ohne sichtbare Scrollbar) ===== */
/* ===== Katalog-Detail Modal ===== */
.catalog-detail-modal {
  width: min(980px, 95vw);
  max-width: 980px;          /* 🔥 wichtig: überschreibt max-width der .modal */
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;        /* nichts rechts abschneiden */
  position: relative;
  padding-top: 2.2rem;       /* Platz für Schließen-Button */


  /* Scrollbar unsichtbar machen */
  -ms-overflow-style: none;  /* IE/Edge */
  scrollbar-width: none;     /* Firefox */
}

/* Scrollbar in Chrome / WebKit verstecken */
.catalog-detail-modal::-webk

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15,23,42,0.6);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1.9rem;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform .12s ease, background .12s ease;
}

.modal-close:hover {
  transform: scale(1.06);
  background: rgba(15,23,42,0.9);
}


/* Session Steps */

.session-step {
  margin-top: 0.4rem;
}

/* =========
   Views
   ========= */

.view {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.tobacco-list-tabs {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(31,41,55,0.9);
  gap: 0.15rem;
}

.tab-button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
}

.tab-button.tab-active {
  background: var(--accent-soft);
  color: var(--accent);
}
/* === Tabak-Inventar als Shopping-Grid ======================= */

/* Kopfzeile "Bild / Hersteller / Name ..." ausblenden,
   weil die Karten selbst alle Infos tragen */

/* Jede Tabellenzeile wird optisch eine Karte */
/* Hover-Effekt: leicht anheben + stärkerer Glow */

/* Erweiterte Karte (nach Klick): volle Breite + leicht größer */
#tobacco-list-body tr.tobacco-row.expanded {
  grid-column: 1 / -1;   /* nimmt ganze Reihe ein */
  transform: scale(1.01);
}

/* Zellen innerhalb der Karte */
#tobacco-list-body td {
  display: flex;
  align-items: center;
  border-bottom: none;
  padding: 0.15rem 0;
}

/* Thumbnail-Zeile etwas mehr Abstand nach unten */
#tobacco-list-body td:first-child {
  margin-bottom: 0.45rem;
}

/* Hersteller + Name etwas betonen */
#tobacco-list-body td:nth-child(2),
#tobacco-list-body td:nth-child(3) {
  font-weight: 600;
}

/* Bestand eher rechts halten (optional) */
#tobacco-list-body td:last-child {
  justify-content: flex-end;
  font-size: 0.8rem;
}

/* Mobile: nur eine Karte pro Zeile */
@media (max-width: 768px) {
  #tobacco-list-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* === Tabak-Inventar als Shopping-Grid ======================= */

/* Tabellen-Kopf im Inventar ausblenden, Karten sollen für sich sprechen */

/* Jede Zeile = eine Karte */
/* Hover-Effekt: leicht anheben + mehr Glow */

/* Erweiterte Karte nach Klick: nimmt die ganze Zeile ein */
#tobacco-list-body tr.tobacco-row.expanded {
  grid-column: 1 / -1;
  transform: scale(1.02);
}

/* Zellen in der Karte „nebeneinander“ */
#tobacco-list-body td {
  display: flex;
  align-items: center;
  border-bottom: none;
  padding: 0.15rem 0;
}

/* erste Zeile (Thumbnail) etwas mehr Abstand nach unten */
#tobacco-list-body td:first-child {
  margin-bottom: 0.45rem;
}

/* Hersteller + Name hervorheben */
#tobacco-list-body td:nth-child(2),
#tobacco-list-body td:nth-child(3) {
  font-weight: 600;
}

/* Bestand rechts ausrichten */
#tobacco-list-body td:last-child {
  justify-content: flex-end;
  font-size: 0.8rem;
}

/* Mobile: eine Karte pro Zeile */
@media (max-width: 768px) {
  #tobacco-list-body {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* ===================== */
/*   Mobile Optimierung  */
/* ===================== */

@media (max-width: 960px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .tobacco-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid rgba(31,41,55,0.8);
    padding: 0.5rem 0.6rem;
  }

  .sidebar-header {
    padding: 0.2rem 0.3rem 0.4rem;
    margin-bottom: 0.4rem;
  }

  .sidebar-title strong {
    font-size: 0.85rem;
  }

  .sidebar-title span {
    font-size: 0.7rem;
  }

  .sidebar-toggle {
    font-size: 0.8rem;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
  }

  .sidebar-section-label {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 0.8rem 0.8rem 1.2rem;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .main-header-title h1 {
    font-size: 1.2rem;
  }

  .header-chips {
    justify-content: flex-start;
  }

  .card {
    padding: 0.85rem 0.9rem;
  }

  .card-header h2 {
    font-size: 1rem;
  }

  .table-wrapper {
    max-height: 320px;
  }

  table {
    font-size: 0.75rem;
  }

  th,
  td {
    padding: 0.35rem 0.45rem;
  }

  .fab {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 600px) {
  .logo-circle {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .sidebar-title span {
    display: none;
  }

  .chip {
    font-size: 0.7rem;
  }

  input,
  select,
  textarea {
    font-size: 0.8rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
/* ===== Fullscreen Layout ohne Body-Scroll ===== */

/* Body soll nie scrollen */
html, body {
  height: 100%;
  overflow: hidden;
}

/* App-Shell auf echte Viewport-Höhe fixieren */
.app-shell {
  height: 100vh;      /* statt nur min-height */
  overflow: hidden;
}

/* Main wird Flex-Container und nimmt volle Höhe */
.main {
  height: 100vh;      /* volle Bildschirmhöhe */
  overflow: hidden;   /* kein Scroll im Main */
  display: flex;
  flex-direction: column;
}

/* Header oben bleibt fix in der Höhe */
.main-header {
  flex: 0 0 auto;
}

/* Dein Grid (2 Spalten) nimmt den ganzen Rest */
.main > .grid {
  flex: 1 1 auto;
  min-height: 0;      /* WICHTIG für korrektes internes Scrollen */
  overflow: hidden;
}

/* Cards im Grid sollen nicht über den Viewport wachsen */
.main > .grid .card {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Der Tabellen-/Listenbereich in der linken Card scrollt intern */
.main > .grid .card .table-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Falls du irgendwo noch Listen ohne table-wrapper hast */
#tobacco-list-body {
  overflow: auto;
}
/* === Inventar: interne Scroll-Liste links === */

/* Linke Card (Tabak-Liste) soll volle Höhe nutzen */
#tobacco-view .grid .card {
  display: flex;
  flex-direction: column;
  min-height: 0;      /* wichtig, sonst kein inneres Scrollen */
}

/* Der Bereich mit der Liste bekommt den Scroll */
#tobacco-view .table-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px; /* bisschen Platz für Scrollbar */
}
/* === Inventar als 2-Spalten-Shop-Grid === */

/* tbody wird Grid-Container */
#tobacco-list-body.inventory-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 6px;
}

/* jede Tabellenzeile ist jetzt eine Grid-Kachel */
#tobacco-list-body.inventory-grid tr.catalog-row {
  display: block;
}

/* aufgeklappt -> volle Breite */
#tobacco-list-body.inventory-grid tr.catalog-row.expanded {
  grid-column: 1 / -1;
}

/* Mobile -> 1 Spalte */
@media (max-width: 900px) {
  #tobacco-list-body.inventory-grid {
    grid-template-columns: 1fr;
  }
}
/* ===== Inventar-Grid: kompakte Shop-Karten ===== */

/* Wenn wir im 2-Spalten-Grid sind, sollen Karten vertikal werden */
#tobacco-list-body.inventory-grid .catalog-card {
  padding: 0.9rem;
}

/* Bild oben, Text darunter (statt links/rechts) */
#tobacco-list-body.inventory-grid .catalog-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

/* Thumbnail zentriert oben */
#tobacco-list-body.inventory-grid .catalog-thumb-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Bildgröße im Grid */
#tobacco-list-body.inventory-grid .catalog-thumb {
  width: 120px;
  height: 120px;
  border-radius: 1rem;
  object-fit: cover;
}

/* Textbereich volle Breite */
#tobacco-list-body.inventory-grid .catalog-info {
  width: 100%;
}

/* Titelzeile sauber umbrechen */
#tobacco-list-body.inventory-grid .catalog-title-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

#tobacco-list-body.inventory-grid .catalog-title-row h4 {
  font-size: 1rem;
  line-height: 1.2;
  margin: 0;
}

/* === Actions standardmäßig verstecken === */
/* Actions im Inventar immer anzeigen */
#tobacco-list-body.inventory-grid .catalog-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.6rem;
  gap: 0.6rem;
}
/* ===== Inventar-Grid Overlap Fix ===== */

/* Mehr Luft zwischen den Karten */
#tobacco-list-body.inventory-grid {
  gap: 18px !important;
  padding: 10px !important;
  align-items: start;
}

/* Jede Grid-Kachel ist ein eigener Block ohne Tabellen-Quatsch */
#tobacco-list-body.inventory-grid tr.catalog-row,
#tobacco-list-body.inventory-grid td {
  display: block !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

/* Karte darf NICHT absolut positionieren */
#tobacco-list-body.inventory-grid .catalog-card,
#tobacco-list-body.inventory-grid .catalog-actions,
#tobacco-list-body.inventory-grid .catalog-badge {
  position: static !important;
  height: auto !important;
}

/* Actions im Grid nicht “über den Rand ziehen” */
#tobacco-list-body.inventory-grid .catalog-actions {
  margin-top: 8px !important;
}
/* ===== Details rechts nur wenn gewählt ===== */
#tobacco-detail-card,
#tobacco-details-card {
  display: none;
}

#tobacco-detail-card.visible,
#tobacco-details-card.visible {
  display: flex;
  flex-direction: column;
}
/* ===== Inventar Grid: mehr Luft & keine Überlappung ===== */

#tobacco-list-body.inventory-grid{
  gap: 24px !important;      /* mehr Abstand horizontal/vertikal */
  padding: 12px !important;
}

/* Karten etwas höher, damit Text Platz hat */
#tobacco-list-body.inventory-grid .inventory-card{
  padding: 1rem !important;
}

/* Text nicht in den Nachbarn laufen lassen */
#tobacco-list-body.inventory-grid .catalog-info,
#tobacco-list-body.inventory-grid .catalog-title-row{
  width: 100%;
  min-width: 0;
}

#tobacco-list-body.inventory-grid .catalog-title-row h4{
  word-break: break-word;
}
/* ===== Kein horizontaler Scroll im Inventar ===== */

#tobacco-view .table-wrapper{
  overflow-x: hidden !important;  /* killt den unteren Slider */
}

#tobacco-list-body.inventory-grid{
  width: 100%;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

/* Falls irgendwo td/tr noch Tabellenbreite erzwingt */
#tobacco-list-body.inventory-grid tr,
#tobacco-list-body.inventory-grid td{
  width: 100%;
  box-sizing: border-box;
}
/* ===== Details Panel verstecken bis Tabak gewählt ===== */

#tobacco-detail-card,
#tobacco-details-card{
  display: none !important;
}

#tobacco-detail-card.visible,
#tobacco-details-card.visible{
  display: flex !important;
  flex-direction: column;
}
/* ===== Vollbreite Inventar-Grid (so viele Spalten wie passen) ===== */
#tobacco-list-body.inventory-grid{
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
  gap: 24px !important;
  padding: 12px !important;
}
/* ===== Tobacco View: Standard = Vollbreite, Details zu ===== */

/* default: zweite Spalte "zu" */
#tobacco-view .grid-2{
  grid-template-columns: 1fr 0fr !important;
  transition: all .25s ease;
}

/* Details Panel hidden + smooth */
#tobacco-view #tobacco-detail-card{
  opacity: 0;
  transform: translateX(18px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

/* wenn Details offen -> Split View aktiv */
#tobacco-view.details-open .grid-2{
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) !important;
}

#tobacco-view.details-open #tobacco-detail-card{
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
/* ===== Split-View: linker Bereich scrollt, Scrollbar unsichtbar ===== */

#tobacco-view.details-open .table-wrapper{
  overflow-y: auto !important;
  max-height: 100% !important;
  padding-right: 6px;
}

/* Scrollbar verstecken (Chrome/Edge/Safari) */
#tobacco-view.details-open .table-wrapper::-webkit-scrollbar{
  width: 0px;
  height: 0px;
}

/* Scrollbar verstecken (Firefox) */
#tobacco-view.details-open .table-wrapper{
  scrollbar-width: none;
}
/* ===== Inventar Scroll-Fix im Split-View ===== */

/* alte 420px Beschränkung im Tobacco-View aufheben */
#tobacco-view .table-wrapper{
  max-height: none !important;
  height: 100% !important;
  flex: 1 1 auto;
  min-height: 0;         /* wichtig für echtes inneres Scrollen */
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* linke Card im Tobacco-View muss Flex sein, sonst kann Kind nicht scrollen */
#tobacco-view .grid-2 > .card:first-child{
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Scrollbar verstecken (Chrome/Edge/Safari) */
#tobacco-view .table-wrapper::-webkit-scrollbar{
  width: 0px;
  height: 0px;
}

/* Scrollbar verstecken (Firefox) */
#tobacco-view .table-wrapper{
  scrollbar-width: none;
}
/* ===== FINAL: Split-View Scroll links (überschreibt alles) ===== */

/* linke Card muss Flex sein und darf schrumpfen */
#tobacco-view.details-open .grid-2 > .card:first-child{
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
}

/* NUR der Listenbereich scrollt */
#tobacco-view.details-open .grid-2 > .card:first-child .table-wrapper{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: none !important;
  padding-right: 6px;
}

/* Scrollbar unsichtbar (Chrome/Edge/Safari) */
#tobacco-view.details-open .grid-2 > .card:first-child .table-wrapper::-webkit-scrollbar{
  width: 0 !important;
  height: 0 !important;
}

/* Scrollbar unsichtbar (Firefox) */
#tobacco-view.details-open .grid-2 > .card:first-child .table-wrapper{
  scrollbar-width: none !important;
}
/* ===== FINAL SCROLL FIX (nur links im Split View) ===== */

#tobacco-view.details-open .grid-2 > .card:first-child{
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
}

/* WICHTIG: height:0 im Flex-Child erzwingt echtes internes Scrollen */
#tobacco-view.details-open .grid-2 > .card:first-child .table-wrapper{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: none !important;
}

/* Das Grid selbst soll NICHT scrollen, sondern nur der Wrapper */
#tobacco-list-body.inventory-grid{
  overflow: visible !important;
  height: auto !important;
}

/* Scrollbar unsichtbar */
#tobacco-view.details-open .grid-2 > .card:first-child .table-wrapper::-webkit-scrollbar{
  width: 0 !important;
  height: 0 !important;
}
#tobacco-view.details-open .grid-2 > .card:first-child .table-wrapper{
  scrollbar-width: none !important;
}
.stock-empty {
  color: var(--text-muted);
  font-weight: 600;
}
/* Hover nur für Inventar-Grid */
#tobacco-list-body.inventory-grid tr.tobacco-row:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.75);
  border-color: rgba(34,197,94,0.8);
  background: radial-gradient(circle at top left,
    rgba(34,197,94,0.28),
    rgba(15,23,42,0.98)
  );
}
/* Katalog soll echte Tabelle sein */
#tobacco-view.catalog-mode #tobacco-list-body tr.tobacco-row {
  display: table-row !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#tobacco-view.catalog-mode #tobacco-list-body td {
  display: table-cell !important;
  padding: 0.4rem 0.55rem !important;
}
/* ============================================================
   KATALOG: echte Tabellen-Optik erzwingen
   (greift immer dann, wenn NICHT inventory-grid aktiv ist)
   ============================================================ */

#tobacco-list-body:not(.inventory-grid) tr.tobacco-row {
  display: table-row !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  transform: none !important;
}

#tobacco-list-body:not(.inventory-grid) tr.tobacco-row:hover {
  transform: none !important;
  box-shadow: none !important;
  background: rgba(255,255,255,0.03) !important; /* leichter Row-Highlight */
}

#tobacco-list-body:not(.inventory-grid) td {
  display: table-cell !important;
  padding: 0.55rem 0.7rem !important;
  vertical-align: middle !important;
  background: transparent !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

/* alle "Card-Layouts" im Katalog zurücksetzen */
#tobacco-list-body:not(.inventory-grid) td:first-child,
#tobacco-list-body:not(.inventory-grid) td:last-child,
#tobacco-list-body:not(.inventory-grid) td:nth-child(2),
#tobacco-list-body:not(.inventory-grid) td:nth-child(3) {
  justify-content: unset !important;
  margin: 0 !important;
}

/* Thumbnail im Katalog klein + sauber */
#tobacco-list-body:not(.inventory-grid) .tobacco-thumb {
  width: 48px !important;
  height: 48px !important;
  border-radius: 0.45rem !important;
}

/* Aktionen-Spalte hübsch mittig */
#tobacco-list-body:not(.inventory-grid) td:last-child {
  text-align: right !important;
  white-space: nowrap !important;
}
.choice-row {
  display:flex;
  gap:0.6rem;
  flex-wrap:wrap;
}

.gram-row {
  display:flex;
  gap:0.6rem;
  flex-wrap:wrap;
  margin-top:0.7rem;
}

.step-hint, .hint {
  color:var(--text-muted);
  font-size:.85rem;
}
/* ===============================
   Session Wizard UI (NEU)
   =============================== */

.session-modal {
  width: min(520px, 94vw);
}

.modal-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:.8rem;
  margin-bottom:.6rem;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: .5rem;
}
.icon-btn:hover { background: rgba(255,255,255,0.06); }

.wizard-progress {
  display:flex;
  gap:.5rem;
  margin:.2rem 0 1rem;
}
.wizard-dot {
  flex:1;
  height:4px;
  border-radius:999px;
  background: rgba(255,255,255,0.12);
  transition: background .25s ease;
}
.wizard-dot.active {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.choice-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.8rem;
  margin-top:.8rem;
}
@media (max-width:520px){
  .choice-grid{ grid-template-columns:1fr; }
}

.choice-card {
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(15,23,42,0.9);
  border-radius:1rem;
  padding:1rem;
  text-align:center;
  cursor:pointer;
  transition: transform .18s ease, border .18s ease, box-shadow .18s ease;
}
.choice-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34,197,94,0.6);
  box-shadow: 0 10px 24px rgba(0,0,0,0.6);
}
.choice-icon { font-size:1.8rem; }
.choice-title { font-weight:700; margin-top:.4rem; }
.choice-sub { font-size:.85rem; color:var(--text-muted); margin-top:.2rem; }

.full { width:100%; }

.gram-row {
  display:flex;
  gap:.6rem;
  margin-top:.7rem;
  flex-wrap:wrap;
}
.gram-btn {
  flex:1;
  min-width:90px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(15,23,42,0.9);
  color:var(--text);
  padding:.65rem .8rem;
  border-radius:.8rem;
  cursor:pointer;
  transition: background .2s ease, border .2s ease, transform .15s ease;
}
.gram-btn:hover { transform: translateY(-2px); }
.gram-btn.active {
  border-color:#22c55e;
  background: rgba(34,197,94,0.15);
}

.wizard-footer {
  margin-top:1rem;
  display:flex;
  justify-content:space-between;
  gap:.8rem;
}
.wizard-footer-right {
  display:flex;
  gap:.5rem;
}

.timer {
  font-size:1.8rem;
  font-weight:800;
  margin-top:.6rem;
  letter-spacing:1px;
}
/* Session Mix Builder */
#session-modal .mix-slot-row{
  display:flex;
  gap:.6rem;
  align-items:center;
  margin-top:.5rem;
}

#session-modal .ss-remove-slot{
  opacity:.7;
}
#session-modal .ss-remove-slot:hover{
  opacity:1;
}
/* Mix-Zeilen im Session Wizard */
.mix-row {
  display: grid;
  grid-template-columns: 1fr 90px 32px;
  gap: .5rem;
  align-items: center;
  margin-top: .5rem;
}

.mix-row input {
  width: 100%;
  text-align: center;
}

.mix-remove {
  border-radius: 999px;
  height: 30px;
  width: 30px;
  padding: 0;
  line-height: 1;
}
#tc-from-catalog {
  margin-top: 0.25rem;
}
/* Session Wizard: Mix-Modus Toggle */
.ss-mix-mode-toggle {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.ss-mix-mode-toggle .btn.active {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.35);
}
/* Subtiler Dashboard Timer */
.timer-wrap {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: .4rem 0 1rem 0;
}

.timer-wrap.hidden {
  display: none;
}

.timer-subtle {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: .25rem .7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
}

.timer-actions {
  display: flex;
  gap: .4rem;
}
/* Utility: überall verstecken */
.hidden {
  display: none !important;
}
/* ===== Live Session Card ===== */
.live-session-card{
  padding: 1rem 1.1rem;
  margin-top: .8rem;
}

.live-session-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  margin-bottom:.75rem;
}

.live-session-status{
  font-size:.85rem;
  color:var(--text-muted);
  margin-top:.15rem;
}

.live-session-actions{
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
}

.live-session-body{
  display:flex;
  align-items:center;
  gap:1.2rem;
  flex-wrap:wrap;
}

/* Progress Ring */
.progress-ring{
  position:relative;
  width:96px;
  height:96px;
  flex:0 0 auto;
}

.progress-ring svg{
  transform: rotate(-90deg);
}

.ring-bg{
  fill:none;
  stroke: rgba(255,255,255,0.08);
  stroke-width:10;
}

.ring-fg{
  fill:none;
  stroke: var(--green);
  stroke-width:10;
  stroke-linecap:round;
  stroke-dasharray: 251.2;   /* 2πr bei r=40 */
  stroke-dashoffset: 251.2;  /* start bei 0% */
  transition: stroke-dashoffset .4s ease;
  filter: drop-shadow(0 0 6px rgba(34,197,94,0.5));
}

.ring-center{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  transform: translateY(1px);
}

.ring-time{
  font-size:1.1rem;
  font-weight:900;
  letter-spacing:1px;
}

.ring-sub{
  font-size:.75rem;
  color:var(--text-muted);
  margin-top:-2px;
}

.live-session-meta{
  min-width:180px;
  flex:1 1 auto;
}

.meta-row{
  display:flex;
  justify-content:space-between;
  padding:.35rem .2rem;
  font-size:.9rem;
  border-bottom:1px dashed rgba(255,255,255,0.06);
}
.meta-row:last-child{ border-bottom:none; }
/* Utility: überall verstecken können (nicht nur Modals) */
.hidden {
  display: none !important;
}
/* ===== Live Session Card (kompakt) ===== */
.live-session-card{
  padding: .9rem 1rem;
  margin-top: .8rem;
}

.live-session-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  margin-bottom:.6rem;
}

.live-session-status{
  font-size:.85rem;
  color:var(--text-muted);
  margin-top:.15rem;
}

.live-session-actions{
  display:flex;
  gap:.45rem;
  flex-wrap:wrap;
}

.live-session-body{
  display:flex;
  align-items:center;
  gap:1rem;
  flex-wrap:wrap;
}

/* Ring */
.progress-ring{
  position:relative;
  width:84px;
  height:84px;
  flex:0 0 auto;
}

.progress-ring svg{
  transform: rotate(-90deg);
}

.ring-bg{
  fill:none;
  stroke: rgba(255,255,255,0.08);
  stroke-width:10;
}

.ring-fg{
  fill:none;
  stroke: var(--green);
  stroke-width:10;
  stroke-linecap:round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset .35s ease;
}

.ring-center{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
}

.ring-time{
  font-size:1.05rem;
  font-weight:900;
  letter-spacing:1px;
}

.ring-sub{
  font-size:.72rem;
  color:var(--text-muted);
  margin-top:-2px;
}

.live-session-meta{
  min-width:170px;
  flex:1 1 auto;
}

.meta-row{
  display:flex;
  justify-content:space-between;
  padding:.3rem .1rem;
  font-size:.9rem;
  border-bottom:1px dashed rgba(255,255,255,0.06);
}
.meta-row:last-child{ border-bottom:none; }
/* Live Timer kompakter */
.live-session-card{
  padding: .8rem 1rem;
}

.progress-ring{
  width:72px;
  height:72px;
}

.progress-ring svg{
  width:72px;
  height:72px;
}

.ring-bg,
.ring-fg{
  stroke-width:8;
}

.ring-time{
  font-size:0.95rem;
}
.ring-sub{
  font-size:0.7rem;
}

.live-session-meta{
  min-width:140px;
  font-size:.85rem;
}
/* Live Session Card kompakt */
.live-session-card{
  padding: .8rem 1rem;
  max-width: 520px;
  width: 100%;
  margin: 0 0 1rem 0;
}

.live-session-body{
  display:flex;
  align-items:center;
  gap:1rem;
}

/* Ring kleiner */
.progress-ring{
  width:72px;
  height:72px;
  position:relative;
  flex: 0 0 auto;
}

.progress-ring svg{
  width:72px;
  height:72px;
  transform: rotate(-90deg);
}

.ring-bg,
.ring-fg{
  stroke-width:8;
}

.ring-time{
  font-size:0.95rem;
  font-weight:800;
}
.ring-sub{
  font-size:0.7rem;
  color:var(--text-muted);
}
/* Live-Session Body nicht auseinander ziehen */
.live-session-body{
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-start; /* <<< wichtig */
}

/* Meta nicht auf volle Breite strecken */
.live-session-meta{
  min-width: 140px;
  flex: 0 0 auto;  /* <<< wichtig, vorher war es 1 1 auto */
  margin-left: .3rem;
  font-size: .85rem;
}
/* ===== Sanduhr / Countdown Ring Style ===== */
.ring-svg{
  transform: rotate(-90deg);
}

.ring-bg{
  fill:none;
  stroke: rgba(255,255,255,0.12);
  stroke-width: 8;
}

/* FG: nur dash/width in CSS, Farbe kommt aus SVG-Gradient */
.ring-fg{
  fill:none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .4s ease;
  filter: drop-shadow(0 0 6px rgba(253,160,133,0.6));
}

/* Card hübscher / kompakter */
.live-session-card{
  padding: .9rem 1.1rem;
  max-width: 520px;
}

.live-session-header{
  margin-bottom: .55rem;
}

/* Ring klein & clean */
.progress-ring{
  width:72px;
  height:72px;
  position:relative;
  flex:0 0 auto;
}

.progress-ring svg{
  width:72px;
  height:72px;
}

/* Zeit in der Mitte etwas größer */
.ring-time{
  font-size:1.05rem;
  font-weight:900;
  letter-spacing:1px;
}

.ring-sub{
  font-size:.72rem;
  color:var(--text-muted);
  margin-top:-3px;
}
/* ===== Sanduhr-Ring für dein aktuelles HTML ===== */

/* Body in der Card nicht auseinander ziehen */
.live-session-body{
  display:flex;
  align-items:center;
  gap:1rem;
  flex-wrap:wrap;
  justify-content:flex-start;
}

/* Max-Block nicht auf volle Breite strecken -> näher am Ring */
.live-session-meta{
  flex:0 0 auto;
  min-width:120px;
  margin-left:.35rem;
  font-size:.85rem;
}

/* Ring + Zeit sauber übereinander */
.ring-wrap{
  position:relative;
  width:72px;
  height:72px;
  flex:0 0 auto;
}

.ring-wrap .ring{
  width:72px;
  height:72px;
  transform: rotate(-90deg);
}

/* Hintergrundkreis */
.ring-bg{
  fill:none;
  stroke: rgba(255,255,255,0.10);
  stroke-width:8;
}

/* Vordergrundkreis = „Sand“ */
.ring-fg{
  fill:none;
  stroke: #f6d365;                 /* sandig */
  stroke-width:8;
  stroke-linecap:round;
  stroke-dasharray:251.2;
  stroke-dashoffset:0;
  transition: stroke-dashoffset .4s ease;
  filter: drop-shadow(0 0 6px rgba(253,160,133,0.6));
}

/* Zeit in die Mitte des Rings */
.ring-time{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.0rem;
  font-weight:900;
  letter-spacing:1px;
  color:#fff;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

.modal {
  background: var(--surface);
  color: var(--text);
  border-radius: 1rem;
  padding: 1.5rem;
  width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
}
/* Floating Add Button wie beim Tabak-Inventar */
.floating-add-btn{
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  z-index: 50;
  padding: .9rem 1.2rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
/* ===== Sterne-Rating (0–5 mit halben Sternen) ===== */
.stars {
  display: inline-flex;
  gap: 2px;
  font-size: 0.95rem;
  line-height: 1;
  transform: translateY(1px);
}

.star {
  color: rgba(255,255,255,0.25);
  position: relative;
}

.star.full {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.45);
}

.star.half {
  color: rgba(255,255,255,0.25);
}
.star.half::before {
  content: "★";
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.45);
}

.star.empty {
  color: rgba(255,255,255,0.25);
}
/* ===== Sterne-Rating (0–5, halbe Sterne) ===== */
.stars {
  display: inline-flex;
  gap: 2px;
  font-size: 0.95rem;
  line-height: 1;
  transform: translateY(1px);
}

.star {
  color: rgba(255,255,255,0.25);
  position: relative;
}

.star.full {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.45);
}

.star.half {
  color: rgba(255,255,255,0.25);
}

.star.half::before {
  content: "★";
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.45);
}

.star.empty {
  color: rgba(255,255,255,0.25);
}

/* ===== Review Summary unter den Details ===== */
.review-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.review-summary-main {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.review-summary-overall {
  font-size: 0.9rem;
}

.review-summary-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.review-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.review-chip {
  font-size: 0.78rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.review-chip strong {
  font-weight: 600;
}
/* ===== Sterne-Rating (0–5, halbe Sterne) ===== */
.stars {
  display: inline-flex;
  gap: 2px;
  font-size: 0.95rem;
  line-height: 1;
  transform: translateY(1px);
}

.star {
  color: rgba(255,255,255,0.25);
  position: relative;
}

.star.full {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.45);
}

.star.half {
  color: rgba(255,255,255,0.25);
}

.star.half::before {
  content: "★";
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.45);
}

.star.empty {
  color: rgba(255,255,255,0.25);
}

/* ===== Review Summary unter den Tabak-Details ===== */
.review-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.review-summary-main {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.review-summary-overall {
  font-size: 0.9rem;
}

.review-summary-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.review-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.review-chip {
  font-size: 0.78rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.review-chip strong {
  font-weight: 600;
}
/* ===== Sterne-Rating (0–5, halbe Sterne) ===== */
.stars {
  display: inline-flex;
  gap: 2px;
  font-size: 0.95rem;
  line-height: 1;
  transform: translateY(1px);
}

.star {
  color: rgba(255,255,255,0.25);
  position: relative;
}

.star.full {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.45);
}

.star.half {
  color: rgba(255,255,255,0.25);
}

.star.half::before {
  content: "★";
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.45);
}

.star.empty {
  color: rgba(255,255,255,0.25);
}

/* ===== Review Summary unter den Tabak-Details ===== */
.review-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.review-summary-main {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.review-summary-overall {
  font-size: 0.9rem;
}

.review-summary-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.review-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.review-chip {
  font-size: 0.78rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.review-chip strong {
  font-weight: 600;
}

/* Rating-Felder im Modal */
.rating-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.rating-field input {
  width: 100%;
}

#tc-rating-comment {
  width: 100%;
  resize: vertical;
}
/* Tabak-Modal etwas breiter als die anderen Modals */
/* Tabak-Modal etwas breiter als die anderen Modals */
#tobacco-modal .modal {
  max-width: 900px;
  width: min(900px, 96vw);   /* überschreibt das globale width:480px */
}
/* Tabakbewertung im Modal hübscher anordnen */
.rating-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.rating-field {
  display: flex;
  flex-direction: column;
}

.rating-field label {
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

/* Textfeld für Kommentar über volle Breite */
#tc-rating-comment {
  width: 100%;
  resize: vertical;
}

/* Auf kleineren Screens alles untereinander statt 3 Spalten */
@media (max-width: 900px) {
  #tobacco-modal .modal {
    max-width: 100%;
  }
  .rating-grid {
    grid-template-columns: 1fr;
  }
}
/* Accordion für Tabakbewertung im Modal */
.rating-section {
  grid-column: 1 / -1;
  margin-top: 0.6rem;
  border-top: 1px solid rgba(148,163,184,0.2);
  padding-top: 0.5rem;
}

.rating-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.rating-toggle-icon {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

/* Inhalt */
.rating-content {
  margin-top: 0.4rem;
}

/* Eingeklappt: Inhalt verstecken + Pfeil drehen */
.rating-section.collapsed .rating-content {
  display: none;
}

.rating-section.collapsed .rating-toggle-icon {
  transform: rotate(-90deg);
}
@media (max-width: 900px) {
  .tobacco-detail-grid {
    grid-template-columns: 1fr;
  }

  .tobacco-image {
    width: 100%;
    height: auto;
  }
}
/* ===== Sterne-Rating (0–5, halbe Sterne) ===== */
.stars {
  display: inline-flex;
  gap: 2px;
  font-size: 0.95rem;
  line-height: 1;
  transform: translateY(1px);
}

.star {
  color: rgba(255,255,255,0.25);  /* leere Sterne */
  position: relative;
}

.star.full {
  color: #fbbf24; /* volle Sterne (gold) */
  text-shadow: 0 0 6px rgba(251,191,36,0.45);
}

.star.half {
  color: rgba(255,255,255,0.25);
}

.star.half::before {
  content: "★";
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.45);
}

.star.empty {
  color: rgba(255,255,255,0.25);
}
.review-delete-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
}

.review-delete-btn:hover {
  background: rgba(248,113,113,0.15);
}
.session-stats {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(0,0,0,0.25);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}

.charts-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

#chartSessionsPerDay,
#chartGramsPerDay {
  width: 100%;
  height: 260px;
}
/* ===== FIX: Katalog Detail Modal Breite & Layout ===== */

.catalog-detail-modal {
  width: min(1100px, 95vw) !important;   /* viel breiter */
  max-width: 1100px !important;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;                     /* kein Rechts-Scrollen */
  padding: 2rem;
}

/* Layout des Inhalts verbessern */
#catalog-detail-content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
}

/* Bild anpassen */
#catalog-detail-content img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
}

/* Rechts stehende Werte */
.catalog-detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Mobile fallback */
@media (max-width: 900px) {
  #catalog-detail-content {
    grid-template-columns: 1fr;
  }
}
.catalog-detail-modal {
  max-width: 900px !important;
}

.catalog-detail-image {
  width: 260px;
  height: 260px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  padding: 10px;
  display: block;
  margin-bottom: 1rem;
}

.catalog-detail-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
}

.catalog-detail-section {
  margin-top: 1rem;
}

.catalog-detail-section h3 {
  margin-bottom: .3rem;
  font-size: 1rem;
}
/* === KATALOG DETAIL MODAL FIX === */

/* Modal etwas breiter */
.catalog-detail-modal {
  max-width: 900px;
}

/* Close-Button schönes großes X oben links */
.catalog-detail-modal .modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 26px;
  background: none;
  color: white;
  opacity: 0.85;
  border: none;
  cursor: pointer;
}
.catalog-detail-modal .modal-close:hover {
  opacity: 1;
}

/* Content-Wrapper */
#catalog-detail-content {
  padding: 1rem;
}

/* Bild zentriert, gleiche Größe */
.catalog-detail-image-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 1rem 0;
}

.catalog-detail-image-wrapper img {
  width: 280px;      /* feste Größe */
  height: 280px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow-strong);
}

/* Zweispaltiges Layout für Infos */
.catalog-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 1rem;
}

.catalog-detail-section-title {
  font-weight: bold;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--text-muted);
}

 
#catalog-detail-content img.tobacco-image {
  width: 260px;
  height: 260px;
  object-fit: contain;   /* oder cover, wenn du es lieber „gefüllt“ magst */
  border-radius: 12px;
}
/* --- Katalog-Detail Bild Fix --- */

/* Header + Bild + Infos untereinander sauber */
.catalog-detail-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: 1rem;
}

/* Layout Container für Bild + Info */
.catalog-detail-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .catalog-detail-layout {
        grid-template-columns: 1fr;
    }
}
.tobacco-image {
  width: 210px;
  height: 210px;
  max-width: 30vw;
  max-height: 30vh;
  object-fit: contain;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  box-shadow: 0 14px 35px rgba(0,0,0,0.6);
}
/* === KATALOG-DETAIL: Bild links unter Titel === */

/* Der Content selbst soll kein Grid mehr sein,
   das erledigt die tobacco-detail-grid innen */
#catalog-detail-content {
  display: block;
  padding: 1rem 1.2rem 1.4rem;
}

/* Das Grid mit Bild + Attributen */
#catalog-detail-content .tobacco-detail-grid {
  display: grid;
  grid-template-columns: 230px 1fr; /* linke Spalte Bild, rechte Infos */
  gap: 1.4rem;
  align-items: flex-start;
  margin-top: 1rem;
}

/* Bildgröße + Position im Katalog-Detail */
#catalog-detail-content img.tobacco-image {
  width: 210px;
  height: 210px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
  margin: 0;              /* NICHT zentrieren */
  display: block;
}
.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.auth-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-actions {
  display: flex;
  gap: 0.4rem;
}
.app-shell {
  height: 100vh;
  overflow: hidden;
}

.main {
  flex: 1;
  padding: 1.25rem 1.4rem;
  max-width: 1200px;
  margin: 0 auto;
  overflow-y: auto;
}
.catalog-scope-toggle {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.5);
}

.catalog-scope-btn {
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.catalog-scope-btn.catalog-scope-active {
  background: var(--accent);
  color: #022c22;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.6);
}
.small-modal {
    width: 350px !important;
}
.small-modal {
  max-width: 480px;
}

#select-public-tobacco-overlay .modal-body {
  padding-top: 0.75rem;
}

#select-public-search {
  margin-bottom: 0.75rem;
}

.select-list {
  width: 100%;
  max-height: 260px;
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(8, 15, 30, 0.95);
  font-size: 0.9rem;
}

.select-list option {
  padding: 0.25rem 0.4rem;
}

.select-list option:hover,
.select-list option:focus,
.select-list option:checked {
  background: rgba(0, 200, 120, 0.2);
}
