:root {
  color-scheme: light;
  --bg: #f5f1ec;
  --ink: #231f20;
  --muted: #766f68;
  --panel: #fffdf9;
  --line: #e3d9cf;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --rose: #b45363;
  --gold: #b7791f;
  --shadow: 0 18px 50px rgba(35, 31, 32, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  display: grid;
  grid-template-columns: 260px 1fr;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #1f2933;
  color: white;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f7c948;
  color: #1f2933;
  font-weight: 800;
}

.brand small,
.eyebrow,
.metric span,
.pill {
  color: var(--muted);
}

.brand small {
  display: block;
  color: #cbd5df;
}

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

.nav-btn {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  background: transparent;
  color: #d9e2ec;
  text-align: left;
}

.nav-btn.active,
.nav-btn:hover {
  background: #324556;
  color: white;
}

.shell {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

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

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
}

.primary,
.ghost,
.danger,
.mini {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 700;
}

.primary {
  background: var(--accent);
  color: white;
}

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

.ghost {
  background: #edf7f6;
  color: var(--accent-dark);
}

.danger {
  background: #fff1f2;
  color: #be123c;
}

.mini {
  min-height: 32px;
  padding: 6px 10px;
  background: #f1f5f9;
  color: #334155;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

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

.metric {
  padding: 18px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.metric.warning strong {
  color: var(--rose);
}

.dashboard-grid,
.report-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.workspace {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel h2,
.form h2 {
  margin: 0 0 16px;
  font-size: 19px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
}

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

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

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.list,
.cards {
  display: grid;
  gap: 10px;
}

.card,
.list-item {
  padding: 14px;
}

.staff-card {
  display: grid;
  gap: 14px;
}

.staff-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.staff-stats span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #faf7f2;
}

.staff-stats strong,
.staff-stats small {
  display: block;
}

.staff-stats small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.staff-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}

.staff-detail-grid p {
  margin: 0;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.item-title {
  margin: 0 0 4px;
  font-weight: 800;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #f4eee7;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #eef2ff;
  color: #4338ca;
}

.status.completed {
  background: #ecfdf5;
  color: #047857;
}

.status.cancelled,
.status.low {
  background: #fff1f2;
  color: #be123c;
}

.status.ok {
  background: #ecfdf5;
  color: #047857;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

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

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.receipt-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(31, 41, 51, .55);
}

.receipt-modal.open {
  display: grid;
}

.receipt-dialog {
  width: min(460px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

.receipt-paper {
  width: 80mm;
  max-width: 100%;
  margin: 0 auto 16px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  color: #111;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
}

.receipt-paper p {
  margin: 4px 0;
}

.receipt-center {
  display: grid;
  gap: 2px;
  text-align: center;
}

.receipt-line {
  margin: 8px 0;
  border-top: 1px dashed #111;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.receipt-row.total {
  font-size: 14px;
  font-weight: 800;
}

.receipt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.report-bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ded2;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.empty {
  color: var(--muted);
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

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

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

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .metrics,
  .dashboard-grid,
  .report-grid,
  .workspace,
  .staff-stats,
  .staff-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .topbar-actions,
  .two {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 26px;
  }
}

@media print {
  @page {
    size: 80mm auto;
    margin: 3mm;
  }

  body {
    display: block;
    background: white;
  }

  body > :not(.receipt-modal),
  .no-print {
    display: none !important;
  }

  .receipt-modal,
  .receipt-modal.open {
    position: static;
    display: block;
    padding: 0;
    background: white;
  }

  .receipt-dialog {
    width: 80mm;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .receipt-paper {
    width: 80mm;
    border: 0;
    margin: 0;
    padding: 0;
    font-size: 11px;
  }
}
