/* ====================================================================
   Isovalle – Design System do Sistema Interno
   Paleta: Dark Navy #071529 · Navy #0F2B48 · Blue #00A3FF · Gold #E8A020
   Tipografia: Inter, sans-serif
   ==================================================================== */

:root {
  --sys-navy-dark:   #071529;
  --sys-navy:        #0F2B48;
  --sys-navy-light:  #16385D;
  --sys-blue:        #00A3FF;
  --sys-blue-hover:  #0084CC;
  --sys-blue-subtle: rgba(0, 163, 255, 0.08);
  --sys-gold:        #E8A020;
  --sys-gold-hover:  #CF8B12;
  --sys-gold-subtle: rgba(232, 160, 32, 0.12);

  /* Variáveis Semânticas (Claro / Padrão) */
  --sys-bg:          #F4F7FA;
  --sys-surface:     #FFFFFF;
  --sys-surface-2:   #F8FAFC;
  --sys-surface-alt: #F8FAFC;
  --sys-text:        #1E2D45;
  --sys-text-muted:  #64748B;
  --sys-border:      #E2E8F0;
  --sys-border-dark: #CBD5E1;
  --sys-primary:     #00A3FF;
  --sys-primary-hover: #0084CC;
  --sys-heading:     #071529;
  --sys-label:       #0F2B48;
  --sys-link:        var(--sys-navy, #0F2B48);
  --sys-link-hover:  var(--sys-navy-dark, #071529);

  --sys-success:     #10B981;
  --sys-success-bg:  #ECFDF5;
  --sys-success-border: #A7F3D0;
  --sys-success-text: #047857;

  --sys-danger:      #EF4444;
  --sys-danger-bg:   #FEF2F2;
  --sys-danger-border: #FECACA;
  --sys-danger-text: #B91C1C;

  --sys-warning:     #F59E0B;
  --sys-warning-bg:  #FFFBEB;
  --sys-warning-border: #FDE68A;
  --sys-warning-text: #B45309;
  --sys-cart-deficit-bg: #FFFDF5;

  --sys-info-bg:     #EFF6FF;
  --sys-info-border: #BFDBFE;
  --sys-info-text:   #1D4ED8;

  --sys-badge-admin-bg:   #FEF3C7;
  --sys-badge-admin-text: #92400E;
  --sys-badge-vendas-bg:  #E0F2FE;
  --sys-badge-vendas-text: #0369A1;
  --sys-badge-fin-bg:     #DCFCE7;
  --sys-badge-fin-text:   #166534;
  --sys-badge-corte-bg:   #F3E8FF;
  --sys-badge-corte-text: #6B21A8;
  --sys-badge-est-bg:     #FFEDD5;
  --sys-badge-est-text:   #9A3412;

  /* Pares Semânticos de Status (Claro / Padrão) */
  --sys-status-danger-bg:     #FEE2E2;
  --sys-status-danger-border: #FECACA;
  --sys-status-danger-text:   #991B1B;

  --sys-status-success-bg:     #DCFCE7;
  --sys-status-success-border: #BBF7D0;
  --sys-status-success-text:   #166534;

  --sys-status-warning-bg:     #FEF3C7;
  --sys-status-warning-border: #FDE68A;
  --sys-status-warning-text:   #92400E;

  --sys-status-info-bg:        #DBEAFE;
  --sys-status-info-border:    #BFDBFE;
  --sys-status-info-text:      #1E40AF;

  --sys-status-neutral-bg:     #F1F5F9;
  --sys-status-neutral-border: #E2E8F0;
  --sys-status-neutral-text:   #475569;

  --sys-status-purple-bg:      #F3E8FF;
  --sys-status-purple-border:  #E9D5FF;
  --sys-status-purple-text:    #6B21A8;

  --sys-status-indigo-bg:      #EEF2FF;
  --sys-status-indigo-border:  #C7D2FE;
  --sys-status-indigo-text:    #4338CA;

  --sys-badge-sky-bg:          #E0F2FE;
  --sys-badge-sky-text:        #0284C7;
  --sys-badge-indigo-bg:       #EEF2FF;
  --sys-badge-indigo-text:     #4F46E5;
  --sys-badge-emerald-bg:      #D1FAE5;
  --sys-badge-emerald-text:    #065F46;

  --sys-radius-sm:   6px;
  --sys-radius:      10px;
  --sys-radius-lg:   14px;
  --sys-shadow-sm:   0 2px 6px rgba(7, 21, 41, 0.04);
  --sys-shadow:      0 4px 20px rgba(7, 21, 41, 0.06);
  --sys-shadow-lg:   0 10px 30px rgba(7, 21, 41, 0.10);
  --sys-modal-backdrop: rgba(15, 23, 42, 0.60);
  --sys-transition:  all 0.2s ease-in-out;
}

[data-theme="dark"] {
  --sys-bg:          #0B132B;
  --sys-surface:     #121D3A;
  --sys-surface-2:   #18264A;
  --sys-surface-alt: #18264A;
  --sys-text:        #E2E8F0;
  --sys-text-muted:  #94A3B8;
  --sys-border:      #1E2E52;
  --sys-border-dark: #2B3D6B;
  --sys-primary:     #00A3FF;
  --sys-primary-hover: #38BDF8;
  --sys-heading:     #F8FAFC;
  --sys-label:       #CBD5E1;
  --sys-link:        #38BDF8;
  --sys-link-hover:  #7DD3FC;

  --sys-success:     #34D399;
  --sys-success-bg:  rgba(16, 185, 129, 0.15);
  --sys-success-border: rgba(16, 185, 129, 0.35);
  --sys-success-text: #6EE7B7;

  --sys-danger:      #F87171;
  --sys-danger-bg:   rgba(239, 68, 68, 0.15);
  --sys-danger-border: rgba(239, 68, 68, 0.35);
  --sys-danger-text: #FCA5A5;

  --sys-warning:     #FBBF24;
  --sys-warning-bg:  rgba(245, 158, 11, 0.15);
  --sys-warning-border: rgba(245, 158, 11, 0.35);
  --sys-warning-text: #FDE68A;
  --sys-cart-deficit-bg: rgba(245, 158, 11, 0.16);

  --sys-info-bg:     rgba(0, 163, 255, 0.15);
  --sys-info-border: rgba(0, 163, 255, 0.35);
  --sys-info-text:   #7DD3FC;

  --sys-badge-admin-bg:   rgba(245, 158, 11, 0.20);
  --sys-badge-admin-text: #FDE68A;
  --sys-badge-vendas-bg:  rgba(0, 163, 255, 0.20);
  --sys-badge-vendas-text: #7DD3FC;
  --sys-badge-fin-bg:     rgba(16, 185, 129, 0.20);
  --sys-badge-fin-text:   #6EE7B7;
  --sys-badge-corte-bg:   rgba(168, 85, 247, 0.20);
  --sys-badge-corte-text: #D8B4FE;
  --sys-badge-est-bg:     rgba(249, 115, 22, 0.20);
  --sys-badge-est-text:   #FDBA74;

  /* Pares Semânticos de Status (Dark) */
  --sys-status-danger-bg:     rgba(239, 68, 68, 0.20);
  --sys-status-danger-border: rgba(239, 68, 68, 0.40);
  --sys-status-danger-text:   #FCA5A5;

  --sys-status-success-bg:     rgba(16, 185, 129, 0.20);
  --sys-status-success-border: rgba(16, 185, 129, 0.40);
  --sys-status-success-text:   #86EFAC;

  --sys-status-warning-bg:     rgba(245, 158, 11, 0.20);
  --sys-status-warning-border: rgba(245, 158, 11, 0.40);
  --sys-status-warning-text:   #FDE68A;

  --sys-status-info-bg:        rgba(0, 163, 255, 0.20);
  --sys-status-info-border:    rgba(0, 163, 255, 0.40);
  --sys-status-info-text:      #93C5FD;

  --sys-status-neutral-bg:     rgba(255, 255, 255, 0.08);
  --sys-status-neutral-border: rgba(255, 255, 255, 0.15);
  --sys-status-neutral-text:   #94A3B8;

  --sys-status-purple-bg:      rgba(168, 85, 247, 0.20);
  --sys-status-purple-border:  rgba(168, 85, 247, 0.40);
  --sys-status-purple-text:    #D8B4FE;

  --sys-status-indigo-bg:      rgba(99, 102, 241, 0.20);
  --sys-status-indigo-border:  rgba(99, 102, 241, 0.40);
  --sys-status-indigo-text:    #A5B4FC;

  --sys-badge-sky-bg:          rgba(14, 165, 233, 0.20);
  --sys-badge-sky-text:        #7DD3FC;
  --sys-badge-indigo-bg:       rgba(99, 102, 241, 0.20);
  --sys-badge-indigo-text:     #A5B4FC;
  --sys-badge-emerald-bg:      rgba(16, 185, 129, 0.20);
  --sys-badge-emerald-text:    #6EE7B7;

  --sys-shadow-sm:   0 2px 6px rgba(0, 0, 0, 0.25);
  --sys-shadow:      0 4px 20px rgba(0, 0, 0, 0.40);
  --sys-shadow-lg:   0 10px 30px rgba(0, 0, 0, 0.55);
  --sys-modal-backdrop: rgba(0, 0, 0, 0.75);
}

[data-theme="dark"] select,
[data-theme="dark"] .sys-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] .sys-input[type="date"],
[data-theme="dark"] .sys-form-control[type="date"] {
  color-scheme: dark !important;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator {
  filter: none !important;
  opacity: .85;
  cursor: pointer;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--sys-bg);
  color: var(--sys-text);
  font-size: 0.93rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--sys-blue);
  text-decoration: none;
  transition: var(--sys-transition);
}
a:hover {
  color: var(--sys-blue-hover);
}

/* ─── Layout Geral ─────────────────────────────────────────────────────────── */
.sys-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ─── Backdrop da Sidebar Mobile (Off-Canvas Drawer) ──────────────────────── */
.sys-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 21, 41, 0.65);
  backdrop-filter: blur(2px);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sys-sidebar {
  width: 260px;
  background: var(--sys-navy-dark);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sys-sidebar__brand {
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
}

.sys-sidebar__brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.sys-sidebar__brand img {
  width: 165px;
  max-width: 100%;
  height: auto;
  max-height: 44px;
  object-fit: contain;
  display: block;
}

.sys-sidebar__brand span {
  font-weight: 700;
  font-size: 0.70rem;
  color: var(--sys-gold);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.sys-sidebar__close {
  display: none !important;
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--sys-radius-sm);
  transition: var(--sys-transition);
}
.sys-sidebar__close:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.10);
}

.sys-sidebar__nav {
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}

.sys-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.70rem 1rem;
  color: #94A3B8;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--sys-radius-sm);
  transition: var(--sys-transition);
}

.sys-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.sys-nav-item.active {
  background: var(--sys-blue);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 163, 255, 0.30);
}

.sys-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sys-sidebar__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: #64748B;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ─── Main Content ────────────────────────────────────────────────────────── */
.sys-main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: calc(100% - 260px);
}

/* ─── Topbar ──────────────────────────────────────────────────────────────── */
.sys-topbar {
  height: 68px;
  background: var(--sys-surface);
  border-bottom: 1px solid var(--sys-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.sys-topbar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.sys-topbar__hamburger {
  display: none !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--sys-radius-sm);
  border: 1px solid var(--sys-border);
  background: var(--sys-surface);
  color: var(--sys-heading);
  cursor: pointer;
  transition: var(--sys-transition);
  flex-shrink: 0;
}

.sys-topbar__hamburger:hover {
  background: var(--sys-surface-alt);
  border-color: var(--sys-border-dark);
}

.sys-topbar__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sys-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sys-topbar__user {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-shrink: 0;
}

.sys-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.sys-user-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--sys-heading);
}

.sys-role-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-admin_master { background: var(--sys-badge-admin-bg); color: var(--sys-badge-admin-text); }
.role-vendas       { background: var(--sys-badge-vendas-bg); color: var(--sys-badge-vendas-text); }
.role-financeiro   { background: var(--sys-badge-fin-bg); color: var(--sys-badge-fin-text); }
.role-corte        { background: var(--sys-badge-corte-bg); color: var(--sys-badge-corte-text); }
.role-estoque      { background: var(--sys-badge-est-bg); color: var(--sys-badge-est-text); }

/* ─── Conteúdo da Página ──────────────────────────────────────────────────── */
.sys-content {
  padding: 2rem;
  flex: 1;
  min-width: 0;
}

/* ─── Rodapé do Sistema ─────────────────────────────────────────────────── */
.sys-footer {
  margin-top: auto;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--sys-border);
  background: var(--sys-surface);
  font-size: 0.78rem;
  color: var(--sys-text-muted);
  text-align: center;
}

.sys-footer a,
.sys-footer__link {
  color: var(--sys-link);
  font-weight: 600;
  text-decoration: underline;
  transition: var(--sys-transition);
}

.sys-footer a:hover,
.sys-footer__link:hover {
  color: var(--sys-link-hover);
}

/* ─── Cards e Containers ─────────────────────────────────────────────────── */
.sys-card {
  background: var(--sys-surface);
  border: 1px solid var(--sys-border);
  border-radius: var(--sys-radius);
  box-shadow: var(--sys-shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.sys-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--sys-border);
}

.sys-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sys-heading);
}

/* ─── Formulários e Controles Universais (Sem Caixas Quadradas) ──────────── */
.sys-form-group {
  margin-bottom: 1.25rem;
}

.sys-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sys-label);
  margin-bottom: 0.4rem;
}

/* Regra Universal para todos os campos de entrada, texto, número e seleção */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
input[type="url"],
select,
textarea,
.sys-input,
.sys-select,
.sys-form-control {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.90rem;
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.4;
  border: 1px solid var(--sys-border-dark);
  border-radius: var(--sys-radius-sm);
  background-color: var(--sys-surface);
  color: var(--sys-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Customização moderna para elementos select com chevron SVG suave */
select,
.sys-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px;
  padding-right: 2.35rem;
  cursor: pointer;
}

select::-ms-expand {
  display: none;
}

/* Foco luminoso unificado */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus,
.sys-input:focus,
.sys-select:focus,
.sys-form-control:focus {
  outline: none;
  border-color: var(--sys-blue);
  box-shadow: 0 0 0 3px var(--sys-blue-subtle);
}

/* Estados desabilitados e apenas leitura */
input:disabled,
select:disabled,
textarea:disabled,
input[readonly],
textarea[readonly] {
  background-color: var(--sys-surface-alt) !important;
  color: var(--sys-text-muted) !important;
  border-color: var(--sys-border) !important;
  cursor: not-allowed;
}

/* Radios e Checkboxes proporcionais */
input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--sys-blue);
  cursor: pointer;
}

/* Botões do Sistema */
.sys-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--sys-radius-sm);
  border: 1px solid transparent;
  color: var(--sys-text);
  cursor: pointer;
  transition: var(--sys-transition);
  white-space: nowrap;
}

.sys-btn-primary,
.sys-btn--primary {
  background: var(--sys-blue);
  color: #FFFFFF;
}
.sys-btn-primary:hover,
.sys-btn--primary:hover {
  background: var(--sys-blue-hover);
  box-shadow: 0 4px 12px rgba(0, 163, 255, 0.25);
}

.sys-btn-gold {
  background: var(--sys-gold);
  color: #FFFFFF;
}
.sys-btn-gold:hover {
  background: var(--sys-gold-hover);
}

.sys-btn-outline {
  background: transparent;
  border-color: var(--sys-border-dark);
  color: var(--sys-text);
}
.sys-btn-outline:hover {
  background: var(--sys-surface-alt);
}

.sys-btn-danger {
  background: var(--sys-danger);
  color: #FFFFFF;
}

.sys-btn-block {
  width: 100%;
}

/* ─── Tabelas de Dados e Contenção de Overflow ───────────────────────────── */
.sys-table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: inherit;
  margin-bottom: 0.5rem;
}

.sys-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.sys-table th {
  background: var(--sys-surface-alt);
  color: var(--sys-heading);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--sys-border);
  white-space: nowrap;
}

.sys-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--sys-border);
  font-size: 0.88rem;
  color: var(--sys-text);
  vertical-align: middle;
}

.sys-table tr:last-child td {
  border-bottom: none;
}

.sys-table tr:hover td {
  background: rgba(0, 163, 255, 0.02);
}

/* ─── Badges de Status ───────────────────────────────────────────────────── */
.sys-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

/* ─── Alertas ─────────────────────────────────────────────────────────────── */
.sys-alert {
  padding: 0.85rem 1.15rem;
  border-radius: var(--sys-radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sys-alert-danger {
  background: var(--sys-danger-bg);
  border: 1px solid var(--sys-danger-border);
  color: var(--sys-danger-text);
}

.sys-alert-success {
  background: var(--sys-success-bg);
  border: 1px solid var(--sys-success-border);
  color: var(--sys-success-text);
}

.sys-alert-warning {
  background: var(--sys-warning-bg);
  border: 1px solid var(--sys-warning-border);
  color: var(--sys-warning-text);
}

.sys-cart-item--deficit {
  background: var(--sys-cart-deficit-bg, #FFFDF5);
  border-color: var(--sys-warning, #F59E0B);
}

[data-theme="dark"] .sys-cart-item--deficit {
  background: var(--sys-cart-deficit-bg, rgba(245, 158, 11, 0.16)) !important;
  border-color: var(--sys-warning, #FBBF24) !important;
}

/* ─── Modais com Contenção de Borda ──────────────────────────────────────── */
.sys-modal-backdrop,
[id^="modal"] {
  box-sizing: border-box;
}

.sys-modal-content,
[id^="modal"] > div {
  max-width: calc(100vw - 2rem) !important;
  max-height: calc(100vh - 2rem);
  box-sizing: border-box;
  overflow-y: auto;
}

/* ─── Grids Responsivos Auxiliares ───────────────────────────────────────── */
.sys-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.sys-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.sys-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.sys-grid-split {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1rem;
}

/* ─── Tela de Autenticação (Login / Troca de Senha) ───────────────────────── */
.sys-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sys-navy-dark) 0%, var(--sys-navy) 100%);
  padding: 1.5rem;
}

.sys-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--sys-surface);
  border-radius: var(--sys-radius-lg);
  box-shadow: var(--sys-shadow-lg);
  padding: 2.25rem;
}

.sys-auth-header {
  text-align: center;
  margin-bottom: 1.85rem;
}

.sys-auth-header img {
  width: 240px;
  max-width: 100%;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1.15rem auto;
}

.sys-auth-badge {
  display: inline-block;
  background: var(--sys-gold-subtle);
  color: var(--sys-gold);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.sys-auth-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--sys-heading);
}

.sys-auth-subtitle {
  font-size: 0.85rem;
  color: var(--sys-text-muted);
  margin-top: 0.25rem;
}

.sys-auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--sys-text-muted);
  border-top: 1px solid var(--sys-border);
  padding-top: 1rem;
}

/* ─── Grid de Módulos (Dashboard) ─────────────────────────────────────────── */
.sys-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.sys-module-card {
  background: var(--sys-surface);
  border: 1px solid var(--sys-border);
  border-radius: var(--sys-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--sys-transition);
  text-decoration: none;
  color: inherit;
}

.sys-module-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sys-shadow);
  border-color: var(--sys-blue);
}

.sys-module-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--sys-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sys-blue-subtle);
  color: var(--sys-blue);
}

.sys-module-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sys-heading);
}

.sys-module-desc {
  font-size: 0.82rem;
  color: var(--sys-text-muted);
  line-height: 1.4;
}

/* ─── Responsividade Completa (Tablet e Mobile) ───────────────────────────── */
@media (max-width: 992px) {
  .sys-topbar__hamburger {
    display: inline-flex !important;
  }

  .sys-sidebar {
    width: 280px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 200;
    transform: translateX(-100%);
    box-shadow: var(--sys-shadow-lg);
  }

  .sys-sidebar__close {
    display: block !important;
  }

  body.sys-sidebar-open .sys-sidebar {
    transform: translateX(0) !important;
  }

  body.sys-sidebar-open .sys-sidebar-backdrop {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.sys-sidebar-open {
    overflow: hidden;
  }

  .sys-main {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .sys-topbar {
    padding: 0 1.25rem;
    height: 62px;
  }

  .sys-topbar__title {
    font-size: 1rem;
    max-width: 220px;
  }

  .sys-content {
    padding: 1.25rem;
  }

  .sys-grid-2,
  .sys-grid-3,
  .sys-grid-4,
  .sys-grid-split {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .sys-topbar {
    padding: 0 0.85rem;
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(58px + env(safe-area-inset-top, 0px));
    gap: 0.5rem;
  }

  .sys-topbar__left {
    flex: 1;
    min-width: 0;
  }

  .sys-topbar__title {
    font-size: 0.95rem;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sys-topbar__user {
    flex-shrink: 0;
  }

  .sys-content {
    padding: 0.85rem;
  }

  .sys-card {
    padding: 1.10rem;
    border-radius: var(--sys-radius-sm);
    margin-bottom: 1rem;
  }

  .sys-user-name,
  .sys-topbar .sys-role-badge {
    display: none;
  }

  .sys-btn {
    min-height: 42px;
    padding: 0.55rem 1rem;
  }

  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="datetime-local"],
  select,
  textarea,
  .sys-input,
  .sys-select,
  .sys-form-control {
    min-height: 42px;
    font-size: 16px; /* Impede auto-zoom no iOS Safari e Chrome Mobile */
  }
}

/* ─── Banner Oficial de Atualização do App (Padrão Agryon) ──────────────── */
.sys-update-banner {
  background: linear-gradient(135deg, #071529 0%, #0F2B48 100%);
  color: #FFFFFF;
  border-bottom: 2px solid var(--sys-gold);
  padding: 0.65rem 1rem;
  padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 4px 14px rgba(7, 21, 41, 0.35);
  position: sticky;
  top: 0;
  z-index: 9999;
  animation: sysSlideDown 0.35s ease;
}

@keyframes sysSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sys-update-banner__content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.sys-update-banner__icon {
  font-size: 1.30rem;
  flex-shrink: 0;
}

.sys-update-banner__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sys-update-banner__text strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sys-update-banner__text span {
  font-size: 0.73rem;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sys-update-banner__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sys-btn-update-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sys-gold);
  color: #071529 !important;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--sys-radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sys-btn-update-download:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.sys-update-banner__close {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
}

.sys-update-banner__close:hover {
  color: #FFFFFF;
}

/* -------------------------------------------------------------------------
   ISOLAMENTO DE IMPRESSÃO: FORÇA TEMA CLARO INDEPENDENTE DE DATA-THEME
   ------------------------------------------------------------------------- */

/* === INICIO TEMA OVERRIDES GLOBAIS === */
/* ====================================================================
   Sobrescritas Globais por Atributo de Estilo Inline (Tema Escuro)
   Gerado automaticamente por ~/verify/gera_tema_overrides.py
   ==================================================================== */

/* ── 1. Textos Escuros Fixos & Semânticos ── */
/* Textos com tokens navy (navy-dark, navy, navy-light) como cor de texto */
[data-theme="dark"] [style*="color: var(--sys-navy-dark)"],
[data-theme="dark"] [style*="color:var(--sys-navy-dark)"],
[data-theme="dark"] [style*="color: var(--sys-navy-dark,"],
[data-theme="dark"] [style*="color:var(--sys-navy-dark,"],
[data-theme="dark"] [style*="color: var(--sys-navy-dark)" i],
[data-theme="dark"] [style*="color:var(--sys-navy-dark)" i],
[data-theme="dark"] [style*="color: var(--sys-navy-dark," i],
[data-theme="dark"] [style*="color:var(--sys-navy-dark," i] {
  color: var(--sys-heading, #F8FAFC) !important;
}

[data-theme="dark"] [style*="color: var(--sys-navy)"],
[data-theme="dark"] [style*="color:var(--sys-navy)"],
[data-theme="dark"] [style*="color: var(--sys-navy,"],
[data-theme="dark"] [style*="color:var(--sys-navy,"],
[data-theme="dark"] [style*="color: var(--sys-navy)" i],
[data-theme="dark"] [style*="color:var(--sys-navy)" i],
[data-theme="dark"] [style*="color: var(--sys-navy," i],
[data-theme="dark"] [style*="color:var(--sys-navy," i],
[data-theme="dark"] [style*="color: var(--sys-navy-light)"],
[data-theme="dark"] [style*="color:var(--sys-navy-light)"],
[data-theme="dark"] [style*="color: var(--sys-navy-light,"],
[data-theme="dark"] [style*="color:var(--sys-navy-light,"],
[data-theme="dark"] [style*="color: var(--sys-navy-light)" i],
[data-theme="dark"] [style*="color:var(--sys-navy-light)" i],
[data-theme="dark"] [style*="color: var(--sys-navy-light," i],
[data-theme="dark"] [style*="color:var(--sys-navy-light," i] {
  color: var(--sys-text, #E2E8F0) !important;
}

/* Classes e componentes que utilizam navy ou cores escuras como texto */
[data-theme="dark"] .sys-product-name {
  color: var(--sys-heading, #F8FAFC) !important;
}

[data-theme="dark"] .sys-pdv-custom-btn {
  color: #FFFFFF !important;
}

[data-theme="dark"] .sys-category-pill.active {
  background: var(--sys-primary) !important;
  border-color: var(--sys-primary) !important;
  color: #071529 !important;
}

[data-theme="dark"] .sys-btn-primary,
[data-theme="dark"] .sys-btn--primary {
  background: var(--sys-primary);
  color: #071529 !important;
  font-weight: 700;
}

[data-theme="dark"] .sys-btn-primary:hover,
[data-theme="dark"] .sys-btn--primary:hover {
  background: var(--sys-primary-hover);
  color: #071529 !important;
}

[data-theme="dark"] .sys-btn-gold {
  color: #071529 !important;
  font-weight: 700;
}

[data-theme="dark"] .sys-nav-item.active {
  color: #071529 !important;
  font-weight: 700;
}

[data-theme="dark"] .sys-nav-item.active svg {
  stroke: #071529 !important;
}

.sys-queue-pos-first {
  background: var(--sys-primary);
  color: #071529;
}

[data-theme="dark"] .sys-queue-pos-first {
  background: var(--sys-primary) !important;
  color: #071529 !important;
}

[data-theme="dark"] .help-criatio-banner .sys-badge,
[data-theme="dark"] .help-criatio-banner .sys-btn {
  color: #071529 !important;
}

[data-theme="dark"] [style*="color: #78350f" i],
[data-theme="dark"] [style*="color:#78350f" i] {
  color: var(--sys-status-warning-text, #FDE68A) !important;
}

[data-theme="dark"] [style*="color: #7f1d1d" i],
[data-theme="dark"] [style*="color:#7f1d1d" i] {
  color: var(--sys-status-danger-text, #FCA5A5) !important;
}

[data-theme="dark"] [style*="color: #0369a1" i],
[data-theme="dark"] [style*="color:#0369a1" i] {
  color: var(--sys-status-info-text, #93C5FD) !important;
}

[data-theme="dark"] .sys-btn[style*="background: var(--sys-success"],
[data-theme="dark"] .sys-btn[style*="background:var(--sys-success"] {
  color: #071529 !important;
  font-weight: 700;
}

/* Textos principais e titulos escuros fixos */
[data-theme="dark"] [style*="color: #071529"],
[data-theme="dark"] [style*="color:#071529"],
[data-theme="dark"] [style*="color: #071529" i],
[data-theme="dark"] [style*="color:#071529" i],
[data-theme="dark"] [style*="color: #0f172a"],
[data-theme="dark"] [style*="color:#0f172a"],
[data-theme="dark"] [style*="color: #0F172A"],
[data-theme="dark"] [style*="color:#0F172A"],
[data-theme="dark"] [style*="color: #0f172a" i],
[data-theme="dark"] [style*="color:#0f172a" i] {
  color: var(--sys-heading, #F8FAFC) !important;
}

/* Textos normais de corpo escuros fixos */
[data-theme="dark"] [style*="color: #1e2d45"],
[data-theme="dark"] [style*="color:#1e2d45"],
[data-theme="dark"] [style*="color: #1E2D45"],
[data-theme="dark"] [style*="color:#1E2D45"],
[data-theme="dark"] [style*="color: #1e2d45" i],
[data-theme="dark"] [style*="color:#1e2d45" i],
[data-theme="dark"] [style*="color: #1e293b"],
[data-theme="dark"] [style*="color:#1e293b"],
[data-theme="dark"] [style*="color: #1E293B"],
[data-theme="dark"] [style*="color:#1E293B"],
[data-theme="dark"] [style*="color: #1e293b" i],
[data-theme="dark"] [style*="color:#1e293b" i],
[data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color:#334155"],
[data-theme="dark"] [style*="color: #334155" i],
[data-theme="dark"] [style*="color:#334155" i] {
  color: var(--sys-text, #E2E8F0) !important;
}

/* Textos secundarios e legendas mutadas */
[data-theme="dark"] [style*="color: #475569"],
[data-theme="dark"] [style*="color:#475569"],
[data-theme="dark"] [style*="color: #475569" i],
[data-theme="dark"] [style*="color:#475569" i],
[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #64748B"],
[data-theme="dark"] [style*="color:#64748B"],
[data-theme="dark"] [style*="color: #64748b" i],
[data-theme="dark"] [style*="color:#64748b" i] {
  color: var(--sys-text-muted, #94A3B8) !important;
}

/* Textos de status sucesso */
[data-theme="dark"] [style*="color: #059669"],
[data-theme="dark"] [style*="color:#059669"],
[data-theme="dark"] [style*="color: #059669" i],
[data-theme="dark"] [style*="color:#059669" i],
[data-theme="dark"] [style*="color: #15803d"],
[data-theme="dark"] [style*="color:#15803d"],
[data-theme="dark"] [style*="color: #15803D"],
[data-theme="dark"] [style*="color:#15803D"],
[data-theme="dark"] [style*="color: #15803d" i],
[data-theme="dark"] [style*="color:#15803d" i],
[data-theme="dark"] [style*="color: #16a34a"],
[data-theme="dark"] [style*="color:#16a34a"],
[data-theme="dark"] [style*="color: #16A34A"],
[data-theme="dark"] [style*="color:#16A34A"],
[data-theme="dark"] [style*="color: #16a34a" i],
[data-theme="dark"] [style*="color:#16a34a" i] {
  color: var(--sys-status-success-text, #86EFAC) !important;
}

/* Textos de status perigo/erro */
[data-theme="dark"] [style*="color: #dc2626"],
[data-theme="dark"] [style*="color:#dc2626"],
[data-theme="dark"] [style*="color: #DC2626"],
[data-theme="dark"] [style*="color:#DC2626"],
[data-theme="dark"] [style*="color: #dc2626" i],
[data-theme="dark"] [style*="color:#dc2626" i],
[data-theme="dark"] [style*="color: #991b1b"],
[data-theme="dark"] [style*="color:#991b1b"],
[data-theme="dark"] [style*="color: #991B1B"],
[data-theme="dark"] [style*="color:#991B1B"],
[data-theme="dark"] [style*="color: #991b1b" i],
[data-theme="dark"] [style*="color:#991b1b" i],
[data-theme="dark"] [style*="color: #ef4444"],
[data-theme="dark"] [style*="color:#ef4444"],
[data-theme="dark"] [style*="color: #EF4444"],
[data-theme="dark"] [style*="color:#EF4444"],
[data-theme="dark"] [style*="color: #ef4444" i],
[data-theme="dark"] [style*="color:#ef4444" i],
[data-theme="dark"] [style*="color: #b91c1c"],
[data-theme="dark"] [style*="color:#b91c1c"],
[data-theme="dark"] [style*="color: #B91C1C"],
[data-theme="dark"] [style*="color:#B91C1C"],
[data-theme="dark"] [style*="color: #b91c1c" i],
[data-theme="dark"] [style*="color:#b91c1c" i] {
  color: var(--sys-status-danger-text, #FCA5A5) !important;
}

/* Textos de status alerta/aviso */
[data-theme="dark"] [style*="color: #92400e"],
[data-theme="dark"] [style*="color:#92400e"],
[data-theme="dark"] [style*="color: #92400E"],
[data-theme="dark"] [style*="color:#92400E"],
[data-theme="dark"] [style*="color: #92400e" i],
[data-theme="dark"] [style*="color:#92400e" i],
[data-theme="dark"] [style*="color: #b45309"],
[data-theme="dark"] [style*="color:#b45309"],
[data-theme="dark"] [style*="color: #B45309"],
[data-theme="dark"] [style*="color:#B45309"],
[data-theme="dark"] [style*="color: #b45309" i],
[data-theme="dark"] [style*="color:#b45309" i],
[data-theme="dark"] [style*="color: #ea580c"],
[data-theme="dark"] [style*="color:#ea580c"],
[data-theme="dark"] [style*="color: #EA580C"],
[data-theme="dark"] [style*="color:#EA580C"],
[data-theme="dark"] [style*="color: #ea580c" i],
[data-theme="dark"] [style*="color:#ea580c" i],
[data-theme="dark"] [style*="color: #c2410c"],
[data-theme="dark"] [style*="color:#c2410c"],
[data-theme="dark"] [style*="color: #C2410C"],
[data-theme="dark"] [style*="color:#C2410C"],
[data-theme="dark"] [style*="color: #c2410c" i],
[data-theme="dark"] [style*="color:#c2410c" i] {
  color: var(--sys-status-warning-text, #FDE68A) !important;
}

/* Textos informativos azuis */
[data-theme="dark"] [style*="color: #1d4ed8"],
[data-theme="dark"] [style*="color:#1d4ed8"],
[data-theme="dark"] [style*="color: #1D4ED8"],
[data-theme="dark"] [style*="color:#1D4ED8"],
[data-theme="dark"] [style*="color: #1d4ed8" i],
[data-theme="dark"] [style*="color:#1d4ed8" i],
[data-theme="dark"] [style*="color: #1e40af"],
[data-theme="dark"] [style*="color:#1e40af"],
[data-theme="dark"] [style*="color: #1E40AF"],
[data-theme="dark"] [style*="color:#1E40AF"],
[data-theme="dark"] [style*="color: #1e40af" i],
[data-theme="dark"] [style*="color:#1e40af" i],
[data-theme="dark"] [style*="color: #2563eb"],
[data-theme="dark"] [style*="color:#2563eb"],
[data-theme="dark"] [style*="color: #2563EB"],
[data-theme="dark"] [style*="color:#2563EB"],
[data-theme="dark"] [style*="color: #2563eb" i],
[data-theme="dark"] [style*="color:#2563eb" i] {
  color: var(--sys-status-info-text, #93C5FD) !important;
}

/* Textos semanticos roxos */
[data-theme="dark"] [style*="color: #6d28d9"],
[data-theme="dark"] [style*="color:#6d28d9"],
[data-theme="dark"] [style*="color: #6D28D9"],
[data-theme="dark"] [style*="color:#6D28D9"],
[data-theme="dark"] [style*="color: #6d28d9" i],
[data-theme="dark"] [style*="color:#6d28d9" i],
[data-theme="dark"] [style*="color: #7c3aed"],
[data-theme="dark"] [style*="color:#7c3aed"],
[data-theme="dark"] [style*="color: #7C3AED"],
[data-theme="dark"] [style*="color:#7C3AED"],
[data-theme="dark"] [style*="color: #7c3aed" i],
[data-theme="dark"] [style*="color:#7c3aed" i],
[data-theme="dark"] [style*="color: #6b21a8"],
[data-theme="dark"] [style*="color:#6b21a8"],
[data-theme="dark"] [style*="color: #6B21A8"],
[data-theme="dark"] [style*="color:#6B21A8"],
[data-theme="dark"] [style*="color: #6b21a8" i],
[data-theme="dark"] [style*="color:#6b21a8" i] {
  color: var(--sys-status-purple-text, #D8B4FE) !important;
}

/* ── 2. Fundos Claros Fixos & Semânticos ── */
/* Cartoes e containers com fundo branco fixo */
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #FFF"],
[data-theme="dark"] [style*="background:#FFF"],
[data-theme="dark"] [style*="background: #fff" i],
[data-theme="dark"] [style*="background:#fff" i],
[data-theme="dark"] [style*="background-color: #fff"],
[data-theme="dark"] [style*="background-color:#fff"],
[data-theme="dark"] [style*="background-color: #FFF"],
[data-theme="dark"] [style*="background-color:#FFF"],
[data-theme="dark"] [style*="background-color: #fff" i],
[data-theme="dark"] [style*="background-color:#fff" i],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: #FFFFFF"],
[data-theme="dark"] [style*="background:#FFFFFF"],
[data-theme="dark"] [style*="background: #ffffff" i],
[data-theme="dark"] [style*="background:#ffffff" i],
[data-theme="dark"] [style*="background-color: #ffffff"],
[data-theme="dark"] [style*="background-color:#ffffff"],
[data-theme="dark"] [style*="background-color: #FFFFFF"],
[data-theme="dark"] [style*="background-color:#FFFFFF"],
[data-theme="dark"] [style*="background-color: #ffffff" i],
[data-theme="dark"] [style*="background-color:#ffffff" i] {
  background-color: var(--sys-surface, #121D3A) !important;
}

/* Containers e colunas de kanban claros */
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #F8FAFC"],
[data-theme="dark"] [style*="background:#F8FAFC"],
[data-theme="dark"] [style*="background: #f8fafc" i],
[data-theme="dark"] [style*="background:#f8fafc" i],
[data-theme="dark"] [style*="background-color: #f8fafc"],
[data-theme="dark"] [style*="background-color:#f8fafc"],
[data-theme="dark"] [style*="background-color: #F8FAFC"],
[data-theme="dark"] [style*="background-color:#F8FAFC"],
[data-theme="dark"] [style*="background-color: #f8fafc" i],
[data-theme="dark"] [style*="background-color:#f8fafc" i],
[data-theme="dark"] [style*="background: #f1f5f9"],
[data-theme="dark"] [style*="background:#f1f5f9"],
[data-theme="dark"] [style*="background: #F1F5F9"],
[data-theme="dark"] [style*="background:#F1F5F9"],
[data-theme="dark"] [style*="background: #f1f5f9" i],
[data-theme="dark"] [style*="background:#f1f5f9" i],
[data-theme="dark"] [style*="background-color: #f1f5f9"],
[data-theme="dark"] [style*="background-color:#f1f5f9"],
[data-theme="dark"] [style*="background-color: #F1F5F9"],
[data-theme="dark"] [style*="background-color:#F1F5F9"],
[data-theme="dark"] [style*="background-color: #f1f5f9" i],
[data-theme="dark"] [style*="background-color:#f1f5f9" i],
[data-theme="dark"] [style*="background: #fafafa"],
[data-theme="dark"] [style*="background:#fafafa"],
[data-theme="dark"] [style*="background: #FAFAFA"],
[data-theme="dark"] [style*="background:#FAFAFA"],
[data-theme="dark"] [style*="background: #fafafa" i],
[data-theme="dark"] [style*="background:#fafafa" i],
[data-theme="dark"] [style*="background-color: #fafafa"],
[data-theme="dark"] [style*="background-color:#fafafa"],
[data-theme="dark"] [style*="background-color: #FAFAFA"],
[data-theme="dark"] [style*="background-color:#FAFAFA"],
[data-theme="dark"] [style*="background-color: #fafafa" i],
[data-theme="dark"] [style*="background-color:#fafafa" i] {
  background-color: var(--sys-surface-2, #18264A) !important;
}

/* Containers neutros cinza-claro */
[data-theme="dark"] [style*="background: #e2e8f0"],
[data-theme="dark"] [style*="background:#e2e8f0"],
[data-theme="dark"] [style*="background: #E2E8F0"],
[data-theme="dark"] [style*="background:#E2E8F0"],
[data-theme="dark"] [style*="background: #e2e8f0" i],
[data-theme="dark"] [style*="background:#e2e8f0" i],
[data-theme="dark"] [style*="background-color: #e2e8f0"],
[data-theme="dark"] [style*="background-color:#e2e8f0"],
[data-theme="dark"] [style*="background-color: #E2E8F0"],
[data-theme="dark"] [style*="background-color:#E2E8F0"],
[data-theme="dark"] [style*="background-color: #e2e8f0" i],
[data-theme="dark"] [style*="background-color:#e2e8f0" i] {
  background-color: var(--sys-surface-alt, #18264A) !important;
}

/* Badges e alertas ambar/amarelo */
[data-theme="dark"] [style*="background: #fffbeb"],
[data-theme="dark"] [style*="background:#fffbeb"],
[data-theme="dark"] [style*="background: #FFFBEB"],
[data-theme="dark"] [style*="background:#FFFBEB"],
[data-theme="dark"] [style*="background: #fffbeb" i],
[data-theme="dark"] [style*="background:#fffbeb" i],
[data-theme="dark"] [style*="background-color: #fffbeb"],
[data-theme="dark"] [style*="background-color:#fffbeb"],
[data-theme="dark"] [style*="background-color: #FFFBEB"],
[data-theme="dark"] [style*="background-color:#FFFBEB"],
[data-theme="dark"] [style*="background-color: #fffbeb" i],
[data-theme="dark"] [style*="background-color:#fffbeb" i],
[data-theme="dark"] [style*="background: #fef3c7"],
[data-theme="dark"] [style*="background:#fef3c7"],
[data-theme="dark"] [style*="background: #FEF3C7"],
[data-theme="dark"] [style*="background:#FEF3C7"],
[data-theme="dark"] [style*="background: #fef3c7" i],
[data-theme="dark"] [style*="background:#fef3c7" i],
[data-theme="dark"] [style*="background-color: #fef3c7"],
[data-theme="dark"] [style*="background-color:#fef3c7"],
[data-theme="dark"] [style*="background-color: #FEF3C7"],
[data-theme="dark"] [style*="background-color:#FEF3C7"],
[data-theme="dark"] [style*="background-color: #fef3c7" i],
[data-theme="dark"] [style*="background-color:#fef3c7" i],
[data-theme="dark"] [style*="background: #ffedd5"],
[data-theme="dark"] [style*="background:#ffedd5"],
[data-theme="dark"] [style*="background: #FFEDD5"],
[data-theme="dark"] [style*="background:#FFEDD5"],
[data-theme="dark"] [style*="background: #ffedd5" i],
[data-theme="dark"] [style*="background:#ffedd5" i],
[data-theme="dark"] [style*="background-color: #ffedd5"],
[data-theme="dark"] [style*="background-color:#ffedd5"],
[data-theme="dark"] [style*="background-color: #FFEDD5"],
[data-theme="dark"] [style*="background-color:#FFEDD5"],
[data-theme="dark"] [style*="background-color: #ffedd5" i],
[data-theme="dark"] [style*="background-color:#ffedd5" i] {
  background-color: var(--sys-warning-bg, rgba(245, 158, 11, 0.15)) !important;
}

/* Badges e alertas verdes */
[data-theme="dark"] [style*="background: #ecfdf5"],
[data-theme="dark"] [style*="background:#ecfdf5"],
[data-theme="dark"] [style*="background: #ECFDF5"],
[data-theme="dark"] [style*="background:#ECFDF5"],
[data-theme="dark"] [style*="background: #ecfdf5" i],
[data-theme="dark"] [style*="background:#ecfdf5" i],
[data-theme="dark"] [style*="background-color: #ecfdf5"],
[data-theme="dark"] [style*="background-color:#ecfdf5"],
[data-theme="dark"] [style*="background-color: #ECFDF5"],
[data-theme="dark"] [style*="background-color:#ECFDF5"],
[data-theme="dark"] [style*="background-color: #ecfdf5" i],
[data-theme="dark"] [style*="background-color:#ecfdf5" i],
[data-theme="dark"] [style*="background: #effcf6"],
[data-theme="dark"] [style*="background:#effcf6"],
[data-theme="dark"] [style*="background: #EFFCF6"],
[data-theme="dark"] [style*="background:#EFFCF6"],
[data-theme="dark"] [style*="background: #effcf6" i],
[data-theme="dark"] [style*="background:#effcf6" i],
[data-theme="dark"] [style*="background-color: #effcf6"],
[data-theme="dark"] [style*="background-color:#effcf6"],
[data-theme="dark"] [style*="background-color: #EFFCF6"],
[data-theme="dark"] [style*="background-color:#EFFCF6"],
[data-theme="dark"] [style*="background-color: #effcf6" i],
[data-theme="dark"] [style*="background-color:#effcf6" i],
[data-theme="dark"] [style*="background: #d1fae5"],
[data-theme="dark"] [style*="background:#d1fae5"],
[data-theme="dark"] [style*="background: #D1FAE5"],
[data-theme="dark"] [style*="background:#D1FAE5"],
[data-theme="dark"] [style*="background: #d1fae5" i],
[data-theme="dark"] [style*="background:#d1fae5" i],
[data-theme="dark"] [style*="background-color: #d1fae5"],
[data-theme="dark"] [style*="background-color:#d1fae5"],
[data-theme="dark"] [style*="background-color: #D1FAE5"],
[data-theme="dark"] [style*="background-color:#D1FAE5"],
[data-theme="dark"] [style*="background-color: #d1fae5" i],
[data-theme="dark"] [style*="background-color:#d1fae5" i],
[data-theme="dark"] [style*="background: #dcfce7"],
[data-theme="dark"] [style*="background:#dcfce7"],
[data-theme="dark"] [style*="background: #DCFCE7"],
[data-theme="dark"] [style*="background:#DCFCE7"],
[data-theme="dark"] [style*="background: #dcfce7" i],
[data-theme="dark"] [style*="background:#dcfce7" i],
[data-theme="dark"] [style*="background-color: #dcfce7"],
[data-theme="dark"] [style*="background-color:#dcfce7"],
[data-theme="dark"] [style*="background-color: #DCFCE7"],
[data-theme="dark"] [style*="background-color:#DCFCE7"],
[data-theme="dark"] [style*="background-color: #dcfce7" i],
[data-theme="dark"] [style*="background-color:#dcfce7" i] {
  background-color: var(--sys-success-bg, rgba(16, 185, 129, 0.15)) !important;
}

/* Badges e alertas azuis */
[data-theme="dark"] [style*="background: #eff6ff"],
[data-theme="dark"] [style*="background:#eff6ff"],
[data-theme="dark"] [style*="background: #EFF6FF"],
[data-theme="dark"] [style*="background:#EFF6FF"],
[data-theme="dark"] [style*="background: #eff6ff" i],
[data-theme="dark"] [style*="background:#eff6ff" i],
[data-theme="dark"] [style*="background-color: #eff6ff"],
[data-theme="dark"] [style*="background-color:#eff6ff"],
[data-theme="dark"] [style*="background-color: #EFF6FF"],
[data-theme="dark"] [style*="background-color:#EFF6FF"],
[data-theme="dark"] [style*="background-color: #eff6ff" i],
[data-theme="dark"] [style*="background-color:#eff6ff" i],
[data-theme="dark"] [style*="background: #f0f9ff"],
[data-theme="dark"] [style*="background:#f0f9ff"],
[data-theme="dark"] [style*="background: #F0F9FF"],
[data-theme="dark"] [style*="background:#F0F9FF"],
[data-theme="dark"] [style*="background: #f0f9ff" i],
[data-theme="dark"] [style*="background:#f0f9ff" i],
[data-theme="dark"] [style*="background-color: #f0f9ff"],
[data-theme="dark"] [style*="background-color:#f0f9ff"],
[data-theme="dark"] [style*="background-color: #F0F9FF"],
[data-theme="dark"] [style*="background-color:#F0F9FF"],
[data-theme="dark"] [style*="background-color: #f0f9ff" i],
[data-theme="dark"] [style*="background-color:#f0f9ff" i],
[data-theme="dark"] [style*="background: #e0f2fe"],
[data-theme="dark"] [style*="background:#e0f2fe"],
[data-theme="dark"] [style*="background: #E0F2FE"],
[data-theme="dark"] [style*="background:#E0F2FE"],
[data-theme="dark"] [style*="background: #e0f2fe" i],
[data-theme="dark"] [style*="background:#e0f2fe" i],
[data-theme="dark"] [style*="background-color: #e0f2fe"],
[data-theme="dark"] [style*="background-color:#e0f2fe"],
[data-theme="dark"] [style*="background-color: #E0F2FE"],
[data-theme="dark"] [style*="background-color:#E0F2FE"],
[data-theme="dark"] [style*="background-color: #e0f2fe" i],
[data-theme="dark"] [style*="background-color:#e0f2fe" i],
[data-theme="dark"] [style*="background: #dbeafe"],
[data-theme="dark"] [style*="background:#dbeafe"],
[data-theme="dark"] [style*="background: #DBEAFE"],
[data-theme="dark"] [style*="background:#DBEAFE"],
[data-theme="dark"] [style*="background: #dbeafe" i],
[data-theme="dark"] [style*="background:#dbeafe" i],
[data-theme="dark"] [style*="background-color: #dbeafe"],
[data-theme="dark"] [style*="background-color:#dbeafe"],
[data-theme="dark"] [style*="background-color: #DBEAFE"],
[data-theme="dark"] [style*="background-color:#DBEAFE"],
[data-theme="dark"] [style*="background-color: #dbeafe" i],
[data-theme="dark"] [style*="background-color:#dbeafe" i] {
  background-color: var(--sys-info-bg, rgba(0, 163, 255, 0.15)) !important;
}

/* Badges e alertas vermelhos */
[data-theme="dark"] [style*="background: #fef2f2"],
[data-theme="dark"] [style*="background:#fef2f2"],
[data-theme="dark"] [style*="background: #FEF2F2"],
[data-theme="dark"] [style*="background:#FEF2F2"],
[data-theme="dark"] [style*="background: #fef2f2" i],
[data-theme="dark"] [style*="background:#fef2f2" i],
[data-theme="dark"] [style*="background-color: #fef2f2"],
[data-theme="dark"] [style*="background-color:#fef2f2"],
[data-theme="dark"] [style*="background-color: #FEF2F2"],
[data-theme="dark"] [style*="background-color:#FEF2F2"],
[data-theme="dark"] [style*="background-color: #fef2f2" i],
[data-theme="dark"] [style*="background-color:#fef2f2" i],
[data-theme="dark"] [style*="background: #fee2e2"],
[data-theme="dark"] [style*="background:#fee2e2"],
[data-theme="dark"] [style*="background: #FEE2E2"],
[data-theme="dark"] [style*="background:#FEE2E2"],
[data-theme="dark"] [style*="background: #fee2e2" i],
[data-theme="dark"] [style*="background:#fee2e2" i],
[data-theme="dark"] [style*="background-color: #fee2e2"],
[data-theme="dark"] [style*="background-color:#fee2e2"],
[data-theme="dark"] [style*="background-color: #FEE2E2"],
[data-theme="dark"] [style*="background-color:#FEE2E2"],
[data-theme="dark"] [style*="background-color: #fee2e2" i],
[data-theme="dark"] [style*="background-color:#fee2e2" i] {
  background-color: var(--sys-danger-bg, rgba(239, 68, 68, 0.15)) !important;
}

/* Badges e alertas roxos */
[data-theme="dark"] [style*="background: #f3e8ff"],
[data-theme="dark"] [style*="background:#f3e8ff"],
[data-theme="dark"] [style*="background: #F3E8FF"],
[data-theme="dark"] [style*="background:#F3E8FF"],
[data-theme="dark"] [style*="background: #f3e8ff" i],
[data-theme="dark"] [style*="background:#f3e8ff" i],
[data-theme="dark"] [style*="background-color: #f3e8ff"],
[data-theme="dark"] [style*="background-color:#f3e8ff"],
[data-theme="dark"] [style*="background-color: #F3E8FF"],
[data-theme="dark"] [style*="background-color:#F3E8FF"],
[data-theme="dark"] [style*="background-color: #f3e8ff" i],
[data-theme="dark"] [style*="background-color:#f3e8ff" i],
[data-theme="dark"] [style*="background: #faf5ff"],
[data-theme="dark"] [style*="background:#faf5ff"],
[data-theme="dark"] [style*="background: #FAF5FF"],
[data-theme="dark"] [style*="background:#FAF5FF"],
[data-theme="dark"] [style*="background: #faf5ff" i],
[data-theme="dark"] [style*="background:#faf5ff" i],
[data-theme="dark"] [style*="background-color: #faf5ff"],
[data-theme="dark"] [style*="background-color:#faf5ff"],
[data-theme="dark"] [style*="background-color: #FAF5FF"],
[data-theme="dark"] [style*="background-color:#FAF5FF"],
[data-theme="dark"] [style*="background-color: #faf5ff" i],
[data-theme="dark"] [style*="background-color:#faf5ff" i],
[data-theme="dark"] [style*="background: #ede9fe"],
[data-theme="dark"] [style*="background:#ede9fe"],
[data-theme="dark"] [style*="background: #EDE9FE"],
[data-theme="dark"] [style*="background:#EDE9FE"],
[data-theme="dark"] [style*="background: #ede9fe" i],
[data-theme="dark"] [style*="background:#ede9fe" i],
[data-theme="dark"] [style*="background-color: #ede9fe"],
[data-theme="dark"] [style*="background-color:#ede9fe"],
[data-theme="dark"] [style*="background-color: #EDE9FE"],
[data-theme="dark"] [style*="background-color:#EDE9FE"],
[data-theme="dark"] [style*="background-color: #ede9fe" i],
[data-theme="dark"] [style*="background-color:#ede9fe" i] {
  background-color: var(--sys-status-purple-bg, rgba(168, 85, 247, 0.20)) !important;
}

/* ── 3. Bordas Claras Fixas ── */
/* Bordas cinza padrao */
[data-theme="dark"] [style*="border-color: #e2e8f0"],
[data-theme="dark"] [style*="border-color:#e2e8f0"],
[data-theme="dark"] [style*="border-color: #E2E8F0"],
[data-theme="dark"] [style*="border-color:#E2E8F0"],
[data-theme="dark"] [style*="border-color: #e2e8f0" i],
[data-theme="dark"] [style*="border-color:#e2e8f0" i],
[data-theme="dark"] [style*="border"][style*="#e2e8f0"],
[data-theme="dark"] [style*="border"][style*="#E2E8F0"],
[data-theme="dark"] [style*="border"][style*="#e2e8f0" i] {
  border-color: var(--sys-border, #1E2E52) !important;
}

/* Bordas cinza escuras */
[data-theme="dark"] [style*="border-color: #cbd5e1"],
[data-theme="dark"] [style*="border-color:#cbd5e1"],
[data-theme="dark"] [style*="border-color: #CBD5E1"],
[data-theme="dark"] [style*="border-color:#CBD5E1"],
[data-theme="dark"] [style*="border-color: #cbd5e1" i],
[data-theme="dark"] [style*="border-color:#cbd5e1" i],
[data-theme="dark"] [style*="border"][style*="#cbd5e1"],
[data-theme="dark"] [style*="border"][style*="#CBD5E1"],
[data-theme="dark"] [style*="border"][style*="#cbd5e1" i] {
  border-color: var(--sys-border-dark, #2B3D6B) !important;
}

[data-theme="dark"] .sys-btn-danger,
[data-theme="dark"] button.sys-btn-danger {
  color: #FFFFFF !important;
}

/* === FIM TEMA OVERRIDES GLOBAIS === */

@media print {
  :root,
  [data-theme="dark"] {
    color-scheme: light !important;
    --sys-bg:          #FFFFFF !important;
    --sys-surface:     #FFFFFF !important;
    --sys-surface-2:   #F8FAFC !important;
    --sys-surface-alt: #F8FAFC !important;
    --sys-text:        #1E2D45 !important;
    --sys-text-muted:  #64748B !important;
    --sys-heading:     #071529 !important;
    --sys-border:      #E2E8F0 !important;
    --sys-border-dark: #CBD5E1 !important;
    --sys-success-bg:  #ECFDF5 !important;
    --sys-success-text: #047857 !important;
    --sys-danger-bg:   #FEF2F2 !important;
    --sys-danger-text: #B91C1C !important;
    --sys-warning-bg:  #FFFBEB !important;
    --sys-warning-text: #B45309 !important;
    --sys-info-bg:     #EFF6FF !important;
    --sys-info-text:   #1D4ED8 !important;
    --sys-status-success-bg:   #DCFCE7 !important;
    --sys-status-success-text: #166534 !important;
    --sys-status-danger-bg:    #FEE2E2 !important;
    --sys-status-danger-text:  #991B1B !important;
    --sys-status-warning-bg:   #FEF3C7 !important;
    --sys-status-warning-text: #92400E !important;
    --sys-status-info-bg:      #DBEAFE !important;
    --sys-status-info-text:    #1E40AF !important;
    --sys-status-purple-bg:    #F3E8FF !important;
    --sys-status-purple-text:  #6B21A8 !important;
    --sys-status-indigo-bg:    #EEF2FF !important;
    --sys-status-indigo-text:  #4338CA !important;
    --sys-status-neutral-bg:   #F1F5F9 !important;
    --sys-status-neutral-text: #475569 !important;
  }

  html,
  body,
  [data-theme="dark"] {
    color-scheme: light !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
  }
}
