:root {
  color-scheme: dark;
  --bg: #101216;
  --panel: #191d24;
  --line: #2b313c;
  --text: #eef0f5;
  --muted: #9aa4b5;
  --accent: #b7f76b;
  --bad: #ff9a9a;
  font:
    14px/1.5 Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a.download {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #222731;
  color: var(--text);
  padding: 9px 14px;
  text-decoration: none;
  transition: background 0.15s;
}
button:hover,
a.download:hover {
  background: #323a46;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: var(--accent);
  color: #15200e;
  border-color: var(--accent);
  font-weight: 700;
}
button.danger {
  color: var(--bad);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.shell {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  min-height: 100vh;
}
aside {
  padding: 27px 18px;
  border-right: 1px solid var(--line);
  background: #14171d;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
}
.brand > span {
  font-size: 18px;
  color: var(--text);
  letter-spacing: 2px;
}
.brand small {
  display: block;
  color: var(--muted);
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 400;
  margin-top: 3px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 32px;
  overflow-y: auto;
}
nav button {
  border: 0;
  background: none;
  text-align: left;
  color: var(--muted);
  padding: 10px 12px;
  font-weight: 500;
}
nav button.active {
  color: var(--accent);
  background: #b7f76b12;
}
nav button span {
  display: inline-block;
  width: 25px;
}
.aside-footer {
  margin-top: auto;
  padding-top: 20px;
  font-size: 11px;
  color: var(--muted);
}
.aside-footer button {
  display: block;
  width: 100%;
  margin-top: 12px;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 7px;
}
main {
  padding: 35px clamp(20px, 3vw, 48px);
  max-width: 1600px;
  width: 100%;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 28px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  margin-bottom: 0;
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 15px;
}
.eyebrow {
  color: var(--muted);
  letter-spacing: 2px;
  font-size: 10px;
  margin-bottom: 8px;
}
.muted {
  color: var(--muted);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metric,
.card {
  padding: 23px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.metric .value {
  font-size: 27px;
  font-weight: 650;
  margin-top: 9px;
  letter-spacing: -0.5px;
}
.metric small {
  color: var(--muted);
  display: block;
  margin-top: 6px;
}
.cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.toolbar input {
  max-width: 280px;
}
.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 15px 18px;
  border-bottom: 1px solid #ffffff07;
  max-width: 370px;
  overflow: hidden;
  text-overflow: ellipsis;
}
tr:last-child td {
  border-bottom: 0;
}
td .sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
td.actions {
  overflow: visible;
  text-overflow: clip;
}
td button {
  padding: 6px 10px;
  font-size: 12px;
  margin-right: 5px;
}
.badge {
  padding: 4px 9px;
  border: 1px solid #b7f76b30;
  border-radius: 20px;
  color: var(--accent);
  font-size: 11px;
  display: inline-block;
}
.badge.warn {
  color: #f3c884;
  border-color: #f3c88430;
}
.badge.bad {
  color: var(--bad);
  border-color: #ff9a9a30;
}
.empty {
  padding: 38px;
  text-align: center;
  color: var(--muted);
}
.pager {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 18px;
  color: var(--muted);
}
label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 17px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10141a;
  color: var(--text);
}
textarea {
  min-height: 110px;
  resize: vertical;
}
input[type="checkbox"] {
  width: auto;
  display: inline-block;
  margin-right: 8px;
}
input[type="file"] {
  padding: 9px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 15px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  gap: 10px;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse at top, #b7f76b08, transparent 60%);
}
.login-card {
  width: min(440px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.login-card .brand {
  margin-bottom: 26px;
}
.login-card h1 {
  font-size: 25px;
  margin-bottom: 10px;
}
.login-card .primary {
  width: 100%;
  margin-top: 6px;
}
.error {
  color: var(--bad);
  font-size: 12px;
}
#notice {
  border: 1px solid #b7f76b40;
  background: #b7f76b0c;
  color: var(--accent);
  padding: 12px 15px;
  border-radius: 9px;
  margin-bottom: 20px;
}
#notice.error {
  border-color: #ff9a9a40;
  background: #ff9a9a0c;
  color: var(--bad);
}
dialog {
  width: min(740px, calc(100% - 32px));
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 26px;
}
dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(4px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 22px;
}
.modal-head h2 {
  margin: 0;
}
.modal-head button {
  padding: 5px 10px;
}
.thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  max-height: 330px;
  overflow-y: auto;
}
.message {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message small {
  color: var(--muted);
  display: block;
  margin-bottom: 5px;
}
.message.admin {
  border-color: #b7f76b30;
}
.stock-value {
  font-family: ui-monospace, monospace;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.help {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}
code {
  font-family: ui-monospace, monospace;
  color: var(--accent);
}
@media (max-width: 1000px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cols {
    grid-template-columns: 1fr;
  }
  .shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  aside {
    height: auto;
    position: static;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  nav {
    flex-direction: row;
    margin-top: 16px;
    overflow-x: auto;
    gap: 5px;
  }
  nav button {
    white-space: nowrap;
  }
  nav button span {
    width: auto;
    margin-right: 6px;
  }
  .aside-footer {
    display: none;
  }
  main {
    padding: 22px 15px;
  }
  .metric {
    padding: 16px;
  }
  .metric .value {
    font-size: 22px;
  }
  h1 {
    font-size: 23px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  td,
  th {
    padding: 12px;
  }
  .login-card {
    padding: 26px;
  }
}
/* Extended shop administration */
body {
  background:
    radial-gradient(ellipse at 90% 0, #b7f76b05, transparent 50%), var(--bg);
}
main {
  padding-top: 30px;
}
header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.aside-footer small {
  display: block;
  margin: 8px 0 0 12px;
  color: var(--muted);
}
#menu-toggle {
  display: none;
}
.section-gap {
  margin-top: 24px;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-heading h2 {
  margin: 0;
}
.filters {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  gap: 10px;
}
.filters input,
.filters select {
  margin: 0;
  min-width: 130px;
}
.filters > input {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
}
.filters select {
  width: auto;
  max-width: 220px;
}
.filters label {
  margin: 0;
  font-size: 10px;
  min-width: 140px;
}
.filters label input {
  margin-top: 4px;
  width: 145px;
}
.filters button,
.filters a {
  align-self: flex-end;
}
.metrics .metric {
  position: relative;
  overflow: hidden;
}
.metrics .metric:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.6;
}
.metric .value {
  font-variant-numeric: tabular-nums;
}
.sales-chart {
  width: 100%;
  height: auto;
  display: block;
  min-height: 190px;
}
.sales-chart text {
  fill: var(--muted);
  font: 12px system-ui;
}
.chart-grid {
  stroke: var(--line);
  stroke-dasharray: 4 5;
}
.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.chart-area {
  fill: #b7f76b12;
}
.sales-chart circle {
  fill: var(--accent);
  stroke: var(--panel);
  stroke-width: 2;
}
.attention-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 370px;
  overflow-y: auto;
}
.attention-list > button {
  text-align: left;
}
.attention-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.attention-row span {
  overflow-wrap: anywhere;
  font-size: 12px;
}
.attention-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
.attention-row button {
  flex-shrink: 0;
  padding: 6px 9px;
  font-size: 11px;
}
.user-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.user-summary h3 {
  margin-bottom: 5px;
}
.user-summary p {
  margin-bottom: 0;
}
.avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #b7f76b15;
  border: 1px solid #b7f76b40;
  border-radius: 14px;
  color: var(--accent);
  font-size: 23px;
  font-weight: 700;
}
.metrics.compact {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
}
.compact .metric {
  padding: 16px;
}
.compact .value {
  font-size: 21px;
}
.loading-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--panel);
  animation: loading-pulse 1s ease-in-out infinite alternate;
}
.message .help {
  margin-bottom: 0;
  margin-top: 10px;
}
dialog h3.section-gap {
  margin-bottom: 12px;
}
dialog .table-wrap {
  max-height: 310px;
  overflow: auto;
}
table th {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}
.toolbar button {
  white-space: nowrap;
}
@keyframes loading-pulse {
  to {
    opacity: 0.55;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 700px) {
  #menu-toggle {
    display: block;
    padding: 8px 12px;
  }
  header {
    align-items: center;
  }
  header > div {
    flex: 1;
  }
  .shell aside {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    height: 100dvh;
    z-index: 10;
    background: #14171df8;
    box-shadow: 30px 0 80px #0009;
  }
  .shell.sidebar-open aside {
    display: flex;
  }
  .shell.sidebar-open main {
    margin-left: 0;
  }
  nav {
    flex-direction: column;
    overflow-y: auto;
    white-space: normal;
    gap: 4px;
  }
  nav button {
    padding: 12px;
    text-align: left;
  }
  .aside-footer {
    display: block;
  }
  .filters > input,
  .filters select {
    max-width: none;
    width: 100%;
    flex: 1 1 100%;
  }
  .filters label {
    flex: 1;
    min-width: 110px;
  }
  .filters label input {
    width: 100%;
    min-width: 0;
  }
  .filters button,
  .filters a {
    flex: 1;
    text-align: center;
    padding: 10px;
  }
  .metrics {
    gap: 10px;
  }
  .metric .value {
    font-size: 21px;
  }
  .sales-chart {
    min-height: 140px;
  }
  header h1 {
    font-size: 20px;
  }
  header .eyebrow {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .attention-list {
    max-height: 280px;
  }
  .cols {
    gap: 14px;
  }
  .section-gap {
    margin-top: 16px;
  }
  .card {
    padding: 18px;
  }
  .user-summary .badge {
    width: 100%;
    text-align: center;
  }
}
.cols > * {
  min-width: 0;
}
.table-wrap {
  max-width: 100%;
  min-width: 0;
}
.error-card {
  border-color: #ff9a9a40;
}
.error-card p {
  color: var(--muted);
}
