:root {
  --bg: #031207;
  --bg-2: #061b0c;
  --sidebar: #071507;
  --panel: #09200d;
  --panel-2: #0d2a12;
  --panel-3: #102f16;
  --line: #1d5b28;
  --line-soft: rgba(60, 151, 70, .28);
  --text: #eaf4df;
  --muted: #83a982;
  --gold: #ffe100;
  --gold-soft: rgba(255, 225, 0, .16);
  --green: #2bdd72;
  --green-2: #2c8b3b;
  --purple: #bb4ee5;
  --red: #e45139;
  --blue: #35a8ff;
  --shadow: 0 18px 70px rgba(0, 0, 0, .42);
}

* {
  box-sizing: border-box;
}

@keyframes softPulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(255, 225, 0, 0);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 225, 0, .18);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0, rgba(255, 225, 0, .12), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(187, 78, 229, .10), transparent 32%),
    linear-gradient(135deg, #020b05 0%, var(--bg) 46%, #001006 100%);
  color: var(--text);
  font-family: Georgia, Cambria, "Times New Roman", serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.boot,
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  background:
    radial-gradient(circle at top, rgba(255, 225, 0, .13), transparent 22%),
    linear-gradient(180deg, rgba(14, 55, 19, .94), rgba(2, 15, 6, .98));
}

.login-panel {
  width: min(430px, 100%);
  background: rgba(4, 28, 8, .92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  box-shadow: var(--shadow), inset 0 0 80px rgba(40, 140, 45, .10);
}

.login-logo {
  display: block;
  width: 168px;
  height: 168px;
  object-fit: contain;
  margin: -12px auto 8px;
  filter: drop-shadow(0 0 22px rgba(255, 225, 0, .16));
}

.eyebrow,
.login-quote {
  text-align: center;
}

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0;
  margin: 0 0 8px;
  font-weight: 800;
}

.login-quote {
  color: var(--muted);
  font-style: italic;
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  color: #bde4b3;
  font-size: 34px;
  line-height: 1.1;
  text-transform: uppercase;
}

h2 {
  color: #c7e7bd;
  font-size: 18px;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 14px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: #021006;
  color: var(--text);
  padding: 11px 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(43, 221, 114, .12);
}

.primary,
.danger {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
  padding: 10px 16px;
}

.primary {
  background: linear-gradient(180deg, #2f9b3e, #237b30);
  border: 1px solid #47c85b;
  color: white;
}

.danger {
  background: rgba(228, 81, 57, .16);
  border: 1px solid rgba(228, 81, 57, .48);
  color: #ff8b7c;
}

.error,
.notice {
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  background: rgba(228, 81, 57, .16);
  border: 1px solid rgba(228, 81, 57, .45);
  color: #ffd2cb;
}

.notice {
  position: sticky;
  top: 16px;
  z-index: 2;
  background: rgba(24, 104, 38, .92);
  border-color: var(--green);
  color: white;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 225, 0, .12), transparent 36%),
    linear-gradient(180deg, #0b1b08, var(--sidebar));
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 12px 0 34px rgba(0, 0, 0, .28);
}

.brand {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 12px 4px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-logo {
  width: 142px;
  height: 118px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 18px rgba(255, 225, 0, .16));
}

.brand span {
  color: var(--gold);
  text-transform: uppercase;
  font-size: 17px;
  font-weight: 900;
}

.brand strong {
  color: var(--gold);
  font-size: 22px;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand small {
  color: var(--muted);
  font-style: italic;
  text-transform: uppercase;
}

nav {
  display: grid;
  gap: 8px;
}

nav button,
.category-row button,
.chips button {
  min-height: 40px;
  border-radius: 7px;
  background: transparent;
  color: #94bd91;
  border: 1px solid transparent;
  padding: 9px 12px;
  text-align: left;
  font-weight: 800;
}

nav button.active,
.category-row button.active,
.chips button.selected {
  background: rgba(255, 225, 0, .10);
  border-color: rgba(255, 225, 0, .40);
  color: var(--gold);
  box-shadow: inset 4px 0 0 var(--gold);
}

.category-row button.active,
.chips button.selected {
  box-shadow: inset 0 -3px 0 var(--purple);
}

.user-box {
  margin-top: auto;
  display: grid;
  gap: 6px;
  color: var(--muted);
  background: rgba(255, 225, 0, .06);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
}

.user-box span {
  color: var(--text);
  font-weight: 900;
}

.user-box small {
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 900;
}

.user-box button {
  margin-top: 8px;
  border-radius: 7px;
  border: 1px solid rgba(228, 81, 57, .42);
  background: rgba(228, 81, 57, .10);
  color: #ff7f70;
  min-height: 38px;
}

.content {
  padding: 18px 56px 24px 38px;
}

.page {
  max-width: 100%;
}

.page-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.metric {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 225, 0, .10), rgba(13, 48, 18, .92));
  padding: 24px;
  display: grid;
  gap: 10px;
}

.metric span,
.muted {
  color: var(--muted);
}

.metric strong {
  font-size: 44px;
  color: var(--gold);
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.dashboard-head span {
  color: var(--muted);
  text-transform: capitalize;
}

.welcome-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 225, 0, .10), rgba(13, 48, 18, .88));
  padding: 28px 32px;
  margin-bottom: 24px;
}

.welcome-panel h2 {
  margin-bottom: 6px;
  font-size: 28px;
}

.welcome-panel p {
  color: var(--muted);
  margin-bottom: 0;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  min-height: 102px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: rgba(8, 35, 12, .92);
  padding: 22px;
  display: grid;
  gap: 8px;
  box-shadow: inset -42px 0 70px rgba(0, 0, 0, .12);
}

.stat-card span {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 900;
  font-size: 13px;
}

.stat-card strong {
  font-size: 30px;
  line-height: 1;
}

.stat-card.gold {
  border-left-color: var(--gold);
}

.stat-card.gold strong,
.week-cards strong,
.rank-row > strong {
  color: var(--gold);
}

.stat-card.blue {
  border-left-color: var(--blue);
}

.stat-card.blue strong {
  color: var(--blue);
}

.stat-card.green {
  border-left-color: #65d66c;
}

.stat-card.green strong {
  color: #65d66c;
}

.stat-card.purple {
  border-left-color: var(--purple);
}

.stat-card.purple strong {
  color: var(--purple);
}

.stat-card.teal {
  border-left-color: #25c6b7;
}

.stat-card.teal strong {
  color: #25c6b7;
}

.stat-card.orange {
  border-left-color: #ffab2e;
}

.stat-card.orange strong {
  color: #ffab2e;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 29, 10, .90);
  padding: 20px;
}

.dashboard-panel h2 {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.week-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.week-cards div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(13, 48, 18, .72);
  padding: 18px;
  display: grid;
  gap: 8px;
}

.week-cards span,
.week-cards i,
.rank-row span,
.mini-sale small {
  color: var(--muted);
}

.week-cards span {
  text-transform: uppercase;
  font-weight: 900;
  font-size: 12px;
}

.week-cards strong {
  font-size: 34px;
}

.week-cards i {
  font-style: normal;
  font-size: 13px;
}

.rank-row {
  display: grid;
  grid-template-columns: 34px 1fr 110px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.rank-row b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #201800;
  background: var(--gold);
}

.rank-row div {
  display: grid;
  gap: 4px;
}

.rank-row em {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--gold);
}

.mini-sale,
.stock-alert {
  display: grid;
  gap: 4px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  padding: 11px 0;
}

.mini-sale {
  grid-template-columns: 140px 1fr 90px;
}

.stock-alert {
  grid-template-columns: 1fr 90px;
}

.mini-sale strong,
.stock-alert strong {
  color: var(--gold);
  text-align: right;
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.search-field {
  max-width: 520px;
  margin-bottom: 12px;
}

.search-field span {
  color: var(--muted);
}

.sales-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: stretch;
  height: calc(100vh - 92px);
  min-height: 0;
  overflow: hidden;
}

.sales-left {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.kasse .product-grid {
  overflow-y: auto;
  align-content: start;
  padding-right: 8px;
  min-height: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
}

.product-tile {
  min-height: 210px;
  border: 1px solid var(--line-soft);
  border-top: 4px solid var(--purple);
  border-radius: 8px;
  background: linear-gradient(180deg, #08150a, var(--panel));
  color: var(--text);
  padding: 0;
  text-align: left;
  display: grid;
  grid-template-rows: 105px auto auto 44px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
  position: relative;
}

.product-tile:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.product-tile img,
.placeholder {
  width: 100%;
  height: 105px;
  object-fit: cover;
  background: #031007;
}

.placeholder {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 30px;
  font-weight: 900;
}

.product-tile > strong,
.product-category,
.product-foot {
  padding-left: 12px;
  padding-right: 12px;
}

.product-tile > strong {
  align-self: end;
  font-size: 15px;
}

.product-category {
  color: var(--muted);
  font-size: 13px;
}

.product-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(42, 112, 48, .25);
}

.product-foot b {
  color: var(--gold);
  font-size: 19px;
}

.product-foot span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.order-panel,
.editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 25, 8, .96);
  padding: 18px;
  box-shadow: inset 0 0 60px rgba(30, 110, 35, .10);
}

.order-panel {
  position: static;
  height: 100%;
  min-height: 0;
  max-width: 340px;
  justify-self: end;
  align-self: stretch;
  overflow-y: auto;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr 70px 92px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
}

.cart-row input {
  min-height: 34px;
  padding: 6px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  text-transform: none;
  font-size: 14px;
}

.switch input {
  display: none;
}

.switch span {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #102317;
  border: 1px solid var(--line);
  position: relative;
}

.soldout-badge {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  background: rgba(228, 81, 57, .92);
  color: white;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, .18);
}

.product-tile:disabled {
  filter: grayscale(.45);
}

.switch span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  top: 2px;
  left: 3px;
  transition: .15s;
}

.switch input:checked + span {
  border-color: var(--green);
  background: rgba(43, 221, 114, .18);
}

.switch input:checked + span::after {
  transform: translateX(18px);
  background: var(--green);
}

.total {
  border: 1px solid rgba(255, 225, 0, .28);
  border-radius: 8px;
  padding: 13px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 225, 0, .06);
}

.total strong {
  font-size: 26px;
  color: var(--gold);
}

.stock-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.vault-editor {
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(280px, 420px);
  gap: 16px;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.editor-actions {
  display: flex;
  gap: 10px;
}

.user-form {
  display: grid;
  grid-template-columns: 1fr 1fr 180px 140px;
  gap: 12px;
  align-items: end;
}

.users-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.admin-row div {
  display: grid;
  gap: 4px;
}

.admin-row span,
.admin-row small {
  color: var(--muted);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
}

.link-button {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.order-history {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.order-history h2 {
  margin-bottom: 4px;
}

.order-history-row,
.user-row {
  display: grid;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.order-history-row {
  grid-template-columns: 1fr 140px 110px;
}

.user-row {
  grid-template-columns: 1fr 180px 110px 120px;
}

.order-history-row div {
  display: grid;
  gap: 3px;
}

.order-history-main {
  min-width: 0;
}

.order-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.order-items li {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #041408;
  padding: 4px 8px;
  font-size: 13px;
}

.order-history-row span {
  color: var(--muted);
}

.muted-money {
  color: var(--muted);
}

.table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1fr 100px 140px 120px;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.table-head {
  background: var(--panel-2);
  color: var(--muted);
}

.table-row {
  background: var(--panel);
  border-top: 1px solid var(--line-soft);
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.inventory-result {
  margin-top: 16px;
  background: #021006;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--text);
}

@media (max-width: 920px) {
  .app-shell,
  .sales-layout,
  .widget-grid,
  .dashboard-panels,
.week-cards {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .order-panel {
    position: static;
    min-height: auto;
    height: auto;
  }

  .sales-layout {
    height: auto;
    overflow: visible;
  }

  .sales-left {
    display: block;
  }

  .kasse .product-grid {
    overflow: visible;
  }

  .vault-editor,
  .user-form,
  .user-row,
  .admin-row,
  .filter-bar,
  .order-history-row,
  .rank-row,
  .mini-sale,
  .stock-alert,
  .form-grid,
  .table-head,
  .table-row {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 18px;
  }
}

.bar-chart {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
}

.bar-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 6px;
  text-align: center;
}

.bar-track {
  height: 150px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(2, 16, 6, .72);
  display: flex;
  align-items: end;
  overflow: hidden;
}

.bar-track span {
  width: 100%;
  display: block;
  background: linear-gradient(180deg, var(--gold), #2bdd72);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 0 16px rgba(255, 225, 0, .18);
}

.bar-item small {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
}

.bar-item b {
  color: var(--gold);
  font-size: 12px;
}

.collapsible-editor {
  padding: 0;
  overflow: hidden;
}

.collapsible-editor.open {
  padding-bottom: 18px;
}

.editor-summary {
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
}

.editor-summary h2 {
  margin: 0 0 4px;
}

.editor-summary span {
  color: var(--muted);
}

.collapsible-editor .form-grid,
.collapsible-editor .chips,
.collapsible-editor > .switch,
.collapsible-editor .editor-actions {
  margin-left: 18px;
  margin-right: 18px;
}

button,
.primary,
.danger,
.link-button,
.product-tile,
nav button,
.category-row button,
.chips button,
.admin-row,
.user-row,
.order-history-row,
.table-row {
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, color .18s ease, filter .18s ease, opacity .18s ease;
}

button {
  user-select: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

button:not(:disabled):active,
.primary:not(:disabled):active,
.danger:not(:disabled):active,
.link-button:active,
.product-tile:active {
  transform: translateY(1px) scale(.99);
}

.primary:not(:disabled):hover {
  background: linear-gradient(180deg, #36b749, #278936);
  box-shadow: 0 0 18px rgba(43, 221, 114, .24), 0 8px 18px rgba(0, 0, 0, .22);
  transform: translateY(-1px);
}

.danger:not(:disabled):hover {
  background: rgba(228, 81, 57, .24);
  box-shadow: 0 0 16px rgba(228, 81, 57, .18);
  transform: translateY(-1px);
}

.notice {
  animation: toastIn .18s ease-out;
}

nav button:not(.active):hover {
  color: var(--text);
  border-color: var(--line-soft);
  background: rgba(43, 221, 114, .06);
  transform: translateX(2px);
}

.category-row button:not(.active):hover,
.chips button:not(.selected):hover {
  color: var(--text);
  border-color: var(--line-soft);
  background: rgba(43, 221, 114, .06);
  transform: translateY(-1px);
}

nav button.active,
.category-row button.active,
.chips button.selected {
  animation: softPulse 2.8s ease-in-out infinite;
}

.user-box button:hover {
  background: rgba(228, 81, 57, .18);
  transform: translateY(-1px);
}

.product-tile:hover {
  border-color: var(--green);
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .34), 0 0 20px rgba(43, 221, 114, .10);
  filter: saturate(1.08);
}

.product-tile:hover img,
.product-tile:hover .placeholder {
  filter: brightness(1.08);
}

.switch:hover span {
  box-shadow: 0 0 16px rgba(43, 221, 114, .14);
}

.order-history-row:hover,
.user-row:hover,
.admin-row:hover,
.table-row:hover {
  border-color: var(--line);
  background: rgba(13, 48, 18, .96);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
