:root {
  --ink: #151515;
  --muted: #77716b;
  --line: #e2ddd8;
  --soft: #f7f3ef;
  --paper: #ffffff;
  --navy: #0f0f0f;
  --teal: #f58220;
  --green: #f58220;
  --gold: #ffb45c;
  --red: #b42318;
  --shadow: 0 18px 38px rgba(15, 15, 15, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: 13px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: #f2eee9;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  background: #0f0f0f;
  border-right: 1px solid var(--line);
  padding: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  color: #fff;
}

.brand-logo {
  display: flex;
  align-items: center;
  width: 100%;
  height: 58px;
  border-radius: 8px;
  background: #f7f3ef;
  border: 1px solid rgba(245, 130, 32, 0.45);
  overflow: hidden;
  padding: 8px 10px;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.brand p,
.eyebrow,
.minimum span,
.summary-row span,
label,
.empty {
  color: var(--muted);
}

.brand p {
  color: #f7f3ef;
  font-weight: 800;
  font-size: 11px;
  padding-left: 2px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  margin-bottom: 10px;
  background: var(--paper);
}

.sidebar .panel {
  border-color: #2a2a2a;
  background: #171717;
  color: #fff;
}

.sidebar .panel h2 {
  color: #fff;
}

.sidebar label,
.sidebar .minimum span,
.sidebar .summary-row span,
.sidebar .minimum small {
  color: #c7c0b8;
}

.sidebar input {
  border-color: #363636;
  background: #0f0f0f;
  color: #fff;
}

.sidebar select {
  border-color: #363636;
  background: #0f0f0f;
  color: #fff;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.panel h2 {
  font-size: 12px;
  margin-bottom: 9px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 9px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.18);
}

.tier-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: var(--soft);
  border-radius: 8px;
  padding: 4px;
}

.tier {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  color: #7d756e;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  font-size: 11px;
}

.tier.active {
  background: var(--teal);
  color: #111;
  box-shadow: 0 2px 12px rgba(245, 130, 32, 0.28);
}

.minimum {
  margin-top: 11px;
}

.minimum > div:first-child,
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.progress {
  height: 7px;
  background: #e4e9f1;
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 6px;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--teal);
  transition: width 0.2s ease;
}

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

.summary-row {
  margin: 7px 0;
}

.summary-row.total {
  padding-top: 10px;
  border-top: 1px solid #2a2a2a;
  font-size: 16px;
}

.whatsapp,
.ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.whatsapp {
  margin-top: 11px;
  border: 0;
  background: var(--green);
  color: #111;
}

.whatsapp:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ghost {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #101010;
  color: #fff;
  border-color: #353535;
}

.fixed-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border-radius: 8px;
  padding: 0 9px;
  background: rgba(245, 130, 32, 0.12);
  color: #ffb45c;
  font-weight: 800;
  font-size: 11px;
}

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

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

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border: 1px solid #c9d7d8;
  border-radius: 8px;
  padding: 0 10px;
  background: #ecf7f6;
  color: #b85806;
  font-weight: 800;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 10px;
  margin-bottom: 10px;
}

.search {
  position: relative;
  margin: 0;
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search input {
  padding-left: 38px;
}

.select-label {
  margin: 0;
}

.table-shell {
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

th,
td {
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  text-align: left;
}

td {
  background: #fff;
}

tbody tr:nth-child(even) td {
  background: #f9fbfd;
}

.product-name {
  font-weight: 800;
  font-size: 12px;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 7px;
  padding: 0 7px;
  background: #f0f4f8;
  color: #111;
  font-weight: 800;
  font-size: 10px;
}

.price,
.subtotal {
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
  font-size: 12px;
}

.qty-control {
  display: grid;
  grid-template-columns: 28px 44px 28px;
  gap: 4px;
  align-items: center;
}

.qty-control button {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  color: var(--navy);
}

.qty-control input {
  height: 28px;
  padding: 0 6px;
  text-align: center;
}

.empty {
  padding: 28px;
  text-align: center;
}

.hidden {
  display: none;
}

svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 14px;
  }

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

  .topbar {
    align-items: flex-start;
  }
}
