:root {
  --page: #f3f5f2;
  --card: #ffffff;
  --ink: #17191f;
  --muted: #676d75;
  --line: #dfe4e2;
  --brand: #0f766e;
  --brand-dark: #0b5954;
  --danger: #be123c;
  --ok: #16803c;
  --amber: #b45309;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 10px 92px;
}

.login-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--page);
}

.login-view.hidden,
.app-shell.hidden {
  display: none;
}

.login-card {
  width: min(100%, 390px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(25, 30, 36, 0.08);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 2px 10px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 8px;
  font-size: 17px;
}

h3 {
  margin-bottom: 3px;
  font-size: 15px;
  line-height: 1.2;
}

.sync-btn,
.primary,
.secondary,
.danger,
.ghost-btn {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 13px;
  font-weight: 850;
  cursor: pointer;
}

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

.secondary {
  color: var(--ink);
  background: #e9ede9;
}

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

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

.header-actions {
  display: flex;
  gap: 7px;
}

.identity-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

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

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 11px;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 0 11px;
  background: var(--page);
  scrollbar-width: none;
}

.tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 11px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.tab.active {
  border-color: var(--brand);
  color: var(--brand);
}

.tab span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  min-height: 20px;
  margin-left: 3px;
  border-radius: 999px;
  color: #fff;
  background: #49515c;
  font-size: 11px;
}

.panel {
  display: none;
}

.panel.active {
  display: grid;
  gap: 11px;
}

.admin-only.hidden {
  display: none;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(25, 30, 36, 0.08);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.metric {
  padding: 13px;
}

.metric strong {
  display: block;
  font-size: 24px;
}

.product-card {
  overflow: hidden;
}

.product-top {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  padding: 10px;
}

.product-top img,
.thumb {
  width: 82px;
  height: 82px;
  border-radius: 8px;
  object-fit: cover;
  background: #d9dedc;
}

.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.tag,
.status-pill {
  flex: 0 0 auto;
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 950;
}

.tag {
  color: var(--brand-dark);
  background: #dff2ee;
}

.status-pill {
  color: #fff;
  background: #4b5563;
}

.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.size-pill {
  border: 1px solid #cfd8d4;
  border-radius: 999px;
  padding: 5px 8px;
  background: #fbfcfb;
  font-size: 12px;
  font-weight: 850;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.expand {
  border-top: 1px solid var(--line);
  padding: 8px 10px 10px;
  background: #fbfcfb;
}

details summary {
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.line:first-of-type {
  border-top: 0;
}

.single-card,
.order-card,
.settings-card {
  padding: 12px;
}

.single-head {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
}

.single-head .thumb {
  width: 58px;
  height: 58px;
}

.ready {
  color: var(--ok);
  font-weight: 950;
}

.pending {
  color: var(--danger);
  font-weight: 950;
}

.form-grid {
  display: grid;
  gap: 9px;
}

.sheet-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-grid {
  display: grid;
  gap: 11px;
}

.credential-grid {
  display: grid;
  gap: 9px;
}

.empty {
  padding: 25px 14px;
  border: 1px dashed #c8ccc8;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: end;
  background: rgba(17, 24, 39, 0.42);
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(100%, 720px);
  margin: 0 auto;
  border-radius: 12px 12px 0 0;
  padding: 15px;
  background: #fff;
}

.toast {
  position: fixed;
  right: 10px;
  bottom: 16px;
  left: 10px;
  z-index: 30;
  display: none;
  max-width: 700px;
  margin: 0 auto;
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: #20242a;
  font-size: 14px;
}

.toast.show {
  display: block;
}

@media (min-width: 680px) {
  .app-shell {
    padding-top: 22px;
  }

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

  #dashboard.panel.active,
  #partial.panel.active,
  #dispatch.panel.active,
  #dispatched.panel.active {
    grid-template-columns: 1fr;
  }
}
