/* ==========================================================
   TSWM Dashboard — AdminLTE 3.2.0 + Bootstrap 4
   Cobre: .dashboard-control e .dashboard-customer
   ========================================================== */

/* ----------------------------------------------------------
   Variáveis — Light Mode
   ---------------------------------------------------------- */
:root {
  color-scheme: light;
  --tswm-ink:    #0f172a;
  --tswm-muted:  #475569;
  --tswm-line:   #cbd5e1;
  --tswm-panel:  #ffffff;
  --tswm-bg:     #f8fafc;
  --tswm-soft:   #f1f5f9;
  --tswm-hover:  #e2e8f0;
  --tswm-blue:   #0284c7;
  --tswm-green:  #16a34a;
  --tswm-red:    #dc2626;
  --tswm-amber:  #d97706;
  --tswm-cyan:   #0891b2;
  --tswm-purple: #7c3aed;
  --tswm-shadow:    0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --tswm-shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  --tswm-radius: 0.375rem;
}

/* ----------------------------------------------------------
   Dark Mode — variáveis com alto contraste e luminosidade
   ---------------------------------------------------------- */
html.theme-dark {
  color-scheme: dark;
  --tswm-ink:    #f8fafc;
  --tswm-muted:  #94a3b8;
  --tswm-line:   #334155;
  --tswm-panel:  #1e293b;
  --tswm-bg:     #0f172a;
  --tswm-soft:   #283548;
  --tswm-hover:  #334155;
  --tswm-blue:   #38bdf8;
  --tswm-green:  #4ade80;
  --tswm-red:    #f87171;
  --tswm-amber:  #fbbf24;
  --tswm-cyan:   #22d3ee;
  --tswm-purple: #c084fc;
  --tswm-shadow:    0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --tswm-shadow-lg: 0 14px 28px rgba(0, 0, 0, 0.45);
}

/* Neutraliza o background do AdminLTE injetado por body.dark-mode */
html.theme-dark body.dashboard-shell {
  background-color: var(--tswm-bg) !important;
  color: var(--tswm-ink) !important;
}

/* ----------------------------------------------------------
   PRELOADER
   ---------------------------------------------------------- */
.preloader {
  background-color: var(--tswm-bg) !important;
  color: var(--tswm-ink);
}

.preloader img {
  background-color: var(--tswm-panel);
  border: 1px solid var(--tswm-line);
  border-radius: 8px;
  box-shadow: var(--tswm-shadow-lg);
  padding: 8px;
}

html.theme-dark .preloader {
  background-color: #0f1724 !important;
}

html.theme-dark .preloader img {
  background-color: #1a2638;
  border-color: #2d3a4f;
}

/* ----------------------------------------------------------
   LOGIN — split screen + mesh gradient animado (FeralUI)
   ---------------------------------------------------------- */
body.login-shell {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background-color: #eef3fa;
  color: var(--tswm-ink);
}

html.theme-dark body.login-shell {
  background-color: #070c18;
}

/* ── Backdrop: blobs desfocados em movimento ───────────────── */
.tswm-gradient-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: #eef3fa;
}

html.theme-dark .tswm-gradient-backdrop {
  background-color: #070c18;
}

.tswm-gradient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: .42;
  pointer-events: none;
  will-change: transform;
}

html.theme-dark .tswm-gradient-blob {
  opacity: .72;
}

.tswm-blob-1 {
  width: 620px;
  height: 620px;
  top: -120px;
  left: -100px;
  background: radial-gradient(circle, rgba(2, 132, 199, .75) 0%, rgba(2, 132, 199, 0) 70%);
  animation: tswm-float-1 20s ease-in-out infinite alternate;
}

.tswm-blob-2 {
  width: 680px;
  height: 680px;
  right: -120px;
  bottom: -160px;
  background: radial-gradient(circle, rgba(34, 211, 238, .65) 0%, rgba(34, 211, 238, 0) 70%);
  animation: tswm-float-2 24s ease-in-out infinite alternate;
}

.tswm-blob-3 {
  width: 540px;
  height: 540px;
  top: 35%;
  left: 38%;
  background: radial-gradient(circle, rgba(29, 78, 216, .55) 0%, rgba(99, 102, 241, .45) 45%, rgba(99, 102, 241, 0) 70%);
  animation: tswm-float-3 22s ease-in-out infinite alternate;
}

.tswm-blob-4 {
  width: 580px;
  height: 580px;
  bottom: 5%;
  left: -80px;
  background: radial-gradient(circle, rgba(8, 145, 178, .8) 0%, rgba(22, 163, 74, .3) 45%, rgba(8, 145, 178, 0) 70%);
  animation: tswm-float-4 26s ease-in-out infinite alternate;
}

/* Malha de pontos por cima dos blobs */
.tswm-gradient-mesh {
  position: absolute;
  inset: 0;
  opacity: .85;
  pointer-events: none;
  background-image: radial-gradient(rgba(15, 23, 42, .06) 1px, transparent 1px);
  background-size: 32px 32px;
}

html.theme-dark .tswm-gradient-mesh {
  background-image: radial-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px);
}

@keyframes tswm-float-1 {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate(140px, 90px) scale(1.15) rotate(40deg); }
  100% { transform: translate(70px, 170px) scale(.92) rotate(80deg); }
}

@keyframes tswm-float-2 {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate(-160px, -100px) scale(1.18) rotate(-45deg); }
  100% { transform: translate(-80px, -190px) scale(.95) rotate(-90deg); }
}

@keyframes tswm-float-3 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-100px, 120px) scale(1.22); }
  100% { transform: translate(120px, -80px) scale(.88); }
}

@keyframes tswm-float-4 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(110px, -110px) scale(1.14); }
  100% { transform: translate(180px, -40px) scale(.9); }
}

/* Respeita quem pediu menos animação no sistema */
@media (prefers-reduced-motion: reduce) {
  .tswm-gradient-blob { animation: none !important; }
}

/* ── Layout split ──────────────────────────────────────────── */
.tswm-login-page {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  width: 100%;
  align-items: stretch;
}

.tswm-login-aside {
  flex: 1 1 52%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 56px clamp(32px, 5vw, 80px);
  max-width: 680px;
}

.tswm-login-aside-logo img {
  display: block;
  max-width: 190px;
  max-height: 64px;
  object-fit: contain;
}

.tswm-login-aside h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.025em;
  color: var(--tswm-ink);
}

.tswm-login-aside h2 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--tswm-blue), var(--tswm-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--tswm-blue);
}

.tswm-login-aside > p {
  margin: 0;
  max-width: 46ch;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--tswm-muted);
}

.tswm-login-features {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tswm-login-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .95rem;
  color: var(--tswm-ink);
}

.tswm-login-features i {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: .85rem;
  color: var(--tswm-blue);
  background: rgba(2, 132, 199, .12);
  border: 1px solid rgba(2, 132, 199, .26);
}

html.theme-dark .tswm-login-features i {
  color: var(--tswm-blue);
  background: rgba(56, 189, 248, .14);
  border-color: rgba(56, 189, 248, .3);
}

.tswm-login-features strong {
  display: block;
  font-weight: 700;
}

.tswm-login-features span {
  color: var(--tswm-muted);
  font-size: .88rem;
}

/* ── Coluna do formulário ──────────────────────────────────── */
.tswm-login-main {
  flex: 1 1 48%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.tswm-login-shell {
  width: min(100%, 430px);
}

/* ── Variante larga: formulários com muitos campos ─────────── */
/* O cartão de login foi dimensionado para duas linhas. O autocadastro tem
   sete campos e, a 430px de largura, passava da altura da tela. A variante
   só alarga o cartão e distribui os campos em duas colunas — padding, logo,
   cabeçalho e espaçamento seguem os do login, para as telas de autenticação
   terem o mesmo ritmo visual. */
.tswm-login-shell--wide {
  width: min(100%, 720px);
}

.tswm-signup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.1rem;
}

.tswm-signup-grid > .tswm-signup-full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .tswm-signup-grid {
    grid-template-columns: 1fr;
  }
}

.tswm-login-brand {
  display: none;
}

.tswm-login-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 20px 50px rgba(2, 132, 199, .1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--tswm-ink);
  padding: 30px;
}

html.theme-dark .tswm-login-card {
  background: rgba(17, 23, 34, .85);
  border-color: rgba(255, 255, 255, .1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 0 40px rgba(56, 189, 248, .1);
}

/* Faixa de gradiente no topo do cartão */
.tswm-login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #075985 0%, var(--tswm-blue) 58%, var(--tswm-cyan) 100%);
}

.tswm-login-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(2, 132, 199, .12);
  border: 1px solid rgba(2, 132, 199, .3);
}

html.theme-dark .tswm-login-card-logo {
  background: rgba(56, 189, 248, .15);
  border-color: rgba(56, 189, 248, .32);
}

.tswm-login-card-logo img {
  width: 2.9rem;
  height: 2.9rem;
  object-fit: contain;
}

.tswm-login-card-header {
  margin-bottom: 24px;
  text-align: center;
}

.tswm-login-kicker {
  color: var(--tswm-blue);
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.tswm-login-card h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--tswm-ink);
}

.tswm-login-card p {
  margin: .45rem 0 0;
  font-size: .9rem;
  color: var(--tswm-muted);
}

.tswm-login-form .form-control {
  min-height: 2.85rem;
  border-radius: .7rem;
  background-color: #fff;
  border: 1px solid var(--tswm-line);
  color: var(--tswm-ink);
  font-size: .95rem;
}

html.theme-dark .tswm-login-form .form-control {
  background-color: #111722;
  border-color: var(--tswm-line);
  color: var(--tswm-ink);
}

.tswm-login-form .form-control:focus {
  border-color: var(--tswm-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, .18);
}

html.theme-dark .tswm-login-form .form-control:focus {
  background-color: #121b28;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .22);
}

.tswm-login-form .form-control::placeholder {
  color: var(--tswm-muted);
}

.tswm-login-form .input-group-text {
  border-radius: .7rem;
  background-color: var(--tswm-soft);
  border: 1px solid var(--tswm-line);
  color: var(--tswm-muted);
}

html.theme-dark .tswm-login-form .input-group-text {
  background-color: #1a2332;
  border-color: var(--tswm-line);
}

.tswm-login-form label {
  color: var(--tswm-muted);
  font-size: .85rem;
  font-weight: 600;
}

.tswm-login-form .btn-primary {
  min-height: 2.85rem;
  border: 0;
  border-radius: .7rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--tswm-blue), var(--tswm-cyan));
  box-shadow: 0 10px 24px rgba(2, 132, 199, .25);
}

.tswm-login-form .btn-primary:hover,
.tswm-login-form .btn-primary:focus {
  filter: brightness(1.06);
}

/* ── Alerta de erro inline ─────────────────────────────────── */
.tswm-login-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: .85rem;
  font-size: .88rem;
  line-height: 1.4;
  color: #991b1b;
  background: rgba(220, 38, 38, .09);
  border: 1px solid rgba(220, 38, 38, .3);
}

.tswm-login-alert-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border-radius: .65rem;
  color: #fff;
  background: #dc2626;
  box-shadow: 0 5px 14px rgba(220, 38, 38, .22);
}

.tswm-login-alert-copy,
.tswm-login-alert-copy > span,
.tswm-login-alert-copy > small {
  display: block;
}

.tswm-login-alert-copy {
  min-width: 0;
}

.tswm-login-alert-copy > strong {
  display: block;
  margin-bottom: .2rem;
  color: inherit;
  font-size: .92rem;
  line-height: 1.25;
}

.tswm-login-alert-copy > small {
  margin-top: .4rem;
  color: #7f1d1d;
  font-size: .76rem;
  line-height: 1.35;
}

html.theme-dark .tswm-login-alert {
  color: #fecaca;
  background: rgba(248, 113, 113, .12);
  border-color: rgba(248, 113, 113, .35);
}

html.theme-dark .tswm-login-alert-copy > small {
  color: #fca5a5;
}

/* Variantes do aviso: o estilo base é de erro (vermelho), que em tela de
   confirmação de cadastro passava a impressão de que algo deu errado. */
.tswm-login-alert--info {
  color: #0c4a6e;
  background: rgba(2, 132, 199, .09);
  border-color: rgba(2, 132, 199, .3);
}

.tswm-login-alert--info .tswm-login-alert-icon {
  background: var(--tswm-blue);
  box-shadow: 0 5px 14px rgba(2, 132, 199, .22);
}

.tswm-login-alert--info .tswm-login-alert-copy > small {
  color: #075985;
}

html.theme-dark .tswm-login-alert--info {
  color: #bae6fd;
  background: rgba(56, 189, 248, .12);
  border-color: rgba(56, 189, 248, .35);
}

html.theme-dark .tswm-login-alert--info .tswm-login-alert-copy > small {
  color: #7dd3fc;
}

.tswm-login-alert--warning {
  color: #78350f;
  background: rgba(217, 119, 6, .1);
  border-color: rgba(217, 119, 6, .32);
}

.tswm-login-alert--warning .tswm-login-alert-icon {
  background: var(--tswm-amber);
  box-shadow: 0 5px 14px rgba(217, 119, 6, .22);
}

.tswm-login-alert--warning .tswm-login-alert-copy > small {
  color: #92400e;
}

html.theme-dark .tswm-login-alert--warning {
  color: #fde68a;
  background: rgba(251, 191, 36, .12);
  border-color: rgba(251, 191, 36, .35);
}

html.theme-dark .tswm-login-alert--warning .tswm-login-alert-copy > small {
  color: #fcd34d;
}

/* ── Campos com rótulo ─────────────────────────────────────── */
.tswm-login-field {
  margin-bottom: 1rem;
}

.tswm-login-field > label {
  display: block;
  margin-bottom: .4rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tswm-muted);
}

/* Botão de revelar senha */
.tswm-login-reveal {
  min-height: 2.85rem;
  padding: 0 .85rem;
  border: 1px solid var(--tswm-line);
  border-left: 0;
  border-radius: 0 .7rem .7rem 0;
  background-color: var(--tswm-soft);
  color: var(--tswm-muted);
}

html.theme-dark .tswm-login-reveal {
  background-color: #1a2332;
  border-color: var(--tswm-line);
}

.tswm-login-reveal:hover,
.tswm-login-reveal:focus {
  color: var(--tswm-blue);
}

/* O input seguido do botão não deve ter canto arredondado à direita */
.tswm-login-field .input-group > .form-control {
  border-radius: .7rem 0 0 .7rem;
}

.tswm-login-capslock {
  display: block;
  margin-top: .4rem;
  font-size: .76rem;
  font-weight: 600;
  color: var(--tswm-amber);
}

/* ── Chamada para criar conta ──────────────────────────────── */
.tswm-login-signup {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--tswm-border, rgba(148, 163, 184, .28));
  text-align: center;
}

.tswm-login-signup > span {
  display: block;
  font-size: .82rem;
  color: var(--tswm-text-muted, #64748b);
}

/* ── Linha de lembrar-me + ajuda ───────────────────────────── */
.tswm-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px 0 18px;
}

.tswm-login-help {
  font-size: .82rem;
  font-weight: 600;
  color: var(--tswm-blue);
  text-decoration: none;
}

.tswm-login-help:hover {
  text-decoration: none;
}

.tswm-login-submit[disabled] {
  opacity: .75;
  cursor: progress;
}

/* ── Código de uso único (2FA) ─────────────────────────────── */
.tswm-otp-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: .42em;
  text-align: center;
  text-indent: .42em;
  min-height: 3.4rem;
}

.tswm-otp-input::placeholder {
  letter-spacing: .42em;
  font-weight: 500;
  opacity: .35;
}

.tswm-login-hint {
  display: block;
  margin-top: .45rem;
  font-size: .78rem;
  color: var(--tswm-muted);
}

/* Ícone no lugar do logo, para telas de verificação */
.tswm-login-card-logo i {
  font-size: 1.7rem;
  color: var(--tswm-blue);
}

.tswm-login-links-center {
  justify-content: center;
}

.tswm-login-danger {
  color: var(--tswm-red) !important;
}

/* ── Passos de ativação do 2FA (dentro do painel) ──────────── */
.tswm-2fa-steps {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
  display: grid;
  gap: 1.15rem;
}

.tswm-2fa-steps > li {
  padding-left: .35rem;
}

.tswm-2fa-steps strong {
  display: block;
  margin-bottom: .3rem;
  font-size: .96rem;
  color: var(--tswm-ink);
}

.tswm-2fa-steps span {
  display: block;
  margin-top: .4rem;
  font-size: .85rem;
  line-height: 1.45;
  color: var(--tswm-muted);
}

.tswm-2fa-qr {
  display: inline-flex;
  margin: .6rem 0 .2rem;
  padding: 12px;
  border-radius: .75rem;
  /* O QR precisa de fundo branco para ser lido, inclusive no tema escuro. */
  background: #fff;
  border: 1px solid var(--tswm-line);
}

.tswm-2fa-qr img {
  display: block;
  width: 176px;
  height: 176px;
}

.tswm-2fa-secret input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
}

.tswm-login-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--tswm-line);
}

.tswm-login-links a {
  color: var(--tswm-blue);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
}

.tswm-login-links a:hover {
  text-decoration: none;
}

.tswm-login-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  font-size: .78rem;
  color: var(--tswm-muted);
}

.tswm-login-theme-toggle {
  align-items: center;
  background-color: rgba(255, 255, 255, .9);
  border: 1px solid var(--tswm-line);
  border-radius: 999px;
  color: var(--tswm-ink);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 1038;
  backdrop-filter: blur(10px);
}

html.theme-dark .tswm-login-theme-toggle {
  background-color: rgba(26, 38, 56, .9);
}

/* ── Responsivo ────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .tswm-login-page {
    flex-direction: column;
  }

  .tswm-login-aside {
    flex: 0 0 auto;
    max-width: none;
    padding: 72px 24px 8px;
    gap: 18px;
    text-align: center;
    align-items: center;
  }

  .tswm-login-aside > p,
  .tswm-login-features {
    display: none;
  }

  .tswm-login-main {
    padding: 24px 20px 48px;
  }
}

@media (max-width: 575.98px) {
  .tswm-login-aside {
    padding: 68px 16px 4px;
  }

  .tswm-login-card {
    padding: 22px;
  }

  .tswm-login-card h1 {
    font-size: 1.35rem;
  }

  .tswm-login-theme-toggle {
    right: 14px;
    top: 14px;
  }
}

/* ----------------------------------------------------------
   BASE BODY / WRAPPER
   ---------------------------------------------------------- */
body.dashboard-shell {
  background-color: var(--tswm-bg);
  color: var(--tswm-ink);
  font-size: 15px;
}

.dashboard-shell .content-wrapper {
  background-color: var(--tswm-bg);
}

html.theme-dark .dashboard-shell .content-wrapper {
  background-color: var(--tswm-bg) !important;
}

html.theme-dark .dashboard-shell .wrapper {
  background-color: var(--tswm-bg);
}

/* ----------------------------------------------------------
   NAVBAR
   ---------------------------------------------------------- */
.dashboard-shell .main-header {
  border-bottom: 1px solid var(--tswm-line);
  background-color: var(--tswm-panel) !important;
  box-shadow: var(--tswm-shadow);
}

html.theme-dark .dashboard-shell .main-header {
  background-color: #1a2638 !important;
  border-bottom-color: var(--tswm-line);
}

.dashboard-shell .main-header .navbar-nav .nav-link {
  color: #334155 !important;
  font-weight: 500;
}

.dashboard-shell .main-header .navbar-nav .nav-link:hover {
  color: #0f172a !important;
}

html.theme-dark .dashboard-shell .main-header .navbar-nav .nav-link {
  color: #cbd5e1 !important;
  font-weight: 500;
}

html.theme-dark .dashboard-shell .main-header .navbar-nav .nav-link:hover {
  color: #ffffff !important;
}


.dashboard-shell .tswm-theme-toggle {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  line-height: 1;
}

html.theme-dark .dashboard-shell .navbar-search-block {
  background-color: var(--tswm-panel);
  border-bottom-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .form-control-navbar {
  background-color: var(--tswm-soft);
  color: var(--tswm-ink);
  border-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .form-control-navbar::placeholder {
  color: var(--tswm-muted);
}

html.theme-dark .dashboard-shell .btn-navbar {
  color: var(--tswm-ink);
  background-color: var(--tswm-soft);
  border-color: var(--tswm-line);
}

/* ----------------------------------------------------------
   SIDEBAR — Light Mode
   ---------------------------------------------------------- */
.dashboard-shell .user-panel .info a {
  color: #343a40;
  font-weight: 600;
}

.tswm-user-company {
  font-size: 11px;
  color: #6c757d;
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----------------------------------------------------------
   SIDEBAR — Dark Mode
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .main-sidebar,
html.theme-dark .dashboard-shell .main-sidebar .sidebar {
  background-color: #1a2638 !important;
}

html.theme-dark .dashboard-shell .brand-link {
  color: #fff !important;
  border-bottom-color: rgba(255,255,255,0.1) !important;
  background-color: rgba(0,0,0,0.15) !important;
}

html.theme-dark .dashboard-shell .brand-link .brand-text {
  color: #fff !important;
}

html.theme-dark .dashboard-shell .user-panel {
  border-bottom-color: rgba(255,255,255,0.1) !important;
}

html.theme-dark .dashboard-shell .user-panel .info a {
  color: #e2e8f4 !important;
}

html.theme-dark .tswm-user-company {
  color: #8a9bb5 !important;
}

html.theme-dark .dashboard-shell .nav-sidebar .nav-link {
  color: #c2c7d0 !important;
}

html.theme-dark .dashboard-shell .nav-sidebar .nav-link p {
  color: #c2c7d0 !important;
}

html.theme-dark .dashboard-shell .nav-sidebar .nav-link .right,
html.theme-dark .dashboard-shell .nav-sidebar .nav-link .nav-icon {
  color: #c2c7d0 !important;
}

html.theme-dark .dashboard-shell .nav-sidebar .nav-link:hover,
html.theme-dark .dashboard-shell .nav-sidebar .menu-open > .nav-link {
  background-color: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}

html.theme-dark .dashboard-shell .nav-sidebar .nav-link:hover p,
html.theme-dark .dashboard-shell .nav-sidebar .menu-open > .nav-link p {
  color: #fff !important;
}

html.theme-dark .dashboard-shell .nav-sidebar > .nav-item > .nav-link.active {
  background-color: var(--tswm-blue) !important;
  color: #fff !important;
}

html.theme-dark .dashboard-shell .nav-sidebar > .nav-item > .nav-link.active p,
html.theme-dark .dashboard-shell .nav-sidebar > .nav-item > .nav-link.active .nav-icon {
  color: #fff !important;
}

html.theme-dark .dashboard-shell .nav-treeview .nav-link {
  color: #8a9bb5 !important;
}

html.theme-dark .dashboard-shell .nav-treeview .nav-link:hover {
  background-color: rgba(255,255,255,0.06) !important;
  color: #c2c7d0 !important;
}

/* ----------------------------------------------------------
   CONTENT HEADER
   ---------------------------------------------------------- */
.dashboard-shell .content-header {
  padding: 15px 0.5rem;
}

.dashboard-shell .content-header h1 {
  color: var(--tswm-ink);
  font-size: 1.8rem;
  font-weight: 600;
}

html.theme-dark .dashboard-shell .content-header {
  background-color: var(--tswm-bg);
}

.dashboard-shell .breadcrumb {
  background-color: transparent;
  padding: 0;
  margin-bottom: 0;
  font-size: 0.875rem;
}

.dashboard-shell .breadcrumb-item + .breadcrumb-item::before {
  color: var(--tswm-muted);
}

.dashboard-shell .breadcrumb-item a {
  color: var(--tswm-blue);
}

.dashboard-shell .breadcrumb-item.active {
  color: var(--tswm-muted);
}

/* ----------------------------------------------------------
   MAIN CONTENT
   ---------------------------------------------------------- */
.dashboard-shell .content {
  padding: 0 0.5rem 1.5rem;
  min-height: calc(100vh - 200px);
}

/* ----------------------------------------------------------
   CARDS
   ---------------------------------------------------------- */
.dashboard-shell .card {
  border-color: var(--tswm-line);
  background-color: var(--tswm-panel);
  box-shadow: var(--tswm-shadow);
  color: var(--tswm-ink);
}

.dashboard-shell .card-header {
  background-color: transparent;
  border-bottom-color: var(--tswm-line);
  color: var(--tswm-ink);
}

.dashboard-shell .card-body {
  background-color: var(--tswm-panel);
  color: var(--tswm-ink);
}

.dashboard-shell .card-footer {
  background-color: var(--tswm-soft);
  border-top-color: var(--tswm-line);
  color: var(--tswm-ink);
}

.dashboard-shell .card-title {
  color: var(--tswm-ink);
  font-weight: 700;
}

.dashboard-shell .card.card-outline.card-primary  { border-top: 3px solid var(--tswm-blue);  }
.dashboard-shell .card.card-outline.card-success  { border-top: 3px solid var(--tswm-green); }
.dashboard-shell .card.card-outline.card-info     { border-top: 3px solid var(--tswm-blue);  }
.dashboard-shell .card.card-outline.card-warning  { border-top: 3px solid var(--tswm-amber); }
.dashboard-shell .card.card-outline.card-danger   { border-top: 3px solid var(--tswm-red);   }

/* ----------------------------------------------------------
   INFO-BOX
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .info-box {
  background-color: var(--tswm-panel);
  color: var(--tswm-ink);
  box-shadow: var(--tswm-shadow);
}

html.theme-dark .dashboard-shell .info-box-text   { color: var(--tswm-muted); }
html.theme-dark .dashboard-shell .info-box-number { color: var(--tswm-ink);   }
html.theme-dark .dashboard-shell .progress-description { color: var(--tswm-muted); }

a.tswm-action-box {
  color: var(--tswm-ink);
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.1s;
  display: flex;
}

a.tswm-action-box:hover {
  color: var(--tswm-ink);
  text-decoration: none;
  box-shadow: var(--tswm-shadow-lg);
  transform: translateY(-1px);
}

html.theme-dark a.tswm-action-box {
  background-color: var(--tswm-panel);
}

/* ----------------------------------------------------------
   SMALL-BOX
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .small-box { color: #fff; }
html.theme-dark .dashboard-shell .small-box .inner h3,
html.theme-dark .dashboard-shell .small-box .inner p { color: #fff; }
html.theme-dark .dashboard-shell .small-box .small-box-footer {
  background-color: rgba(0,0,0,0.2);
  color: rgba(255,255,255,0.8);
}
html.theme-dark .dashboard-shell .small-box .small-box-footer:hover {
  background-color: rgba(0,0,0,0.3);
  color: #fff;
}

/* ----------------------------------------------------------
   CALLOUT
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .callout {
  background-color: var(--tswm-panel);
  border-left-color: var(--tswm-line);
  color: var(--tswm-ink);
}
html.theme-dark .dashboard-shell .callout h5 { color: var(--tswm-ink);   }
html.theme-dark .dashboard-shell .callout p  { color: var(--tswm-muted); }
html.theme-dark .dashboard-shell .callout.callout-info    { border-left-color: #17a2b8;          }
html.theme-dark .dashboard-shell .callout.callout-success { border-left-color: var(--tswm-green);}
html.theme-dark .dashboard-shell .callout.callout-warning { border-left-color: var(--tswm-amber);}
html.theme-dark .dashboard-shell .callout.callout-danger  { border-left-color: var(--tswm-red);  }

/* ----------------------------------------------------------
   PRODUCTS-LIST
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .products-list .item        { border-bottom-color: var(--tswm-line); }
html.theme-dark .dashboard-shell .products-list .product-title       { color: var(--tswm-ink);   }
html.theme-dark .dashboard-shell .products-list .product-description { color: var(--tswm-muted); }

/* ----------------------------------------------------------
   FORMULÁRIOS — controles base
   ---------------------------------------------------------- */
.dashboard-shell .form-control,
.dashboard-shell .custom-select {
  border-color: var(--tswm-line);
  background-color: var(--tswm-panel);
  color: var(--tswm-ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

html.theme-dark .dashboard-shell .form-control,
html.theme-dark .dashboard-shell .custom-select {
  border-color: var(--tswm-line);
  background-color: var(--tswm-soft);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .form-control::placeholder { color: var(--tswm-muted); }

.dashboard-shell .form-control:focus,
.dashboard-shell .custom-select:focus {
  border-color: var(--tswm-blue);
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

html.theme-dark .dashboard-shell .form-control:focus,
html.theme-dark .dashboard-shell .custom-select:focus {
  background-color: var(--tswm-soft);
}

.dashboard-shell label {
  color: var(--tswm-ink);
  font-weight: 600;
}

/* ── custom-select: seta do dropdown ── */
/* Bootstrap 4 embute um SVG escuro; em dark mode ele some. Sobrescrevemos com SVG claro. */
html.theme-dark .dashboard-shell .custom-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23e2e8f4' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 8px 10px;
}

/* ── input-group ── */
.dashboard-shell .input-group-text {
  background-color: var(--tswm-soft);
  border-color: var(--tswm-line);
  color: var(--tswm-muted);
}

html.theme-dark .dashboard-shell .input-group-text {
  background-color: var(--tswm-soft);
  border-color: var(--tswm-line);
  color: var(--tswm-muted);
}

/* ── custom-control (checkbox / radio / switch) ── */
html.theme-dark .dashboard-shell .custom-control-label {
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .custom-control-label::before {
  background-color: var(--tswm-soft);
  border-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--tswm-blue);
  border-color: var(--tswm-blue);
}

html.theme-dark .dashboard-shell .custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.35);
}

html.theme-dark .dashboard-shell .custom-control-input:not(:checked) ~ .custom-control-label::before {
  border-color: var(--tswm-line);
}

/* ── iCheck ── */
html.theme-dark .dashboard-shell .icheck-primary > input:first-child + label::before,
html.theme-dark .dashboard-shell .icheck-primary > input:first-child + input[type="hidden"] + label::before {
  background-color: var(--tswm-soft);
  border-color: var(--tswm-line);
}

/* ── read-only / disabled ── */
html.theme-dark .dashboard-shell .form-control:disabled,
html.theme-dark .dashboard-shell .form-control[readonly] {
  background-color: rgba(45, 58, 79, .5);
  opacity: 1;
}

/* ----------------------------------------------------------
   Bootstrap utility classes — adaptação dark mode
   ---------------------------------------------------------- */
/* Utilitários de background */
html.theme-dark .dashboard-shell .bg-white  { background-color: var(--tswm-panel) !important; }
html.theme-dark .dashboard-shell .bg-light  { background-color: var(--tswm-soft)  !important; }
html.theme-dark .dashboard-shell .bg-secondary { background-color: #374558 !important;        }

/* Texto */
html.theme-dark .dashboard-shell .text-dark   { color: var(--tswm-ink)   !important; }
html.theme-dark .dashboard-shell .text-body   { color: var(--tswm-ink)   !important; }
html.theme-dark .dashboard-shell .text-muted  { color: var(--tswm-muted) !important; }
html.theme-dark .dashboard-shell .text-secondary { color: var(--tswm-muted) !important; }

/* Bordas — rgba(0,0,0,.1) é invisível em fundos escuros */
html.theme-dark .dashboard-shell .border,
html.theme-dark .dashboard-shell .border-top,
html.theme-dark .dashboard-shell .border-right,
html.theme-dark .dashboard-shell .border-bottom,
html.theme-dark .dashboard-shell .border-left {
  border-color: var(--tswm-line) !important;
}

html.theme-dark .dashboard-shell hr {
  border-top-color: var(--tswm-line);
}

/* ----------------------------------------------------------
   TABELAS
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .table {
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .table th,
html.theme-dark .dashboard-shell .table td {
  border-top-color: var(--tswm-line);
  border-bottom-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .table thead th {
  border-bottom-color: var(--tswm-line);
  background-color: var(--tswm-soft);
  color: var(--tswm-muted);
}

html.theme-dark .dashboard-shell .table-hover tbody tr:hover {
  background-color: rgba(45,58,79,.5);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(26,38,56,.6);
}

html.theme-dark .dashboard-shell .table-bordered,
html.theme-dark .dashboard-shell .table-bordered th,
html.theme-dark .dashboard-shell .table-bordered td {
  border-color: var(--tswm-line);
}

/* ----------------------------------------------------------
   BADGES — Design System com contraste pleno e WCAG AA/AAA
   ---------------------------------------------------------- */
.dashboard-shell .badge {
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.35;
  padding: .32em .65em;
  border-radius: 4px;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
}

/* Light Mode Badges */
html.theme-light .dashboard-shell .badge-primary {
  background-color: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

html.theme-light .dashboard-shell .badge-success {
  background-color: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

html.theme-light .dashboard-shell .badge-warning {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

html.theme-light .dashboard-shell .badge-danger {
  background-color: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

html.theme-light .dashboard-shell .badge-info {
  background-color: #e0f2fe;
  color: #0284c7;
  border-color: #bae6fd;
}

html.theme-light .dashboard-shell .badge-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

html.theme-light .dashboard-shell .badge-light {
  background-color: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

html.theme-light .dashboard-shell .badge-dark {
  background-color: #0f172a;
  color: #f8fafc;
  border-color: #0f172a;
}

/* Dark Mode Badges */
html.theme-dark .dashboard-shell .badge-primary {
  background-color: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

html.theme-dark .dashboard-shell .badge-success {
  background-color: rgba(74, 222, 128, 0.16);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
}

html.theme-dark .dashboard-shell .badge-warning {
  background-color: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}

html.theme-dark .dashboard-shell .badge-danger {
  background-color: rgba(248, 113, 113, 0.16);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}

html.theme-dark .dashboard-shell .badge-info {
  background-color: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

html.theme-dark .dashboard-shell .badge-secondary {
  background-color: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.3);
}

html.theme-dark .dashboard-shell .badge-light {
  background-color: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

html.theme-dark .dashboard-shell .badge-dark {
  background-color: #0b1120;
  color: #cbd5e1;
  border-color: #334155;
}

/* ----------------------------------------------------------
   ALERTAS — Light e Dark Mode
   ---------------------------------------------------------- */
.dashboard-shell .alert {
  border-radius: 8px;
  font-weight: 500;
  line-height: 1.5;
  border-width: 1px;
}

/* Light Mode Alerts */
html.theme-light .dashboard-shell .alert-primary,
html.theme-light .dashboard-shell .alert-info {
  background-color: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

html.theme-light .dashboard-shell .alert-success {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

html.theme-light .dashboard-shell .alert-warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

html.theme-light .dashboard-shell .alert-danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

html.theme-light .dashboard-shell .alert-secondary {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

html.theme-light .dashboard-shell .alert-light {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

html.theme-light .dashboard-shell .alert-dark {
  background-color: #0f172a;
  border-color: #1e293b;
  color: #f8fafc;
}

/* Dark Mode Alerts */
html.theme-dark .dashboard-shell .alert {
  border-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .alert-primary,
html.theme-dark .dashboard-shell .alert-info {
  background-color: rgba(2, 132, 199, 0.16);
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

html.theme-dark .dashboard-shell .alert-success {
  background-color: rgba(22, 163, 74, 0.16);
  border-color: rgba(74, 222, 128, 0.35);
  color: #86efac;
}

html.theme-dark .dashboard-shell .alert-warning {
  background-color: rgba(217, 119, 6, 0.16);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde047;
}

html.theme-dark .dashboard-shell .alert-danger {
  background-color: rgba(220, 38, 38, 0.16);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

html.theme-dark .dashboard-shell .alert-secondary {
  background-color: rgba(51, 65, 85, 0.3);
  border-color: #334155;
  color: #cbd5e1;
}

html.theme-dark .dashboard-shell .alert-light {
  background-color: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

html.theme-dark .dashboard-shell .alert-dark {
  background-color: #0b1120;
  border-color: #334155;
  color: #cbd5e1;
}

/* ----------------------------------------------------------
   DROPDOWNS
   ---------------------------------------------------------- */
.dashboard-shell .dropdown-menu {
  background-color: var(--tswm-panel);
  border-color: var(--tswm-line);
  box-shadow: var(--tswm-shadow-lg);
  border-radius: 8px;
}

.dashboard-shell .dropdown-item {
  color: var(--tswm-ink);
  font-weight: 500;
}

.dashboard-shell .dropdown-item:hover,
.dashboard-shell .dropdown-item:focus {
  background-color: var(--tswm-hover);
  color: var(--tswm-ink);
}

.dashboard-shell .dropdown-item.dropdown-header {
  color: var(--tswm-muted);
  background-color: var(--tswm-soft);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
}

.dashboard-shell .dropdown-item.dropdown-footer {
  background-color: var(--tswm-soft);
  color: var(--tswm-blue);
  font-weight: 600;
}

.dashboard-shell .dropdown-divider {
  border-top-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .dropdown-menu {
  background-color: var(--tswm-panel);
  border-color: var(--tswm-line);
  box-shadow: var(--tswm-shadow-lg);
}

html.theme-dark .dashboard-shell .dropdown-item { color: var(--tswm-ink); }

html.theme-dark .dashboard-shell .dropdown-item:hover,
html.theme-dark .dashboard-shell .dropdown-item:focus {
  background-color: var(--tswm-soft);
  color: #ffffff;
}

html.theme-dark .dashboard-shell .dropdown-item.dropdown-header {
  color: var(--tswm-muted);
  background-color: var(--tswm-soft);
}

html.theme-dark .dashboard-shell .dropdown-item.dropdown-footer {
  background-color: var(--tswm-soft);
  color: var(--tswm-blue);
}

html.theme-dark .dashboard-shell .dropdown-divider { border-top-color: var(--tswm-line); }

/* ----------------------------------------------------------
   BOTÕES — Light e Dark Mode com contraste pleno
   ---------------------------------------------------------- */
/* Light Mode Buttons */
html.theme-light .dashboard-shell .btn-primary {
  background-color: #0284c7;
  border-color: #0284c7;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-primary:hover,
html.theme-light .dashboard-shell .btn-primary:focus {
  background-color: #0369a1;
  border-color: #0369a1;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-success {
  background-color: #16a34a;
  border-color: #16a34a;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-success:hover,
html.theme-light .dashboard-shell .btn-success:focus {
  background-color: #15803d;
  border-color: #15803d;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-danger {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-danger:hover,
html.theme-light .dashboard-shell .btn-danger:focus {
  background-color: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-warning {
  background-color: #f59e0b;
  border-color: #d97706;
  color: #0f172a !important;
}

html.theme-light .dashboard-shell .btn-warning:hover,
html.theme-light .dashboard-shell .btn-warning:focus {
  background-color: #d97706;
  border-color: #b45309;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-info {
  background-color: #0284c7;
  border-color: #0284c7;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-info:hover,
html.theme-light .dashboard-shell .btn-info:focus {
  background-color: #0369a1;
  border-color: #0369a1;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-secondary {
  background-color: #475569;
  border-color: #475569;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-secondary:hover,
html.theme-light .dashboard-shell .btn-secondary:focus {
  background-color: #334155;
  border-color: #334155;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .btn-default {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

html.theme-light .dashboard-shell .btn-default:hover,
html.theme-light .dashboard-shell .btn-default:focus {
  background-color: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Dark Mode Buttons */
html.theme-dark .dashboard-shell .btn-primary {
  background-color: #0284c7;
  border-color: #38bdf8;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-primary:hover,
html.theme-dark .dashboard-shell .btn-primary:focus {
  background-color: #0369a1;
  border-color: #7dd3fc;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-success {
  background-color: #15803d;
  border-color: #4ade80;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-success:hover,
html.theme-dark .dashboard-shell .btn-success:focus {
  background-color: #166534;
  border-color: #86efac;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-danger {
  background-color: #b91c1c;
  border-color: #f87171;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-danger:hover,
html.theme-dark .dashboard-shell .btn-danger:focus {
  background-color: #991b1b;
  border-color: #fca5a5;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-warning {
  background-color: #d97706;
  border-color: #fbbf24;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-warning:hover,
html.theme-dark .dashboard-shell .btn-warning:focus {
  background-color: #b45309;
  border-color: #fde047;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-info {
  background-color: #0369a1;
  border-color: #38bdf8;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-info:hover,
html.theme-dark .dashboard-shell .btn-info:focus {
  background-color: #075985;
  border-color: #7dd3fc;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-secondary {
  background-color: #334155;
  border-color: #475569;
  color: #f8fafc !important;
}

html.theme-dark .dashboard-shell .btn-secondary:hover,
html.theme-dark .dashboard-shell .btn-secondary:focus {
  background-color: #475569;
  border-color: #64748b;
  color: #ffffff !important;
}

html.theme-dark .dashboard-shell .btn-default {
  background-color: var(--tswm-soft);
  border-color: var(--tswm-line);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .btn-default:hover,
html.theme-dark .dashboard-shell .btn-default:focus {
  background-color: var(--tswm-line);
  color: #ffffff;
}

html.theme-dark .dashboard-shell .btn-outline-primary {
  color: #38bdf8;
  border-color: #38bdf8;
}

html.theme-dark .dashboard-shell .btn-outline-primary:hover {
  background-color: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

html.theme-dark .dashboard-shell .btn-outline-success {
  color: #4ade80;
  border-color: #4ade80;
}

html.theme-dark .dashboard-shell .btn-outline-success:hover {
  background-color: #16a34a;
  border-color: #4ade80;
  color: #ffffff;
}

html.theme-dark .dashboard-shell .btn-outline-danger {
  color: #f87171;
  border-color: #f87171;
}

html.theme-dark .dashboard-shell .btn-outline-danger:hover {
  background-color: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}

html.theme-dark .dashboard-shell .btn-outline-warning {
  color: #fbbf24;
  border-color: #fbbf24;
}

html.theme-dark .dashboard-shell .btn-outline-warning:hover {
  background-color: #d97706;
  border-color: #fbbf24;
  color: #ffffff;
}

html.theme-dark .dashboard-shell .btn-outline-info {
  color: #38bdf8;
  border-color: #38bdf8;
}

html.theme-dark .dashboard-shell .btn-outline-info:hover {
  background-color: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

html.theme-dark .dashboard-shell .btn-outline-secondary {
  color: var(--tswm-muted);
  border-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .btn-outline-secondary:hover {
  background-color: var(--tswm-soft);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .btn-outline-light {
  color: var(--tswm-ink);
  border-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .btn-light {
  background-color: var(--tswm-soft);
  border-color: var(--tswm-line);
  color: var(--tswm-ink);
}


/* ----------------------------------------------------------
   LIST-GROUP
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .list-group-item {
  background-color: var(--tswm-panel);
  border-color: var(--tswm-line);
  color: var(--tswm-ink);
}

/* ----------------------------------------------------------
   Destaque suave de linha (ex.: dados de revenda/parceiro).
   Substitui backgrounds inline, que venciam as regras de tema.
   ---------------------------------------------------------- */
.list-group-item.tswm-highlight {
  background-color: rgba(2, 132, 199, 0.06);
}

html.theme-dark .dashboard-shell .list-group-item.tswm-highlight {
  background-color: rgba(56, 189, 248, 0.10);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .list-group-item.active {
  background-color: var(--tswm-blue);
  border-color: var(--tswm-blue);
  color: #fff;
}

html.theme-dark .dashboard-shell .list-group-item-action:hover,
html.theme-dark .dashboard-shell .list-group-item-action:focus {
  background-color: var(--tswm-soft);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .list-group-item-light {
  background-color: var(--tswm-soft);
  color: var(--tswm-ink);
}

/* ----------------------------------------------------------
   NAV / TABS / PILLS
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .nav-tabs {
  border-bottom-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .nav-tabs .nav-link {
  color: var(--tswm-muted);
  border-color: transparent;
}

html.theme-dark .dashboard-shell .nav-tabs .nav-link:hover {
  border-color: var(--tswm-line);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .nav-tabs .nav-link.active,
html.theme-dark .dashboard-shell .nav-tabs .nav-item.show .nav-link {
  background-color: var(--tswm-panel);
  border-color: var(--tswm-line) var(--tswm-line) var(--tswm-panel);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .tab-content {
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .nav-pills .nav-link {
  color: var(--tswm-muted);
}

html.theme-dark .dashboard-shell .nav-pills .nav-link.active {
  background-color: var(--tswm-blue);
  color: #fff;
}

/* ----------------------------------------------------------
   PAGINAÇÃO
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .pagination .page-link {
  background-color: var(--tswm-panel);
  border-color: var(--tswm-line);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .pagination .page-item.active .page-link {
  background-color: var(--tswm-blue);
  border-color: var(--tswm-blue);
  color: #fff;
}

html.theme-dark .dashboard-shell .pagination .page-item.disabled .page-link {
  background-color: var(--tswm-soft);
  color: var(--tswm-muted);
}

/* ----------------------------------------------------------
   MODAL
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .modal-content {
  background-color: var(--tswm-panel);
  border-color: var(--tswm-line);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .modal-header,
html.theme-dark .dashboard-shell .modal-footer {
  border-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .modal-header .modal-title {
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .close {
  color: var(--tswm-ink);
  text-shadow: none;
  opacity: 0.7;
}

html.theme-dark .dashboard-shell .close:hover {
  color: var(--tswm-ink);
  opacity: 1;
}

html.theme-dark .dashboard-shell .modal-backdrop {
  background-color: #000;
}

/* ----------------------------------------------------------
   CODE / PRE
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell code {
  background-color: rgba(45,58,79,.7);
  color: #f8a4c0;
  border-radius: 3px;
  padding: 1px 4px;
}

html.theme-dark .dashboard-shell pre {
  background-color: #0f1724;
  border: 1px solid var(--tswm-line);
  color: var(--tswm-ink);
  border-radius: 4px;
}

html.theme-dark .dashboard-shell kbd {
  background-color: #0f1724;
  color: var(--tswm-ink);
  border: 1px solid var(--tswm-line);
}

/* ----------------------------------------------------------
   SELECT2
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell .select2-container--default .select2-selection--single,
html.theme-dark .dashboard-shell .select2-container--default .select2-selection--multiple {
  background-color: var(--tswm-soft);
  border-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .select2-container--default .select2-selection__rendered {
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .select2-container--default .select2-selection__arrow b {
  border-top-color: var(--tswm-muted);
}

html.theme-dark .dashboard-shell .select2-dropdown {
  background-color: var(--tswm-panel);
  border-color: var(--tswm-line);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .select2-results__option { color: var(--tswm-ink); }
html.theme-dark .dashboard-shell .select2-search__field {
  background-color: var(--tswm-soft);
  border-color: var(--tswm-line);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .select2-results__option--highlighted {
  background-color: var(--tswm-blue) !important;
  color: #fff !important;
}

/* ----------------------------------------------------------
   FOOTER
   ---------------------------------------------------------- */
.dashboard-shell .tswm-app-footer {
  padding: 0;
  border-top: 1px solid var(--tswm-line);
  background: var(--tswm-panel);
  color: var(--tswm-muted);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .035);
}

.dashboard-shell .tswm-footer-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .8rem 1.5rem;
}

.dashboard-shell .tswm-footer-brand,
.dashboard-shell .tswm-footer-meta {
  display: flex;
  align-items: center;
}

.dashboard-shell .tswm-footer-brand {
  min-width: 0;
}

.dashboard-shell .tswm-footer-mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  margin-right: .75rem;
  border: 1px solid rgba(2, 132, 199, .2);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(2, 132, 199, .14), rgba(8, 145, 178, .08));
  color: var(--tswm-blue);
  font-size: 1rem;
}

.dashboard-shell .tswm-footer-brand-copy {
  min-width: 0;
}

.dashboard-shell .tswm-footer-brand-copy strong,
.dashboard-shell .tswm-footer-brand-copy small {
  display: block;
}

.dashboard-shell .tswm-footer-brand-copy strong {
  color: var(--tswm-ink);
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.dashboard-shell .tswm-footer-brand-copy small {
  overflow: hidden;
  margin-top: .08rem;
  color: var(--tswm-muted);
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-shell .tswm-footer-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem 1rem;
  font-size: .76rem;
}

.dashboard-shell .tswm-footer-meta > * {
  position: relative;
  color: var(--tswm-muted);
  white-space: nowrap;
}

.dashboard-shell .tswm-footer-meta > * + *::before {
  position: absolute;
  left: -.55rem;
  color: var(--tswm-line);
  content: "•";
}

.dashboard-shell .tswm-footer-meta a {
  color: var(--tswm-blue) !important;
  font-weight: 700;
  text-decoration: none !important;
}

.dashboard-shell .tswm-footer-meta a:hover,
.dashboard-shell .tswm-footer-meta a:focus {
  color: var(--tswm-cyan) !important;
  text-decoration: none !important;
}

.dashboard-shell .tswm-footer-meta a i {
  margin-left: .22rem;
  font-size: .62rem;
}

.dashboard-shell .tswm-footer-protected i {
  margin-right: .35rem;
  color: var(--tswm-green);
}

html.theme-dark .dashboard-shell .main-footer {
  background-color: var(--tswm-panel);
  border-top-color: var(--tswm-line);
  color: var(--tswm-muted);
}

html.theme-dark .dashboard-shell .main-footer a { color: var(--tswm-blue); }

html.theme-dark .dashboard-shell .tswm-app-footer {
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .13);
}

html.theme-dark .dashboard-shell .tswm-footer-mark {
  border-color: rgba(56, 189, 248, .2);
  background: rgba(2, 132, 199, .12);
}

@media (max-width: 767.98px) {
  .dashboard-shell .tswm-footer-inner {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: .7rem;
    padding: 1rem;
  }

  .dashboard-shell .tswm-footer-meta {
    justify-content: flex-start;
    gap: .45rem .9rem;
    padding-left: 0;
  }

  .dashboard-shell .tswm-footer-meta > * + *::before {
    left: -.5rem;
  }
}

@media (max-width: 479.98px) {
  .dashboard-shell .tswm-footer-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: .3rem;
  }

  .dashboard-shell .tswm-footer-meta > * + *::before {
    display: none;
  }
}

/* ----------------------------------------------------------
   TIPOGRAFIA AUXILIAR
   ---------------------------------------------------------- */
html.theme-dark .dashboard-shell h1,
html.theme-dark .dashboard-shell h2,
html.theme-dark .dashboard-shell h3,
html.theme-dark .dashboard-shell h4,
html.theme-dark .dashboard-shell h5,
html.theme-dark .dashboard-shell h6 {
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell p    { color: var(--tswm-ink);   }
html.theme-dark .dashboard-shell small,
html.theme-dark .dashboard-shell .small { color: var(--tswm-muted); }

/* Links padrão do dashboard */
.dashboard-shell a:not(.btn):not(.nav-link):not(.dropdown-item):not(.badge):not(.breadcrumb-item a) {
  color: var(--tswm-blue);
  text-decoration: none;
  font-weight: 500;
}

.dashboard-shell a:not(.btn):not(.nav-link):not(.dropdown-item):not(.badge):not(.breadcrumb-item a):hover {
  color: #0369a1;
  text-decoration: none;
}

html.theme-dark .dashboard-shell a:not(.btn):not(.nav-link):not(.dropdown-item):not(.badge):not(.breadcrumb-item a) {
  color: #38bdf8;
}

html.theme-dark .dashboard-shell a:not(.btn):not(.nav-link):not(.dropdown-item):not(.badge):not(.breadcrumb-item a):hover {
  color: #7dd3fc;
}


/* ----------------------------------------------------------
   MISCELLÂNEA dark mode
   ---------------------------------------------------------- */

/* Progress bars */
html.theme-dark .dashboard-shell .progress {
  background-color: var(--tswm-soft);
}

/* Spinner / loading */
html.theme-dark .dashboard-shell .spinner-border,
html.theme-dark .dashboard-shell .spinner-grow {
  color: var(--tswm-muted);
}

/* Tooltip */
html.theme-dark .dashboard-shell .tooltip-inner {
  background-color: var(--tswm-ink);
  color: var(--tswm-bg);
}

/* Popover */
html.theme-dark .dashboard-shell .popover {
  background-color: var(--tswm-panel);
  border-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .popover-header {
  background-color: var(--tswm-soft);
  border-bottom-color: var(--tswm-line);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .popover-body {
  color: var(--tswm-ink);
}

/* Accordion (Bootstrap 4 usa card para isso) */
html.theme-dark .dashboard-shell .card-header[data-toggle="collapse"],
html.theme-dark .dashboard-shell .card-header[data-bs-toggle="collapse"] {
  cursor: pointer;
}

/* Scrollbar — tema escuro */
html.theme-dark .dashboard-shell ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

html.theme-dark .dashboard-shell ::-webkit-scrollbar-track {
  background: var(--tswm-bg);
}

html.theme-dark .dashboard-shell ::-webkit-scrollbar-thumb {
  background: var(--tswm-line);
  border-radius: 3px;
}

html.theme-dark .dashboard-shell ::-webkit-scrollbar-thumb:hover {
  background: var(--tswm-muted);
}

/* ==========================================================
   CONTROL HOME — central operacional do ERP
   ========================================================== */
.tswm-control-home {
  --home-radius: 16px;
  --home-blue: #1769e0;
  --home-violet: #6d5ce8;
  --home-green: #169b62;
  --home-amber: #d8890b;
}

.tswm-control-home .content {
  padding-bottom: 2rem;
}

.tswm-home-header {
  background:
    radial-gradient(circle at 88% 15%, rgba(255,255,255,.2), transparent 19rem),
    linear-gradient(120deg, #102a56 0%, #1256a3 56%, #087b92 100%);
  color: #fff;
  margin-bottom: 1.5rem;
  padding: 2.1rem .5rem 4.5rem !important;
}

.tswm-home-header h1,
html.theme-dark .dashboard-shell .tswm-home-header h1 {
  color: #fff;
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.08;
  margin: .35rem 0 .55rem;
}

.tswm-home-header p,
html.theme-dark .dashboard-shell .tswm-home-header p {
  color: rgba(255,255,255,.76);
  font-size: 1rem;
}

.tswm-eyebrow,
.tswm-panel-kicker {
  display: block;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tswm-eyebrow { color: #8fe7f4; }
.tswm-panel-kicker { color: var(--home-blue); margin-bottom: .2rem; }

.tswm-header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: flex-end;
}

.tswm-header-actions .btn {
  border-radius: 8px;
  font-weight: 600;
  min-height: 40px;
  padding: .5rem 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all .2s ease-in-out;
}

.tswm-header-actions .btn-outline-light,
.tswm-header-actions .btn-light {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff !important;
}

.tswm-header-actions .btn-outline-light:hover,
.tswm-header-actions .btn-light:hover {
  background: #fff;
  border-color: #fff;
  color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.tswm-header-actions .btn-outline-light:hover i,
.tswm-header-actions .btn-light:hover i {
  color: #0f172a !important;
}

.tswm-header-actions .btn-primary {
  background-color: #ffffff !important;
  border: 1px solid #ffffff !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16) !important;
}

.tswm-header-actions .btn-primary:hover,
.tswm-header-actions .btn-primary:focus {
  background-color: #f8fafc !important;
  border-color: #ffffff !important;
  color: #0284c7 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24) !important;
  transform: translateY(-1px);
}

.tswm-header-actions .btn-primary:active {
  transform: translateY(0);
}

.tswm-header-actions .btn-primary i {
  color: #0284c7 !important;
  transition: transform .2s ease, color .2s ease-in-out;
}

.tswm-header-actions .btn-primary:hover i,
.tswm-header-actions .btn-primary:focus i {
  color: #0284c7 !important;
  transform: scale(1.08);
}

.tswm-header-actions .btn-outline-light i,
.tswm-header-actions .btn-light i {
  transition: color .2s ease-in-out;
}

.tswm-current-date {
  align-items: center;
  color: rgba(255,255,255,.82);
  display: inline-flex;
  font-size: .88rem;
  font-weight: 600;
  gap: .5rem;
  margin-right: .25rem;
}

.tswm-control-home .content > .container-fluid {
  margin-top: -4.25rem;
}

.tswm-kpi-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tswm-kpi-card {
  align-items: flex-start;
  background: var(--tswm-panel);
  border: 1px solid rgba(223,229,238,.9);
  border-radius: var(--home-radius);
  box-shadow: 0 12px 30px rgba(15,37,69,.1);
  color: var(--tswm-ink);
  display: flex;
  gap: .9rem;
  min-height: 150px;
  overflow: hidden;
  padding: 1.25rem;
  position: relative;
  text-decoration: none !important;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tswm-kpi-card::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 5px;
  left: 1.25rem;
  opacity: .8;
  position: absolute;
  right: 1.25rem;
  top: 0;
}

.tswm-kpi-card:hover {
  border-color: currentColor;
  box-shadow: 0 16px 38px rgba(15,37,69,.16);
  transform: translateY(-3px);
}

.tswm-kpi-blue { color: var(--home-blue) !important; }
.tswm-kpi-violet { color: var(--home-violet) !important; }
.tswm-kpi-amber { color: var(--home-amber) !important; }
.tswm-kpi-green { color: var(--home-green) !important; }

.tswm-kpi-icon {
  align-items: center;
  background: currentColor;
  border-radius: 12px;
  display: inline-flex;
  flex: 0 0 46px;
  height: 46px;
  justify-content: center;
}

.tswm-kpi-icon i { color: #fff; font-size: 1.05rem; }

.tswm-kpi-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tswm-kpi-copy small {
  color: var(--tswm-muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .025em;
  margin-bottom: .25rem;
  text-transform: uppercase;
}

.tswm-kpi-copy strong {
  color: var(--tswm-ink);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.1;
}

.tswm-kpi-copy strong.tswm-money { font-size: clamp(1.35rem, 2vw, 1.85rem); }

.tswm-kpi-copy em {
  color: var(--tswm-muted);
  font-size: .82rem;
  font-style: normal;
  margin-top: auto;
  padding-top: .55rem;
}

.tswm-kpi-copy em i { font-size: .68rem; margin-left: .2rem; }

.tswm-dashboard-row { margin-top: 1.5rem; }

.dashboard-shell .tswm-panel-card {
  border: 1px solid var(--tswm-line);
  border-radius: var(--home-radius);
  box-shadow: 0 7px 22px rgba(15,37,69,.07);
  margin-bottom: 0;
  overflow: hidden;
}

.tswm-panel-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 74px;
  padding: 1rem 1.25rem;
}

/* O clearfix do AdminLTE vira um terceiro item quando o header usa flex. */
.tswm-panel-heading::after {
  content: none;
  display: none;
}

.tswm-panel-heading > div:first-child {
  min-width: 0;
}

.tswm-panel-heading > .btn,
.tswm-panel-heading > .card-tools,
.tswm-panel-heading > .tswm-live-indicator {
  flex: 0 0 auto;
  margin-left: auto;
}

.dashboard-shell .tswm-panel-heading .card-title {
  float: none;
  font-size: 1.08rem;
  margin: 0;
}

.tswm-panel-heading .btn { border-radius: 8px; font-weight: 700; }

.tswm-dashboard-table thead th {
  background: var(--tswm-soft);
  border: 0;
  color: var(--tswm-muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .055em;
  padding: .7rem 1.25rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.tswm-dashboard-table tbody td {
  border-top: 1px solid var(--tswm-line);
  padding: .95rem 1.25rem;
  vertical-align: middle;
}

.tswm-dashboard-table tbody tr:first-child td { border-top: 0; }
.tswm-dashboard-table tbody tr:hover { background: rgba(23,105,224,.035); }

.tswm-dashboard-table td small {
  color: var(--tswm-muted);
  display: block;
  font-size: .76rem;
  margin-top: .12rem;
}

.tswm-table-primary {
  color: var(--tswm-ink) !important;
  display: block;
  font-weight: 700;
  white-space: nowrap;
}

.tswm-table-primary:hover { color: var(--home-blue) !important; }

.tswm-module-icon {
  align-items: center;
  background: rgba(23,105,224,.1);
  border-radius: 7px;
  color: var(--home-blue);
  display: inline-flex;
  height: 28px;
  justify-content: center;
  margin-right: .5rem;
  width: 28px;
}

.tswm-live-indicator {
  align-items: center;
  color: var(--tswm-muted);
  display: inline-flex;
  font-size: .72rem;
  font-weight: 700;
  gap: .4rem;
}

.tswm-live-indicator i {
  background: var(--home-green);
  border: 3px solid rgba(22,155,98,.18);
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.tswm-attention-card .card-body { padding: .45rem 1rem 1rem; }

.tswm-attention-item {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--tswm-ink) !important;
  display: grid;
  gap: .8rem;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  margin-top: .55rem;
  padding: .7rem;
  text-decoration: none !important;
  transition: background .15s ease, border-color .15s ease;
}

.tswm-attention-item:hover {
  background: var(--tswm-soft);
  border-color: var(--tswm-line);
}

.tswm-attention-icon {
  align-items: center;
  background: var(--tswm-soft);
  border-radius: 9px;
  color: var(--home-blue);
  display: inline-flex;
  height: 38px;
  justify-content: center;
}

.tswm-attention-item.is-critical .tswm-attention-icon {
  background: rgba(220,53,69,.1);
  color: var(--tswm-red);
}

.tswm-attention-item span:nth-child(2) { min-width: 0; }
.tswm-attention-item strong { display: block; font-size: .9rem; }
.tswm-attention-item small { color: var(--tswm-muted); display: block; font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tswm-attention-item b { background: var(--tswm-soft); border-radius: 999px; font-size: .78rem; min-width: 30px; padding: .28rem .5rem; text-align: center; }
.tswm-attention-item.is-critical b { background: var(--tswm-red); color: #fff; }

.tswm-module-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tswm-module-grid a {
  border: 1px solid var(--tswm-line);
  border-radius: 12px;
  color: var(--tswm-ink) !important;
  display: grid;
  min-height: 100px;
  padding: .85rem;
  text-decoration: none !important;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.tswm-module-grid a:hover {
  background: var(--tswm-soft);
  border-color: rgba(23,105,224,.4);
  transform: translateY(-2px);
}

.tswm-module-grid a > span {
  align-items: center;
  background: rgba(23,105,224,.1);
  border-radius: 8px;
  color: var(--home-blue);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  margin-bottom: .55rem;
  width: 32px;
}

.tswm-module-grid strong { font-size: .88rem; }
.tswm-module-grid small { color: var(--tswm-muted); font-size: .74rem; line-height: 1.25; }

.tswm-empty-state {
  align-items: center;
  color: var(--tswm-muted);
  display: flex;
  flex-direction: column;
  gap: .35rem;
  justify-content: center;
  min-height: 180px;
  padding: 1.5rem;
  text-align: center;
}

.tswm-empty-state > i { color: #a5b1c3; font-size: 1.8rem; margin-bottom: .2rem; }
.tswm-empty-state strong { color: var(--tswm-ink); }

.tswm-dashboard-footnote {
  align-items: center;
  color: var(--tswm-muted);
  display: flex;
  font-size: .78rem;
  justify-content: space-between;
  padding: 1.25rem .25rem 0;
}

.tswm-dashboard-footnote span:first-child { align-items: center; display: inline-flex; gap: .4rem; }
.tswm-dashboard-footnote i { color: var(--home-blue); }

html.theme-dark .tswm-home-header {
  background:
    radial-gradient(circle at 88% 15%, rgba(66,186,202,.14), transparent 19rem),
    linear-gradient(120deg, #0b1930 0%, #123c70 58%, #075b69 100%);
}

html.theme-dark .tswm-kpi-card {
  border-color: var(--tswm-line);
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
}

html.theme-dark .tswm-dashboard-table tbody tr:hover { background: rgba(110,168,254,.06); }
html.theme-dark .tswm-module-icon,
html.theme-dark .tswm-module-grid a > span { background: rgba(110,168,254,.12); color: #6ea8fe; }

@media (max-width: 1199.98px) {
  .tswm-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tswm-kpi-card { min-height: 138px; }
}

@media (max-width: 767.98px) {
  .tswm-home-header { padding: 1.55rem 0 4.25rem !important; }
  .tswm-header-actions { justify-content: flex-start; }
  .tswm-current-date { flex-basis: 100%; }
  .tswm-kpi-grid { grid-template-columns: 1fr; }
  .tswm-kpi-card { min-height: 126px; }
  .tswm-dashboard-table thead { display: none; }
  .tswm-dashboard-table tbody td { min-width: 135px; padding: .85rem; }
  .tswm-panel-heading { min-height: 66px; padding: .85rem 1rem; }
  .tswm-panel-heading { align-items: flex-start; }
  .tswm-panel-heading > .btn { white-space: nowrap; }
  .tswm-dashboard-footnote { align-items: flex-start; flex-direction: column; gap: .5rem; }
}

@media (max-width: 420px) {
  .tswm-header-actions .btn { flex: 1 1 auto; }
  .tswm-module-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .tswm-kpi-card,
  .tswm-module-grid a { transition: none; }
}

/* ----------------------------------------------------------
   THEME PARITY — regras explícitas para light e dark
   ---------------------------------------------------------- */
html.theme-light body.dashboard-shell,
html.theme-light .dashboard-shell .content-wrapper,
html.theme-light .dashboard-shell .wrapper {
  background-color: var(--tswm-bg) !important;
  color: var(--tswm-ink);
}

html.theme-light .dashboard-shell .main-header {
  background-color: #fff !important;
  border-bottom-color: var(--tswm-line);
}

html.theme-light .dashboard-shell .main-sidebar,
html.theme-light .dashboard-shell .main-sidebar .sidebar {
  background-color: #fff !important;
}

html.theme-light .dashboard-shell .brand-link {
  background-color: #fff !important;
  border-bottom-color: var(--tswm-line) !important;
  color: var(--tswm-ink) !important;
}

html.theme-light .dashboard-shell .user-panel {
  border-bottom-color: var(--tswm-line) !important;
}

html.theme-light .dashboard-shell .nav-sidebar .nav-header {
  color: #8290a4;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .11em;
  padding-bottom: .45rem;
}

html.theme-light .dashboard-shell .nav-sidebar .nav-link {
  color: #425067;
}

html.theme-light .dashboard-shell .nav-sidebar .nav-link:hover,
html.theme-light .dashboard-shell .nav-sidebar .menu-open > .nav-link {
  background-color: #edf3fb;
  color: #174f96;
}

html.theme-light .dashboard-shell .nav-sidebar > .nav-item > .nav-link.active {
  background-color: #1769e0;
  box-shadow: 0 5px 13px rgba(23,105,224,.2);
  color: #fff;
}

html.theme-light .dashboard-shell .nav-treeview .nav-link.active {
  background-color: #e8f1fd;
  color: #1454a0;
}

html.theme-dark .dashboard-shell .nav-sidebar .nav-header {
  color: #8294ae !important;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .11em;
  padding-bottom: .45rem;
}

html.theme-dark .dashboard-shell .nav-treeview .nav-link.active {
  background-color: rgba(110,168,254,.14) !important;
  color: #b9d4ff !important;
}

html.theme-dark .dashboard-shell .nav-treeview .nav-link.active p,
html.theme-dark .dashboard-shell .nav-treeview .nav-link.active .nav-icon {
  color: #b9d4ff !important;
}

.dashboard-shell .tswm-theme-toggle {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  margin-top: 1px;
  width: 38px;
}

html.theme-light .dashboard-shell .tswm-theme-toggle:hover {
  background-color: var(--tswm-soft);
  color: #174f96 !important;
}

html.theme-dark .dashboard-shell .tswm-theme-toggle:hover {
  background-color: var(--tswm-soft);
  color: #ffd978 !important;
}

html.theme-light .dashboard-shell .main-footer {
  background-color: #fff;
  border-top-color: var(--tswm-line);
  color: var(--tswm-muted);
}

html.theme-dark .dashboard-shell .main-footer {
  background-color: #172437;
}

/* Cabeçalho principal: impede que .content-header do AdminLTE remova o degradê. */
html.theme-light .dashboard-shell .content-wrapper.tswm-control-home .tswm-home-header {
  background:
    radial-gradient(circle at 88% 15%, rgba(255,255,255,.2), transparent 19rem),
    linear-gradient(120deg, #102a56 0%, #1256a3 56%, #087b92 100%) !important;
}

html.theme-dark .dashboard-shell .content-wrapper.tswm-control-home .tswm-home-header {
  background:
    radial-gradient(circle at 88% 15%, rgba(93,211,225,.15), transparent 19rem),
    linear-gradient(120deg, #091629 0%, #123b6d 58%, #075766 100%) !important;
}

html.theme-light .dashboard-shell .content-wrapper.tswm-control-home .tswm-home-header h1,
html.theme-dark .dashboard-shell .content-wrapper.tswm-control-home .tswm-home-header h1 {
  color: #fff !important;
}

html.theme-dark .tswm-control-home {
  --home-blue: #6ea8fe;
  --home-violet: #ad9fff;
  --home-green: #52d99f;
  --home-amber: #f6bd57;
}

html.theme-light .dashboard-shell .tswm-home-header .btn-outline-light,
html.theme-dark .dashboard-shell .tswm-home-header .btn-outline-light,
html.theme-light .dashboard-shell .tswm-home-header .btn-light,
html.theme-dark .dashboard-shell .tswm-home-header .btn-light {
  background-color: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.38) !important;
  color: #ffffff !important;
}

html.theme-light .dashboard-shell .tswm-home-header .btn-outline-light:hover,
html.theme-dark .dashboard-shell .tswm-home-header .btn-outline-light:hover,
html.theme-light .dashboard-shell .tswm-home-header .btn-light:hover,
html.theme-dark .dashboard-shell .tswm-home-header .btn-light:hover {
  background-color: #ffffff !important;
  border-color: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

html.theme-light .dashboard-shell .tswm-home-header .btn-outline-light:hover i,
html.theme-dark .dashboard-shell .tswm-home-header .btn-outline-light:hover i,
html.theme-light .dashboard-shell .tswm-home-header .btn-light:hover i,
html.theme-dark .dashboard-shell .tswm-home-header .btn-light:hover i {
  color: #0f172a !important;
}

html.theme-light .dashboard-shell .tswm-home-header .btn-primary,
html.theme-dark .dashboard-shell .tswm-home-header .btn-primary {
  background-color: #ffffff !important;
  border-color: #ffffff !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16) !important;
  white-space: nowrap !important;
}

html.theme-light .dashboard-shell .tswm-home-header .btn-primary:hover,
html.theme-dark .dashboard-shell .tswm-home-header .btn-primary:hover,
html.theme-light .dashboard-shell .tswm-home-header .btn-primary:focus,
html.theme-dark .dashboard-shell .tswm-home-header .btn-primary:focus {
  background-color: #f8fafc !important;
  border-color: #ffffff !important;
  color: #0284c7 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24) !important;
  transform: translateY(-1px);
}

html.theme-light .dashboard-shell .tswm-home-header .btn-primary i,
html.theme-dark .dashboard-shell .tswm-home-header .btn-primary i {
  color: #0284c7 !important;
  transition: transform .2s ease, color .2s ease-in-out;
}

html.theme-light .dashboard-shell .tswm-home-header .btn-primary:hover i,
html.theme-dark .dashboard-shell .tswm-home-header .btn-primary:hover i {
  color: #0284c7 !important;
  transform: scale(1.08);
}

html.theme-light .dashboard-shell .tswm-kpi-card,
html.theme-light .dashboard-shell .tswm-panel-card {
  background-color: #fff;
  border-color: var(--tswm-line);
}

html.theme-dark .dashboard-shell .tswm-kpi-card,
html.theme-dark .dashboard-shell .tswm-panel-card {
  background-color: var(--tswm-panel);
  border-color: var(--tswm-line);
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
}

html.theme-dark .dashboard-shell .tswm-kpi-card:hover {
  box-shadow: 0 15px 34px rgba(0,0,0,.34);
}

html.theme-dark .dashboard-shell .tswm-panel-kicker { color: #78b0ff; }

html.theme-light .dashboard-shell .tswm-dashboard-table thead th,
html.theme-dark .dashboard-shell .tswm-dashboard-table thead th {
  background-color: var(--tswm-soft);
  color: var(--tswm-muted);
}

html.theme-light .dashboard-shell .tswm-dashboard-table tbody td,
html.theme-dark .dashboard-shell .tswm-dashboard-table tbody td {
  background-color: var(--tswm-panel);
  border-top-color: var(--tswm-line);
  color: var(--tswm-ink);
}

html.theme-light .dashboard-shell .tswm-dashboard-table tbody tr:hover td,
html.theme-dark .dashboard-shell .tswm-dashboard-table tbody tr:hover td {
  background-color: var(--tswm-hover);
}

html.theme-dark .dashboard-shell .tswm-table-primary {
  color: #eaf1fc !important;
}

html.theme-dark .dashboard-shell .tswm-table-primary:hover {
  color: #8fbcff !important;
}

html.theme-dark .dashboard-shell .tswm-attention-item:hover,
html.theme-dark .dashboard-shell .tswm-module-grid a:hover {
  background-color: var(--tswm-hover);
  border-color: #4b6382;
}

html.theme-dark .dashboard-shell .tswm-attention-icon,
html.theme-dark .dashboard-shell .tswm-attention-item b {
  background-color: var(--tswm-soft);
}

html.theme-dark .dashboard-shell .tswm-attention-item.is-critical .tswm-attention-icon {
  background-color: rgba(255,102,117,.14);
  color: #ff8490;
}

html.theme-dark .dashboard-shell .tswm-attention-item.is-critical b {
  background-color: #cf4352;
  color: #fff;
}

.dashboard-shell a:focus-visible,
.dashboard-shell button:focus-visible,
.dashboard-shell input:focus-visible,
.dashboard-shell select:focus-visible,
.dashboard-shell textarea:focus-visible {
  outline: 3px solid rgba(2, 132, 199, .45);
  outline-offset: 2px;
}

html.theme-dark .dashboard-shell a:focus-visible,
html.theme-dark .dashboard-shell button:focus-visible,
html.theme-dark .dashboard-shell input:focus-visible,
html.theme-dark .dashboard-shell select:focus-visible,
html.theme-dark .dashboard-shell textarea:focus-visible {
  outline: 3px solid rgba(56, 189, 248, .55);
  outline-offset: 2px;
}


@media (prefers-contrast: more) {
  html.theme-dark {
    --tswm-ink: #ffffff;
    --tswm-muted: #c7d2e3;
    --tswm-line: #60728c;
  }

  html.theme-light {
    --tswm-ink: #0b1220;
    --tswm-muted: #405066;
    --tswm-line: #aeb9c8;
  }
}

/* ----------------------------------------------------------
   GEOMETRY PARITY — dimensões idênticas nos dois temas
   ---------------------------------------------------------- */
body.dashboard-shell {
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.dashboard-shell .main-header {
  min-height: calc(3.5rem + 1px);
}

.dashboard-shell .main-header .nav-link {
  align-items: center;
  display: flex;
  font-size: .9rem;
  font-weight: 400;
  height: 2.5rem;
  line-height: 1.25;
}

.dashboard-shell .main-header .font-weight-bold {
  font-weight: 700 !important;
}

.dashboard-shell .brand-link {
  align-items: center;
  display: flex;
  font-size: 1.15rem;
  font-weight: 700;
  height: calc(3.5rem + 1px);
  line-height: 1;
  padding: .45rem .85rem;
}

.dashboard-shell .tswm-brand-logo {
  display: block;
  flex: 0 0 38px;
  height: 38px;
  margin-right: .65rem;
  object-fit: contain;
  width: 38px;
}

.dashboard-shell .brand-link .brand-text {
  font-size: 1.15rem;
  font-weight: 700 !important;
  line-height: 1;
}

.dashboard-shell .sidebar {
  height: calc(100% - (3.5rem + 1px));
}

.dashboard-shell .user-panel {
  align-items: center;
  min-height: 58px;
}

.dashboard-shell .user-panel img {
  height: 2.1rem;
  object-fit: cover;
  width: 2.1rem;
}

.dashboard-shell .user-panel .info {
  line-height: 1.25;
  padding: 5px 5px 5px 10px;
}

.dashboard-shell .user-panel .info a {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.25;
}

.dashboard-shell .user-panel .info > span,
.dashboard-shell .user-panel .info > small {
  color: var(--tswm-muted);
  display: block;
  font-size: .7rem;
  font-weight: 400;
  line-height: 1.25;
  margin-top: .15rem;
}

.dashboard-shell .tswm-user-company {
  font-size: .7rem;
  line-height: 1.25;
  margin-top: .15rem;
}

.dashboard-shell .nav-sidebar .nav-header {
  font-size: .65rem;
  font-weight: 800;
  line-height: 1.25;
  min-height: 30px;
  padding: .65rem .75rem .4rem;
}

.dashboard-shell .nav-sidebar .nav-item > .nav-link {
  align-items: center;
  display: flex;
  font-size: .925rem;
  font-weight: 400;
  line-height: 1.5;
  min-height: 40px;
  padding-bottom: .5rem;
  padding-top: .5rem;
}

.dashboard-shell .nav-sidebar .nav-link p {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.dashboard-shell .nav-sidebar > .nav-item > .nav-link > .nav-icon,
.dashboard-shell .nav-sidebar > .nav-item > .nav-link > p > .nav-icon {
  font-size: 1.05rem;
  line-height: 1.25;
}

.dashboard-shell .nav-sidebar .nav-link > .right,
.dashboard-shell .nav-sidebar .nav-link > p > .right {
  top: .72rem;
}

.dashboard-shell .content-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.2;
}

.dashboard-shell .card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.dashboard-shell .table {
  font-size: .9rem;
  line-height: 1.4;
}

.dashboard-shell .table thead th {
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .04em;
  text-transform: uppercase;
  background-color: var(--tswm-soft);
  color: var(--tswm-muted);
  border-bottom: 2px solid var(--tswm-line);
}

.dashboard-shell .badge {
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.35;
  padding: .32em .65em;
}


.dashboard-shell .btn {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.5;
}

.dashboard-shell .form-control,
.dashboard-shell .custom-select {
  font-size: .9375rem;
  line-height: 1.5;
}

.dashboard-shell .main-footer {
  font-size: .875rem;
  line-height: 1.5;
}

/* O hero é a única exceção tipográfica e permanece igual em light/dark. */
.dashboard-shell .content-wrapper.tswm-control-home .tswm-home-header h1 {
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  font-weight: 700;
  line-height: 1.08;
}

@media (max-width: 767.98px) {
  body.dashboard-shell { font-size: 15px; }
  .dashboard-shell .content-header h1 { font-size: 1.55rem; }
  .dashboard-shell .main-header .nav-link { font-size: .875rem; }
}

/* ----------------------------------------------------------
   STANDARD FORM — fonte única para os formulários do painel
   ---------------------------------------------------------- */
.dashboard-shell .tswm-page-kicker {
  color: var(--tswm-blue);
  display: block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.2;
  margin-bottom: .35rem;
  text-transform: uppercase;
}

.dashboard-shell .tswm-form-page .content-header {
  padding-bottom: .75rem;
}

.dashboard-shell .tswm-form-page .content-header h1 {
  color: var(--tswm-ink);
  margin: 0;
}

.dashboard-shell .tswm-form-page .content-header p {
  color: var(--tswm-muted);
  font-size: .925rem;
  margin: .35rem 0 0;
}

.dashboard-shell .tswm-form-card {
  background: var(--tswm-panel);
  border: 1px solid var(--tswm-line);
  border-radius: .65rem;
  box-shadow: var(--tswm-shadow-lg);
  color: var(--tswm-ink);
  overflow: hidden;
}

.dashboard-shell .tswm-form-card::before {
  background: linear-gradient(90deg, #087bf0, #2d99ff 56%, #27a768);
  content: "";
  display: block;
  height: 3px;
  width: 100%;
}

.dashboard-shell .tswm-form-card-header {
  align-items: center;
  background: var(--tswm-panel);
  border-bottom: 1px solid var(--tswm-line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 78px;
  padding: 1rem 1.25rem;
}

.dashboard-shell .tswm-form-heading {
  align-items: center;
  display: flex;
  gap: .85rem;
  min-width: 0;
}

.dashboard-shell .tswm-form-heading-icon {
  align-items: center;
  background: rgba(0, 123, 255, .1);
  border: 1px solid rgba(0, 123, 255, .2);
  border-radius: .6rem;
  color: var(--tswm-blue);
  display: inline-flex;
  flex: 0 0 42px;
  font-size: 1rem;
  height: 42px;
  justify-content: center;
}

.dashboard-shell .tswm-form-heading .card-title {
  color: var(--tswm-ink);
  float: none;
  font-size: 1.1rem;
  line-height: 1.25;
  margin: 0;
}

.dashboard-shell .tswm-form-heading p {
  color: var(--tswm-muted);
  font-size: .85rem;
  line-height: 1.35;
  margin: .2rem 0 0;
}

.dashboard-shell .tswm-form-card-tools {
  float: none;
  margin: 0;
  position: static;
  white-space: nowrap;
}

.dashboard-shell .tswm-required-legend {
  color: var(--tswm-muted);
  font-size: .75rem;
  font-weight: 600;
}

.dashboard-shell .tswm-required-legend span,
.dashboard-shell .tswm-required-mark {
  color: var(--tswm-red);
  font-weight: 800;
  margin-left: .2rem;
}

.dashboard-shell .tswm-form-card > .card-body {
  padding: 1.35rem 1.25rem 1.45rem;
}

.dashboard-shell .tswm-form-grid {
  display: grid;
  gap: 1.15rem 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-shell .tswm-form-field {
  min-width: 0;
}

.dashboard-shell .tswm-form-field-wide {
  grid-column: 1 / -1;
}

.dashboard-shell .tswm-standard-form label,
.dashboard-shell .content-wrapper form .form-group > label,
.dashboard-shell .content-wrapper form > label {
  color: var(--tswm-ink);
  display: inline-block;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: .45rem;
}

.dashboard-shell .tswm-standard-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.dashboard-shell .tswm-standard-form select,
.dashboard-shell .tswm-standard-form textarea,
.dashboard-shell .content-wrapper form .form-control,
.dashboard-shell .content-wrapper form .custom-select {
  background-color: var(--tswm-panel);
  border-color: var(--tswm-line);
  border-radius: .38rem;
  color: var(--tswm-ink);
  min-height: 42px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  width: 100%;
}

.dashboard-shell .tswm-standard-form textarea,
.dashboard-shell .content-wrapper form textarea.form-control {
  min-height: 108px;
  resize: vertical;
}

.dashboard-shell .tswm-standard-form input::placeholder,
.dashboard-shell .tswm-standard-form textarea::placeholder,
.dashboard-shell .content-wrapper form .form-control::placeholder {
  color: var(--tswm-muted);
  opacity: .72;
}

.dashboard-shell .tswm-standard-form input:not([type="checkbox"]):not([type="radio"]):focus,
.dashboard-shell .tswm-standard-form select:focus,
.dashboard-shell .tswm-standard-form textarea:focus,
.dashboard-shell .content-wrapper form .form-control:focus,
.dashboard-shell .content-wrapper form .custom-select:focus {
  background-color: var(--tswm-panel);
  border-color: #3b91f1;
  box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .14);
  color: var(--tswm-ink);
}

html.theme-dark .dashboard-shell .tswm-standard-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
html.theme-dark .dashboard-shell .tswm-standard-form select,
html.theme-dark .dashboard-shell .tswm-standard-form textarea,
html.theme-dark .dashboard-shell .content-wrapper form .form-control,
html.theme-dark .dashboard-shell .content-wrapper form .custom-select {
  background-color: #162438;
}

html.theme-dark .dashboard-shell .tswm-standard-form input:not([type="checkbox"]):not([type="radio"]):focus,
html.theme-dark .dashboard-shell .tswm-standard-form select:focus,
html.theme-dark .dashboard-shell .tswm-standard-form textarea:focus,
html.theme-dark .dashboard-shell .content-wrapper form .form-control:focus,
html.theme-dark .dashboard-shell .content-wrapper form .custom-select:focus {
  background-color: #192a40;
}

.dashboard-shell .tswm-form-check {
  align-items: flex-start;
  background: var(--tswm-soft);
  border: 1px solid var(--tswm-line);
  border-radius: .45rem;
  display: flex;
  gap: .65rem;
  min-height: 44px;
  padding: .7rem .8rem;
}

.dashboard-shell .tswm-form-check input[type="checkbox"],
.dashboard-shell .tswm-form-check input[type="radio"] {
  flex: 0 0 auto;
  height: 17px;
  margin: .12rem 0 0;
  width: 17px;
}

.dashboard-shell .tswm-form-check label {
  cursor: pointer;
  margin: 0;
}

.dashboard-shell .tswm-form-help,
.dashboard-shell .tswm-form-field-error {
  display: block;
  font-size: .78rem;
  line-height: 1.4;
  margin-top: .38rem;
}

.dashboard-shell .tswm-form-help {
  color: var(--tswm-muted);
}

.dashboard-shell .tswm-form-field-error,
.dashboard-shell .content-wrapper form .errorlist {
  color: var(--tswm-red);
}

.dashboard-shell .tswm-form-field-error i {
  margin-right: .3rem;
}

.dashboard-shell .tswm-form-field.has-error input,
.dashboard-shell .tswm-form-field.has-error select,
.dashboard-shell .tswm-form-field.has-error textarea {
  border-color: var(--tswm-red) !important;
}

.dashboard-shell .content-wrapper form .errorlist {
  font-size: .8rem;
  list-style: none;
  margin: .35rem 0 0;
  padding: 0;
}

.dashboard-shell .tswm-form-error-summary {
  align-items: flex-start;
  display: flex;
  gap: .7rem;
  margin-bottom: 1.2rem;
}

.dashboard-shell .tswm-form-error-summary > i {
  margin-top: .2rem;
}

.dashboard-shell .tswm-form-error-summary ul {
  margin: .25rem 0 0;
  padding-left: 1.15rem;
}

.dashboard-shell .tswm-form-section {
  background: var(--tswm-panel);
  border: 1px solid var(--tswm-line);
  border-radius: .55rem;
  height: 100%;
  padding: 1rem;
}

.dashboard-shell .tswm-form-section-accent {
  border-top: 3px solid var(--tswm-green);
}

.dashboard-shell .tswm-form-section-warning {
  border-top: 3px solid var(--tswm-amber);
}

.dashboard-shell .tswm-form-section-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--tswm-line);
  display: flex;
  gap: .65rem;
  margin-bottom: 1rem;
  padding-bottom: .8rem;
}

.dashboard-shell .tswm-form-section-heading > i {
  color: var(--tswm-blue);
  margin-top: .2rem;
}

.dashboard-shell .tswm-form-section-heading h3 {
  color: var(--tswm-ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.dashboard-shell .tswm-form-section-heading p {
  color: var(--tswm-muted);
  font-size: .8rem;
  line-height: 1.35;
  margin: .18rem 0 0;
}

.dashboard-shell .tswm-form-note {
  border-radius: .55rem;
  font-size: .875rem;
  margin-bottom: 0;
}

.dashboard-shell .tswm-form-actions {
  align-items: center;
  background: var(--tswm-soft);
  border-top: 1px solid var(--tswm-line);
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: space-between;
  padding: .9rem 1.25rem;
}

.dashboard-shell .tswm-form-actions .btn {
  min-width: 112px;
}

/* Formulários operacionais antigos também consomem o mesmo ritmo visual. */
.dashboard-shell .content-wrapper form .form-group {
  margin-bottom: 1rem;
}

.dashboard-shell .content-wrapper form .card-footer.d-flex {
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
}

.dashboard-shell .content-wrapper form .input-group > .form-control,
.dashboard-shell .content-wrapper form .input-group > input:not([type="checkbox"]):not([type="radio"]),
.dashboard-shell .content-wrapper form .input-group > select {
  min-width: 0;
  width: 1%;
}

@media (max-width: 767.98px) {
  .dashboard-shell .tswm-form-card-header {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .dashboard-shell .tswm-form-card-tools {
    margin-left: 3.6rem;
  }

  .dashboard-shell .tswm-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-shell .tswm-form-field-wide {
    grid-column: auto;
  }

  .dashboard-shell .tswm-form-section {
    height: auto;
    margin-bottom: 1rem;
  }
}

@media (max-width: 479.98px) {
  .dashboard-shell .tswm-form-heading-icon {
    display: none;
  }

  .dashboard-shell .tswm-form-card-tools {
    margin-left: 0;
  }

  .dashboard-shell .tswm-form-card > .card-body,
  .dashboard-shell .tswm-form-card-header,
  .dashboard-shell .tswm-form-actions {
    padding-left: .9rem;
    padding-right: .9rem;
  }

  .dashboard-shell .tswm-form-actions .btn {
    flex: 1 1 100%;
  }
}

/* ----------------------------------------------------------
   PROJECT-WIDE PAGE STANDARD — control, customer e partner
   ---------------------------------------------------------- */
.dashboard-shell .tswm-standard-page > .content-header,
.dashboard-shell .content-wrapper > .content-header {
  border-bottom: 1px solid transparent;
  min-height: 82px;
  padding-bottom: 1rem;
  padding-top: 1rem;
}

.dashboard-shell .tswm-standard-header .row.mb-2 {
  align-items: flex-end;
  margin-bottom: 0 !important;
}

.dashboard-shell .tswm-standard-header h1 {
  color: var(--tswm-ink);
  line-height: 1.15;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.dashboard-shell .tswm-page-kicker-auto {
  margin-bottom: .3rem;
}

.dashboard-shell .tswm-standard-page > .content,
.dashboard-shell .content-wrapper > .content {
  padding-bottom: 2rem;
}

.dashboard-shell .tswm-standard-card {
  border-radius: .55rem;
  margin-bottom: 1.25rem;
}

.dashboard-shell .tswm-standard-card > .card-header:first-child {
  border-radius: .55rem .55rem 0 0;
}

.dashboard-shell .tswm-card-header-with-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  justify-content: space-between;
}

.dashboard-shell .tswm-card-header-with-tools::after {
  content: none;
}

.dashboard-shell .tswm-card-header-with-tools > .card-title {
  float: none;
  margin: 0;
}

.dashboard-shell .tswm-card-header-with-tools > .card-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  float: none;
  gap: .4rem;
  margin-left: auto;
  position: static;
}

.dashboard-shell .tswm-standard-table {
  margin-bottom: 0;
}

.dashboard-shell .tswm-standard-table > thead > tr > th {
  background: var(--tswm-soft);
  border-bottom: 1px solid var(--tswm-line);
  color: var(--tswm-muted);
  letter-spacing: .035em;
  padding-bottom: .7rem;
  padding-top: .7rem;
  text-transform: uppercase;
  vertical-align: middle;
}

.dashboard-shell .tswm-standard-table > tbody > tr > td {
  border-top-color: var(--tswm-line);
  color: var(--tswm-ink);
  padding-bottom: .7rem;
  padding-top: .7rem;
  vertical-align: middle;
}

.dashboard-shell .tswm-standard-table.table-hover > tbody > tr:hover > td {
  background-color: var(--tswm-hover);
}

.dashboard-shell .tswm-standard-form-legacy h5 {
  align-items: center;
  border-bottom: 1px solid var(--tswm-line);
  color: var(--tswm-ink);
  display: flex;
  font-size: .95rem;
  font-weight: 800;
  gap: .4rem;
  line-height: 1.35;
  padding-bottom: .6rem;
}

.dashboard-shell .tswm-standard-form-legacy .text-danger,
.dashboard-shell .tswm-standard-form .text-danger {
  font-size: .8rem;
  line-height: 1.4;
}

.dashboard-shell .tswm-standard-form-legacy .form-text,
.dashboard-shell .tswm-standard-form-legacy small.text-muted {
  color: var(--tswm-muted) !important;
  font-size: .78rem;
  line-height: 1.4;
}

.dashboard-shell .tswm-standard-form-legacy .btn[type="submit"] {
  min-width: 112px;
}

html.theme-dark .dashboard-shell .tswm-standard-table > tbody > tr > td {
  background-color: var(--tswm-panel);
}

html.theme-dark .dashboard-shell .tswm-standard-table.table-hover > tbody > tr:hover > td {
  background-color: var(--tswm-hover);
}

@media (max-width: 767.98px) {
  .dashboard-shell .tswm-standard-page > .content-header,
  .dashboard-shell .content-wrapper > .content-header {
    min-height: 0;
  }

  .dashboard-shell .tswm-standard-header .breadcrumb {
    float: none !important;
    margin-top: .75rem;
  }

  .dashboard-shell .tswm-card-header-with-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-shell .tswm-card-header-with-tools > .card-tools {
    margin-left: 0;
    width: 100%;
  }

  .dashboard-shell .tswm-card-header-with-tools > .card-tools .btn {
    white-space: normal;
  }
}

/* ----------------------------------------------------------
   ENVIRONMENT MODE SWITCHER (PRODUÇÃO vs SANDBOX) — AdminLTE
   ---------------------------------------------------------- */
.dashboard-shell.tswm-sandbox-active .main-header {
  border-top: 3px solid #ffc107 !important;
}

.dashboard-shell .main-header .btn-group .btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  line-height: 1.4;
}

.sidebar-collapse .sidebar .card.card-outline,
body.sidebar-collapse .sidebar .card.card-outline {
  display: none !important;
}

html.theme-dark .dashboard-shell .btn-outline-secondary {
  color: #cbd5e1;
  border-color: #475569;
}

html.theme-dark .dashboard-shell .btn-outline-secondary:hover {
  background-color: #334155;
  color: #ffffff;
  border-color: #64748b;
}

html.theme-dark .dashboard-shell .card.card-outline.card-warning {
  border-top-color: #ffc107;
}

html.theme-dark .dashboard-shell .card.card-outline.card-success {
  border-top-color: #28a745;
}
