:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-muted: #ecefeb;
  --line: #d8ded5;
  --text: #1d2420;
  --muted: #66736b;
  --accent: #315a49;
  --accent-dark: #1f3e33;
  --danger: #9b2f2f;
  --shadow: 0 16px 40px rgba(31, 42, 35, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
}

h2 {
  font-size: 22px;
  font-weight: 700;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.draft-note,
.muted {
  color: var(--muted);
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 90px);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: #eef1ed;
}

.nav-tab {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.nav-tab:hover,
.nav-tab:focus-visible,
.nav-tab.is-active {
  border-color: var(--line);
  background: var(--surface);
  outline: none;
}

.nav-tab.is-active {
  color: var(--accent-dark);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.content {
  padding: 28px 32px 40px;
}

.panel {
  display: none;
  max-width: 1120px;
}

#products,
#orders,
#members {
  max-width: min(1680px, calc(100vw - 300px));
}

.panel.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric {
  min-height: 108px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.metric strong {
  display: block;
  margin-top: 14px;
  font-size: 30px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-form.compact {
  grid-template-columns: minmax(0, 1fr);
  max-width: 720px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--text);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(49, 90, 73, 0.14);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 1 / -1;
  padding-top: 4px;
}

.full-span {
  grid-column: 1 / -1;
}

.upload-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 12px;
  align-items: center;
  padding: 4px 0 8px;
}

.upload-actions span {
  color: var(--muted);
  font-size: 13px;
}

button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

button:hover,
button:focus-visible {
  border-color: var(--accent-dark);
  outline: none;
}

.danger {
  border-color: rgba(155, 47, 47, 0.35);
  color: var(--danger);
}

@media (max-width: 820px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-tab {
    flex: 0 0 auto;
    width: auto;
  }

  .content {
    padding: 22px 18px 32px;
  }

  .metric-grid,
  .admin-form {
    grid-template-columns: 1fr;
  }
}

.qle-wordmark--logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(280px, 46vw);
}

.qle-wordmark--logo img {
  display: block;
  width: 100%;
  height: auto;
}

.admin-brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.admin-brand-lockup img {
  width: 210px;
  max-width: 36vw;
  height: auto;
}

@media (max-width: 560px) {
  .qle-wordmark--logo {
    width: min(220px, 54vw);
  }

  .admin-brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .admin-brand-lockup img {
    max-width: 240px;
    width: 72vw;
  }
}


.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid #dfd6ca;
  margin-bottom: 24px;
  background: #fff;
}

.admin-table-wrap--orders {
  max-height: 460px;
  min-height: 220px;
  overflow: auto;
  resize: vertical;
}

.admin-table-wrap--products,
.admin-table-wrap--members {
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1500px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #eadfd2;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6d6358;
}

.admin-table button {
  margin-right: 8px;
}

.admin-address-cell {
  max-width: 260px;
  min-width: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-orders-table {
  min-width: 1680px;
}

.admin-items-cell {
  max-width: 260px;
}

.admin-items-cell p {
  margin: 0 0 6px;
}
