:root {
  --ink: #18211f;
  --muted: #61706c;
  --line: #d9dfdc;
  --paper: #f7f3e9;
  --panel: #fffdf8;
  --green: #236a4b;
  --green-strong: #154632;
  --amber: #d59028;
  --red: #b83a32;
  --blue: #2b5d7f;
  --shadow: 0 18px 50px rgba(24, 33, 31, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(35, 106, 75, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(35, 106, 75, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background: #17211e;
  color: #fff8e8;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--amber);
  color: #20150a;
  font-size: 28px;
  font-weight: 800;
}

.brand h1,
.brand p,
.panel h2,
.panel h3,
.eyebrow {
  margin: 0;
}

.brand h1 {
  font-size: 26px;
  line-height: 1;
}

.brand p {
  margin-top: 4px;
  color: #d7cdb7;
}

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

.nav-button,
.ghost-button,
.danger-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff8e8;
  text-align: left;
  transition: 0.15s ease;
}

.nav-button:hover,
.nav-button.is-active {
  background: #fff8e8;
  color: #17211e;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.ghost-button,
.danger-button {
  text-align: center;
}

.danger-button {
  background: rgba(184, 58, 50, 0.14);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.clock {
  margin-top: 5px;
  font-size: 34px;
  font-weight: 800;
}

.topbar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}

.topbar-stats div,
.panel,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.topbar-stats div {
  padding: 14px 16px;
}

.topbar-stats span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.topbar-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.cashier-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.8fr);
  gap: 18px;
}

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

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

.panel-head.compact {
  margin-top: 16px;
  margin-bottom: 10px;
}

.panel h2 {
  margin-top: 4px;
  font-size: 28px;
}

.panel h3 {
  font-size: 18px;
}

.search-input,
.register-fields input,
.stock-add {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
}

.search-input {
  max-width: 280px;
}

.group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.group-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  background: #fff;
  color: var(--ink);
}

.group-tabs button.is-active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: calc(100vh - 238px);
  overflow: auto;
  padding-right: 4px;
}

.product-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
  text-align: left;
}

.product-card:hover,
.product-card.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 106, 75, 0.14);
}

.product-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 16px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.stock-pill {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 10px 12px;
  background: #e5f0e9;
  color: var(--green-strong);
  font-weight: 800;
}

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

.register-fields label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.register-fields input {
  margin-top: 6px;
  color: var(--ink);
  font-size: 18px;
}

.qty-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.qty-pad button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.sell-button {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.sell-button:disabled {
  cursor: not-allowed;
  background: #a6b5af;
}

.status-line {
  min-height: 22px;
  color: var(--green-strong);
  font-weight: 800;
}

.recent-sale,
.low-stock-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.recent-sale span,
.low-stock-item span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #17211e;
  color: #fff8e8;
  font-size: 13px;
}

td.number,
th.number {
  text-align: right;
}

.stock-add-wrap {
  display: flex;
  gap: 8px;
}

.stock-add {
  max-width: 90px;
  padding: 9px;
}

.small-button,
.delete-button {
  border: 0;
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.delete-button {
  background: var(--red);
}

.month-wrap {
  max-height: calc(100vh - 176px);
}

.month-table {
  min-width: 1540px;
}

.month-table th:first-child,
.month-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}

.month-table th:first-child {
  z-index: 3;
  background: #17211e;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 18px;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
}

.summary-card span {
  color: var(--muted);
}

.empty {
  padding: 18px;
  color: var(--muted);
}

.warning {
  color: var(--red);
  font-weight: 800;
}

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

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

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

  .topbar,
  .cashier-grid,
  .panel-head {
    display: grid;
  }

  .topbar-stats,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .cashier-grid {
    grid-template-columns: 1fr;
  }

  .product-grid {
    max-height: none;
  }
}

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

  .clock {
    font-size: 25px;
  }

  .register-fields,
  .qty-pad,
  .nav,
  .sidebar-footer {
    grid-template-columns: 1fr;
  }
}
