:root {
  color-scheme: light;
  --green: #123b2c;
  --cream: #faf7f0;
  --line: #e5dfd4;
  --ink: #18271f;
  --muted: #59635b;
  font:
    15px/1.5 system-ui,
    "Noto Sans Myanmar",
    "PingFang SC",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) minmax(315px, 32%);
  min-height: 100vh;
}
.sidebar {
  background: var(--green);
  color: white;
  padding: 18px 12px;
}
.brand {
  font:
    46px Georgia,
    serif;
  padding: 4px 13px 20px;
  border-bottom: 1px solid #ffffff38;
  margin-bottom: 25px;
}
.brand small {
  display: block;
  font: 11px system-ui;
  letter-spacing: 0.17em;
}
.sidebar button {
  display: flex;
  width: 100%;
  text-align: left;
  align-items: center;
  gap: 10px;
  background: none;
  color: inherit;
  border: 0;
  margin: 4px 0;
  padding: 11px;
}
.sidebar button.active,
#mobile button.active {
  background: #f7edda;
  color: var(--green);
  font-weight: 700;
}
.nav-icon {
  font-size: 19px;
  width: 24px;
  text-align: center;
}
main {
  padding: 20px;
  min-width: 0;
}
header,
.title-row,
.controls,
.entry,
.bubble-head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
header {
  margin-bottom: 17px;
  flex-wrap: wrap;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(28px, 3.2vw, 48px);
  letter-spacing: -0.04em;
  color: var(--green);
}
h2 {
  font-size: 21px;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 16px;
}
button,
input,
select {
  font: inherit;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffaf3;
  padding: 7px 10px;
  min-width: 0;
}
button {
  cursor: pointer;
}
button:hover {
  border-color: #6a8974;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #42885d;
  outline-offset: 2px;
}
.primary,
.filters .active {
  background: var(--green);
  color: white;
}
.link {
  border: 0;
  background: none;
  color: var(--green);
  font-weight: 650;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdfa78;
  padding: 15px;
  min-width: 0;
}
.stack {
  display: grid;
  gap: 12px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.metric {
  display: grid;
  gap: 5px;
  align-content: start;
  padding: 11px;
  overflow-wrap: anywhere;
}
.metric strong {
  font-size: clamp(14px, 1.32vw, 22px);
  line-height: 1.25;
}
.metric small {
  color: var(--muted);
}
.symbol {
  background: #e9eddb;
  color: var(--green);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 17px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  vertical-align: middle;
}
th {
  font-size: 12px;
  color: var(--muted);
}
tr:last-child td {
  border-bottom: 0;
}
td img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  vertical-align: middle;
  border-radius: 5px;
  margin-right: 6px;
}
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 7px;
  background: #e6eddf;
  color: #194331;
  font-size: 0.82rem;
}
.badge.warn {
  background: #f8e8c7;
  color: #794512;
}
.badge.out {
  background: #f8e4dd;
  color: #8b3324;
}
.muted {
  color: var(--muted);
  font-size: 0.88rem;
}
.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.products img {
  width: 100%;
  aspect-ratio: 1.4;
  object-fit: cover;
  border-radius: 9px;
  background: #ede7d8;
}
.stock {
  color: #923820;
  font-size: 0.85rem;
}
.chat {
  margin: 20px 12px 20px 0;
  display: grid;
  align-content: start;
  gap: 12px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.filters button {
  font-size: 12px;
  padding: 6px 7px;
}
.thread {
  width: 100%;
  text-align: left;
  padding: 9px;
  display: block;
}
.thread.active {
  background: #e8eddf;
  border-color: #8b9f86;
}
.dot {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 8px;
  color: white;
  margin-right: 5px;
  font-size: 12px;
}
.transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
  max-height: 430px;
  overflow: auto;
}
.bubble {
  max-width: 91%;
  align-self: flex-start;
}
.bubble.ai {
  align-self: flex-end;
}
.bubble p {
  padding: 9px 12px;
  border-radius: 10px;
  background: #f1eadf;
  overflow-wrap: anywhere;
}
.bubble.ai p {
  background: #e4edde;
}
.bubble small {
  color: var(--muted);
}
.activity td:first-child,
.amount {
  white-space: nowrap;
}
#mobile {
  display: none;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--cream);
  color: var(--ink);
  width: min(560px, 96vw);
  padding: 20px;
}
dialog::backdrop {
  background: #142e2580;
}
form label {
  display: grid;
  gap: 4px;
}
form input,
form select {
  width: 100%;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.list-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.list-item img {
  width: 80px;
  height: 65px;
  object-fit: cover;
  border-radius: 7px;
}
@media (max-width: 1200px) {
  body {
    grid-template-columns: 174px minmax(0, 1fr) minmax(260px, 32%);
  }
  main {
    padding: 14px;
  }
  .chat {
    margin-top: 14px;
  }
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  body {
    display: block;
    padding-bottom: 68px;
  }
  .sidebar {
    padding: 0;
  }
  .brand {
    margin: 0;
    padding: 10px 16px;
    font-size: 32px;
    border: 0;
  }
  .sidebar nav {
    display: none;
  }
  main {
    padding: 14px;
  }
  h1 {
    font-size: 32px;
  }
  .chat {
    display: none;
    margin: 0 14px 14px;
  }
  body[data-page="inbox"] #chat {
    display: grid;
  }
  body[data-page="inbox"] #content {
    display: none;
  }
  #mobile {
    display: flex;
    position: fixed;
    z-index: 2;
    inset: auto 0 0;
    justify-content: space-around;
    background: var(--green);
    padding: 6px 4px max(6px, env(safe-area-inset-bottom));
    color: white;
  }
  #mobile button {
    flex: 1;
    background: none;
    color: inherit;
    border: 0;
    font-size: 12px;
    padding: 4px;
  }
  #mobile .nav-icon {
    display: block;
    margin: auto;
  }
  .metrics,
  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric strong {
    font-size: 17px;
  }
}
@media (max-width: 420px) {
  .controls {
    width: 100%;
  }
  th,
  td {
    padding: 7px 5px;
  }
}
@media print {
  body > * {
    display: none !important;
  }
  body > #receipt:not([hidden]) {
    display: block !important;
    color: black;
    padding: 1cm;
  }
  body {
    display: block;
    background: white;
  }
  dialog::backdrop {
    display: none;
  }
}
