:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --canvas: #f2f4f7;
  --accent: #f97316;
  --accent-dark: #d95108;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --navy: #111827;
  --shadow: 0 16px 40px rgba(16, 24, 40, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(249, 115, 22, 0.09), transparent 24rem),
    var(--canvas);
}

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

body.auth-pending .workspace { visibility: hidden; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fb923c, #ea580c);
  color: white;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.24);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -0.02em; }
.brand small { color: var(--muted); margin-top: 2px; }
.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafb;
}
.primary-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: #667085;
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
}
.primary-nav a:hover { color: var(--ink); }
.primary-nav a.active { color: var(--ink); background: white; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

.status-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.logout-button {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 7px 11px;
  background: white;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}
.logout-button:hover { border-color: #fda29b; color: #b42318; }
.status-pill {
  padding: 7px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid transparent;
}
.status-pill.on { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.status-pill.off { color: #475467; background: #f2f4f7; border-color: #e4e7ec; }
.status-pill.neutral { color: #475467; background: white; border-color: var(--line); }

.workspace {
  max-width: 1540px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(430px, 1.15fr) minmax(370px, 0.85fr);
  align-items: start;
  gap: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel-heading, .phone-label, .section-title, .form-footer, .customer-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading.compact { margin-bottom: 20px; }
.eyebrow { color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
h1, h2, p { margin-top: 0; }
h1, h2 { letter-spacing: -0.025em; }
h1 { margin-bottom: 0; font-size: 24px; }
h2 { margin-bottom: 0; font-size: 18px; }
.panel-heading .eyebrow + h1, .panel-heading .eyebrow + h2, .phone-label .eyebrow + h2 { margin-top: 5px; }
.muted { color: var(--muted); line-height: 1.55; }
.tiny { font-size: 12px; }

.step-badge {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff7ed;
  color: var(--accent-dark);
  border: 1px solid #fed7aa;
  font-weight: 800;
  font-size: 13px;
}

label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
textarea, input, select {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}
textarea { resize: vertical; line-height: 1.55; min-height: 170px; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12); }
.form-footer { margin-top: 12px; }

.home-heading { margin-bottom: 18px; }
.home-heading p { margin: 7px 0 0; font-size: 12px; }

.settings-form { display: grid; gap: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-form label { margin-bottom: 6px; }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.checkbox-row { display: flex !important; align-items: center; gap: 9px; margin: 0 !important; font-weight: 650; }
.checkbox-row input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--navy); }
.settings-result { margin: 0; color: #067647; font-size: 12px; font-weight: 700; }
.settings-result.warning { color: #b54708; }
.config-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfcfd;
}
.compact-section-heading,
.module-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.compact-section-heading { margin-bottom: 14px; }
.compact-section-heading h2 { font-size: 15px; }
.compact-section-heading p,
.module-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.compact-section-heading > span {
  padding: 5px 8px;
  border-radius: 7px;
  color: #475467;
  background: #f2f4f7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.advanced-settings {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.advanced-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  list-style: none;
  cursor: pointer;
}
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary > span:first-child { display: grid; gap: 2px; }
.advanced-settings summary strong { font-size: 12px; }
.advanced-settings summary small { color: var(--muted); font-size: 10px; }
.details-chevron {
  color: #667085;
  font-size: 18px;
  transition: transform 160ms ease;
}
.advanced-settings[open] .details-chevron { transform: rotate(180deg); }
.advanced-settings-body {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #f9fafb;
}
.advanced-checkbox { padding: 2px; font-size: 12px; }
.compact-actions { justify-content: flex-end; min-height: 42px; }
.compact-actions .settings-result { flex: 1; }
.compact-actions .button { padding: 10px 14px; font-size: 12px; }
.test-mode-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fafb;
}
.test-mode-card.active { border-color: #f4b183; background: #fffaf5; }
.test-mode-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.test-mode-heading strong { font-size: 13px; }
.test-mode-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.test-mode-toggle {
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  font-size: 11px;
}
.test-mode-card textarea {
  min-height: 76px;
  padding: 10px 12px;
  font-size: 12px;
}
.test-mode-card textarea:disabled { color: #98a2b3; background: #f2f4f7; }
.test-mode-summary { margin: 0; color: #475467; font-size: 10px; font-weight: 700; }
.test-mode-card.active .test-mode-summary { color: #b54708; }
.test-mode-card.active .test-mode-summary.blocked { color: #b42318; }
.panel-divider { height: 1px; margin: 22px 0 0; background: var(--line); }
.event-teaching-title { margin-top: 0; }
.event-teaching-title .eyebrow { display: block; margin-bottom: 5px; }
.event-create-section { padding-top: 20px; }
.event-create-section textarea { min-height: 138px; }
.whatsapp-setup { padding-top: 1px; }
.compact-module {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfcfd;
}
.module-heading { align-items: center; }
.module-heading h2 { font-size: 15px; }
.module-heading p { margin-right: 12px; }
.whatsapp-title-row { align-items: flex-end; }
.whatsapp-title-row h2 { margin-top: 5px; font-size: 18px; }
.connection-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #fedf89;
  border-radius: 99px;
  color: #93370d;
  background: #fffaeb;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.connection-badge.ready { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.connection-badge.off { color: #475467; background: #f2f4f7; border-color: #e4e7ec; }
.whatsapp-connect-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 13px;
}
.wa-qr-frame {
  width: 260px;
  max-width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.wa-qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.wa-qr-frame.connected { border-color: #abefc6; background: #ecfdf3; }
.wa-qr-placeholder {
  min-height: 90px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: #98a2b3;
  text-align: center;
}
.wa-qr-placeholder span { font-size: 34px; line-height: 1; }
.wa-qr-placeholder small { font-size: 10px; }
.wa-instructions { min-width: 0; font-size: 12px; }
.wa-instructions > strong { font-size: 12px; }
.wa-instructions ol { margin: 8px 0 12px; padding-left: 18px; color: #475467; line-height: 1.6; }
.wa-link-instructions strong { font-size: 12px; }
.wa-link-instructions p { margin: 4px 0 11px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.wa-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wa-actions .button { padding: 9px 12px; font-size: 11px; }
.link-button.danger { color: #b42318; }
.wa-pairing-panel {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafb;
}
.wa-pairing-panel > strong { font-size: 12px; }
.wa-pairing-panel > p { margin: 4px 0 9px; color: var(--muted); font-size: 11px; }
.wa-pairing-form { display: flex; gap: 8px; }
.wa-pairing-form input { min-width: 0; padding: 9px 10px; }
.wa-pairing-form .button { flex: 0 0 auto; padding: 9px 12px; font-size: 11px; }
.wa-pairing-result {
  margin-top: 11px;
  padding: 11px;
  border-radius: 10px;
  background: white;
  border: 1px solid #a6f4c5;
}
.wa-pairing-result span,
.wa-pairing-result small { display: block; color: var(--muted); font-size: 10px; }
.wa-pairing-result strong {
  display: block;
  margin: 5px 0;
  color: #067647;
  font-size: 25px;
  letter-spacing: 4px;
}
.wa-reset-session {
  margin-top: 10px;
  font-size: 10px;
}
.wa-connected-number {
  margin: 0 0 10px;
  color: #067647;
  font-size: 11px;
  font-weight: 750;
}
.wa-session-error {
  margin: 12px 0 0;
  padding: 9px 11px;
  border: 1px solid #fecdca;
  border-radius: 10px;
  color: #b42318;
  background: #fef3f2;
  font-size: 11px;
}
.wa-disclaimer {
  margin: 14px 0 0;
  color: #667085;
  font-size: 10px;
  line-height: 1.45;
}

.button {
  border: 0;
  border-radius: 11px;
  padding: 11px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 750;
}
.button.primary { color: white; background: var(--navy); }
.button.primary:hover { background: #293141; }
.button.secondary { color: #344054; background: white; border: 1px solid #d0d5dd; }
.button.secondary:hover { background: #f9fafb; }
.button:disabled { opacity: 0.55; cursor: wait; }

.result-box {
  margin-top: 16px;
  border-radius: 12px;
  padding: 13px 14px;
  background: var(--green-soft);
  border: 1px solid #abefc6;
  color: #05603a;
  font-size: 13px;
  white-space: pre-line;
  line-height: 1.5;
}
.result-box.warning { background: #fffaeb; border-color: #fedf89; color: #93370d; }
.hidden { display: none !important; }

.section-title { margin: 24px 0 12px; }
.section-title h2 { font-size: 14px; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-title-actions { display: flex; align-items: center; gap: 8px; }
.counter {
  min-width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.events-list, .orders-list { display: grid; gap: 10px; }
.event-card, .order-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  background: #fcfcfd;
}
.event-card header, .order-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.event-card strong, .order-card strong { font-size: 14px; }
.event-card p, .order-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.order-contact { display: grid; gap: 3px; margin-top: 9px; font-size: 11px; color: #475467; }
.order-contact a { color: #175cd3; font-weight: 700; overflow-wrap: anywhere; }
.event-card-actions { display: flex; align-items: center; gap: 8px; }
.event-edit-button,
.event-delete-button {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 5px 8px;
  color: #344054;
  background: white;
  font-size: 10px;
  font-weight: 750;
}
.event-edit-button:hover { color: var(--accent-dark); border-color: #fdba74; }
.event-delete-button { color: #b42318; border-color: #fecdca; background: #fffafa; }
.event-delete-button:hover { color: #912018; border-color: #f97066; background: #fff1f0; }
.event-delete-button:disabled { cursor: wait; opacity: .6; }
.product-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.product-tags span, .order-status {
  border-radius: 7px;
  background: white;
  border: 1px solid var(--line);
  padding: 5px 7px;
  font-size: 11px;
  color: #344054;
}
.instruction-tags { display: grid; gap: 6px; margin-top: 9px; }
.instruction-tags span {
  padding: 7px 9px;
  border: 1px solid #b9e6fe;
  border-radius: 8px;
  color: #026aa2;
  background: #f0f9ff;
  font-size: 10px;
  line-height: 1.4;
}
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.event-status { color: #067647; font-size: 11px; font-weight: 750; }
.empty-state { color: #98a2b3; text-align: center; padding: 28px 12px; border: 1px dashed #d0d5dd; border-radius: 14px; font-size: 13px; }

.coupon-section {
  margin-top: 24px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}
.coupon-section .section-title { margin-top: 20px; }
.coupon-create-button { color: var(--accent-dark); border-color: #fdba74; background: #fff7ed; }
.coupons-list { display: grid; gap: 8px; }
.coupon-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fcfcfd;
}
.coupon-card.paused { background: #f9fafb; opacity: .82; }
.coupon-card-main { min-width: 0; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.coupon-code {
  padding: 5px 8px;
  border: 1px dashed #fdba74;
  border-radius: 7px;
  color: #9a3412;
  background: #fff7ed;
  font-size: 12px;
  letter-spacing: .04em;
}
.coupon-discount { color: #101828; font-size: 12px; font-weight: 750; }
.coupon-card-main p {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}
.coupon-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.coupon-status { font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.coupon-status.active { color: #067647; }
.coupon-status.paused { color: #667085; }
.coupon-editor { width: min(680px, calc(100vw - 32px)); }
.coupon-editor-grid { align-items: start; }
.coupon-check {
  min-height: 68px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfcfd;
  cursor: pointer;
}
.coupon-check input { width: auto; margin-top: 2px; accent-color: var(--accent); }
.coupon-check span { display: grid; gap: 3px; }
.coupon-check strong { font-size: 12px; }
.coupon-check small { color: var(--muted); font-size: 10px; line-height: 1.35; }

.event-editor {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: white;
  box-shadow: 0 30px 100px rgba(16, 24, 40, .3);
}
.event-editor::backdrop { background: rgba(16, 24, 40, .58); backdrop-filter: blur(3px); }
.event-editor-card { max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; }
.event-editor-card > header,
.event-editor-card > footer,
.event-products-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.event-editor-card > header { margin-bottom: 20px; }
.event-editor-card > header h2 { margin-top: 5px; }
.dialog-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #475467;
  background: white;
  font-size: 22px;
}
.event-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.event-editor-grid .wide { grid-column: 1 / -1; }
.event-editor-grid textarea { min-height: 88px; }
.event-products-heading { margin: 24px 0 12px; }
.event-products-heading h3 { margin: 0; font-size: 15px; }
.event-products-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.event-products-editor { display: grid; gap: 10px; }
.event-product-editor-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) 105px 115px 90px minmax(150px, 1fr) 95px 32px;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fcfcfd;
}
.event-product-editor-row label { margin-bottom: 5px; color: #475467; font-size: 10px; }
.event-product-editor-row input,
.event-product-editor-row select { padding: 9px 10px; border-radius: 9px; font-size: 12px; }
.event-product-remove {
  width: 32px;
  height: 34px;
  border: 1px solid #fecdca;
  border-radius: 9px;
  color: #b42318;
  background: #fef3f2;
  font-size: 18px;
}
.event-editor-card > footer { justify-content: flex-end; margin-top: 22px; }

.phone-section { min-width: 0; }
.phone-label { padding: 2px 8px 14px; }
.phone-shell {
  background: #111827;
  padding: 12px;
  border-radius: 34px;
  box-shadow: 0 25px 60px rgba(16, 24, 40, 0.25);
  position: relative;
}
.phone-speaker { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 64px; height: 5px; border-radius: 99px; background: #344054; z-index: 2; }
.chat-header {
  min-height: 68px;
  padding: 17px 15px 10px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: #075e54;
  color: white;
  border-radius: 23px 23px 0 0;
}
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #f97316; font-weight: 900; }
.chat-contact { flex: 1; }
.chat-contact strong, .chat-contact span { display: block; }
.chat-contact span { font-size: 11px; opacity: .85; margin-top: 3px; }
.chat-contact i { width: 6px; height: 6px; display: inline-block; background: #86efac; border-radius: 50%; margin-right: 4px; }
.icon-button { border: 0; background: rgba(255,255,255,.12); color: white; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; }

.chat-messages {
  height: 510px;
  overflow-y: auto;
  padding: 18px 12px;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(17, 24, 39, .045) 1px, transparent 1px);
  background-size: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-empty { margin: auto; color: #667085; text-align: center; display: grid; gap: 4px; font-size: 12px; }
.message { max-width: 84%; border-radius: 11px; padding: 9px 11px 7px; box-shadow: 0 1px 1px rgba(16,24,40,.08); }
.message.inbound { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 3px; }
.message.outbound { align-self: flex-start; background: white; border-top-left-radius: 3px; }
.message-body { white-space: pre-line; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.message-time { display: block; margin-top: 4px; text-align: right; color: #98a2b3; font-size: 9px; }
.quick-replies { display: flex; gap: 6px; overflow-x: auto; padding: 8px 8px 4px; background: #f8fafc; }
.quick-replies button { white-space: nowrap; border: 1px solid #d0d5dd; border-radius: 99px; padding: 6px 9px; color: #475467; background: white; font-size: 10px; }
.quick-replies button:hover { color: var(--accent-dark); border-color: #fdba74; }
.chat-composer { display: flex; gap: 8px; padding: 8px; background: #f8fafc; border-radius: 0 0 23px 23px; }
.chat-composer input { border-radius: 99px; padding: 10px 13px; font-size: 13px; }
.chat-composer button { flex: 0 0 auto; border: 0; width: 40px; height: 40px; border-radius: 50%; background: #00a884; color: white; }
.customer-id-row { margin: 13px 8px 0; }
.customer-id-row label { margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; }
.customer-id-row input { width: 180px; padding: 7px 9px; font-size: 11px; }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metrics article { padding: 14px; border-radius: 14px; background: #f9fafb; border: 1px solid var(--line); }
.metrics article.wide { grid-column: 1 / -1; background: #111827; color: white; }
.metrics span, .metrics strong { display: block; }
.metrics span { font-size: 11px; color: var(--muted); }
.metrics .wide span { color: #98a2b3; }
.metrics strong { font-size: 23px; margin-top: 5px; letter-spacing: -0.03em; }
.sales-overview {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 28px;
}
.sales-overview-copy { width: min(340px, 34%); }
.sales-overview-copy h2 { margin: 6px 0 7px; font-size: 20px; }
.sales-overview-copy p { margin-bottom: 14px; font-size: 12px; }
.sales-overview-copy .button { text-decoration: none; }
.sales-overview .metrics {
  flex: 1;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
}
.sales-overview .metrics article.wide { grid-column: auto; }
.order-status.paid { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.order-status.pending { color: #b54708; background: #fffaeb; border-color: #fedf89; }
.order-status.review { color: #6941c6; background: #f4f3ff; border-color: #d9d6fe; }
.order-status.sent { color: #026aa2; background: #f0f9ff; border-color: #b9e6fe; }
.order-status.cancelled { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.receipt-box {
  display: grid;
  gap: 3px;
  margin-top: 11px;
  padding: 10px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: white;
}
.receipt-box a { color: #175cd3; font-size: 11px; font-weight: 750; overflow-wrap: anywhere; }
.receipt-box span { color: #667085; font-size: 10px; }
.order-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 11px; }
.compact-button { padding: 8px 10px; border-radius: 8px; font-size: 11px; }
.link-button { border: 0; padding: 0; color: var(--accent-dark); background: transparent; font-size: 11px; font-weight: 750; }
.test-guide { margin-top: 22px; display: flex; gap: 12px; padding: 15px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 15px; }
.guide-icon { flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: white; font-weight: 900; }
.test-guide strong { font-size: 13px; }
.test-guide ol { margin: 8px 0 0; padding-left: 18px; color: #7c2d12; font-size: 11px; line-height: 1.65; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 380px; padding: 12px 15px; border-radius: 12px; color: white; background: #b42318; box-shadow: var(--shadow); font-size: 13px; }
.toast.success { background: #067647; }

.login-screen {
  position: fixed;
  inset: 76px 0 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(242, 244, 247, 0.96);
  backdrop-filter: blur(8px);
}
.login-card {
  width: min(410px, 100%);
  display: grid;
  gap: 12px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .16);
}
.login-card .brand-mark { margin-bottom: 4px; }
.login-card h1 { margin: 5px 0 8px; }
.login-card p { margin-bottom: 8px; }
.login-card .button { margin-top: 6px; width: 100%; }
.login-error { color: #b42318; font-size: 12px; margin: 0 !important; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr 1fr; }
  .activity-panel { grid-column: 1 / -1; }
  .orders-list { grid-template-columns: repeat(2, 1fr); }
  .sales-overview { align-items: stretch; flex-direction: column; }
  .sales-overview-copy { width: 100%; }
}

@media (max-width: 760px) {
  .topbar { height: auto; min-height: 72px; padding: 12px 16px; align-items: flex-start; flex-wrap: wrap; }
  .login-screen { inset: 72px 0 0; }
  .brand small { display: none; }
  .primary-nav { order: 3; width: 100%; }
  .primary-nav a { flex: 1; text-align: center; }
  .status-row { max-width: 190px; }
  .workspace { display: flex; flex-direction: column; padding: 14px; gap: 18px; }
  .workspace > * { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .whatsapp-connect-grid { grid-template-columns: 1fr; }
  .wa-qr-frame { width: 280px; margin: 0 auto; }
  .event-editor-card { padding: 18px; }
  .event-editor-grid { grid-template-columns: 1fr; }
  .event-editor-grid .wide { grid-column: auto; }
  .event-product-editor-row { grid-template-columns: 1fr 1fr; }
  .event-product-editor-row > :first-child,
  .event-product-editor-row > :nth-child(5) { grid-column: 1 / -1; }
  .event-product-remove { justify-self: end; }
  .coupon-card { align-items: flex-start; flex-direction: column; }
  .coupon-card-actions { justify-content: flex-start; }
  .panel { padding: 18px; border-radius: 18px; }
  .phone-shell { max-width: 440px; margin: 0 auto; }
  .chat-messages { height: 470px; }
  .orders-list { grid-template-columns: 1fr; }
  .sales-overview .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-overview .metrics article.wide { grid-column: 1 / -1; }
}
