:root {
  --bg: #0b0d10;
  --panel: rgba(17, 20, 26, 0.92);
  --panel-strong: rgba(20, 24, 32, 0.98);
  --text: #f0f4f8;
  --muted: #a2b0c3;
  --accent: #ff7a59;
  --line: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", "Satoshi", "Avenir Next", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1b2130 0%, #0b0d10 45%, #0b0d10 100%);
  color: var(--text);
  min-height: 100vh;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-x: hidden;
  min-height: 100vh;
}

.hero {
  display: flex;
  position: relative;
  flex-direction: column;
  gap: 0.5rem;
}

.eyebrow {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 12px;
  color: #ffd166;
  margin: 0;
}

h1 { margin: 0; }

.subhead { color: var(--muted); margin: 0 0 1rem 0; }

.nav-links {
  display: flex;
  flex-direction: row;
  gap: 18px;
  justify-content: space-evenly;
  & a {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s ease-in-out;
    border: 1px solid var(--line);
    & .inline-svg {
      height: 1.5rem;
      width: auto;
      object-fit: contain;
      fill: white;
      &.compact {
        height: 1rem;
      }
    }
  }
}

.status {
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  align-self: start;
}

.underline {
  text-decoration: underline;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
}

.doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.doc-sidebar {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 12px;
  align-self: start;
}

.doc-title {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-nav {
  display: grid;
  gap: 8px;
}

.doc-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.doc-nav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.doc-content {
  display: grid;
  gap: 24px;
}

.breadcrumb {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.breadcrumb > * {
  color: var(--muted);
  text-decoration: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  & .inline-svg {
    height: 1.5rem;
    width: auto;
    object-fit: contain;
    fill: white;
  }
}

.breadcrumb a:hover {
  color: var(--text);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: static;
  }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  min-width: 0;
  max-width: 100%;
}

.card .card-wrapper {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  width: 100%;
}

.card-wrapper img {
  display: flex;
  flex: 1 1 0;
  min-width: 0;  
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.card-wrapper .card-content {
  display: flex;
  flex: 1 1 0;
  max-width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
}

.card-wrapper .card-button {
  display: flex;
  justify-content: end;
  align-items: center;
  margin-top: 12px;
  padding: 10px 16px;
  color: #ff5c3d;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  gap: 0.5rem;
  & .inline-svg {
    height: 1rem;
    width: auto;
    object-fit: contain;
    fill: #ff5c3d;
    transform: rotate(180deg);
  }
}

.hidden {
  display: none!important;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 240px;
  height: 100%;
  flex: 1;
}

.drop-inner { display: grid; gap: 0.75rem; }

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

.field { display: grid; gap: 0.5rem; margin-bottom: 14px; }

label { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.inline { font-size: 13px; text-transform: none; letter-spacing: 0; }

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.row { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #ff5c3d);
  border: none;
}

.actions { display: flex; justify-content: center; }

.log-card pre {
  background: rgba(9, 11, 15, 0.9);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 16px;
  min-height: 140px;
  max-height: 240px;
  overflow: auto;
  font-size: 12px;
  color: #d2d8e2;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-selections {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.product-week,
.product-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(12, 14, 18, 0.7);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.product-week > summary,
.product-group > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
}

.product-week > summary::-webkit-details-marker,
.product-group > summary::-webkit-details-marker {
  display: none;
}

.selection-hint {
  margin: 8px 0 10px;
  font-size: 12px;
  color: var(--muted);
}

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

.product-table {
  width: max-content;
  min-width: 1400px;
  border-collapse: collapse;
  font-size: 12px;
}

.product-table th,
.product-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.product-table th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.danger {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 0, 0, 0.5);
  background-color: rgba(255, 0, 0, 0.1);
  font-size: 10px;
  margin-right: 4px;
}

.badge {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 10px;
  margin-right: 4px;
}

.badge.prio {
  border-color: rgba(125, 175, 255, 0.5);
  color: #c6ddff;
}

.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 92, 61, 0.16);
  border: 1px solid rgba(255, 92, 61, 0.55);
  color: #ff5c3d;
  font-weight: 700;
  line-height: 1;
  font-size: 12px;
}

.rank-sub {
  font-size: 10px;
  color: var(--muted);
}

.thumb-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.thumb-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: block;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
  gap: 6px;
  max-width: 160px;
}

.thumb-grid .thumb-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

.thumb-count {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 92, 61, 0.95);
  color: #0b0d10;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  place-items: center;
  padding: 24px;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.72);
}

.image-modal-card {
  position: relative;
  max-width: min(860px, 92vw);
  max-height: 90vh;
  padding: 18px;
  background: rgba(12, 16, 22, 0.96);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1;
}

.image-modal-card img {
  max-width: 100%;
  flex: 1;
  height: auto;
  min-height: 1px;
  object-fit: contain;
  border-radius: 12px;
}

.image-modal-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.image-modal-meta {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.image-modal-thumbs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.image-modal-thumbs .thumb-img {
  width: 46px;
  height: 46px;
  border-radius: 6px;
}

.modal-thumb {
  position: relative;
}

.thumb-check {
  position: absolute;
  left: -6px;
  top: -6px;
  width: 18px;
  height: 18px;
  accent-color: #ff7a59;
}

.modal-thumb.active .thumb-img {
  border: 2px solid rgba(255, 122, 89, 0.9);
}

.image-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.image-modal-caption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}


.grid.empty {
  grid-template-columns: 1fr;
}

.grid.empty .dropzone {
  min-height: 100%;
}

.grid.has-file .dropzone {
  min-height: 160px;
  width: 100%;
  align-self: start;
  flex: none;
}


.table-scroll {
  overflow: auto;
  max-width: 100%;
  width: 100%;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) rgba(255, 255, 255, 0.08);
}

.table-scroll::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0);
  background-clip: padding-box;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.42);
}

.product-table {
  width: max-content;
  min-width: 1400px;
}

.product-table th,
.product-table td {
  vertical-align: center;
}


.select-field {
  position: relative;
  display: grid;
  gap: 6px;
}

.select-field select {
  appearance: none;
  background: rgba(14, 18, 24, 0.95);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 40px 10px 14px;
  border-radius: 12px;
  font-size: 14px;
}

.select-field select option {
  background: #0e1218;
  color: var(--text);
}

.select-field select:focus {
  outline: 2px solid rgba(255, 122, 89, 0.6);
  outline-offset: 2px;
}

.select-field::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 42px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  pointer-events: none;
}

@media (max-width: 600px) {
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    & a {
      flex-direction: row;
      & .inline-svg {
        display: none;
      }
    }
  }
}