/* ===========================================
   GLOBAL: Hintergrund + Font
=========================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
:root {
  --trex-bg: #f5f5dc;
  --trex-green: #6b8e23;
  --trex-green-dark: #9fa18a;
  --trex-hover-bg: #dfe6bf;

  --clickable-color: var(--trex-green);
  --clickable-hover: var(--trex-green-dark);
}

html, body { height: 100%; }

body {
  background-color: var(--trex-bg) !important;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  color: #333333;
}

/* Bootstrap bg-light überschreiben */
.bg-light { background-color: var(--trex-bg) !important; }

body, table, input, select, button {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* ===========================================
   LINKS & BUTTONS
=========================================== */
a:not(.btn),
a:not(.btn):visited {
  color: var(--clickable-color) !important;
  text-decoration: underline;
}

a:not(.btn):hover,
a:not(.btn):focus {
  color: var(--clickable-hover) !important;
}

/* Buttons */
.btn-primary {
  background-color: var(--trex-green) !important;
  border-color: var(--trex-bg) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--trex-green-dark) !important;
  color: #fff !important;
}

/* ===========================================
   HEADER (Grid – Desktop + Mobile)
=========================================== */
.header-logo {
  height: 48px;
  width: auto;
  display: block;
}

/* Desktop */
.trex-page-header{
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-areas:
    "logo title user"
    "logo title actions";
  align-items: center;
  gap: .6rem 1.2rem;
}

.trex-logo-link { grid-area: logo; }

.trex-title {
  grid-area: title;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
}


.trex-user {
  grid-area: user;
  text-align: right;
}

.trex-header-actions {
  grid-area: actions;
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}

.trex-header-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  font-size: .95rem;
  padding: .55rem .8rem;
}

/* ===========================================
   TABELLE / KARTEN
=========================================== */
.table {
  border-collapse: separate;
  border-spacing: 0 0.4rem;
  width: 100%;
}

/* Verkaufspreis rechtsbündig */
.table thead th:nth-child(8),
.table tbody td:nth-child(8) {
  text-align: right;
  white-space: nowrap;
}

.table tbody tr > * {
  background-color: #ffffff !important;
  border: none !important;
}

/* Kartenoptik */
.trex-table tbody tr > *:first-child {
  border-radius: 0.6rem 0 0 0.6rem !important;
}
.trex-table tbody tr > *:last-child {
  border-radius: 0 0.6rem 0.6rem 0 !important;
}

/* Hover */
.table-hover tbody tr { transition: box-shadow .15s ease; }
.table-hover tbody tr:hover > * { background-color: var(--trex-hover-bg) !important; }
.table-hover tbody tr:hover { box-shadow: 0 4px 12px rgba(107, 142, 35, 0.25); }

/* Sticky Header Desktop */
.table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: var(--trex-bg) !important;
  border: none !important;
}

.table-responsive {
  max-height: 72vh;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===========================================
   SORTIER-BUTTONS (Tabellen-Header)
=========================================== */
th .sort-btn {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-weight: 600;
  color: #000 !important;
  white-space: nowrap;
  padding: 0;
  text-decoration: none !important;
}

/* Bootstrap btn-link macht sonst blau/unterstrichen */
th .sort-btn.btn-link,
th .sort-btn.btn-link:visited,
th .sort-btn.btn-link:hover,
th .sort-btn.btn-link:focus {
  color: #000 !important;
  text-decoration: none !important;
}

th .sort-btn:focus {
  outline: none;
  box-shadow: none !important;
}

/* Pfeile */
th .sort-btn[data-sort="asc"]::after {
  content: "▲";
  font-size: .75rem;
  line-height: 1;
}

th .sort-btn[data-sort="desc"]::after {
  content: "▼";
  font-size: .75rem;
  line-height: 1;
}


/* ===========================================
   THUMBNAILS / ARTIKELNUMMER
=========================================== */
.thumb-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #fff;
}

td.artikelnummer {
  font-weight: 600;
  white-space: nowrap;
}

/* ===========================================
   GALERIE
=========================================== */
#galleryModal .carousel-control-prev-icon,
#galleryModal .carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background-color: rgba(0,0,0,.6);
  background-size: 60%;
}

/* ===========================================
   MOBILE
=========================================== */
@media (max-width: 768px) {

  body { font-size: 16px; line-height: 1.35; }

  .trex-page-header{
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "title"
      "user"
      "actions";
    align-items: start;
  }

  .header-logo { height: 44px; }

  .trex-title {
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .trex-user {
    text-align: left;
  }

  .trex-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
  }

  .trex-header-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Erste Spalte sticky beim horizontalen Scrollen */
  .trex-table td:first-child,
  .trex-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background-color: #fff;
  }
  .trex-table th:first-child {
    background-color: var(--trex-bg);
    z-index: 4;
  }

  .table-responsive {
    max-height: none;
    overflow-y: visible;
  }

  .table thead th { position: static; }
}

@media (max-width: 380px) {
  .trex-header-actions {
    grid-template-columns: 1fr;
  }
}

/* ===========================================
   SONSTIGES
=========================================== */
.img-manager-thumb{
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
}

