:root {
  --ink: #17212b;
  --muted: #657282;
  --line: #d9e0e7;
  --panel: #ffffff;
  --paper: #f6f8fb;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #b42318;
  --gold: #b7791f;
  --blue: #2563eb;
  --ok: #15803d;
  --warn: #c2410c;
  --danger: #b91c1c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.sidebar {
  background: #101820;
  color: #f8fafc;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e, #f7b32b);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
}

.brand strong {
  display: block;
  font-size: 20px;
}

.brand span {
  color: #afbac7;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  background: transparent;
  color: #dbe4ee;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button:hover,
.nav button.active {
  background: #1f2d3a;
  color: #fff;
}

.nav-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.user-chip {
  margin-top: auto;
  padding: 14px;
  background: #1f2d3a;
  border-radius: 8px;
  color: #dbe4ee;
}

.user-chip strong {
  display: block;
  color: #fff;
  margin-bottom: 4px;
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 72px;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.content {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
}

.auth-hero {
  color: #fff;
  padding: 42px;
  background:
    linear-gradient(90deg, rgba(16, 24, 32, .86), rgba(16, 24, 32, .42)),
    url("https://images.unsplash.com/photo-1483729558449-99ef09a8c325?auto=format&fit=crop&w=1600&q=80") center/cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-hero h1 {
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1;
  margin: 0 0 18px;
  letter-spacing: 0;
}

.auth-hero p {
  max-width: 620px;
  font-size: 20px;
  line-height: 1.5;
  color: #eef4f7;
}

.auth-panel {
  background: #fff;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #eef2f6;
  padding: 4px;
  border-radius: 8px;
}

.auth-tabs button {
  border-radius: 6px;
  padding: 10px;
  background: transparent;
  color: var(--muted);
}

.auth-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: #405064;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

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

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

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

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.panel h2,
.panel h3 {
  margin: 0 0 14px;
  letter-spacing: 0;
}

.metric {
  display: grid;
  gap: 8px;
}

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

.metric strong {
  font-size: 28px;
}

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

.btn {
  min-height: 40px;
  border-radius: 8px;
  padding: 10px 14px;
  background: #e8edf3;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  text-decoration: none;
}

.btn.primary {
  background: var(--brand);
  color: #fff;
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.danger {
  background: #fee2e2;
  color: var(--danger);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .04em;
  background: #f8fafc;
}

td input,
td select {
  width: 100%;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 750;
  background: #e5e7eb;
  color: #374151;
  white-space: nowrap;
}

.status.ready_for_pickup,
.status.paid {
  background: #dbeafe;
  color: #1d4ed8;
}

.status.withdrawn,
.status.approved,
.status.paid-refund {
  background: #dcfce7;
  color: #166534;
}

.status.suspended,
.status.cancelled,
.status.rejected {
  background: #fee2e2;
  color: #991b1b;
}

.status.requested,
.status.pending_payment {
  background: #fef3c7;
  color: #92400e;
}

.notice {
  border-left: 4px solid var(--brand);
  background: #ecfdf5;
  color: #064e3b;
  padding: 12px 14px;
  border-radius: 8px;
}

.error {
  border-left-color: var(--danger);
  background: #fef2f2;
  color: #991b1b;
}

.empty {
  color: var(--muted);
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 36px;
  align-items: center;
  gap: 10px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--brand);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 30;
}

.modal {
  width: min(620px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .3);
}

.mobile-menu {
  display: none;
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .sidebar.open {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    z-index: 40;
    display: flex;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 360px;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .topbar,
  .content {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media print {
  .sidebar,
  .topbar,
  .actions,
  .no-print {
    display: none !important;
  }

  .shell {
    display: block;
  }

  .content {
    padding: 0;
  }
}
