/* ============================================================
   CALENDÁRIO · Célula do dia (BRAND seção 14 — Calendário)
   ============================================================ */
.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-3);
  background: var(--bg-surface);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-apple);
  min-height: var(--cell-min-h);
  overflow: hidden;
}

.cell:hover { background: var(--bg-hover); }

.cell--out { opacity: 0.4; }
.cell--out:hover { background: var(--bg-surface); cursor: default; }

.cell--today {
  outline: 1.5px solid var(--goold-red);
  outline-offset: -1.5px;
  z-index: 1;
}

.cell--today .cell__day { color: var(--goold-red); }

.cell__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 18px;
}

.cell__day {
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: 1;
}

.cell__indicators {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.cell__indicator--ok { color: var(--status-success); }
.cell__indicator--alert { color: var(--status-danger); }

.cell__indicators [data-lucide],
.cell__indicators svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.cell__actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.cell__more {
  font-size: 11px;
  color: var(--text-tertiary);
  padding-left: 4px;
  font-weight: var(--fw-medium);
}

/* --- Ação dentro da célula --- */
.cell-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-apple);
}

.cell-action:hover { background: rgba(0, 0, 0, 0.03); }

.cell-action__head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cell-action__channel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.channel-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin: 4px;
}

.cell-action__tag {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  background: var(--tag-automacao-bg);
  color: var(--tag-automacao-text);
  font-size: 10px;
  font-weight: var(--fw-medium);
  border-radius: var(--radius-badge);
  line-height: 1;
  letter-spacing: 0;
}

.cell-action__title {
  font-size: var(--fz-small);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.cell-action__price {
  font-size: var(--fz-small);
  font-weight: var(--fw-semibold);
  color: var(--goold-red);
  line-height: 1.3;
}

/* ============================================================
   DRAWER · Detalhe de ação (BRAND seções 6 + 14)
   ============================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-drawer-in) var(--ease-apple);
  z-index: 60;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: var(--drawer-w);
  background: var(--bg-surface);
  border-left: 0.5px solid var(--hairline);
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%);
  transition: transform var(--dur-drawer-out) var(--ease-apple);
  z-index: 70;
  display: flex;
  flex-direction: column;
}

.drawer.is-open {
  transform: translateX(0);
  transition-duration: var(--dur-drawer-in);
}

@media (max-width: 480px) {
  .drawer {
    width: 100vw;
    height: 92vh;
    top: auto;
    bottom: 0;
    border-left: none;
    border-top-left-radius: var(--radius-modal);
    border-top-right-radius: var(--radius-modal);
    transform: translateY(100%);
  }
  .drawer.is-open { transform: translateY(0); }
}

/* --- Header --- */
.drawer__header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 0.5px solid var(--hairline);
  flex-shrink: 0;
}

.drawer__close {
  justify-self: start;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    color var(--dur-fast) var(--ease-apple);
}

.drawer__close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.drawer__close [data-lucide],
.drawer__close svg { width: 20px; height: 20px; }

.drawer__channel {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.drawer__channel .channel-icon { width: 32px; height: 32px; }
.drawer__channel .channel-icon svg { width: 32px; height: 32px; }

.channel-mark {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.status-pill {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  font-size: var(--fz-label);
  font-weight: var(--fw-medium);
  padding: 4px 10px;
  border-radius: var(--radius-badge);
  line-height: 1;
  white-space: nowrap;
}

.status-pill--aguardando {
  background: rgba(245, 158, 11, 0.14);
  color: #B45309;
}
.status-pill--executada {
  background: rgba(22, 163, 74, 0.12);
  color: var(--status-success);
}
.status-pill--cancelada {
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-danger);
}

/* --- Body --- */
.drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.drawer__intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer__date {
  font-size: var(--fz-h3);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: 1.3;
}

.drawer__title {
  margin: 0;
  font-size: 24px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight-h1);
  line-height: 1.2;
  color: var(--text-primary);
}

/* --- Price block --- */
.drawer__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.drawer__price-from {
  font-size: var(--fz-body);
  color: var(--text-secondary);
  text-decoration: line-through;
}

.drawer__price-to {
  font-size: var(--fz-h2);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight-h2);
  color: var(--goold-red);
}

.drawer__freight {
  margin-left: auto;
  font-size: var(--fz-small);
  color: var(--text-secondary);
}

/* --- Info rows --- */
.info-rows {
  display: flex;
  flex-direction: column;
  border-top: 0.5px solid var(--hairline);
  border-bottom: 0.5px solid var(--hairline);
}

.info-row {
  display: grid;
  grid-template-columns: 16px auto 1fr;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.info-row + .info-row { border-top: 0.5px solid var(--hairline); }

.info-row__icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  stroke-width: 1.75;
}

.info-row__label {
  font-size: var(--fz-body);
  color: var(--text-secondary);
}

.info-row__value {
  text-align: right;
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

/* --- Sections (Produtos, Observação) --- */
.drawer__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.drawer__section-title {
  margin: 0;
  font-size: var(--fz-label);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* --- Product list --- */
.product-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.product-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  font-size: var(--fz-body-lg);
  color: var(--text-primary);
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease-apple);
}

.product-item + .product-item { border-top: 0.5px solid var(--hairline); }

.product-item__check {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--hairline);
  border-radius: 6px;
  color: transparent;
  flex-shrink: 0;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    border-color var(--dur-fast) var(--ease-apple),
    color var(--dur-fast) var(--ease-apple);
}

.product-item__check [data-lucide],
.product-item__check svg {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

.product-item.is-done .product-item__check {
  background: var(--status-success);
  border-color: var(--status-success);
  color: #fff;
}

.product-item.is-done .product-item__name {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.product-item__name { flex: 1 1 auto; }

/* --- Observação (italic per BRAND seção 3) --- */
.drawer__note {
  margin: 0;
  font-style: italic;
  font-size: var(--fz-body-lg);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* --- Footer --- */
.drawer__footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 0.5px solid var(--hairline);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.drawer__footer .btn-secondary,
.drawer__footer .btn-primary {
  flex: 1 1 0;
  height: 44px;
  white-space: nowrap;
}

/* --- Secondary button (outline) --- */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-5);
  background: var(--bg-surface);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    transform var(--dur-instant) var(--ease-apple);
}

.btn-secondary:hover { background: var(--bg-hover); }
.btn-secondary:active { transform: scale(0.985); }
.btn-secondary [data-lucide],
.btn-secondary svg { width: 16px; height: 16px; }

/* ============================================================
   TOAST · Notificação flutuante
   ============================================================ */
.toast-stack {
  position: fixed;
  top: calc(var(--header-h) + var(--space-3));
  right: var(--space-5);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 280px;
  max-width: 360px;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-dropdown);
  cursor: pointer;
  pointer-events: auto;
  animation: toast-in var(--dur-fade) var(--ease-apple);
}

.toast__icon {
  color: var(--goold-red);
  flex-shrink: 0;
  margin-top: 2px;
}
.toast__icon [data-lucide],
.toast__icon svg { width: 18px; height: 18px; }

.toast__body { flex: 1 1 auto; min-width: 0; }
.toast__title {
  font-size: var(--fz-body);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: 1.3;
}
.toast__meta {
  font-size: var(--fz-small);
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

.toast__close {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    color var(--dur-fast) var(--ease-apple);
}
.toast__close:hover { background: var(--bg-hover); color: var(--text-primary); }
.toast__close [data-lucide],
.toast__close svg { width: 14px; height: 14px; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   AUTH · Tela de login (BRAND seção 13 + 14)
   ============================================================ */
.auth {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: var(--space-8) var(--space-4);
  z-index: 200;
  overflow-y: auto;
}

.auth[hidden] { display: none; }

.auth__logo {
  display: block;
  height: 88px;
  width: auto;
  margin-bottom: var(--space-6);
  color: var(--goold-red);
}

.auth__title {
  margin: 0 0 var(--space-8) 0;
  font-size: var(--fz-h1-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight-h1);
  line-height: var(--lh-heading);
  color: var(--text-primary);
  text-align: center;
}

.auth__card {
  width: 100%;
  max-width: var(--form-card-w);
  padding: var(--space-8);
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-card);
}

.auth__submit {
  width: 100%;
  margin-top: var(--space-6);
}

@media (max-width: 480px) {
  .auth__card { padding: var(--space-6); }
  .auth__title {
    font-size: var(--fz-h1);
    margin-bottom: var(--space-6);
  }
}

/* ============================================================
   FORMULÁRIO · Padrão único (BRAND seção 13)
   ============================================================ */
.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-5);
}

.form-field:last-of-type { margin-bottom: 0; }

.form-field__label {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: nowrap;
  margin-bottom: var(--space-2);
  font-size: var(--fz-body);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.form-field__hint {
  font-size: var(--fz-small);
  font-weight: var(--fw-regular);
  color: var(--text-secondary);
  white-space: nowrap;
}

.form-field__error {
  margin: 6px 0 0 0;
  font-size: var(--fz-small);
  font-weight: var(--fw-regular);
  line-height: var(--lh-small);
  color: var(--goold-red-dark);
}

.form-field__error[hidden] { display: none; }

.form-input-wrap {
  position: relative;
  width: 100%;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
  font-family: inherit;
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--text-primary);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--dur-fast) var(--ease-apple);
}

.form-input::placeholder { color: var(--text-tertiary); }

.form-input:focus,
.form-input:focus-visible {
  border-color: var(--goold-red);
  outline: none;
  box-shadow: none;
}

.form-input.is-invalid { border-color: var(--goold-red); }

.form-input-wrap--password .form-input { padding-right: 44px; }

.form-input__toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-apple);
}

.form-input__toggle:hover { color: var(--text-primary); }

.form-input__toggle [data-lucide],
.form-input__toggle svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

/* ============================================================
   BOTÃO PRIMÁRIO · Padrão CTA (BRAND seção 6 + 13)
   Namespace .btn-primary (single dash) — não colide com .btn--primary antigo
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  padding: 0 var(--space-5);
  background: var(--goold-red);
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-semibold);
  color: #fff;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    transform var(--dur-instant) var(--ease-apple),
    opacity var(--dur-fast) var(--ease-apple);
}

.btn-primary:hover:not(:disabled) { background: #EC4869; }
.btn-primary:active:not(:disabled) { transform: scale(0.985); }

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

.btn-primary__spinner {
  display: none;
  width: 20px;
  height: 20px;
  animation: btn-spin 0.8s linear infinite;
}

.btn-primary.is-loading .btn-primary__label { display: none; }
.btn-primary.is-loading .btn-primary__spinner { display: inline-block; }

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   SIDEBAR · Nav rail (BRAND seção 14 — Sidebar)
   ============================================================ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: var(--goold-sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
  border-right: none;
  gap: 0;
  max-height: none;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 var(--space-6);
  flex-shrink: 0;
}

.sidebar__logo {
  height: 36px;
  width: auto;
  display: block;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-3);
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar__section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__label {
  font-size: var(--fz-label);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
  line-height: var(--lh-h2);
}

.sidebar__items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sidebar-item);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-medium);
  line-height: 1;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    color var(--dur-fast) var(--ease-apple);
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-primary);
}

.sidebar-item.is-active {
  background: var(--bg-surface);
  color: var(--goold-red);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-card);
}

.sidebar-item.is-active .sidebar-item__icon { color: var(--goold-red); }

.sidebar-item__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: currentColor;
  stroke-width: 1.75;
}

.sidebar-item__icon svg,
.sidebar-item__icon[data-lucide] {
  width: 18px;
  height: 18px;
}

.sidebar-item__label {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
  border-top: 1px solid rgba(225, 29, 72, 0.08);
  flex-shrink: 0;
}

.sidebar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--goold-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fz-caption);
  font-weight: var(--fw-semibold);
  flex-shrink: 0;
}

.sidebar__user {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar__user-name {
  font-size: var(--fz-body);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sidebar__user-role {
  font-size: var(--fz-caption);
  color: var(--text-tertiary);
  line-height: 1.3;
}

/* ============================================================
   HEADER · Barra superior por view (BRAND seção 14 — Header)
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: var(--header-h);
  padding: 0 var(--space-8);
  background: var(--bg-page);
  border-bottom: 0.5px solid var(--hairline);
}

.header__title {
  margin: 0;
  font-size: var(--fz-h2);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight-h2);
  line-height: var(--lh-h2);
  color: var(--text-primary);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header__month-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding-right: var(--space-3);
  border-right: 0.5px solid var(--hairline);
  margin-right: var(--space-2);
}

.header__month-label {
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  min-width: 9ch;
  text-align: center;
  letter-spacing: var(--ls-tight-h2);
}

.header__today {
  height: 32px;
  padding: 0 var(--space-3);
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: var(--fz-body);
  font-weight: var(--fw-medium);
  color: var(--goold-red);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-apple);
  margin-left: var(--space-1);
}

.header__today:hover { background: var(--bg-hover); }
.header__today:active { transform: scale(0.985); }

.header__icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    color var(--dur-fast) var(--ease-apple),
    transform var(--dur-instant) var(--ease-apple);
}

.header__icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header__icon-btn:active { transform: scale(0.985); }

.header__icon-btn [data-lucide],
.header__icon-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

.header__icon-btn--sm {
  width: 28px;
  height: 28px;
}

.header__icon-btn--sm [data-lucide],
.header__icon-btn--sm svg {
  width: 16px;
  height: 16px;
}

.header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--goold-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: var(--fz-caption);
  font-weight: var(--fw-semibold);
  border: none;
  cursor: pointer;
  transition: transform var(--dur-instant) var(--ease-apple);
  flex-shrink: 0;
  margin-left: var(--space-1);
}

.header__avatar:hover { transform: scale(1.04); }
.header__avatar:active { transform: scale(0.96); }

/* ============================================================
   PAINEL · Home (BRAND seção 14 — Painel)
   ============================================================ */
.painel {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.painel[hidden],
.calendar[hidden] { display: none; }

.painel__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.painel__greeting {
  margin: 0;
  font-size: var(--fz-body-lg);
  color: var(--text-secondary);
  line-height: var(--lh-body);
}

.painel__date {
  margin: 0;
  font-size: var(--fz-h1);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight-h1);
  line-height: var(--lh-heading);
  color: var(--text-primary);
}

/* --- Hero card "Próxima ação" --- */
.hero-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-8);
  background: var(--bg-surface);
  border: 0.5px solid var(--goold-red);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition:
    transform var(--dur-base) var(--ease-apple),
    box-shadow var(--dur-base) var(--ease-apple),
    background-color var(--dur-base) var(--ease-apple);
}

.hero-card:hover {
  transform: translateY(-1px);
  background: var(--bg-hover);
  box-shadow: var(--shadow-card-hover);
}

.hero-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.hero-card__label {
  font-size: var(--fz-label);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.hero-card__when {
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}

.hero-card__body {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.hero-card__channel {
  flex-shrink: 0;
}

.hero-card__title {
  margin: 0;
  font-size: 24px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight-h1);
  line-height: var(--lh-h2);
  color: var(--text-primary);
}

.hero-card__price {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-3);
}

.hero-card__price-from {
  font-size: var(--fz-body);
  color: var(--text-secondary);
  text-decoration: line-through;
}

.hero-card__price-to {
  font-size: var(--fz-h2);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight-h2);
  color: var(--goold-red);
}

.hero-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fz-small);
  color: var(--text-secondary);
}

.hero-card__meta [data-lucide],
.hero-card__meta svg { width: 14px; height: 14px; }

/* --- Stat cards grid --- */
.painel__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition:
    transform var(--dur-base) var(--ease-apple),
    box-shadow var(--dur-base) var(--ease-apple),
    background-color var(--dur-base) var(--ease-apple);
}

.stat-card:hover {
  transform: translateY(-1px);
  background: var(--bg-hover);
  box-shadow: var(--shadow-card-hover);
}

.stat-card__num {
  display: block;
  font-size: var(--fz-display);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight-display);
  line-height: var(--lh-display);
  color: var(--text-primary);
}

.stat-card__label {
  font-size: var(--fz-small);
  color: var(--text-secondary);
}

.stat-card__hint {
  font-size: var(--fz-caption);
  color: var(--text-tertiary);
}

/* --- Sections (esta semana / box / agenda) --- */
.painel__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.painel__section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0;
}

.painel__section-title {
  margin: 0;
  font-size: var(--fz-h2);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight-h2);
  line-height: var(--lh-h2);
  color: var(--text-primary);
}

.painel__section-hint {
  font-size: var(--fz-small);
  color: var(--text-secondary);
}

/* --- Lista iOS Settings (esta semana + agenda exterior) --- */
.row-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.row-list__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    transform var(--dur-instant) var(--ease-apple);
  position: relative;
}

.row-list__row + .row-list__row::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--space-5) + 18px + var(--space-3));
  right: 0;
  height: 0.5px;
  background: var(--hairline);
}

.row-list__row:hover { background: var(--bg-hover); }
.row-list__row:active { transform: scale(0.995); }

.row-list__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  flex-shrink: 0;
}

.row-list__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.row-list__title {
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.row-list__meta {
  font-size: var(--fz-small);
  color: var(--text-secondary);
  line-height: 1.3;
}

.row-list__value {
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  flex-shrink: 0;
}

.row-list__chevron {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  stroke-width: 2;
}

/* --- Channel icon wrapper --- */
.channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Box do mês cards --- */
.painel__boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

.box-mini {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-card);
  transition:
    transform var(--dur-base) var(--ease-apple),
    box-shadow var(--dur-base) var(--ease-apple),
    background-color var(--dur-base) var(--ease-apple);
}

.box-mini:hover {
  transform: translateY(-1px);
  background: var(--bg-hover);
  box-shadow: var(--shadow-card-hover);
}

.box-mini__head {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.box-mini__head [data-lucide],
.box-mini__head svg { width: 18px; height: 18px; color: var(--text-secondary); }

.box-mini__products {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fz-small);
  color: var(--text-secondary);
}

.box-mini__products li::before {
  content: "·";
  color: var(--text-tertiary);
  margin-right: 6px;
}

.box-mini__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  border-top: 0.5px solid var(--hairline);
}

.box-mini__qty {
  font-size: var(--fz-small);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

/* --- Pills USA / Europa --- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fz-label);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-badge);
  flex-shrink: 0;
  min-width: 56px;
  height: 22px;
  line-height: 1;
}

.pill--usa     { background: rgba(59, 130, 246, 0.12); color: var(--channel-usa); }
.pill--europa  { background: rgba(139, 92, 246, 0.12); color: var(--channel-europa); }

/* --- Empty state --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  font-size: var(--fz-body-lg);
  color: var(--text-secondary);
  text-align: center;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  background: var(--bg-surface);
}

.empty-state__icon {
  width: 32px;
  height: 32px;
  color: var(--text-tertiary);
  stroke-width: 1.5;
}

/* ============================================================
   USUÁRIOS · Tela (BRAND seção 14 — Usuários)
   ============================================================ */
.users {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.users[hidden] { display: none; }

.users__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.users__title {
  margin: 0;
  font-size: var(--fz-h2);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight-h2);
  line-height: var(--lh-h2);
  color: var(--text-primary);
}

.users__subtitle {
  margin: 4px 0 0 0;
  font-size: var(--fz-body);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- Primary button — sm modifier (40px height) --- */
.btn-primary--sm {
  height: 40px;
  padding: 0 var(--space-4);
  font-size: var(--fz-body);
}

.btn-primary--sm [data-lucide],
.btn-primary--sm svg { width: 16px; height: 16px; }

/* --- Table --- */
.users-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
}

.users-table thead th {
  font-size: var(--fz-label);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: left;
  padding: var(--space-3) var(--space-5);
  border-bottom: 0.5px solid var(--hairline);
  background: var(--bg-surface);
  line-height: 1.2;
}

.users-table tbody td {
  padding: 0 var(--space-5);
  height: 64px;
  vertical-align: middle;
  font-size: var(--fz-body-lg);
  color: var(--text-primary);
}

.users-table tbody tr + tr td { border-top: 0.5px solid var(--hairline); }

.users-table__row {
  transition: background-color var(--dur-fast) var(--ease-apple);
}

.users-table__row:hover { background: var(--bg-hover); }

.users-table__cell--muted {
  color: var(--text-secondary);
  font-size: var(--fz-small);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-cell__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--goold-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fz-small);
  font-weight: var(--fw-semibold);
  flex-shrink: 0;
}

.user-cell__name {
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

/* --- Role pill --- */
.role-pill {
  display: inline-flex;
  align-items: center;
  font-size: var(--fz-label);
  font-weight: var(--fw-medium);
  padding: 4px 10px;
  border-radius: var(--radius-badge);
  line-height: 1;
  white-space: nowrap;
}

.role-pill--master {
  background: var(--goold-pink-soft);
  color: var(--goold-red-dark);
}

.role-pill--padrao,
.role-pill--padrão {
  background: var(--hairline-soft);
  color: var(--text-secondary);
}

/* --- Skeleton row (loading) --- */
.users-skeleton {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.users-skeleton__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 64px;
  padding: 0 var(--space-5);
  border-top: 0.5px solid var(--hairline);
}

.users-skeleton__row:first-child { border-top: none; }

.skeleton-bar {
  background: linear-gradient(90deg, var(--hairline-soft) 0%, #E5E7EB 50%, var(--hairline-soft) 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  height: 12px;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ============================================================
   AÇÕES DE LINHA · Editar / Excluir (Fase 8)
   ============================================================ */
.users-table__actions-th { width: 92px; }

.users-table__actions {
  text-align: right;
  white-space: nowrap;
  width: 92px;
}

.row-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    color var(--dur-fast) var(--ease-apple);
}

.row-icon-btn + .row-icon-btn { margin-left: 2px; }

.row-icon-btn:hover { background: var(--bg-hover); }
.row-icon-btn--edit:hover { color: var(--goold-red); }
.row-icon-btn--delete:hover { color: var(--status-danger); }

.row-icon-btn [data-lucide],
.row-icon-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
}

/* ============================================================
   MODAL · Geral (BRAND seção 6)
   ============================================================ */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  pointer-events: none;
}

.modal-root[data-modal-key=""] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--dur-drawer-in) var(--ease-apple);
}

.modal-root.is-open { pointer-events: auto; }
.modal-root.is-open .modal-backdrop { opacity: 1; }

.modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - var(--space-8));
  background: var(--bg-surface);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-drawer);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--dur-drawer-in) var(--ease-apple),
    transform var(--dur-drawer-in) var(--ease-apple);
}

.modal-root.is-open .modal {
  opacity: 1;
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-8) var(--space-3) var(--space-8);
  flex-shrink: 0;
}

.modal__title {
  margin: 0;
  font-size: var(--fz-h2);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight-h2);
  color: var(--text-primary);
}

.modal__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    color var(--dur-fast) var(--ease-apple);
}

.modal__close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal__close [data-lucide],
.modal__close svg { width: 20px; height: 20px; }

.modal__body {
  padding: var(--space-3) var(--space-8) var(--space-4) var(--space-8);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.modal__error {
  display: block;
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-4) 0;
  background: var(--goold-pink-soft);
  border-radius: var(--radius-input);
  font-size: var(--fz-small);
  color: var(--goold-red-dark);
}

.modal__error[hidden] { display: none; }

.modal__message {
  margin: 0;
  font-size: var(--fz-body-lg);
  color: var(--text-primary);
  line-height: 1.5;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8) var(--space-6) var(--space-8);
  flex-shrink: 0;
}

.modal__footer .btn-secondary,
.modal__footer .btn-primary,
.modal__footer .btn-danger {
  height: 44px;
  padding: 0 var(--space-5);
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .modal__header,
  .modal__body,
  .modal__footer { padding-left: var(--space-6); padding-right: var(--space-6); }
}

/* ============================================================
   SELECT · Estilo do formulário (BRAND seção 13)
   ============================================================ */
.form-select {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
  font-family: inherit;
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-regular);
  color: var(--text-primary);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  transition: border-color var(--dur-fast) var(--ease-apple);
}

.form-select:focus,
.form-select:focus-visible {
  border-color: var(--goold-red);
  outline: none;
  box-shadow: none;
}

.form-select.is-invalid { border-color: var(--goold-red); }

/* ============================================================
   BOTÃO DESTRUTIVO (BRAND seção 6)
   ============================================================ */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-5);
  background: var(--bg-surface);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: var(--fz-body-lg);
  font-weight: var(--fw-medium);
  color: var(--status-danger);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    transform var(--dur-instant) var(--ease-apple),
    opacity var(--dur-fast) var(--ease-apple);
}

.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.06); }
.btn-danger:active:not(:disabled) { transform: scale(0.985); }

.btn-danger:disabled,
.btn-danger.is-loading {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Espaçamento entre form-fields dentro do modal (override do default) */
.modal__body .form-field { margin-bottom: var(--space-5); }
.modal__body .form-field:last-of-type { margin-bottom: 0; }

/* ============================================================
   ESTADOS · Loading / Erro (BRAND seção 14 — Vazio / loading / erro)
   ============================================================ */

/* --- Error state --- */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  text-align: center;
}

.error-state__icon {
  width: 24px;
  height: 24px;
  color: var(--status-danger);
  stroke-width: 1.75;
}

.error-state__message {
  margin: 0;
  font-size: var(--fz-body-lg);
  color: var(--text-primary);
  line-height: 1.5;
  max-width: 420px;
}

.error-state__retry {
  margin-top: var(--space-2);
  height: 40px;
  padding: 0 var(--space-4);
}

.error-state__retry [data-lucide],
.error-state__retry svg { width: 16px; height: 16px; }

/* --- Skeleton variants (build on .skeleton-bar do Phase 8) --- */
.skeleton-bar--avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-bar--md { width: 100%; height: 14px; }
.skeleton-bar--sm { width: 80%; height: 11px; }
.skeleton-bar--pill {
  width: 64px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}
.skeleton-bar--icons {
  width: 72px;
  height: 18px;
  border-radius: 6px;
  justify-self: end;
}

/* --- Users skeleton grid (match real table columns) --- */
.users-skeleton {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.users-skeleton__row {
  display: grid;
  grid-template-columns: 36px minmax(120px, 1.4fr) minmax(180px, 2fr) 80px minmax(80px, 1fr) 92px;
  align-items: center;
  gap: var(--space-3);
  height: 64px;
  padding: 0 var(--space-5);
  border-top: 0.5px solid var(--hairline);
}

.users-skeleton__row:first-child { border-top: none; }

/* --- Hero card e stat card skeleton variants --- */
.hero-card--skeleton,
.stat-card--skeleton {
  cursor: default;
  border-color: var(--hairline-soft);
}

.hero-card--skeleton:hover,
.stat-card--skeleton:hover {
  transform: none;
  box-shadow: var(--shadow-card);
  background: var(--bg-surface);
}
