/* =============================================================================
   FIESTA API UPDATE - INTERFACE ADMIN
   Design System: Moderno, Clean, Responsivo
   ============================================================================= */

:root {
  /* Cores Principais */
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  
  --secondary: #10b981;
  --secondary-dark: #059669;
  
  --danger: #ef4444;
  --danger-dark: #dc2626;
  
  --warning: #f59e0b;
  --warning-dark: #d97706;
  
  --info: #06b6d4;
  --info-dark: #0891b2;
  
  /* Tons de Cinza */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Backgrounds */
  --bg-body: #eef2f6;
  --bg-card: #ffffff;
  /* Sidebar clara (paridade visual com apps tipo PetControl — não “metade dark”) */
  --bg-sidebar: #f1f5f9;
  --bg-hover: #f3f4f6;
  /* Texto e divisões da sidebar — tema claro */
  --sidebar-text: #334155;
  --sidebar-text-muted: #64748b;
  --sidebar-border: #e2e8f0;
  --sidebar-hover: rgba(37, 99, 235, 0.08);
  --sidebar-active-bg: rgba(37, 99, 235, 0.12);
  --sidebar-btn-bg: #ffffff;
  --sidebar-btn-border: #cbd5e1;
  --sidebar-menu-bg: #ffffff;
  --sidebar-menu-border: #e2e8f0;
  --sidebar-menu-item: #334155;
  --sidebar-menu-item-hover-bg: rgba(15, 23, 42, 0.06);
  --sidebar-menu-sep: rgba(15, 23, 42, 0.08);
  --sidebar-shadow: 1px 0 0 var(--sidebar-border), 4px 0 24px rgba(15, 23, 42, 0.05);
  
  /* Textos */
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-white: #ffffff;
  
  /* Bordas */
  --border-color: #e5e7eb;
  /* Contorno tipo MUI “outlined” em inputs/selects (claro: cinza sobre branco) */
  --outline-muted-border: rgba(0, 0, 0, 0.23);
  --border-radius: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Transições */
  --transition: all 0.2s ease-in-out;
}

/* Tema escuro — alinhado ao Sistema 2 (MUI createAppTheme dark, primary azul) */
:root[data-theme="dark"] {
  --primary: #42a5f5;
  --primary-dark: #1976d2;
  --primary-light: #64b5f6;

  --secondary: #66bb6a;
  --secondary-dark: #388e3c;

  --danger: #ef5350;
  --danger-dark: #c62828;

  --warning: #ffb74d;
  --warning-dark: #f57c00;

  --info: #4fc3f7;
  --info-dark: #0288d1;

  --gray-50: #2c2c2c;
  --gray-100: #333333;
  --gray-200: #3d3d3d;
  --gray-300: #505050;
  --gray-400: #9e9e9e;
  --gray-500: #b0b0b0;
  --gray-600: #c4c4c4;
  --gray-700: #d6d6d6;
  --gray-800: #e0e0e0;
  --gray-900: #ececec;

  --bg-body: #121212;
  --bg-card: #1e1e1e;
  /* Sidebar um pouco acima do body (mesma lógica que o claro: rail separado, continua escuro) */
  --bg-sidebar: #171717;
  --bg-hover: rgba(255, 255, 255, 0.08);
  --sidebar-text: rgba(255, 255, 255, 0.92);
  --sidebar-text-muted: var(--gray-400);
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: rgba(66, 165, 245, 0.18);
  --sidebar-btn-bg: rgba(255, 255, 255, 0.06);
  --sidebar-btn-border: rgba(255, 255, 255, 0.14);
  --sidebar-menu-bg: rgba(30, 30, 30, 0.98);
  --sidebar-menu-border: rgba(255, 255, 255, 0.12);
  --sidebar-menu-item: rgba(248, 250, 252, 0.95);
  --sidebar-menu-item-hover-bg: rgba(255, 255, 255, 0.08);
  --sidebar-menu-sep: rgba(255, 255, 255, 0.1);
  /* Mesmo “desenho” que o tema claro: linha + sombra suave */
  --sidebar-shadow: 1px 0 0 var(--sidebar-border), 4px 0 28px rgba(0, 0, 0, 0.45);

  --text-primary: rgba(255, 255, 255, 0.87);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-white: #ffffff;

  /* Borda de cartões/divisores: um pouco mais visível que 0.12 no #121212 */
  --border-color: rgba(255, 255, 255, 0.22);
  /* Mesmo peso visual que rgba(0,0,0,0.23) no tema claro, mas em contornos claros sobre fundo escuro */
  --outline-muted-border: rgba(255, 255, 255, 0.28);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.55);
}

:root[data-theme="dark"] .sidebar-nav-item.active {
  background-color: var(--sidebar-active-bg);
  color: var(--primary-light);
  border-right-color: var(--primary-light);
}

:root[data-theme="dark"] .sidebar-nav-title {
  color: var(--gray-400);
}

:root[data-theme="dark"] .header-theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* =============================================================================
   RESET E BASE
   ============================================================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Calendário MUI (portal): o bundle define Roboto no tema; forçar Helvetica como no resto do admin */
.MuiPopper-root .MuiPaper-root {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: var(--transition);
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* =============================================================================
   LAYOUT PRINCIPAL
   ============================================================================= */

.admin-container {
  display: flex;
  min-height: 100vh;
}

/* =============================================================================
   SIDEBAR
   ============================================================================= */

.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 1000;
  box-shadow: var(--sidebar-shadow);
}

.sidebar-header {
  /* 5rem ≡ 80px com font-size raiz 16px — altura do bloco marca (medida no inspetor) */
  min-height: 5rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-white);
}

.sidebar-logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  color: var(--sidebar-text);
}

.sidebar-logo-text p {
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--sidebar-text-muted);
  margin: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-nav-section {
  margin-bottom: 1.5rem;
}

.sidebar-nav-title {
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sidebar-text-muted);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--sidebar-text-muted);
  transition: var(--transition);
  /* Mesmo estilo “pill” à direita em claro e escuro (referência PetControl) */
  margin-right: 0.75rem;
  border-radius: 0 10px 10px 0;
}

.sidebar-nav-item:hover {
  background-color: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.sidebar-nav-item.active {
  background-color: var(--sidebar-active-bg);
  color: var(--primary);
  border-right: 3px solid var(--primary);
  font-weight: 600;
}

.sidebar-nav-item-icon {
  font-size: 1.25rem;
  width: 20px;
  text-align: center;
}

/* hicons-bold (sidebar): SVG inline herda currentColor — não usar <img> */
.sidebar-nav-item-icon.sidebar-hicon {
  font-size: 0;
  width: 1.25rem;
  min-width: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.sidebar-nav-item-icon.sidebar-hicon svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  display: block;
}

.sidebar-nav-item-text {
  font-weight: 500;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sidebar-border);
}

/* Toggle de tema na barra lateral (Sistema 1) — acima do utilizador */
.sidebar-theme-wrap {
  margin-bottom: 1rem;
}

.sidebar-footer .header-theme-toggle {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--sidebar-btn-border);
  border-radius: var(--border-radius);
  background-color: var(--sidebar-btn-bg);
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-footer .header-theme-toggle:hover {
  background-color: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.sidebar-footer .header-theme-toggle-icon {
  font-size: 0.9rem;
  opacity: 0.95;
}

.sidebar-user-wrap {
  position: relative;
  width: 100%;
}

.sidebar-user-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.25rem;
  border: none;
  border-radius: var(--border-radius);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: inherit;
  transition: var(--transition);
}

.sidebar-user-trigger:hover {
  background-color: var(--sidebar-hover);
}

.sidebar-user-wrap.is-open .sidebar-user-trigger {
  background-color: var(--sidebar-active-bg);
}

.sidebar-user-trigger-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  color: var(--sidebar-text-muted);
  font-size: 0.65rem;
  transition: transform 0.2s ease;
}

.sidebar-user-wrap.is-open .sidebar-user-trigger-chevron {
  transform: rotate(180deg);
}

.sidebar-user-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.5rem);
  z-index: 1010;
  padding: 0.35rem 0;
  margin: 0;
  list-style: none;
  background: var(--sidebar-menu-bg);
  border: 1px solid var(--sidebar-menu-border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.sidebar-user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  margin: 0 0.35rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sidebar-menu-item);
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-user-menu-item:hover {
  background-color: var(--sidebar-menu-item-hover-bg);
  color: var(--sidebar-text);
}

.sidebar-user-menu-item i {
  width: 1.1rem;
  text-align: center;
  opacity: 0.9;
  font-size: 0.9rem;
}

.sidebar-user-menu-item--logout:hover {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fecaca;
}

.sidebar-user-menu-sep {
  height: 1px;
  margin: 0.35rem 0.65rem;
  background: var(--sidebar-menu-sep);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--info));
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.sidebar-user-info {
  flex: 1;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--sidebar-text);
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: var(--sidebar-text-muted);
}

/* Formulário estilo painel expandir (Usuários / Minha conta) */
.user-expand-panel {
  padding: 1.25rem 1.5rem;
  margin: 0;
  border-left: 3px solid var(--primary);
  background: var(--bg-card);
}

.user-expand-panel h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
}

.user-expand-panel .fiesta-outlined-modal-form {
  max-width: 100%;
}

.user-expand-panel .user-expand-form-row--r1 {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: flex-end;
}

.user-expand-panel .user-expand-form-row--r1 > .fiesta-field-outlined {
  flex: 1 1 calc(25% - 1rem);
  min-width: 9.5rem;
  max-width: none;
  width: auto;
}

.user-expand-hint-below-r1 {
  display: block;
  margin: 0.15rem 0 0.75rem 2px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.user-expand-form-row--r2 {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin-top: 0.15rem;
}

.user-expand-panel .user-expand-form-r2-perfil {
  flex: 0 0 calc((100% - 3 * 1.25rem) / 4);
  width: calc((100% - 3 * 1.25rem) / 4);
  max-width: calc((100% - 3 * 1.25rem) / 4);
  min-width: 9.5rem;
  box-sizing: border-box;
}

.user-expand-panel .user-expand-form-r2-theme {
  flex: 0 0 calc((100% - 3 * 1.25rem) / 4);
  width: calc((100% - 3 * 1.25rem) / 4);
  max-width: calc((100% - 3 * 1.25rem) / 4);
  min-width: 12rem;
  box-sizing: border-box;
}

.user-expand-panel .user-expand-form-r2-perfil > .fiesta-field-outlined {
  flex: none;
  width: 100%;
  max-width: none;
}

.user-expand-panel .fiesta-outlined-modal-form .fiesta-select-menu {
  max-height: none;
  overflow-y: visible;
}

.user-expand-form-r2-active {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding-bottom: 0.35rem;
}

.user-expand-form-r2-active .fiesta-modal-checkbox {
  margin-top: 0;
  margin-bottom: 0;
}

/* Switch estilo MUI (Sistema 2) — mantém <input type="checkbox"> por baixo */
.fiesta-mui-form-control-label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  margin: 0;
  cursor: pointer;
  user-select: none;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.user-expand-form-r2-active .fiesta-mui-form-control-label {
  margin-top: 0;
  margin-bottom: 0;
}

.fiesta-mui-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 26px;
}

.fiesta-mui-switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.fiesta-mui-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.18);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

:root[data-theme="dark"] .fiesta-mui-switch-track {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.fiesta-mui-switch-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transform: translate(0, -50%);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.fiesta-mui-switch-input:checked + .fiesta-mui-switch-track {
  background: rgba(25, 118, 210, 0.35);
  border-color: rgba(25, 118, 210, 0.55);
}

:root[data-theme="dark"] .fiesta-mui-switch-input:checked + .fiesta-mui-switch-track {
  background: rgba(144, 202, 249, 0.22);
  border-color: rgba(144, 202, 249, 0.45);
}

.fiesta-mui-switch-input:checked + .fiesta-mui-switch-track .fiesta-mui-switch-thumb {
  transform: translate(18px, -50%);
  background: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.fiesta-mui-switch-input:focus-visible + .fiesta-mui-switch-track {
  outline: 2px solid rgba(25, 118, 210, 0.65);
  outline-offset: 2px;
}

:root[data-theme="dark"] .fiesta-mui-switch-input:focus-visible + .fiesta-mui-switch-track {
  outline-color: rgba(144, 202, 249, 0.75);
}

.fiesta-mui-switch-input:disabled + .fiesta-mui-switch-track {
  opacity: 0.45;
  cursor: not-allowed;
}

.user-expand-form-r2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  flex: 1 1 12rem;
  min-width: min(100%, 16rem);
}

.user-expand-form-r2-actions .btn {
  flex: 0 1 auto;
  min-height: 40px;
}

.account-page-panel {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary);
}

.account-role-readonly {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 2px;
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* Minha conta: dica da senha inicia alinhada em "Nova senha" (3ª coluna do r1) */
.account-page-panel .user-expand-hint-below-r1 {
  margin-left: calc(50% + 0.625rem);
}

/* Minha conta: Perfil (rótulo) + badge na mesma linha, badge à direita */
.account-perfil-readonly-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 48px;
  padding-top: 10px;
  box-sizing: border-box;
}

.account-perfil-readonly-label {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.account-perfil-readonly-wrap .account-role-readonly {
  flex: 0 0 auto;
  min-height: 0;
  margin-left: auto;
  justify-content: flex-end;
}

@media (max-width: 1100px) {
  .account-page-panel .user-expand-hint-below-r1 {
    margin-left: 2px;
  }
}

.user-expand-form-row--theme {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  margin-top: 0.5rem;
}

.user-expand-panel .user-expand-form-theme-wrap {
  flex: 0 1 22rem;
  min-width: 12rem;
  max-width: 100%;
}

.user-expand-panel .user-expand-form-theme-wrap > .fiesta-field-outlined {
  width: 100%;
  max-width: none;
}

/* =============================================================================
   MAIN CONTENT
   ============================================================================= */

.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
}

/* =============================================================================
   HEADER
   ============================================================================= */

.header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  /* ~80px de altura total da faixa (título + breadcrumb) vs ~94px com 1rem vertical */
  padding: 0.625rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.header-breadcrumb-item {
  transition: var(--transition);
}

.header-breadcrumb-item:hover {
  color: var(--primary);
}

.header-breadcrumb-separator {
  color: var(--gray-300);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Toggle tema (mesmo padrão conceitual do Sistema 2: label + ícone, um clique) */
.header-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: none;
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition);
}

.header-theme-toggle:hover {
  background-color: var(--bg-hover);
}

.header-theme-toggle-label {
  white-space: nowrap;
}

.header-theme-toggle-icon {
  font-size: 0.9rem;
  opacity: 0.95;
}

.header-env {
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-env.development {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning-dark);
}

.header-env.production {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-dark);
}

.header-env.test {
  background-color: rgba(6, 182, 212, 0.1);
  color: var(--info-dark);
}

/* =============================================================================
   CONTENT AREA
   ============================================================================= */

.content {
  flex: 1;
  padding: 2rem;
}

/* =============================================================================
   CARDS
   ============================================================================= */

.card {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Dropdowns / popovers que ultrapassam o cartão (ex.: filtros Pedidos) */
.card.card--overflow-visible {
  overflow: visible;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background-color: var(--gray-50);
  border-top: 1px solid var(--border-color);
}

/* =============================================================================
   BOTÕES
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: var(--transition);
  white-space: nowrap;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--gray-200);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--gray-300);
}

.btn-success {
  background-color: var(--secondary);
  color: var(--text-white);
}

.btn-success:hover {
  background-color: var(--secondary-dark);
}

.btn-danger {
  background-color: var(--danger);
  color: var(--text-white);
}

.btn-danger:hover {
  background-color: var(--danger-dark);
}

.btn-warning {
  background-color: #ffc107;
  border: none;
  color: #000;
}

.btn-warning:hover {
  background-color: #e0a800;
}

.btn-info {
  background-color: #17a2b8;
  border: none;
  color: white;
}

.btn-info:hover {
  background-color: #138496;
}

.btn-outline {
  border: 1px solid var(--border-color);
  background-color: transparent;
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--bg-hover);
}

/* Contorno primário (estilo MUI / fiesta-financial – Filtrar outlined) */
.btn-outline-primary {
  border: 1px solid var(--primary);
  background-color: transparent;
  color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: rgba(37, 99, 235, 0.06);
  border-color: var(--primary-dark);
  color: var(--primary-dark);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

/* =============================================================================
   FORMS
   ============================================================================= */

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-label.required::after {
  content: " *";
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: var(--transition);
  background-color: var(--bg-card);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-help {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.form-error {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--danger);
}

/* =============================================================================
   Filtros outlined (Pedidos, Histórico sync, modal Marketplaces — MUI-like)
   ============================================================================= */

/* Sistema 1 — só filtros Flask (Pedidos / aba Sincronização): Helvetica 14px, line-height 24px (1.5rem @ root 16px) */
.fiesta-outlined-filter-form {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5rem;
}

.fiesta-outlined-filter-form .fiesta-field-outlined > input[type="date"],
.fiesta-outlined-filter-form .fiesta-field-outlined > select:not(.fiesta-select-sync),
.fiesta-outlined-filter-form .fiesta-field-outlined > input:not([type="hidden"]):not([type="checkbox"]):not([type="date"]),
.fiesta-outlined-filter-form .fiesta-field-outlined > textarea,
.fiesta-outlined-filter-form .fiesta-field-credential .credential-field input,
.fiesta-outlined-filter-form .fiesta-field-credential .credential-field textarea,
.fiesta-outlined-filter-form .fiesta-field-search .fiesta-search-field-input,
.fiesta-outlined-filter-form .fiesta-select-trigger,
.fiesta-outlined-filter-form .fiesta-select-option,
.fiesta-outlined-filter-form .fiesta-field-outlined > .fiesta-daterange-display {
  font-family: inherit;
  font-size: inherit;
  line-height: 1.5rem;
}

.fiesta-outlined-filter-form .fiesta-periodo-value-title,
.fiesta-outlined-filter-form .fiesta-periodo-option-title {
  line-height: 1.5rem;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined {
  position: relative;
  flex: 1 1 160px;
  min-width: 148px;
  max-width: 100%;
  padding-top: 10px;
}

.fiesta-outlined-modal-form .fiesta-field-outlined {
  flex: none;
  width: 100%;
  min-width: 0;
}

.fiesta-outlined-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.fiesta-outlined-modal-form .fiesta-modal-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.fiesta-outlined-modal-form .fiesta-modal-form-actions .btn {
  flex: 1;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-hint {
  display: block;
  margin-top: 0.35rem;
  margin-left: 2px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.fiesta-outlined-modal-form .fiesta-modal-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* Modal marketplaces / editor de loja: scroll no overlay; corpo sem clip */
#marketplaceModal .marketplace-modal-body,
#storeEditorModal .marketplace-modal-body,
#userModal .marketplace-modal-body {
  overflow: visible;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > label {
  position: absolute;
  left: 12px;
  top: 10px;
  transform: translateY(-50%);
  z-index: 1;
  padding: 0 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-600);
  background-color: var(--bg-card);
  line-height: 1;
  pointer-events: none;
  transition: color 0.15s ease;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined.fiesta-select-is-open > label,
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-select-custom:focus-within > label,
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined:not(.fiesta-field-select-custom):focus-within > label {
  color: var(--primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > input[type="date"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--outline-muted-border);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > input[type="date"]:hover {
  border-color: var(--text-primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > select:not(.fiesta-select-sync) {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--outline-muted-border);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  cursor: pointer;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > select:not(.fiesta-select-sync):focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > select:not(.fiesta-select-sync):hover:not(:disabled) {
  border-color: var(--text-primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > select:not(.fiesta-select-sync):disabled {
  opacity: 0.75;
  cursor: not-allowed;
  background-color: var(--gray-50);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > input[readonly] {
  background-color: var(--gray-50);
  cursor: default;
  color: var(--text-secondary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > input[readonly]:hover {
  border-color: var(--outline-muted-border);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > input:not([type="hidden"]):not([type="checkbox"]):not([type="date"]),
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--outline-muted-border);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > textarea {
  min-height: 72px;
  padding-top: 10px;
  resize: vertical;
  line-height: 1.4;
}

.fiesta-outlined-filter-form .fiesta-field-outlined > textarea {
  line-height: 1.5rem;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > input:not([type="hidden"]):not([type="checkbox"]):not([type="date"]):focus,
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > input:not([type="hidden"]):not([type="checkbox"]):not([type="date"]):hover,
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > textarea:hover {
  border-color: var(--text-primary);
}

/* Campo credencial (olho) — borda no wrapper; input/textarea sem borda interna */
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-credential .credential-field {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--outline-muted-border);
  border-radius: 8px;
  background-color: var(--bg-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-credential .credential-field input,
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-credential .credential-field textarea {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  padding: 8px 12px;
  padding-right: 2.75rem;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-credential .credential-field textarea {
  min-height: 72px;
  padding-top: 10px;
  resize: vertical;
  align-self: stretch;
  line-height: 1.4;
}

.fiesta-outlined-filter-form .fiesta-field-credential .credential-field textarea {
  line-height: 1.5rem;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-credential .credential-field:has(textarea) {
  align-items: flex-start;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-credential:focus-within .credential-field {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-credential .credential-field:hover {
  border-color: var(--text-primary);
}

.credential-field:has(textarea) .credential-toggle {
  top: 0.65rem;
  transform: none;
}

/* Select custom (lista estilo fiesta-financial / MUI) */
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-root,
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-periodo-select-root {
  position: relative;
  width: 100%;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-periodo-select-root {
  min-width: 0;
  max-width: 100%;
}

/* 200px @ root 16px — Fonte, Marketplace, Período (filtros Pedidos / Sincronização) */
.fiesta-outlined-filter-form .fiesta-field-outlined.fiesta-filter-field-200,
.fiesta-outlined-filter-form .fiesta-field-outlined.fiesta-periodo-field {
  flex: 0 0 12.5rem;
  width: 12.5rem;
  min-width: 12.5rem;
  max-width: 12.5rem;
}

/* 400px @ root 16px — campo Busca (abas Pedidos e Sincronização) */
.fiesta-outlined-filter-form .fiesta-field-outlined.fiesta-filter-field-busca {
  flex: 0 0 25rem;
  width: 25rem;
  min-width: 25rem;
  max-width: 25rem;
}

/* Busca estilo Sistema 2 (MUI): lupa = submeter filtro; X = limpar termo (mesmo slot à direita) */
.fiesta-outlined-filter-form .fiesta-field-search .fiesta-search-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--outline-muted-border);
  border-radius: 8px;
  background-color: var(--bg-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.fiesta-outlined-filter-form .fiesta-field-search:focus-within .fiesta-search-field-wrap {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.fiesta-outlined-filter-form .fiesta-field-search .fiesta-search-field-wrap:hover {
  border-color: var(--text-primary);
}

.fiesta-outlined-filter-form .fiesta-field-search .fiesta-search-field-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  padding: 8px 12px;
  padding-right: 2.75rem;
  min-height: 38px;
  border-radius: 8px;
  box-sizing: border-box;
}

.fiesta-outlined-filter-form .fiesta-field-search .fiesta-search-field-input::placeholder {
  color: var(--gray-500);
}

.fiesta-outlined-filter-form .fiesta-field-search .fiesta-search-adorn-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--gray-600);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

/* [hidden] perde display:none no UA quando há display:inline-flex acima — força ocultar um dos adornos */
.fiesta-outlined-filter-form .fiesta-field-search .fiesta-search-adorn-btn[hidden] {
  display: none !important;
  pointer-events: none;
}

.fiesta-outlined-filter-form .fiesta-field-search .fiesta-search-adorn-btn:hover {
  color: var(--primary);
  background-color: var(--bg-hover);
}

.fiesta-outlined-filter-form .fiesta-field-search .fiesta-search-adorn-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.fiesta-outlined-filter-form .fiesta-field-search .fiesta-search-adorn-btn--clear {
  font-size: 0.875rem;
}

.fiesta-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.fiesta-outlined-filter-form .fiesta-periodo-select-root .fiesta-select-menu {
  min-width: 100%;
  width: max-content;
  max-width: min(280px, 92vw);
  max-height: none !important;
  overflow-y: visible !important;
  overflow: visible;
}

.fiesta-outlined-filter-form .fiesta-periodo-select-root .fiesta-select-trigger {
  align-items: center;
}

.fiesta-periodo-select-root .fiesta-periodo-value-sub {
  display: none !important;
}

.fiesta-periodo-trigger-text {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fiesta-periodo-value-title {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.25;
}

.fiesta-periodo-option-title {
  font-size: 0.875rem;
  line-height: 1.25;
}

.fiesta-periodo-option-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.2;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-sync {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  text-align: left;
  background-color: var(--bg-card);
  border: 1px solid var(--outline-muted-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-trigger:hover {
  border-color: var(--text-primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-root.is-open .fiesta-select-trigger,
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-periodo-select-root.is-open .fiesta-select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--gray-500);
  transition: transform 0.2s ease;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-root.is-open .fiesta-select-chevron,
:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-periodo-select-root.is-open .fiesta-select-chevron {
  transform: rotate(180deg);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 2000;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.06);
  max-height: 280px;
  overflow-y: auto;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-option {
  margin: 2px 8px;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-option:hover {
  background-color: var(--gray-100);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-option.is-selected {
  background-color: #e8f0fe;
  color: var(--text-primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-option.is-selected:hover {
  background-color: #dbe8fd;
}

/* Lista do select custom: #e8f0fe + texto claro = ilegível no tema escuro */
:root[data-theme="dark"] :is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-option.is-selected {
  background-color: rgba(66, 165, 245, 0.22);
  color: var(--text-primary);
}

:root[data-theme="dark"] :is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-select-option.is-selected:hover {
  background-color: rgba(66, 165, 245, 0.32);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-filter-actions .btn {
  min-height: 40px;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (max-width: 640px) {
  :is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-filter-actions {
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }

  :is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-filter-actions .btn {
    flex: 1;
  }
}

.fiesta-outlined-filter-form .fiesta-daterange-anchor {
  position: relative;
}

/* =============================================================================
   Date range popover (Pedidos — alinhado ao fiesta-financial / MUI)
   ============================================================================= */

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > .fiesta-daterange-display {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--outline-muted-border);
  border-radius: 8px;
  box-sizing: border-box;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined > .fiesta-daterange-display:hover {
  border-color: var(--text-primary);
}

:is(.fiesta-outlined-filter-form, .fiesta-outlined-modal-form) .fiesta-field-outlined:focus-within > .fiesta-daterange-display {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* Tokens MUI default (Dashboard Pedidos fiesta-financial) */
.fiesta-daterange-popover {
  --drp-mui-primary: #1976d2;
  --drp-mui-primary-dark: #1565c0;
  --drp-mui-primary-light: rgba(25, 118, 210, 0.08);
  --drp-mui-primary-range: rgba(25, 118, 210, 0.12);
  --drp-mui-primary-range-hover: rgba(25, 118, 210, 0.2);
  --drp-mui-divider: rgba(0, 0, 0, 0.12);
  --drp-mui-badge-bg: #c3dbf3;
  position: fixed;
  z-index: 5000;
  box-sizing: border-box;
  width: max-content;
  min-width: 350px;
  max-width: min(100vw - 16px, 400px);
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 4px;
  box-shadow:
    0 3px 3px -2px rgba(0, 0, 0, 0.2),
    0 3px 4px 0 rgba(0, 0, 0, 0.14),
    0 1px 8px 0 rgba(0, 0, 0, 0.12);
  font-family: inherit;
  color: rgba(0, 0, 0, 0.87);
}

.fiesta-daterange-popover-inner {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding: 16px;
  padding-bottom: 12px;
}

.fiesta-daterange-popover-inputs {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.fiesta-daterange-days-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 4px;
  background-color: var(--drp-mui-badge-bg);
  flex-shrink: 0;
  text-align: center;
}

.fiesta-daterange-days-count[hidden] {
  display: none !important;
}

.fiesta-daterange-days-count-n {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.6);
}

.fiesta-daterange-days-count-lbl {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.6);
}

/* TextField outlined size="small" ~ MUI */
.fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field {
  position: relative;
  flex: 0 0 140px;
  width: 140px;
  min-width: 0;
  max-width: 140px;
  padding-top: 0;
}

.fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field > label {
  position: absolute;
  left: 12px;
  top: 0;
  transform: translateY(-50%);
  z-index: 1;
  padding: 0 4px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1;
  color: rgba(0, 0, 0, 0.6);
  background-color: #fff;
  pointer-events: none;
  transition: color 0.15s ease;
}

.fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field:focus-within > label {
  color: var(--drp-mui-primary);
}

.fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field > input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.4375em;
  color: rgba(0, 0, 0, 0.87);
  background-color: #fff;
  /* Tema claro: borda MUI; tema escuro: ver bloco :root[data-theme="dark"] .fiesta-daterange-popover */
  border: 1px solid rgba(0, 0, 0, 0.23);
  border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field > input::placeholder {
  color: rgba(0, 0, 0, 0.38);
}

.fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field > input:focus {
  outline: none;
  border-color: var(--drp-mui-primary);
  box-shadow: 0 0 0 1px var(--drp-mui-primary);
}

.fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field > input:hover {
  border-color: rgba(0, 0, 0, 0.87);
}

.fiesta-daterange-popover-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 16px;
  min-width: 0;
}

.fiesta-daterange-title-btn .fiesta-daterange-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 12rem;
}

.fiesta-daterange-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(0, 0, 0, 0.54);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.fiesta-daterange-nav-btn:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.fiesta-daterange-title-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 500;
  font-family: inherit;
  color: rgba(0, 0, 0, 0.87);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.fiesta-daterange-title-btn:hover {
  background-color: var(--gray-100);
}

.fiesta-daterange-title-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(0, 0, 0, 0.54);
  transition: transform 0.2s ease;
}

.fiesta-daterange-title-btn.is-open .fiesta-daterange-title-chevron {
  transform: rotate(180deg);
}

.fiesta-daterange-month-panel {
  margin: 0 0 0.5rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.fiesta-daterange-month-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.fiesta-daterange-month-year {
  font-weight: 600;
  font-size: 0.9375rem;
}

.fiesta-daterange-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.fiesta-daterange-month-cell {
  padding: 0.45rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  background: #fff;
  color: rgba(0, 0, 0, 0.87);
  cursor: pointer;
  text-transform: capitalize;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.fiesta-daterange-month-cell:hover {
  background: var(--gray-100);
}

.fiesta-daterange-month-cell.is-selected {
  background: var(--drp-mui-primary-dark);
  border-color: var(--drp-mui-primary-dark);
  color: #fff;
}

.fiesta-daterange-popover-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
  width: 100%;
  box-sizing: border-box;
}

.fiesta-daterange-wd {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.6);
  padding: 6px 0;
  text-transform: lowercase;
}

.fiesta-daterange-popover-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

.fiesta-daterange-day.ph {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  max-height: 40px;
  margin: 0 auto;
}

.fiesta-daterange-day {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  max-height: 40px;
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 0.8125rem;
  font-family: inherit;
  color: rgba(0, 0, 0, 0.87);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.fiesta-daterange-day:hover:not(.ph) {
  background-color: rgba(0, 0, 0, 0.04);
}

.fiesta-daterange-day.is-edge {
  background-color: var(--drp-mui-primary);
  color: #fff;
  font-weight: 600;
}

.fiesta-daterange-day.is-edge:hover {
  background-color: var(--drp-mui-primary-dark);
  color: #fff;
}

.fiesta-daterange-day.is-in-range {
  border-radius: 0;
  background-color: var(--drp-mui-primary-range);
}

.fiesta-daterange-day.is-in-range:hover {
  background-color: var(--drp-mui-primary-range-hover);
}

.fiesta-daterange-popover-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--drp-mui-divider);
}

.fiesta-daterange-btn {
  flex: 1;
  box-sizing: border-box;
  min-height: 36px;
  padding: 6px 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.75;
  border-radius: 4px;
  cursor: pointer;
  text-transform: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.fiesta-daterange-btn-outlined {
  border: 1px solid rgba(25, 118, 210, 0.5);
  background: #fff;
  color: var(--drp-mui-primary);
}

.fiesta-daterange-btn-outlined:hover:not(:disabled) {
  border-color: var(--drp-mui-primary);
  background: var(--drp-mui-primary-light);
}

.fiesta-daterange-btn-outlined-muted {
  border-color: rgba(0, 0, 0, 0.23);
  color: rgba(0, 0, 0, 0.38);
}

.fiesta-daterange-btn-outlined-muted:hover:not(:disabled) {
  border-color: rgba(0, 0, 0, 0.87);
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.87);
}

.fiesta-daterange-btn-contained {
  border: none;
  background: var(--drp-mui-primary);
  color: #fff;
  box-shadow:
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.fiesta-daterange-btn-contained:hover {
  background: var(--drp-mui-primary-dark);
  box-shadow:
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    0 4px 5px 0 rgba(0, 0, 0, 0.14),
    0 1px 10px 0 rgba(0, 0, 0, 0.12);
}

.fiesta-daterange-btn:disabled {
  cursor: not-allowed;
  pointer-events: none;
  color: rgba(0, 0, 0, 0.26);
  border-color: rgba(0, 0, 0, 0.12);
  background: transparent;
  box-shadow: none;
}

.fiesta-daterange-btn-contained:disabled {
  background-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.26);
}

/* Popover "Data personalizada" (Pedidos) — tokens e fundos claros incompatíveis com tema escuro */
:root[data-theme="dark"] .fiesta-daterange-popover {
  --drp-mui-primary: #42a5f5;
  --drp-mui-primary-dark: #1976d2;
  --drp-mui-primary-light: rgba(66, 165, 245, 0.14);
  --drp-mui-primary-range: rgba(66, 165, 245, 0.22);
  --drp-mui-primary-range-hover: rgba(66, 165, 245, 0.32);
  --drp-mui-divider: rgba(255, 255, 255, 0.12);
  --drp-mui-badge-bg: rgba(66, 165, 245, 0.22);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

:root[data-theme="dark"] .fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field > label {
  color: var(--text-secondary);
  background-color: var(--bg-card);
}

:root[data-theme="dark"] .fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field > input {
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--outline-muted-border);
}

:root[data-theme="dark"] .fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field > input::placeholder {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .fiesta-daterange-popover .fiesta-field-outlined.fiesta-daterange-popover-field > input:hover {
  border-color: var(--text-secondary);
}

:root[data-theme="dark"] .fiesta-daterange-days-count-n,
:root[data-theme="dark"] .fiesta-daterange-days-count-lbl {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .fiesta-daterange-nav-btn {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .fiesta-daterange-nav-btn:hover {
  background-color: var(--bg-hover);
}

:root[data-theme="dark"] .fiesta-daterange-title-btn {
  color: var(--text-primary);
}

:root[data-theme="dark"] .fiesta-daterange-title-btn:hover {
  background-color: var(--bg-hover);
}

:root[data-theme="dark"] .fiesta-daterange-title-chevron {
  border-top-color: var(--gray-400);
}

:root[data-theme="dark"] .fiesta-daterange-month-panel {
  background: var(--gray-100);
  border: 1px solid var(--border-color);
}

:root[data-theme="dark"] .fiesta-daterange-month-year {
  color: var(--text-primary);
}

:root[data-theme="dark"] .fiesta-daterange-month-cell {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--outline-muted-border);
}

:root[data-theme="dark"] .fiesta-daterange-month-cell:hover {
  background: var(--bg-hover);
}

:root[data-theme="dark"] .fiesta-daterange-wd {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .fiesta-daterange-day {
  color: var(--text-primary);
}

:root[data-theme="dark"] .fiesta-daterange-day:hover:not(.ph) {
  background-color: var(--bg-hover);
}

:root[data-theme="dark"] .fiesta-daterange-btn-outlined {
  border-color: rgba(66, 165, 245, 0.55);
  background: transparent;
  color: var(--primary);
}

:root[data-theme="dark"] .fiesta-daterange-btn-outlined:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--drp-mui-primary-light);
}

:root[data-theme="dark"] .fiesta-daterange-btn-outlined-muted {
  border-color: var(--outline-muted-border);
  color: var(--text-secondary);
}

:root[data-theme="dark"] .fiesta-daterange-btn-outlined-muted:hover:not(:disabled) {
  border-color: var(--text-secondary);
  background: var(--bg-hover);
  color: var(--text-primary);
}

:root[data-theme="dark"] .fiesta-daterange-btn:disabled {
  color: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.1);
  background: transparent;
}

:root[data-theme="dark"] .fiesta-daterange-btn-contained:disabled {
  background-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.35);
}

/* =============================================================================
   ALERTS
   ============================================================================= */

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-info {
  background-color: rgba(6, 182, 212, 0.1);
  color: var(--info-dark);
  border-left: 4px solid var(--info);
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--secondary-dark);
  border-left: 4px solid var(--secondary);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning-dark);
  border-left: 4px solid var(--warning);
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-dark);
  border-left: 4px solid var(--danger);
}

/* Toasts fixos: melhorar contraste e evitar sobreposição do header */
#toast-container {
  z-index: 30000 !important;
}

#toast-container .alert {
  margin-bottom: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background-clip: padding-box;
  align-items: center;
}

#toast-container .alert-info {
  background-color: #e0f7ff;
  color: #0b4b5a;
}

#toast-container .alert-success {
  background-color: #e8fbf3;
  color: #145a41;
}

#toast-container .alert-warning {
  background-color: #fff4dd;
  color: #7a4d00;
}

#toast-container .alert-danger {
  background-color: #ffe8e8;
  color: #7f1d1d;
}

:root[data-theme="dark"] #toast-container .alert {
  border-color: rgba(255, 255, 255, 0.18);
}

:root[data-theme="dark"] #toast-container .alert-info {
  background-color: #0f2d38;
  color: #d2f0ff;
}

:root[data-theme="dark"] #toast-container .alert-success {
  background-color: #103025;
  color: #d7f7e8;
}

:root[data-theme="dark"] #toast-container .alert-warning {
  background-color: #3a2a0f;
  color: #ffe8bf;
}

:root[data-theme="dark"] #toast-container .alert-danger {
  background-color: #3b1a1a;
  color: #ffd6d6;
}

/* Renovação UpSeller (modal VNC fullscreen): toast bem visível sobre fundo escuro */
#toast-upseller-renew {
  min-width: 320px;
  max-width: min(520px, calc(100vw - 2rem));
  padding: 0.85rem 1.1rem !important;
  opacity: 1 !important;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(6px);
}

#toast-upseller-renew.alert-info {
  background-color: #0c4a6e !important;
  color: #e0f2fe !important;
  border-left: 4px solid #38bdf8 !important;
}

#toast-upseller-renew.alert-success {
  background-color: #14532d !important;
  color: #dcfce7 !important;
  border-left: 4px solid #4ade80 !important;
}

#toast-upseller-renew.alert-danger {
  background-color: #7f1d1d !important;
  color: #fee2e2 !important;
  border-left: 4px solid #f87171 !important;
}

body:has(#upsellerRenewalModal[style*="flex"]) #toast-container {
  z-index: 30001 !important;
}

#toast-container .alert-toast-confirm {
  align-items: flex-start;
  max-width: min(26rem, calc(100vw - 2.5rem));
  min-width: 0;
}

#toast-container .alert-toast-confirm > .alert-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

#toast-container .alert-toast-confirm .alert-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
}

.toast-confirm-title {
  white-space: normal;
  line-height: 1.35;
  font-weight: 600;
}

.toast-confirm-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
}

.toast-confirm-warning {
  opacity: 0.9;
  font-size: 0.875rem;
  line-height: 1.35;
  white-space: normal;
}

.toast-confirm-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

/* =============================================================================
   TABLES
   ============================================================================= */

.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background-color: var(--gray-50);
}

.table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background-color: var(--bg-hover);
}

/* =============================================================================
   BADGES
   ============================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-primary {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--primary-dark);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--secondary-dark);
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-dark);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning-dark);
}

.badge-info {
  background-color: rgba(6, 182, 212, 0.1);
  color: var(--info-dark);
}

/* =============================================================================
   ABAS — página Pedidos (lista / sincronização)
   ============================================================================= */

.fiesta-pedidos-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fiesta-page-tabs-wrap {
  margin-bottom: 1.25rem;
  width: 100%;
}

.fiesta-page-tabs {
  display: flex;
  width: 100%;
  align-items: stretch;
  padding: 4px;
  gap: 4px;
  background: linear-gradient(145deg, var(--gray-100) 0%, var(--gray-200) 100%);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.fiesta-page-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
  padding: 0.65rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.fiesta-page-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.55);
}

.fiesta-page-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.fiesta-page-tab.is-active {
  color: var(--primary-dark);
  font-weight: 600;
  background: var(--bg-card);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 4px 12px rgba(37, 99, 235, 0.12);
}

.fiesta-page-tab.is-active .fiesta-page-tab-icon {
  color: var(--primary);
}

.fiesta-page-tab-icon {
  font-size: 1rem;
  opacity: 0.85;
  transition: color 0.2s ease;
}

.fiesta-pedidos-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: fiesta-tab-fade-in 0.28s ease;
}

.fiesta-pedidos-tab-panel[hidden] {
  display: none !important;
}

@keyframes fiesta-tab-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .fiesta-page-tabs {
    flex-direction: column;
  }

  .fiesta-page-tab {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }
}

/* Rodapé de tabela — tipografia Sistema 2 (Helvetica 14px / lh 20px, cor secundária MUI) */
.fiesta-table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}

.fiesta-table-pagination__rows {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fiesta-table-pagination__label {
  font-size: inherit;
  line-height: inherit;
  color: rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.fiesta-table-pagination__select {
  /* 5rem ≈ 80px @ root 16px — tipografia MUI body1 (16px / 24px) como Sistema 2 */
  width: 5rem;
  min-width: 5rem;
  max-width: 5rem;
  box-sizing: border-box;
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 1rem;
  line-height: 1.5rem;
  font-family: inherit;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.87);
  background-color: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  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='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem 1rem;
}

.fiesta-table-pagination__select:hover {
  border-color: var(--primary);
}

.fiesta-table-pagination__select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.fiesta-table-pagination__right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.fiesta-table-pagination__range,
.fiesta-table-pagination__page-of {
  font-size: inherit;
  line-height: inherit;
  color: rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.fiesta-table-pagination__icons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.fiesta-table-pagination__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--primary);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.fiesta-table-pagination__icon:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-dark);
}

.fiesta-table-pagination__icon--disabled {
  color: var(--gray-400);
  cursor: default;
  pointer-events: none;
}

/* Paginação (Pedidos / Sincronização): labels e texto usavam cinza MUI claro — no dark ficavam ilegíveis */
:root[data-theme="dark"] .fiesta-table-pagination {
  border-top-color: var(--border-color);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, var(--gray-100) 100%);
}

:root[data-theme="dark"] .fiesta-table-pagination__label,
:root[data-theme="dark"] .fiesta-table-pagination__range,
:root[data-theme="dark"] .fiesta-table-pagination__page-of {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .fiesta-table-pagination__select {
  color: var(--text-primary);
  border-color: var(--outline-muted-border);
  background-color: var(--bg-card);
  /* Chevron alinhado ao tamanho 16px (1rem) do Sistema 2 */
  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='none' stroke='%23bdbdbd' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-size: 1rem 1rem;
}

:root[data-theme="dark"] .fiesta-table-pagination__select:hover {
  border-color: var(--primary);
}

:root[data-theme="dark"] .fiesta-table-pagination__select:focus {
  box-shadow: 0 0 0 2px rgba(66, 165, 245, 0.28);
}

:root[data-theme="dark"] .fiesta-table-pagination__icon:hover {
  background: rgba(66, 165, 245, 0.12);
  color: var(--primary-light);
}

/* =============================================================================
   UTILITIES
   ============================================================================= */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .content {
    padding: 1rem;
  }
  
  .header {
    padding: 0.625rem 1rem;
  }
}
