/*
 * Mewtda Trocas — Material Design 3, tema claro branco + verde.
 * Tokens seguem os papéis de cor do M3 (primary, surface-container, outline…).
 */

:root {
  --primary: #0b5a36;
  --on-primary: #ffffff;
  --primary-container: #b7f1bd;
  --primary-vivid: #22a85a;
  --on-primary-container: #002107;
  --secondary: #506351;
  --secondary-container: #d3e8d1;
  --on-secondary-container: #0e1f11;
  --tertiary: #39656b;
  --tertiary-container: #bcebf1;
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --on-error-container: #410002;
  --warning: #7a5900;
  --warning-container: #ffdf9e;

  --surface: #ffffff;
  --surface-dim: #f5f8f4;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f6faf5;
  --surface-container: #f0f5ef;
  --surface-container-high: #eaf0e9;
  --surface-container-highest: #e4eae3;
  --on-surface: #181d18;
  --on-surface-variant: #414941;
  --outline: #717970;
  --outline-variant: #c1c9be;
  --scrim: rgb(0 0 0 / 0.32);
  --on-error: #ffffff;
  --on-tertiary-container: #001f23;
  --state-hover: rgb(24 29 24 / 0.08);
  --brand-ink: #033a26;
  --auth-side-bg: #e7f3ea;
  --warning-surface: #fffbf2;
  --banner-warning-bg: #fff4d6;
  --banner-warning-fg: #3f2e00;

  --accent: var(--primary);

  --shape-xs: 4px;
  --shape-sm: 8px;
  --shape-md: 12px;
  --shape-lg: 16px;
  --shape-xl: 28px;
  --shape-full: 999px;

  --elev-1: 0 1px 2px rgb(0 0 0 / 0.08), 0 1px 3px 1px rgb(0 0 0 / 0.05);
  --elev-2: 0 1px 2px rgb(0 0 0 / 0.1), 0 2px 6px 2px rgb(0 0 0 / 0.06);
  --elev-3: 0 4px 8px 3px rgb(0 0 0 / 0.08), 0 1px 3px rgb(0 0 0 / 0.1);

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --topbar-h: 52px;
  --sidebar-w: 248px;
  --rail-w: var(--sidebar-w);
  --footer-h: 44px;
  --bottom-nav-h: 64px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --primary: #86d99a;
  --on-primary: #00391c;
  --primary-container: #0b5a36;
  --primary-vivid: #3ecf7a;
  --on-primary-container: #b7f1bd;
  --secondary: #b7ccb5;
  --secondary-container: #232b26;
  --on-secondary-container: #d3e8d1;
  --tertiary: #a1ced5;
  --tertiary-container: #1f4d54;
  --on-tertiary-container: #bcebf1;
  --error: #ffb4ab;
  --on-error: #690005;
  --error-container: #93000a;
  --on-error-container: #ffdad6;
  --warning: #f0c05a;
  --warning-container: #4d3a00;

  --surface: #0f1216;
  --surface-dim: #0a0c0f;
  --surface-container-lowest: #07080a;
  --surface-container-low: #0d1013;
  --surface-container: #14181c;
  --surface-container-high: #1b2025;
  --surface-container-highest: #22282e;
  --on-surface: #e8ecef;
  --on-surface-variant: #aab1b8;
  --outline: #6b737b;
  --outline-variant: #252a30;
  --scrim: rgb(0 0 0 / 0.6);
  --state-hover: rgb(255 255 255 / 0.08);
  --brand-ink: var(--primary);
  --auth-side-bg: #0d1511;
  --warning-surface: #1f1b0d;
  --banner-warning-bg: #3a2f0a;
  --banner-warning-fg: #ffe9b0;

  --elev-1: 0 1px 2px rgb(0 0 0 / 0.4), 0 1px 3px 1px rgb(0 0 0 / 0.25);
  --elev-2: 0 1px 2px rgb(0 0 0 / 0.45), 0 2px 6px 2px rgb(0 0 0 / 0.3);
  --elev-3: 0 4px 8px 3px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.5);

  color-scheme: dark;
}
:root[data-theme="dark"] .brand-lockup__mark { filter: brightness(1.7) saturate(1.1); }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: "Roboto Flex", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.01em;
  color: var(--on-surface);
  background: var(--surface-dim);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.92em; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.msr {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  user-select: none;
  flex-shrink: 0;
}
.msr--sm { font-size: 16px; vertical-align: -3px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Tipografia M3 */
.headline-small { font-size: 24px; line-height: 32px; font-weight: 400; letter-spacing: 0; }
.title-medium { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: 0.01em; }
.title-small { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.01em; }
.body-medium { font-size: 14px; line-height: 20px; }
.body-small { font-size: 12px; line-height: 16px; letter-spacing: 0.03em; }
.overline { font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-surface-variant); }
.muted { color: var(--on-surface-variant); }

@keyframes spin { to { transform: rotate(360deg); } }
.msr--spin { animation: spin 800ms linear infinite; }

/* ---------- Shell (app logada) ---------- */

.app { padding-top: var(--topbar-h); padding-left: var(--rail-w); min-height: 100vh; }

.top-app-bar {
  position: fixed;
  inset: 0 0 auto var(--rail-w);
  height: var(--topbar-h);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--outline-variant);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--on-surface); font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand strong { font-weight: 600; color: var(--primary); }
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--brand-ink); }
.brand-lockup__mark { width: 40px; height: 40px; }
.brand-lockup__text { display: grid; line-height: 1; }
.brand-lockup__name { font-family: "Fredoka", "Roboto Flex", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.brand-lockup__by { font-family: "Fredoka", "Roboto Flex", sans-serif; font-weight: 600; font-size: 11px; justify-self: end; margin-top: 2px; }
.brand-lockup--lg { flex-direction: column; gap: 12px; }
.brand-lockup--lg .brand-lockup__mark { width: 72px; height: 72px; }
.brand-lockup--lg .brand-lockup__name { font-size: 32px; }
.brand-lockup--lg .brand-lockup__by { font-size: 14px; }

.top-app-bar .top-app-bar__brand, .bottom-nav { display: none; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; color: var(--on-surface-variant); white-space: nowrap; }
.breadcrumb strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--on-surface); font-weight: 500; }
.breadcrumb__sep { color: var(--outline); }
.top-app-bar__tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.font-size { display: inline-flex; }
/* Plano da loja no topo: nome, quanto falta e uma barra fina. */
.plan-meter { display: inline-grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 6px; row-gap: 4px;
  margin-right: 10px; padding: 5px 12px 6px; border-radius: var(--shape-full); background: var(--surface-container);
  color: var(--on-surface-variant); font-size: 13px; line-height: 1.1; letter-spacing: 0.01em; text-decoration: none; white-space: nowrap; }
a.plan-meter:hover { background: var(--surface-container-high); }
.plan-meter__name { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--on-surface); }
.plan-meter__name .msr { color: var(--primary); }
.plan-meter__count { font-variant-numeric: tabular-nums; font-weight: 500; }
/* Tooltip genérico: data-tooltip="texto" (\n quebra linha) e data-tooltip-side="bottom | bottom-end | right". */
[data-tooltip] { position: relative; }
[data-tooltip]:is(:hover, :focus-visible)::after {
  content: attr(data-tooltip); position: absolute; z-index: 60; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: min(260px, 80vw); padding: 8px 12px; border-radius: var(--shape-sm); background: var(--on-surface);
  color: var(--surface); font-size: 13px; font-weight: 500; line-height: 1.4; letter-spacing: 0; text-align: left; white-space: pre-line;
  box-shadow: var(--elev-3); pointer-events: none; }
[data-tooltip-side="bottom-end"]:is(:hover, :focus-visible)::after { left: auto; right: 0; transform: none; }
[data-tooltip-side="right"]:is(:hover, :focus-visible)::after { top: 50%; left: calc(100% + 14px); transform: translateY(-50%); white-space: nowrap; }
.sidebar [data-tooltip]:is(:hover, :focus-visible)::after { display: none; }
.plan-meter__bar { grid-column: 1 / -1; position: relative; height: 4px; min-width: 96px; border-radius: var(--shape-full);
  background: var(--outline-variant); overflow: hidden; }
.plan-meter__bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--used); border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-vivid)); transition: width .6s var(--ease); }
.plan-meter--warning .plan-meter__bar::after { background: var(--warning); }
.plan-meter--warning .plan-meter__count { color: var(--warning); }
.plan-meter--critical .plan-meter__bar::after { background: var(--error); }
.plan-meter--critical .plan-meter__count { color: var(--error); font-weight: 600; }
@media (max-width: 600px) { .plan-meter__bar { min-width: 56px; } .plan-meter { margin-right: 4px; } }
.font-size { align-items: center; gap: 0; padding: 0 2px; border: 1px solid var(--outline-variant); border-radius: var(--shape-full); }
.font-size__value { min-width: 36px; padding: 0; border: 0; background: none; font: inherit; font-size: 11px; text-align: center; color: var(--on-surface-variant); cursor: pointer; }
.font-size__value:hover { color: var(--on-surface); }
.font-size__button { width: 24px; height: 24px; font-size: 12px; font-weight: 700; color: var(--on-surface); }
@media (max-width: 380px) { .font-size__value { display: none; } }
.theme-toggle { width: 36px; height: 36px; }
.theme-toggle .msr { font-size: 20px; }
.theme-toggle__light, :root[data-theme="dark"] .theme-toggle__dark { display: none; }
:root[data-theme="dark"] .theme-toggle__light { display: block; }

.client-switcher, .select-menu__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-sm);
  background: var(--surface);
  color: var(--on-surface-variant);
  font-size: 14px;
}
.store-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--on-surface); }
.initial-badge { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 700; }

.field-dropdown { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.field-dropdown__label { position: absolute; left: 12px; top: 16px; z-index: 1; padding: 0 4px; font-size: 16px; line-height: 24px; color: var(--on-surface-variant); background: var(--surface); pointer-events: none; transform-origin: left top; transform: translateY(-24px) scale(0.75); transition: color 150ms; }
.field-dropdown .select-menu__trigger { min-height: 56px; padding: 16px 12px 16px 16px; border-color: var(--outline); border-radius: var(--shape-xs); box-shadow: none; font-size: 16px; line-height: 24px; transition: border-color 150ms; }
.field-dropdown .select-menu__trigger .select-menu__label { font-weight: 400; }
.field-dropdown .select-menu__trigger .msr { font-size: 24px; }
.field-dropdown .select-menu__trigger:hover { border-color: var(--on-surface); }
.field-dropdown .select-menu__trigger:focus-visible, .field-dropdown .select-menu[open] .select-menu__trigger { outline: 0; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.field-dropdown:has(.select-menu[open]) .field-dropdown__label, .field-dropdown:has(.select-menu__trigger:focus-visible) .field-dropdown__label { color: var(--primary); }
.field-dropdown .select-menu__option, .field-dropdown .select-menu__footer { font-size: 15px; }
.field-dropdown.has-error .select-menu__trigger { border-color: var(--error); }
.field-dropdown.has-error .field-dropdown__label, .field-dropdown.has-error .text-field__supporting { color: var(--error); }
.select-menu { position: relative; min-width: 0; }
.select-menu > summary { list-style: none; cursor: pointer; }
.select-menu > summary::-webkit-details-marker { display: none; }
.select-menu__trigger { box-shadow: var(--elev-1, 0 1px 2px rgb(0 0 0 / 0.06)); }
.select-menu__trigger .msr { font-size: 18px; }
.select-menu__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--on-surface); }
.select-menu__current { display: flex; align-items: center; flex: 1; gap: 10px; min-width: 0; }
.select-menu__trigger .select-menu__label { font-weight: 600; }
.select-menu__surface { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 45; padding: 8px; border: 1px solid var(--outline-variant); border-radius: var(--shape-sm); background: var(--surface); box-shadow: var(--elev-2); }
.select-menu__heading { margin: 4px 8px 8px; font-size: 10px; }
.select-menu__form { margin: 0; }
.select-menu__option, .select-menu__footer { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 8px; border: 0; border-radius: var(--shape-sm); background: none; font: inherit; font-size: 13px; color: var(--on-surface); text-align: left; cursor: pointer; }
.select-menu__option:hover, .select-menu__footer:hover { background: var(--state-hover); text-decoration: none; }
.select-menu__option:disabled { cursor: not-allowed; }
.select-menu__option:disabled:hover { background: none; }
.select-menu__option:disabled .select-menu__label { color: var(--on-surface-variant); }
.select-menu__option .msr { margin-left: auto; font-size: 20px; visibility: hidden; }
.select-menu__option.is-selected .msr { visibility: visible; }
.select-menu__footer { margin-top: 6px; border-top: 1px solid var(--outline-variant); border-radius: 0 0 var(--shape-sm) var(--shape-sm); color: var(--on-surface-variant); }
.select-menu__footer .msr { font-size: 20px; }

.loading { display: none; position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%); margin: 0; width: max-content; max-width: calc(100% - 32px); height: auto; max-height: none; outline: 0; padding: 28px 40px; border: 0; border-radius: var(--shape-lg, 24px); background: var(--surface); color: var(--on-surface); box-shadow: var(--elev-2); text-align: center; }
.loading[open] { display: grid; justify-items: center; gap: 14px; }
.loading::backdrop { background: rgb(24 29 24 / 0.45); }
.loading__mark { width: 64px; height: 64px; animation: loading-pulse 1.4s ease-in-out infinite; }
.loading__bar { position: relative; width: 160px; height: 4px; border-radius: 2px; overflow: hidden; background: var(--outline-variant); }
.loading__bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 2px; background: var(--accent, var(--primary)); animation: loading-slide 1.1s ease-in-out infinite; }
.loading p { margin: 0; color: var(--on-surface-variant); }
@media (max-width: 600px) {
  .loading { padding: 18px 24px; }
  .loading[open] { gap: 10px; }
  .loading__mark { width: 40px; height: 40px; }
  .loading__bar { width: 110px; }
  .loading p { font-size: 13px; }
}
@keyframes loading-pulse { 50% { transform: scale(1.08); opacity: 0.8; } }
@keyframes loading-slide { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .loading__mark, .loading__bar::after { animation: none; } .loading__bar::after { left: 30%; } }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.avatar {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--shape-full);
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-weight: 600;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--large { width: 96px; height: 96px; font-size: 36px; flex-shrink: 0; }
.avatar--small { width: 36px; height: 36px; font-size: 14px; flex-shrink: 0; }
.cell-user { display: flex; align-items: center; gap: 12px; }
.user-data--with-photo { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 720px) { .user-data--with-photo { grid-template-columns: minmax(0, 1fr); } }
.profile-photo { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-photo__pick { position: relative; display: block; width: 96px; height: 96px; cursor: pointer; border-radius: var(--shape-full); }
.profile-photo__camera {
  position: absolute; right: 0; bottom: 0;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 2px solid var(--surface); border-radius: var(--shape-full);
  background: var(--primary); color: var(--on-primary);
}
.profile-photo__camera .msr { font-size: 18px; }
.profile-photo__pick:hover .avatar { filter: brightness(0.85); }
.profile-photo__pick:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 30%, white); outline-offset: 2px; }
.menu__surface {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 15;
  min-width: 240px;
  padding: 8px 0;
  border-radius: var(--shape-sm);
  background: var(--surface-container);
  box-shadow: var(--elev-2);
}
.menu__header { display: grid; padding: 8px 16px 12px; border-bottom: 1px solid var(--outline-variant); margin-bottom: 8px; }
.menu__header span { font-size: 12px; color: var(--on-surface-variant); }
.menu form { margin: 0; }
.menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  background: none;
  font: inherit;
  color: var(--on-surface);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.menu__item:hover { background: var(--state-hover); text-decoration: none; }
.menu__item .msr { font-size: 20px; color: var(--on-surface-variant); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 10px 14px;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--outline-variant);
}
.sidebar__brand { display: flex; align-items: center; flex-shrink: 0; height: var(--topbar-h); padding: 0 8px; }
.sidebar__brand .brand-lockup { gap: 8px; }
.sidebar__brand .brand-lockup__mark { width: 34px; height: 34px; }
.sidebar__brand .brand-lockup__name { font-size: 19px; }
.sidebar__brand .brand-lockup__by { font-size: 10px; }
.sidebar__nav { display: grid; gap: 2px; }
.sidebar__group { margin: 14px 10px 4px; font-size: 11px; }
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--shape-sm);
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 500;
}
.sidebar__item .msr { font-size: 20px; }
.sidebar__item:hover { background: var(--state-hover); text-decoration: none; }
.sidebar__item.is-active { background: var(--secondary-container); color: var(--on-secondary-container); }
.sidebar__item.is-active .msr { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.sidebar__user { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--outline-variant); }
.sidebar__user form { margin: 0; }
.sidebar__profile { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; color: inherit; }
.sidebar__profile:hover { text-decoration: none; }
.sidebar__user-text { display: grid; min-width: 0; line-height: 1.25; }
.sidebar__user .avatar { width: 32px; height: 32px; font-size: 13px; }
.sidebar__user .icon-button { width: 36px; height: 36px; }
.sidebar__user-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.sidebar__user-text span { font-size: 12px; color: var(--on-surface-variant); }
.drawer-backdrop { display: none; }
.sidebar-toggle { display: none; }
@media (min-width: 721px) {
  .sidebar, .app, .top-app-bar, .app-footer { transition-duration: 200ms; transition-timing-function: var(--ease); }
  .sidebar { transition-property: width; }
  .app { transition-property: padding-left; }
  .top-app-bar, .app-footer { transition-property: left; }
  .sidebar-toggle {
    position: fixed; left: calc(var(--sidebar-w) - 14px); top: calc(var(--topbar-h) / 2 - 14px); z-index: 41;
    display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
    border: 1px solid var(--outline-variant); border-radius: var(--shape-full);
    background: var(--surface); color: var(--on-surface-variant); box-shadow: var(--elev-1); cursor: pointer;
    transition: left 200ms var(--ease);
  }
  .sidebar-toggle:hover { color: var(--on-surface); background: var(--surface-container, var(--surface)); }
  .sidebar-toggle .msr { font-size: 18px; }
  .sidebar-toggle__expand, :root[data-sidebar="collapsed"] .sidebar-toggle__collapse { display: none; }
  :root[data-sidebar="collapsed"] .sidebar-toggle__expand { display: block; }

  :root[data-sidebar="collapsed"] { --sidebar-w: 72px; }
  :root[data-sidebar="collapsed"] .sidebar { overflow: visible; }
  :root[data-sidebar="collapsed"] .sidebar__brand { justify-content: center; padding: 0; }
  :root[data-sidebar="collapsed"] .sidebar__brand .brand-lockup__text,
  :root[data-sidebar="collapsed"] .sidebar .store-name,
  :root[data-sidebar="collapsed"] .sidebar .select-menu__trigger > .msr,
  :root[data-sidebar="collapsed"] .sidebar .select-menu__trigger .select-menu__label,
  :root[data-sidebar="collapsed"] .sidebar__item span:not(.msr),
  :root[data-sidebar="collapsed"] .sidebar__user-text { display: none; }
  :root[data-sidebar="collapsed"] .sidebar .client-switcher,
  :root[data-sidebar="collapsed"] .sidebar .select-menu__trigger { justify-content: center; padding: 0; }
  :root[data-sidebar="collapsed"] .sidebar .select-menu__trigger .select-menu__current { flex: none; }
  :root[data-sidebar="collapsed"] .sidebar .select-menu__surface { right: auto; min-width: 240px; }
  :root[data-sidebar="collapsed"] .sidebar__item { justify-content: center; padding: 0; }
  :root[data-sidebar="collapsed"] .sidebar__group { height: 1px; margin: 10px 8px; padding: 0; font-size: 0; background: var(--outline-variant); }
  :root[data-sidebar="collapsed"] .sidebar__user { flex-direction: column; }
  :root[data-sidebar="collapsed"] .sidebar__profile { flex: none; }

  :root[data-sidebar="collapsed"] .sidebar [data-tooltip]:is(:hover, :focus-visible)::after {
    display: block; top: 50%; left: calc(100% + 14px); transform: translateY(-50%); white-space: nowrap;
  }
}

.main { padding: 28px 40px 96px; zoom: var(--ui-zoom, 1); }

.app-footer {
  position: fixed; left: var(--rail-w); right: 0; bottom: 0; z-index: 15;
  height: calc(var(--footer-h) + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 32px env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--outline-variant);
}
.auth .app-footer { left: 0; display: flex; }
.app-footer__logo { width: auto; height: 22px; margin-left: -6px; transform: translateY(-2px); }

/* ---------- Bolinha de suporte ---------- */

.support-bubble {
  position: fixed; bottom: calc(var(--footer-h) + 24px); right: 24px; z-index: 30;
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; padding: 0;
  border-radius: 50%; background: var(--primary); color: var(--on-primary);
  box-shadow: var(--elev-3); animation: support-float 3.2s var(--ease) infinite;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}
/* Reserva espaço pro botão "Salvar configuração" (.sticky-actions) não ficar embaixo da bolinha. */
body:has(.support-bubble) .sticky-actions { padding-right: 76px; }
.support-bubble:hover, .support-bubble:focus-within { text-decoration: none; transform: translateY(-2px) scale(1.03); animation-play-state: paused; }
.support-bubble:focus-visible { outline: 3px solid var(--primary-container); outline-offset: 3px; }
.support-bubble__icon {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; background: #25d366; color: #fff;
}
.support-bubble__icon::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: #25d366;
  animation: support-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite; z-index: -1;
}
.support-bubble__dot {
  position: absolute; top: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%;
  background: #b7f1bd; border: 2px solid var(--primary);
}
.support-bubble__tooltip {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%) translateX(4px);
  display: grid; line-height: 1.15; padding: 8px 14px; border-radius: var(--shape-sm);
  background: var(--primary); color: var(--on-primary); box-shadow: var(--elev-3);
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}
.support-bubble__tooltip strong { font-size: 14px; }
.support-bubble__tooltip span { font-size: 11px; opacity: 0.85; }
.support-bubble:hover .support-bubble__tooltip,
.support-bubble:focus-visible .support-bubble__tooltip { opacity: 1; transform: translateY(-50%) translateX(0); pointer-events: auto; }

@keyframes support-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes support-ping { 0% { transform: scale(1); opacity: 0.55; } 80%, 100% { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .support-bubble, .support-bubble__icon::before { animation: none; }
}

/* ---------- Page structure ---------- */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-header h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-header__lead { display: flex; align-items: center; gap: 8px; }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-label { display: none; }
.page-header__actions form { margin: 0; }

.grid { display: grid; gap: 16px; align-items: start; }
.grid--detail { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid--wide-first { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.grid--editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; min-width: 0; }
.card { min-width: 0; max-width: 100%; }
.stack--tight { gap: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-md);
  padding: 20px 24px;
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}
.card--flush { padding: 0; gap: 0; overflow: hidden; }
.card__pad { padding: 20px 24px 16px; display: grid; gap: 8px; }
.team-refund-switch { justify-content: flex-start; }
.card--primary { background: var(--surface-container-low); border-color: var(--primary-container); }
.card--warning { background: var(--warning-surface); border-color: var(--warning-container); }
.card__title { display: flex; align-items: center; gap: 10px; }
.card__title .msr { font-size: 20px; color: var(--primary); }

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--primary);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--shape-full);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  white-space: nowrap;
  transition: box-shadow 200ms var(--ease);
}
.btn .msr { font-size: 18px; margin-left: -6px; }
.btn::after { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity 150ms; z-index: -1; }
.btn:hover { text-decoration: none; }
.btn:hover::after { opacity: 0.08; }
.btn:active::after, .btn:focus-visible::after { opacity: 0.12; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }

.btn--filled { --btn-bg: var(--primary); --btn-fg: var(--on-primary); }
.btn--filled:hover { box-shadow: var(--elev-1); }
.btn--accent { --btn-bg: var(--accent); }
.btn--tonal { --btn-bg: var(--secondary-container); --btn-fg: var(--on-secondary-container); }
.btn--outlined { border: 1px solid var(--outline); }
.btn--danger { --btn-fg: var(--error); border-color: var(--error); }
.btn--filled.btn--danger { --btn-bg: var(--error); --btn-fg: var(--on-error); }

.dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--shape-xl);
  background: var(--surface);
  color: var(--on-surface);
  box-shadow: var(--elev-3);
}
.dialog--form { width: min(640px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgb(0 0 0 / 0.32); }
.dialog[open] { animation: dialog-in 150ms var(--ease); }
.dialog__surface { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px; }
.dialog--form { max-height: calc(100dvh - 32px); overflow-y: auto; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }
.next-steps { counter-reset: step; list-style: none; display: grid; gap: 20px; margin: 0; padding: 0; }
.next-steps li { position: relative; display: grid; gap: 4px; padding-left: 44px; }
.next-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-container); color: var(--on-primary-container); font-weight: 700; font-size: 14px;
}
.next-steps code { justify-self: start; }
.next-steps .body-small p { margin: 0; }
@keyframes dialog-in { from { opacity: 0; transform: scale(0.95); } }
.btn--text { padding: 0 12px; }
.btn--small { height: 32px; padding: 0 16px; font-size: 13px; }
.btn--block { width: 100%; height: 48px; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: var(--shape-full);
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-button:hover { background: var(--state-hover); text-decoration: none; }
.icon-button.is-disabled { opacity: 0.38; cursor: default; background: none; }
.icon-button--danger { color: var(--error); }
.icon-button--danger:hover { background: var(--error-container); }

.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.sticky-actions {
  position: sticky;
  bottom: calc(var(--footer-h) + 16px);
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  pointer-events: none;
}
.sticky-actions .btn { pointer-events: auto; box-shadow: var(--elev-3); height: 48px; }

/* ---------- Chips ---------- */

.assist-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-sm);
  font-weight: 500;
  color: var(--on-surface);
  background: var(--surface);
}
.assist-chip .msr { font-size: 18px; color: var(--primary); }
.assist-chip--primary { background: var(--primary-container); border-color: transparent; color: var(--on-primary-container); font-weight: 500; }
.assist-chip--small { height: 24px; padding: 0 8px; font-size: 12px; font-weight: 400; color: var(--on-surface-variant); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: var(--shape-sm);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.status-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-chip--lg { height: 32px; gap: 8px; padding: 0 14px 0 12px; font-size: 15px; }
.status-chip--lg::before { width: 10px; height: 10px; }
.status-chip--pending { background: var(--warning-container); color: var(--warning); }
.status-chip--approved { background: var(--primary-container); color: var(--primary); }
.status-chip--completed { background: var(--tertiary-container); color: var(--tertiary); }
.status-chip--rejected { background: var(--error-container); color: var(--error); }
.status-chip--received { background: var(--warning-container); color: var(--warning); }
.status-chip--refunding { background: var(--warning-container); color: var(--warning); }
.status-chip--refunded { background: var(--secondary-container); color: var(--on-secondary-container); }
.chip-stack { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; vertical-align: middle; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.item-group-label { margin-top: 12px; margin-bottom: -2px; font-size: 12px; letter-spacing: 0.02em; }
.chip-row--center { justify-content: center; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kind-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px 0 6px;
  border-radius: var(--shape-sm);
  font-size: 12px;
  font-weight: 500;
}
.kind-chip .msr { font-size: 16px; }
.kind-chip--swap { background: var(--primary-container); color: var(--on-primary-container); }
.kind-chip--refund { background: var(--secondary-container); color: var(--on-secondary-container); }

/* ---------- Stats ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: var(--shape-md);
  border: 1px solid var(--outline-variant);
  background: var(--surface);
  color: var(--on-surface);
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}
.stat-card:hover { text-decoration: none; background: var(--surface-container-low); }
.stat-card__icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--shape-md);
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
}
.stat-card__icon .msr { font-size: 22px; }
.stat-card__value { font-size: 22px; line-height: 28px; font-weight: 500; }
.stat-card__label { font-size: 12px; color: var(--on-surface-variant); }
.stat-card { position: relative; cursor: pointer; }
.stat-card:has(input:checked) { background: var(--surface-container-low); border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.stat-card:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.stat-card--pending .stat-card__icon { background: var(--warning-container); color: var(--warning); }
.stat-card--approved .stat-card__icon { background: var(--primary-container); color: var(--primary); }
.stat-card--completed .stat-card__icon { background: var(--tertiary-container); color: var(--tertiary); }
.stat-card--rejected .stat-card__icon { background: var(--error-container); color: var(--error); }
.stat-card--received .stat-card__icon { background: var(--warning-container); color: var(--warning); }
.stat-card--all .stat-card__icon { background: var(--secondary-container); color: var(--on-secondary-container); }

/* ---------- Table ---------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 16px; border-bottom: 1px solid var(--outline-variant); }
.toolbar .checkbox-inline { font-size: 15px; }
.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 260px;
  max-width: 480px;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--shape-full);
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
}
.search-field input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--on-surface); outline: none; min-width: 0; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--on-surface-variant);
  padding: 12px 16px;
  white-space: nowrap;
  background: var(--surface-container-low);
}
.data-table td { padding: 14px 16px; border-top: 1px solid var(--outline-variant); vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: background 120ms; }
.data-table tbody tr:hover { background: var(--surface-container-low); }
.data-table--static tbody tr { cursor: default; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table td.muted { white-space: nowrap; }
.strong-link { font-weight: 600; }
.cell-title { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--on-surface-variant); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--outline-variant); }

.empty-state { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 64px 24px; }
.empty-state__icon {
  font-size: 40px;
  width: 80px; height: 80px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-container);
  color: var(--primary);
  margin-bottom: 8px;
}

.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 300px)); justify-content: center; gap: 12px; width: min(960px, 100%); margin-top: 24px; text-align: left; }
.store-grid form { display: contents; }
.store-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px; border: 1px solid var(--outline-variant); border-radius: var(--shape-lg);
  background: var(--surface-container-lowest); color: var(--on-surface); font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.store-card:hover { border-color: var(--primary); box-shadow: var(--elev-2); transform: translateY(-1px); }
.store-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.store-card__initial {
  display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 14px;
  background: var(--primary-container); color: var(--on-primary-container); font-weight: 700; font-size: 26px;
}
.store-card__logo {
  display: grid; place-items: center; flex: none; width: 64px; height: 64px; padding: 5px; overflow: hidden;
  border: 1px solid var(--outline-variant); border-radius: 14px; background: #fff;
}
.store-card__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.store-card__logo--dark { border-color: transparent; background: #1f2937; }
.store-card__text { display: grid; gap: 2px; min-width: 0; }
.store-card__go { margin-left: auto; flex: none; color: var(--on-surface-variant); transition: transform 0.15s var(--ease), color 0.15s var(--ease); }
.store-card:hover .store-card__go { color: var(--primary); transform: translateX(3px); }
.store-card__text strong { font-weight: 600; }
.store-card__text small { color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Detail ---------- */

.stepper { display: flex; list-style: none; padding: 0; margin: 0 0 20px; gap: 0; }
.stepper__step { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--on-surface-variant); font-weight: 500; }
.stepper__step:not(:last-child)::after { content: ""; flex: 1; height: 2px; margin: 0 12px; background: var(--outline-variant); border-radius: 2px; }
.stepper__step--done:not(:last-child)::after { background: var(--primary); }
.stepper__dot {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--outline-variant);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.stepper__dot .msr { font-size: 18px; }
.stepper__step--done .stepper__dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.stepper__step--done { color: var(--on-surface); }
.stepper__step--current .stepper__dot { border-color: var(--primary); color: var(--primary); background: var(--primary-container); }
.stepper__step--current { color: var(--primary); }
.stepper__step--error .stepper__dot { background: var(--error); border-color: var(--error); color: var(--on-error); }
.stepper__step--error { color: var(--error); }
.stepper__label { white-space: nowrap; }
.stepper:not(.stepper--stacked) .stepper__step:last-child { flex: 0 0 auto; }

.stepper--compact { justify-content: center; }
.stepper--compact .stepper__step { flex: 0 0 auto; }
.stepper--compact .stepper__step:not(:last-child)::after { flex: 0 0 40px; }
.customer .stepper__step--done .stepper__dot { background: var(--accent); border-color: var(--accent); }
.customer .stepper__step--done:not(:last-child)::after { background: var(--accent); }
.customer .stepper__step--current .stepper__dot { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, white); }
.customer .stepper__step--current { color: var(--accent); }
.customer-card .stepper { margin: 0; }
.customer-card .stepper__label { font-size: 12px; }
.stepper--stacked .stepper__step { position: relative; flex-direction: column; gap: 6px; text-align: center; }
.stepper--stacked .stepper__step:not(:last-child)::after { position: absolute; top: 15px; left: calc(50% + 22px); right: calc(-50% + 22px); margin: 0; }
.stepper--stacked .stepper__label { display: block; white-space: normal; }
@media (max-width: 480px) {
  .customer-card .stepper--stacked { margin: 0 -12px; }
  .customer-card .stepper--stacked .stepper__label { font-size: 11px; }
}
.stepper:not(.stepper--compact) .stepper__step--current { color: var(--on-surface-variant); }
.stepper:not(.stepper--compact) .stepper__step--current .stepper__dot { border-color: var(--outline-variant); color: var(--on-surface-variant); background: var(--surface); }
.stepper:not(.stepper--compact) .stepper__step--done:has(+ .stepper__step--current)::after {
  background: linear-gradient(90deg, var(--outline-variant) 0%, var(--accent) 50%, var(--outline-variant) 100%);
  background-size: 200% 100%;
  animation: stepper-progress 1.6s linear infinite;
}
@keyframes stepper-progress { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .stepper:not(.stepper--compact) .stepper__step--done:has(+ .stepper__step--current)::after { animation: none; }
}

.item-list { list-style: none; margin: 0; padding: 0; display: grid; }
.item-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; padding: 14px 0; border-top: 1px solid var(--outline-variant); align-items: start; }
.item-row:first-child { border-top: 0; padding-top: 0; }
.item-row__thumb { width: 56px; height: 56px; border-radius: var(--shape-sm); overflow: hidden; display: block; background: var(--surface-container); }
.item-row__thumb { position: relative; }
.item-row__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.item-row__thumb--empty { display: grid; place-items: center; color: var(--outline); }
.disclosure.item-details { margin-top: 8px; border-top: 0; padding-top: 0; }
.file-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-photo { display: grid; gap: 4px; margin-top: 8px; justify-items: start; }
.item-photo__thumb { display: block; width: 80px; height: 80px; border-radius: var(--shape-sm); overflow: hidden; background: var(--surface-container); }
.item-photo__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-photo__stack { position: relative; padding: 0; border: 0; cursor: pointer; }
.item-photo__count { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / 0.45); color: #fff; font-size: 22px; font-weight: 500; transition: background 120ms; }
.item-photo__stack:hover .item-photo__count { background: rgb(0 0 0 / 0.6); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.photo-grid a { display: block; aspect-ratio: 1; border-radius: var(--shape-sm); overflow: hidden; background: var(--surface-container); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-row__price { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.item-row__price-note { display: block; font-weight: 400; }

.totals { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--outline-variant); }
.totals > div { display: flex; justify-content: space-between; }
.totals strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.totals__note { font-size: 14px; font-variant-numeric: tabular-nums; }

.details { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; }
.details dt { color: var(--on-surface-variant); }
.details dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.coupon {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 6px 10px 16px;
  border: 1px dashed var(--primary);
  border-radius: var(--shape-sm);
  background: var(--surface);
}
.coupon code { flex: 1; font-size: 15px; font-weight: 600; color: var(--primary); letter-spacing: 0.04em; overflow-wrap: anywhere; min-width: 0; }
.coupon .icon-button { flex-shrink: 0; }
.coupon--compact { align-items: center; margin-bottom: 12px; padding: 2px 2px 2px 12px; border: 1px solid var(--outline-variant); }
.coupon--compact code { font-size: 14px; color: var(--on-surface); }
.coupon--compact .icon-button { width: 32px; height: 32px; }
.coupon-validity { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--on-surface); }
.coupon-validity--expired { color: var(--error); }

/* ---------- Forms (M3 outlined text field) ---------- */

.text-field { position: relative; display: grid; min-width: 0; }
.text-field input,
.text-field textarea,
.text-field select {
  width: 100%;
  min-height: 56px;
  padding: 16px;
  border: 1px solid var(--outline);
  border-radius: var(--shape-xs);
  background-color: var(--surface);
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  color: var(--on-surface);
  outline: none;
  transition: border-color 150ms;
  appearance: none;
}
.text-field textarea { resize: vertical; min-height: 112px; }
.text-field select {
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23414941'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.text-field input:hover, .text-field textarea:hover, .text-field select:hover { border-color: var(--on-surface); }
.text-field input:focus, .text-field textarea:focus, .text-field select:focus { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.text-field label {
  position: absolute;
  left: 12px;
  top: 16px;
  padding: 0 4px;
  font-size: 16px;
  line-height: 24px;
  color: var(--on-surface-variant);
  background: var(--surface);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 150ms var(--ease), color 150ms;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-field input:focus + label,
.text-field input:not(:placeholder-shown) + label,
.text-field textarea:focus + label,
.text-field textarea:not(:placeholder-shown) + label,
.text-field select + label,
.text-field input[type="number"] + label {
  transform: translateY(-24px) scale(0.75);
}
.text-field input:focus + label, .text-field textarea:focus + label, .text-field select:focus + label { color: var(--primary); }
.text-field__supporting { padding: 8px 0px 0; font-size: 12px; line-height: 16px; color: var(--on-surface-variant); }
.text-field.has-error input, .text-field.has-error textarea { border-color: var(--error); }
.text-field.has-error label, .text-field.has-error .text-field__supporting { color: var(--error); }
.text-field__trailing { position: absolute; right: 8px; top: 8px; }
.text-field.is-loading::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 18px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--outline-variant);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
.text-field.is-filling { opacity: 0.55; pointer-events: none; transition: opacity 150ms var(--ease); }
.text-field--with-actions input { padding-right: 136px; }
.text-field input.is-secret { -webkit-text-security: disc; }
.text-field--with-actions .text-field__trailing { display: flex; }
.text-field--narrow { max-width: 160px; }
.card .text-field label, .customer-card .text-field label { background: var(--surface); }

.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; align-items: start; }

.checkbox-inline { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--on-surface-variant); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row__text { display: grid; gap: 2px; min-width: 0; }
.switch-row.is-disabled { opacity: 0.55; cursor: default; }
.manual-label { display: none; }
.dialog__surface:has(input[type=checkbox][name=shipping_payer]:checked) .manual-label { display: grid; }
.resolution-only { display: none; }
.dialog:has(#resolution_coupon:checked) .resolution-only--coupon { display: block; }
.switch { position: relative; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 52px; height: 32px; margin: 0; cursor: pointer; z-index: 1; }
.switch__track {
  display: flex;
  align-items: center;
  width: 52px;
  height: 32px;
  padding: 0 6px;
  border: 2px solid var(--outline);
  border-radius: var(--shape-full);
  background: var(--surface-container-highest);
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}
.switch__thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--outline); transition: transform 200ms var(--ease), width 200ms var(--ease), height 200ms var(--ease), background 200ms; }
.switch input:checked ~ .switch__track { background: var(--primary); border-color: var(--primary); }
.switch input:checked ~ .switch__track .switch__thumb { transform: translateX(18px); width: 24px; height: 24px; background: var(--on-primary); margin-left: -4px; }
.switch input:focus-visible ~ .switch__track { outline: 3px solid var(--primary-container); outline-offset: 2px; }

.color-field { display: flex; align-items: center; gap: 16px; }
.color-field input[type="color"] {
  width: 56px; height: 56px;
  padding: 0;
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-md);
  background: none;
  cursor: pointer;
}
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: var(--shape-sm); }

.upload { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.upload__preview {
  width: 96px; height: 72px;
  display: grid;
  place-items: center;
  border-radius: var(--shape-sm);
  border: 1px dashed var(--outline);
  background: var(--surface-container-low);
  color: var(--outline);
  overflow: hidden;
  flex-shrink: 0;
}
.upload__preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.upload__preview--dark { background: #1f2937; border-style: solid; }
.upload__body { display: grid; gap: 8px; justify-items: start; min-width: 0; }

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--shape-md);
}
.banner ul { margin: 4px 0 0; padding-left: 18px; }
.banner__details > summary { cursor: pointer; font-weight: 500; }
.dialog .banner { margin-bottom: 0; }
.banner--error { background: var(--error-container); color: var(--on-error-container); }
.banner--warning { background: var(--banner-warning-bg); color: var(--banner-warning-fg); }
.banner--info { background: var(--tertiary-container); color: var(--on-tertiary-container); }

/* Tabs */
.tabs-select { display: none; }
.tabs { display: flex; border-bottom: 1px solid var(--outline-variant); margin-bottom: 16px; overflow-x: auto; }
.tabs__tab {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 112px;
  padding: 10px 16px 12px;
  border: 0;
  border-radius: var(--shape-sm) var(--shape-sm) 0 0;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--on-surface-variant);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.tabs__tab:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--primary); text-decoration: none; }
.tabs__tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.tabs__tab.is-active { color: var(--primary); }
.tabs__tab.is-active::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.tabs__tab.is-active .msr { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.tab-panel { display: grid; gap: 16px; }
.panel-intro { margin-bottom: 4px; }

/* Email preview */
.email-templates__previews { position: sticky; top: calc(var(--topbar-h) + 16px); min-width: 0; }
.email-preview { gap: 0; padding: 0; overflow: hidden; }
.email-preview__bar { display: flex; align-items: center; gap: 8px; padding: 12px 20px; font-weight: 500; color: var(--on-surface-variant); border-bottom: 1px solid var(--outline-variant); }
.email-preview__bar .msr { font-size: 20px; }
.email-preview__meta { display: grid; gap: 2px; padding: 12px 20px; border-bottom: 1px solid var(--outline-variant); }
.email-preview__canvas {
  --surface: #ffffff; --surface-container: #f0f5ef; --surface-container-low: #f6faf5;
  --on-surface: #181d18; --on-surface-variant: #414941; --outline: #717970; --outline-variant: #c1c9be;
  padding: 24px 16px; background: var(--surface-container); color: var(--on-surface); color-scheme: light;
}
.email-preview__mail {
  max-width: 440px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--shape-lg);
  overflow: hidden;
  border-top: 6px solid var(--mail-accent);
  box-shadow: var(--elev-1);
}
.email-preview__logo { text-align: center; padding: 20px 24px 0; }
.email-preview__logo img { max-height: 40px; }
.email-preview__image { display: block; width: calc(100% - 48px); margin: 20px 24px 0; border-radius: var(--shape-md); }
.email-preview__mail h3 { font-size: 20px; line-height: 28px; font-weight: 500; padding: 20px 24px 8px; margin: 0; }
.email-preview__body { padding: 0 24px 24px; color: var(--on-surface-variant); line-height: 1.6; }
.email-preview__body p { margin: 0 0 12px; }
.email-preview__action { text-align: center; padding: 0 24px 24px; }
.email-preview__action span { display: inline-block; padding: 10px 22px; border-radius: 999px; background: var(--mail-accent); color: #fff; font-size: 14px; font-weight: 500; }
.email-preview__footer { padding: 12px 24px; background: var(--surface-container-low); font-size: 12px; color: var(--outline); }

/* Snackbar */
.snackbar-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(560px, calc(100vw - 32px)); }
.snackbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 4px 4px 4px 16px;
  border-radius: var(--shape-xs);
  background: #2d322c;
  color: #eef2ea;
  box-shadow: var(--elev-3);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.snackbar.is-visible { opacity: 1; transform: none; }
.snackbar > .msr { font-size: 20px; color: #9cd89f; }
.snackbar--error > .msr { color: #ffb4ab; }
.snackbar__text { flex: 1; }
.snackbar .icon-button { color: #c1c9be; }

/* ---------- Auth ---------- */

.auth {
  min-height: 100vh;
  min-height: 100dvh; /* iOS: 100vh ignora a barra do navegador e empurra o conteudo para baixo */
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  background: var(--surface);
}
.auth-side {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 32px;
  padding: 64px clamp(32px, 7vw, 96px);
  background: var(--auth-side-bg);
}
.auth-side__title { max-width: 20ch; margin: 0; font-size: 36px; line-height: 44px; font-weight: 500; color: var(--brand-ink); }
.auth-side__list { display: grid; gap: 16px; list-style: none; margin: 0; padding: 0; }
.auth-side__list li { display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 24px; color: var(--on-surface-variant); }
.auth-side__list .msr { color: var(--primary); }
.auth-main { display: grid; place-items: center; padding: 24px 16px calc(var(--footer-h) + env(safe-area-inset-bottom)); } /* reserva o rodape fixo para centralizar na area livre */
.auth-card {
  width: min(380px, 100%);
  display: grid;
  gap: 28px;
}
.auth-card__brand { display: none; justify-items: center; }
.auth-card__head { display: grid; gap: 4px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth-card__brand { display: grid; }
  .auth-card__head { text-align: center; }
}

/* ---------- Página pública ---------- */

.customer {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, white) 0, var(--surface) 320px);
}
.customer .btn--filled { --btn-bg: var(--accent); }
.customer .text-field input:focus, .customer .text-field textarea:focus, .customer .text-field select:focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.customer .text-field input:focus + label, .customer .text-field select:focus + label { color: var(--accent); }
.customer input[type="checkbox"], .customer input[type="radio"] { accent-color: var(--accent); }
.customer__main { flex: 1; display: grid; justify-items: center; align-content: start; padding: 40px 16px; }
.customer__main > turbo-frame { display: contents; }

.customer-card {
  width: min(480px, 100%);
  display: grid;
  gap: 20px;
  padding: 32px;
  border-radius: var(--shape-xl);
  background: var(--surface);
  box-shadow: var(--elev-1);
  border: 1px solid var(--outline-variant);
}
.customer-card--wide { width: min(640px, 100%); }
.customer-card--compact { gap: 14px; padding: 28px; }
.customer-card--compact .stack--tight { gap: 12px; }
.customer-card--compact .final-actions { margin-top: 10px; }
.customer-card .banner { margin-bottom: 0; }
.customer-card--compact .coupon--compact { margin-bottom: 4px; }
@media (max-width: 520px) { .customer__main { padding: 16px; } .customer-card--compact { padding: 20px; } }
.customer-card--center { justify-items: center; text-align: center; }
.customer-header { display: grid; justify-items: center; gap: 12px; }
.customer-header__logo { max-height: 56px; max-width: 220px; object-fit: contain; }
.customer-header__logo-wrap--dark { padding: 12px 20px; border-radius: var(--shape-md); background: #1f2937; }
.customer-header__mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--shape-lg); background: var(--accent); color: #fff; }
.existing-requests { display: grid; gap: 8px; width: 100%; text-align: left; }
.existing-request { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--outline-variant); border-radius: var(--shape-md); }
.existing-request > div { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.existing-request > .msr { color: var(--accent); }
.info-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0; }
.info-tiles > div { display: grid; gap: 4px; padding: 12px 16px; border-radius: var(--shape-md); background: var(--surface-container-low); }
.info-tiles dd { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.item-list--cards { gap: 8px; }
.item-row--simple, .item-row--simple:first-child { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--outline-variant); border-radius: var(--shape-md); background: color-mix(in srgb, var(--accent) 4%, white); }
.item-row--simple .assist-chip .msr { font-size: 16px; }
.customer .card__title .msr, .customer .assist-chip .msr { color: var(--accent); }
.customer .card--primary { background: color-mix(in srgb, var(--accent) 5%, white); border-color: color-mix(in srgb, var(--accent) 30%, white); }
@media (max-width: 420px) { .item-row--simple, .item-row--simple:first-child { grid-template-columns: minmax(0, 1fr); justify-items: start; } }
.protocol { display: grid; gap: 6px; justify-items: center; width: 100%; }
.protocol .coupon { width: min(280px, 100%); align-items: center; }
.protocol code { text-align: center; font-size: 22px; letter-spacing: 0.12em; }

.pick-item {
  margin: 0;
  padding: 0;
  border: 1px solid var(--outline-variant);
  border-radius: var(--shape-md);
  transition: border-color 150ms, background 150ms;
  min-width: 0;
}
.pick-item.is-selected { --pick-bg: var(--surface); border-color: var(--accent); background: var(--pick-bg); }
.pick-item.is-selected .text-field label { background: var(--pick-bg); }
.pick-item__head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.location-list { display: grid; gap: 16px; margin-top: 12px; }
.location-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px 32px; align-items: start; padding: 18px 20px; border: 1px solid var(--outline-variant); border-radius: var(--shape-md); }
.location-row__info { display: grid; gap: 6px; justify-items: start; }
.location-row__badge { color: var(--on-primary-container); }
.location-row__badge .msr { color: inherit; }
.location-row__switches { display: grid; gap: 14px; }
.location-row__hours { display: none; grid-column: 1 / -1; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.location-row:has(.location-returns input:checked) .location-row__hours { display: grid; }
.store-list.stack { display: none; }
fieldset:has(input[name="return_mode"][value="loja"]:checked) .store-list.stack { display: grid; }
.store-info { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--outline-variant); border-radius: var(--shape-md); text-align: left; }
.store-info__icon { color: var(--accent); }
.store-info__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.blocked-items { width: 100%; text-align: left; }
.blocked-items .pick-item__head { cursor: default; }
.pick-item__head input { position: absolute; opacity: 0; pointer-events: none; }
.pick-item__check {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 2px solid var(--outline);
  color: transparent;
  flex-shrink: 0;
  transition: background 150ms, border-color 150ms;
}
.pick-item__check .msr { font-size: 18px; }
.pick-item__head input:checked + .pick-item__check { background: var(--accent); border-color: var(--accent); color: #fff; }
.pick-item__head input:focus-visible + .pick-item__check { outline: 3px solid color-mix(in srgb, var(--accent) 30%, white); outline-offset: 2px; }
.pick-item__info { display: grid; gap: 2px; min-width: 0; }
.pick-item__options { display: grid; gap: 16px; padding: 4px 16px 16px 54px; }

.pick-item .field-row { grid-template-columns: minmax(0, 1fr) 132px; }
.pick-item .field-row > :only-child { grid-column: 1 / -1; }
.photo-drop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.photo-list:empty { display: none; }
.photo-list li { position: relative; width: 72px; height: 72px; }
.photo-list img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--shape-sm); display: block; background: var(--surface-container); }
.photo-list__remove { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--on-surface); color: var(--surface); cursor: pointer; }
.photo-list__remove .msr { font-size: 16px; }
.file-preview { position: relative; width: 72px; height: 72px; }
.file-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--shape-sm); display: block; background: var(--surface-container); }
.file-preview--doc { display: grid; place-items: center; border-radius: var(--shape-sm); background: var(--surface-container); color: var(--primary); }
.file-preview--doc .msr { font-size: 32px; }

.success-mark {
  display: grid;
  place-items: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, white);
  color: var(--accent);
}
.success-mark .msr { font-size: 40px; }
.success-mark--muted { background: var(--surface-container-high); color: var(--on-surface-variant); }
.success-mark--warning { background: var(--warning-container); color: var(--warning); }
.choice-list { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--outline-variant); border-radius: var(--shape-md); cursor: pointer; }
.choice:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); border-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.choice input { accent-color: var(--accent); margin: 0; }
.choice.is-disabled { opacity: 0.5; cursor: default; }
.choice.is-disabled:hover { background: none; border-color: var(--outline-variant); }
.choice--static { cursor: default; border-color: var(--accent); }
.choice--static .msr { color: var(--accent); }
.choice-list--row { grid-template-columns: repeat(3, 1fr); }
.approve-item { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--outline-variant); border-radius: var(--shape-md); }
.approve-item__coupon { margin-top: 8px; }
.restock-field { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--outline-variant); }
.restock-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.restock-check input { accent-color: var(--accent); margin: 0; }
.dialog__surface:has(input[name="resolution"][value="repair"]:checked) .restock-field { display: none; }
.coupon-combine { display: none; }
.dialog__surface:has(input[name="resolution"][value="coupon"]:checked) .coupon-combine { display: flex; }
@media (max-width: 600px) { .choice-list--row { grid-template-columns: 1fr; } }
:where(.customer-card fieldset) { border: 0; padding: 0; margin: 0; min-width: 0; }
:where(.customer-card legend) { padding: 0; margin-bottom: 8px; }
.reason-panel { padding-top: 4px; }
.pick-item.is-disabled { opacity: 0.7; }
.pick-item.is-disabled .pick-item__head { cursor: not-allowed; }
.item-blocked { display: inline-flex; align-items: center; gap: 4px; color: var(--error); }
.conditions { align-items: flex-start; }
.customer-header__mark-img { width: 48px; height: 48px; }
.customer__powered { display: inline-flex; align-items: center; gap: 4px; }
.customer__powered img { vertical-align: middle; }
.customer__footer { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 24px; font-size: 12px; color: var(--outline); }
.customer__support { display: grid; gap: 6px; justify-items: center; font-size: 13px; color: var(--on-surface-variant); }
.customer__support .title-small { display: inline-flex; align-items: center; gap: 6px; color: var(--on-surface); }
.customer__support-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.customer__support-links a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 500; }
.customer__support .msr { font-size: 16px; }

/* ---------- Formulários da configuração ---------- */

.card__title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card h3.title-small { margin: 8px 0 0; color: var(--on-surface-variant); }
.section-title { margin: 32px 0 12px; }
.form-actions--start { justify-content: flex-start; flex-wrap: wrap; }
.grid + .form-actions { margin-top: 24px; }
.save-inline { margin-top: 24px; }
.text-field.is-readonly input { background: var(--surface-container-low); color: var(--on-surface-variant); }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.check-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.check-chip { position: relative; cursor: pointer; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip > span {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 6px 14px; line-height: 1.3;
  border: 1px solid var(--outline); border-radius: var(--shape-sm); font-size: 13px; font-weight: 500;
}
.check-chip input:checked + span { background: var(--secondary-container); border-color: transparent; color: var(--on-secondary-container); }
.check-chip input:checked + span::before { content: "check"; font-family: "Material Symbols Rounded"; font-size: 18px; }
.check-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.check-chip.is-locked { pointer-events: none; }
.check-chip.is-locked input:checked + span { opacity: 0.85; }
.question-list { display: grid; gap: 8px; }
.question-list:not(:has(.question-row)) { display: none; }
.question-row { display: flex; align-items: center; gap: 8px; }
.question-row .text-field { flex: 1; }
.pause-row { padding: 16px; border: 1px solid var(--outline-variant); border-radius: var(--shape-md); }
.reason-card__head { display: grid; gap: 12px; }
.reason-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.reason-card .chip-row { gap: 24px; }
.whatsapp-preview { gap: 12px; grid-template-columns: minmax(0, 1fr); }
.whatsapp-preview__bubble {
  justify-self: start; max-width: 100%; padding: 10px 12px; border-radius: 12px 12px 12px 4px;
  background: #dcf8c6; color: #111; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45;
}
.text-warning { color: var(--warning); vertical-align: middle; }

/* ---------- Detalhe da solicitação ---------- */
.disclosure { border-top: 1px solid var(--outline-variant); padding-top: 12px; }
.disclosure > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: "expand_more"; font-family: "Material Symbols Rounded"; font-size: 20px; }
.disclosure[open] > summary::after { content: "expand_less"; }
.disclosure[open] > :not(summary) { margin-top: 12px; }
.customer-card .disclosure > summary { display: flex; justify-content: space-between; width: 100%; }
.last-update { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--shape-md); background: color-mix(in srgb, var(--accent) 4%, white); }
.last-update > .msr { color: var(--accent); }
.customer-card .assist-chip--small strong { color: var(--on-surface); }

.simulation-result { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--outline-variant); border-radius: var(--shape-md); background: var(--surface-container-low); animation: result-in 250ms var(--ease); }
.simulation-result > .msr { font-size: 28px; color: var(--primary); }
.simulation-result--error { border-color: var(--error); background: var(--surface); color: var(--error); }
.simulation-result--error > .msr { color: var(--error); }
form[aria-busy="true"] #correios-simulation { display: none; }
@keyframes result-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .simulation-result { animation: none; } }
.cost-estimate { position: relative; display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 12px 16px; border-radius: var(--shape-md); background: var(--surface-container-low); border: 1px solid var(--outline-variant); }
.cost-estimate > .msr { font-size: 28px; color: var(--on-surface-variant); }
.cost-estimate__badges { position: absolute; top: 8px; right: 12px; display: flex; gap: 6px; }
.cost-estimate__carrier { display: flex; align-items: center; gap: 6px; }
.cost-estimate__carrier .carrier-logo { margin-left: 0; }
@media (max-width: 520px) {
  .cost-estimate { flex-wrap: wrap; }
  .cost-estimate__badges { position: static; flex-wrap: wrap; width: 100%; }
  .cost-estimate > div:not(.cost-estimate__badges) { flex: 1; min-width: 0; }
}
.tabs-toolbar { display: flex; justify-content: flex-end; margin: -8px 0 8px; }
.audit-frame { display: block; max-height: 55vh; overflow-y: auto; }
.event-list { list-style: none; margin: 0; padding: 0 8px 0 0; display: grid; gap: 12px; max-height: 320px; overflow-y: auto; }
.event-list li { display: grid; gap: 2px; padding-left: 14px; border-left: 3px solid var(--primary-container); }
.customer .event-list li { border-left-color: color-mix(in srgb, var(--accent) 35%, white); }
.event-list li.is-error { border-left-color: var(--error); }
.event-list li .msr { vertical-align: middle; }
.answers { display: grid; gap: 2px; margin: 8px 0 0; font-size: 13px; }
.answers dt { color: var(--on-surface-variant); }
.answers dd { margin: 0 0 6px; overflow-wrap: anywhere; white-space: pre-line; }
.refund-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.refund-item { display: grid; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--outline-variant); }
.refund-item:last-child { border-bottom: 0; padding-bottom: 0; }
.refund-item__head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.refund-item__head .status-chip { margin-left: 6px; }
.refund-item__head .body-small { margin-top: 6px; }
.carrier-block { display: grid; gap: 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
.carrier-logo { height: 28px; width: auto; margin-left: 8px; padding: 4px 10px; background: #fff; border: 1px solid var(--outline-variant); border-radius: var(--shape-sm); vertical-align: middle; }
.carrier-logo--small { height: 22px; padding: 2px 8px; margin-left: 6px; }
.refund-shipping { max-width: 560px; padding: 12px 16px; border: 1px solid var(--outline); border-radius: var(--shape-md); background: var(--surface-container-low); }
.refund-shipping .switch-row { gap: 24px; }
.refund-shipping .body-small { color: var(--on-surface); }
.refund-item__form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.request-refund { margin-bottom: 16px; }
.refund-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.refund-way { display: grid; align-content: start; gap: 10px; padding: 16px; border: 1px solid var(--outline-variant); border-radius: var(--shape-md); }
.refund-way .title-small { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--primary); }
.file-field { display: grid; gap: 4px; justify-items: start; }
.reject-menu, .approve-menu, .receive-menu { position: relative; }
.reject-menu > summary, .approve-menu > summary, .receive-menu > summary { list-style: none; }
.reject-menu > summary::-webkit-details-marker, .approve-menu > summary::-webkit-details-marker, .receive-menu > summary::-webkit-details-marker { display: none; }
.menu__surface--form { width: min(360px, 90vw); padding: 16px; background: var(--surface-container-lowest); }

/* ---------- Como usar ---------- */

.help-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.help-toc { position: sticky; top: calc(var(--topbar-h) + 16px); display: grid; gap: 4px; }
.help-toc a { padding: 6px 8px; border-radius: var(--shape-sm); color: var(--on-surface-variant); font-weight: 500; font-size: 14px; }
.help-toc a:hover { background: var(--surface-container); text-decoration: none; }
.help-content { display: grid; gap: 16px; }
.help-content section { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.help-content p { margin: 0; line-height: 1.6; }
.help-steps, .help-list { margin: 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.6; }
.help-steps li::marker { color: var(--primary); font-weight: 700; }
.stepper--help { margin: 4px 0 8px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .request-detail > .stack { display: contents; }
  .request-history { order: 1; }
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-toc { position: static; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--detail, .grid--editor, .grid--wide-first, .location-row { grid-template-columns: minmax(0, 1fr); }
  .location-row__hours { grid-template-columns: minmax(0, 1fr); }
  .email-templates__previews { position: static; }
}

@media (max-width: 720px) {
  .app-footer { display: none; }
  .support-bubble { right: 12px; bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); width: 44px; height: 44px; }
  .support-bubble__icon { width: 32px; height: 32px; }
  .support-bubble__tooltip { display: none; }
  :root { --rail-w: 0px; }
  .main { padding: 20px 16px 56px; }
  .top-app-bar .brand-lockup { gap: 8px; }
  .top-app-bar .brand-lockup__mark { width: 32px; height: 32px; }
  .top-app-bar .brand-lockup__name { font-size: 17px; }
  .top-app-bar .brand-lockup__by { font-size: 10px; }
  .top-app-bar { gap: 8px; padding: 0 12px; }
  .top-app-bar .top-app-bar__brand { display: inline-flex; flex-shrink: 0; white-space: nowrap; }
  .top-app-bar .font-size { padding: 0 2px; gap: 0; }
  .top-app-bar .font-size__button { width: 30px; height: 32px; font-size: 13px; }
  .top-app-bar .font-size__value { min-width: 38px; font-size: 12px; }
  .top-app-bar .theme-toggle { width: 32px; }
  .app { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .bottom-nav {
    position: fixed; inset: auto 0 0 0; z-index: 15;
    display: flex; justify-content: space-evenly;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    padding: 0 4px env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--outline-variant);
  }
  .bottom-nav__item {
    display: flex; flex: 0 1 auto; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-width: 0; padding: 0; border: 0; background: none; font: inherit; font-size: 11px; font-weight: 500; line-height: 1;
    color: var(--on-surface-variant); cursor: pointer;
  }
  .bottom-nav__item:hover { text-decoration: none; }
  .bottom-nav__item .msr { font-size: 24px; }
  .bottom-nav__item.is-active { color: var(--on-surface); }
  .bottom-nav__item.is-active .msr { color: var(--primary-vivid); font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
  .breadcrumb { display: none; }
  .sidebar { width: min(var(--sidebar-w), 86vw); padding-bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-100%); visibility: hidden; transition: transform 200ms var(--ease), visibility 200ms; }
  .drawer-open { overflow: hidden; }
  .drawer-open .sidebar { transform: none; visibility: visible; box-shadow: var(--elev-3); }
  .drawer-open .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgb(24 29 24 / 0.45); }
  .stats { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 4px; scrollbar-width: none; }
  .stats::-webkit-scrollbar { display: none; }
  .stat-card { display: inline-flex; flex: none; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--shape-full); white-space: nowrap; }
  .stat-card__icon { display: none; }
  .stat-card__label { order: 1; font-size: 14px; color: var(--on-surface); }
  .stat-card__value { order: 2; font-size: 14px; line-height: 20px; font-weight: 600; }
  .data-table th:nth-child(3), .data-table td:nth-child(3),
  .data-table th:nth-child(4), .data-table td:nth-child(4),
  .data-table th:nth-child(6), .data-table td:nth-child(6) { display: none; }
  .data-table td, .data-table th { padding-left: 12px; padding-right: 12px; }
  .cell-sub { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .stepper__label { display: none; }
  .stepper__step--current .stepper__label { display: inline; }
  .stepper:not(.stepper--stacked) { width: 100%; }
  .stepper:not(.stepper--stacked) .stepper__step { position: relative; flex: 1; flex-direction: column; gap: 6px; text-align: center; }
  .stepper:not(.stepper--stacked) .stepper__step:last-child { flex: 1; }
  .stepper:not(.stepper--stacked) .stepper__step:not(:last-child)::after { position: absolute; top: 15px; left: calc(50% + 22px); right: calc(-50% + 22px); margin: 0; }
  .stepper:not(.stepper--stacked) .stepper__step { min-width: 0; }
  .stepper:not(.stepper--stacked) .stepper__label { display: block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; hyphens: auto; text-align: center; font-size: 10px; line-height: 12px; }
  .item-row:has(.item-row__price-note) { grid-template-columns: 56px minmax(0, 1fr); }
  .item-row:has(.item-row__price-note) .item-row__price { grid-column: 2; text-align: left; }
  .item-row:has(.item-row__price-note) .item-row__price-note { white-space: normal; }
  .item-row .kind-chip, .item-row .assist-chip { height: auto; min-height: 24px; max-width: 100%; padding-top: 4px; padding-bottom: 4px; line-height: 1.3; white-space: normal; }
  .page-header__actions { position: relative; }
  .reject-menu, .approve-menu, .receive-menu { position: static; }
  .page-header__actions .menu__surface--form { left: 0; right: auto; width: calc(100vw - 32px); }
  .page-header__lead { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-header__lead > .icon-button { display: inline-flex; align-items: center; gap: 4px; width: auto; height: 32px; padding: 0 12px 0 6px; font-size: 14px; font-weight: 500; }
  .page-header__lead > .icon-button .msr { font-size: 20px; }
  .back-label { display: inline; }
  .page-header h1.request-title { flex-direction: column-reverse; flex-wrap: nowrap; align-items: flex-start; gap: 4px; }
  .meta-sep { display: none; }
  .meta-received { display: block; }
  .customer-card { padding: 24px 20px; }
  .pick-item__options { padding-left: 16px; }
  .pick-item .field-row { grid-template-columns: minmax(0, 1fr); }
  .text-field--narrow { max-width: none; }
  .snackbar-host { bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); }
  .sticky-actions { bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); }
}

@media (max-width: 900px) {
  .tabs--sections, .tabs--kinds { display: none; }
  .tabs-select { display: grid; margin-bottom: 16px; }

  .data-table--cards thead { display: none; }
  .data-table--cards, .data-table--cards tbody { display: block; }
  .data-table--cards tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 16px;
    border-top: 1px solid var(--outline-variant);
  }
  .data-table--cards td, .data-table--cards td:nth-child(3), .data-table--cards td:nth-child(4), .data-table--cards td:nth-child(6) { display: block; grid-column: 1 / -1; padding: 0; border: 0; }
  .data-table--cards td:first-child { grid-column: 1; }
  .data-table--cards td.cell-badge { grid-column: 2; grid-row: 1; }
  .data-table--cards td.num { text-align: left; white-space: normal; }
  .data-table--cards td.cell-actions { display: none; }
  .data-table--cards td[data-label]::before { content: attr(data-label) ": "; font-size: 12px; color: var(--on-surface-variant); }
  .data-table--cards .cell-sub { max-width: none; }
  .data-table--cards .assist-chip { max-width: 100%; height: auto; min-height: 32px; overflow-wrap: anywhere; }
  .data-table--cards .row-actions { justify-content: flex-start; }
}
