:root {
  color-scheme: dark;
  --bg: #0e1113;
  --panel: #171c1f;
  --panel-2: #1d2427;
  --field: #101416;
  --ink: #f6f1e8;
  --muted: #9aa39f;
  --soft: #c8cec8;
  --line: #2c3536;
  --line-strong: #3d4949;
  --gold: #d5ad5b;
  --green: #39a982;
  --red: #de5d4e;
  --yellow: #e2b853;
  --blue: #5fa9c9;
  --shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(213, 173, 91, .06), transparent 260px),
    var(--bg);
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
}

body.login-body {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
}

a { color: inherit; text-decoration: none; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 26px 18px;
  background: #111719;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #d5ad5b;
  color: #12110d;
  font-size: 14px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--soft);
  font-weight: 800;
}

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

nav a.active {
  background: rgba(213, 173, 91, .14);
  border-color: rgba(213, 173, 91, .42);
  color: #ffe0a0;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sidebar-foot small {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}

.logout-form button {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.logout-form button:hover {
  border-color: rgba(222, 93, 78, .5);
  color: #ffc4bc;
}

.main {
  min-width: 0;
  padding: 34px;
}

.content-shell {
  width: min(100%, 1280px);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow,
.section-kicker,
.card-kicker {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1,
h2 {
  margin-bottom: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

h1 { font-size: 34px; }
h2 { font-size: 18px; }

.page-copy {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 660px;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  border-color: var(--gold);
}

.button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #17120b;
}

.button.danger {
  background: rgba(222, 93, 78, .12);
  border-color: rgba(222, 93, 78, .5);
  color: #ffc4bc;
}

.link {
  color: #f0c873;
  font-weight: 900;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card,
.surface,
.settings-card,
.login-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 118px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

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

.metric-card strong {
  font-size: 32px;
  line-height: 1;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
}

.surface,
.settings-card {
  padding: 18px;
}

.surface.compact {
  min-height: 210px;
}

.section-head,
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  max-width: 390px;
  line-height: 1.4;
}

tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pill.ok,
.pill.approved {
  background: rgba(57, 169, 130, .14);
  border-color: rgba(57, 169, 130, .48);
  color: #9be0c6;
}

.pill.paid {
  background: rgba(95, 169, 201, .14);
  border-color: rgba(95, 169, 201, .48);
  color: #b9dff0;
}

.pill.warn,
.pill.pending {
  background: rgba(226, 184, 83, .14);
  border-color: rgba(226, 184, 83, .48);
  color: #f1d38b;
}

.pill.danger {
  background: rgba(222, 93, 78, .14);
  border-color: rgba(222, 93, 78, .48);
  color: #ffc4bc;
}

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

.order-list {
  display: grid;
  gap: 8px;
}

.order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}

.order-row:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .045);
}

.order-row strong,
.order-row small {
  display: block;
}

.order-row small {
  margin-top: 4px;
  color: var(--muted);
}

.order-row em {
  font-style: normal;
}

.empty,
.empty-cell {
  color: var(--muted);
}

.empty {
  margin: 0;
  padding: 14px 0 2px;
}

.empty-cell {
  padding: 18px 12px;
}

.form,
.settings-layout {
  display: grid;
  gap: 16px;
}

.form {
  max-width: 920px;
}

.form-row {
  display: grid;
  gap: 14px;
}

.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 900;
}

label small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.4;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 10px 11px;
  font: inherit;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

select {
  cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(213, 173, 91, .12);
}

input[readonly] {
  color: var(--muted);
  background: #0d1112;
  cursor: not-allowed;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.actions,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-form {
  margin-top: 16px;
}

.status-form select {
  min-width: 190px;
  width: auto;
}

.danger-zone {
  margin-top: 16px;
}

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

.data-list,
.data-grid {
  display: grid;
  gap: 11px;
  margin: 14px 0 0;
}

.data-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.crypto-detail {
  margin-bottom: 18px;
}

.delivery-box {
  display: grid;
  gap: 8px;
}

.delivery-box p {
  margin-bottom: 10px;
}

.preline {
  white-space: pre-line;
  color: var(--soft);
  line-height: 1.55;
}

code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101416;
  color: #ffe0a0;
  padding: 2px 6px;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
}

.settings-layout {
  max-width: 1120px;
}

.settings-card {
  display: grid;
  gap: 16px;
}

.note-card {
  border-color: rgba(213, 173, 91, .28);
}

.copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.copy-grid > div {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}

.copy-grid small {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.login-shell {
  width: min(100%, 420px);
}

.login-box {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.login-brand {
  margin-bottom: 4px;
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

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

  nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-foot {
    margin-top: 0;
  }

  .main {
    padding: 24px;
  }

  .metrics,
  .grid.two,
  .detail-grid,
  .data-grid,
  .copy-grid,
  .form-row.two,
  .form-row.three,
  .form-row.four {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.login-body {
    padding: 14px;
  }

  .sidebar {
    padding: 18px 14px;
  }

  nav {
    grid-template-columns: 1fr 1fr;
  }

  .main {
    padding: 18px 14px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 28px;
  }

  .order-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .surface,
  .settings-card,
  .login-box {
    padding: 15px;
  }
}
