:root {
  --bg: #f5f4f0;
  --panel: #fff;
  --ink: #18221f;
  --muted: #71807b;
  --line: #e3e7e4;
  --primary: #126552;
  --primary-dark: #0b4d3e;
  --accent: #e5f2ee;
  --warning: #f5e9cc;
  --danger: #b1483f;
  --sidebar: #102c27;
  --sidebar-muted: #a6c0bb;
  --shadow: 0 18px 36px rgba(21, 44, 39, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

.login-screen.hidden {
  display: none;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(100%, 390px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  background: white;
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 28px;
}

.login-card p,
.login-card small {
  color: var(--muted);
}

#login-error {
  min-height: 16px;
  color: var(--danger);
  font-weight: 700;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  width: 236px;
  flex-direction: column;
  padding: 24px 16px;
  color: white;
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark,
.shop-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-weight: 800;
}

.brand-mark {
  color: var(--sidebar);
  background: #b6e4d8;
}

.bag-mark {
  position: relative;
}

.bag-mark::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 12px;
  width: 16px;
  height: 13px;
  border: 3px solid currentColor;
  border-radius: 4px 4px 5px 5px;
}

.bag-mark::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 7px;
  width: 10px;
  height: 9px;
  border: 3px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 54px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--sidebar-muted);
  background: transparent;
  text-align: left;
}

.nav-link.active,
.nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-note {
  display: flex;
  gap: 9px;
  margin-top: auto;
  padding: 12px 10px;
  border-radius: 10px;
  color: white;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
}

.sidebar-note small {
  display: block;
  margin-top: 3px;
  color: var(--sidebar-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #efc974;
}

.main {
  margin-left: 236px;
  padding: 30px 42px 56px;
}

.topbar,
.section-heading,
.panel-heading,
.shop-switcher,
.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.05em;
}

h1 {
  margin-top: 3px;
  font-size: 30px;
}

h2 {
  font-size: 20px;
}

.eyebrow,
.step-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.shop-switcher {
  gap: 10px;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.shop-switcher small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

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

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0 22px;
}

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

.summary-card {
  padding: 18px;
}

.summary-card p,
.summary-card small,
.checkout-help {
  color: var(--muted);
}

.summary-card strong {
  display: block;
  margin: 7px 0 5px;
  font-family: "Manrope", sans-serif;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.receipt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 18px;
  align-items: start;
}

.receipt-form {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 20px;
}

.panel-heading {
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin-top: 5px;
}

.required-note {
  padding: 5px 8px;
  border-radius: 20px;
  color: var(--primary);
  background: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

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

.checkbox-label,
.customer-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input,
.customer-option input {
  width: auto;
}

.checkbox-label span,
.customer-option span {
  margin: 0;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #54635f;
  font-size: 13px;
  font-weight: 700;
}

label small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 101, 82, 0.1);
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
}

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

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

.button.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: white;
}

.button.compact {
  padding: 7px 10px;
  font-size: 12px;
}

.button.wide {
  width: 100%;
}

.items-head,
.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 60px 120px 100px 28px;
  gap: 9px;
  align-items: center;
}

.items-head,
.history-head {
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item-row {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.item-total {
  font-size: 13px;
  font-weight: 700;
}

.remove-item {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 20px;
}

.money-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.money-input span {
  margin: 0;
  padding-left: 11px;
}

.money-input input {
  border: 0;
}

.checkout-card {
  position: sticky;
  top: 22px;
  padding: 20px;
}

.checkout-card h2 {
  margin-top: 5px;
}

.total-list {
  display: grid;
  gap: 11px;
  margin: 26px 0 13px;
  color: var(--muted);
  font-size: 13px;
}

.total-list div,
.grand-total {
  display: flex;
  justify-content: space-between;
}

.grand-total {
  align-items: center;
  margin: 0 -20px 20px;
  padding: 17px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.grand-total strong {
  font-family: "Manrope", sans-serif;
  font-size: 23px;
  letter-spacing: -0.05em;
}

.checkout-help {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-top: 6px;
  font-size: 25px;
}

.filter-row {
  margin-bottom: 17px;
}

.filter-row input {
  max-width: 390px;
}

.history-head,
.history-row {
  display: grid;
  grid-template-columns: 1.15fr 1.5fr 1fr 0.85fr 0.85fr 54px;
  gap: 12px;
  align-items: center;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.pagination-row div {
  display: flex;
  gap: 8px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.history-row {
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.history-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.receipt-link {
  border: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 700;
}

.badge {
  width: max-content;
  padding: 4px 7px;
  border-radius: 12px;
  color: #8b6b20;
  background: var(--warning);
  font-size: 11px;
  font-weight: 700;
}

.sms-error {
  display: block;
  max-width: 170px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--danger);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  padding: 30px 0 12px;
  color: var(--muted);
  text-align: center;
}

.settings-form {
  max-width: 780px;
}

.bulk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.bulk-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.customer-picker {
  display: grid;
  gap: 8px;
  max-height: 360px;
  margin-top: 18px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.customer-option {
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.customer-option small,
.campaign-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.campaign-panel {
  position: sticky;
  top: 22px;
}

.campaign-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.campaign-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.full-width {
  grid-column: 1 / -1;
}

.settings-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.receipt-modal {
  width: min(92vw, 520px);
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 20px 70px rgba(12, 34, 29, 0.24);
}

.receipt-modal::backdrop {
  background: rgba(12, 34, 29, 0.48);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.printable-receipt {
  padding: 32px;
  color: #202020;
  background: white;
}

.print-head {
  padding-bottom: 16px;
  border-bottom: 1px dashed #aaa;
  text-align: center;
}

.receipt-logo {
  display: block;
  width: auto;
  max-width: 72px;
  max-height: 48px;
  margin: 0 auto 8px;
  object-fit: contain;
}

.print-head h2 {
  margin-bottom: 5px;
  font-size: 24px;
}

.print-meta,
.print-totals {
  display: grid;
  gap: 6px;
  padding: 15px 0;
  border-bottom: 1px dashed #aaa;
  font-size: 12px;
}

.print-meta div,
.print-totals div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.print-items {
  width: 100%;
  padding: 13px 0;
  border-bottom: 1px dashed #aaa;
  border-spacing: 0 7px;
  font-size: 12px;
  text-align: left;
}

.print-items th:last-child,
.print-items td:last-child {
  text-align: right;
}

.print-total {
  font-size: 15px;
  font-weight: 800;
}

.print-footer {
  margin-top: 20px;
  color: #555;
  font-size: 11px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  translate: 0 16px;
  opacity: 0;
  border-radius: 8px;
  padding: 12px 15px;
  color: white;
  background: var(--primary);
  font-size: 13px;
  transition: 180ms ease;
  pointer-events: none;
}

.toast.visible {
  translate: 0;
  opacity: 1;
}

@media (max-width: 960px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 15px 20px;
  }

  .nav {
    display: flex;
    margin-top: 18px;
  }

  .sidebar-note {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 24px;
  }
}

@media (max-width: 720px) {
  .dashboard-summary {
    grid-template-columns: 1fr;
  }

  .receipt-layout {
    grid-template-columns: 1fr;
  }

  .bulk-layout {
    grid-template-columns: 1fr;
  }

  .checkout-card {
    position: static;
  }

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

  .full-width {
    grid-column: auto;
  }

  .items-table,
  .history-table {
    overflow-x: auto;
  }

  .items-head,
  .item-row {
    min-width: 590px;
  }

  .history-head,
  .history-row {
    min-width: 700px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .receipt-modal,
  .receipt-modal * {
    visibility: visible;
  }

  .receipt-modal {
    position: absolute;
    inset: 0;
    width: 80mm;
    max-width: 80mm;
    margin: 0 auto;
    box-shadow: none;
  }

  .no-print {
    display: none;
  }

  .printable-receipt {
    width: 80mm;
    padding: 8mm;
  }

  .receipt-logo {
    max-width: 28mm;
    max-height: 18mm;
  }
}
