﻿/* ══════════════════════════════════════════════════════════════════════════════
   GESTÃO VISUAL — Auth Pages — Sneat-inspired design
   ══════════════════════════════════════════════════════════════════════════════ */

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

/* ── Variáveis — Tema Escuro (padrão) ─────────────────────────────────────── */
:root {
  --primary:   #FF6E28;
  --primary-dark: #e85e18;
  --success:   #4CAF50;
  --danger:    #FF4444;
  --warning:   #FFB900;
  --info:      #3B9EFF;
  --purple:    #8B5CF6;

  --primary-soft: rgba(255,110,40,.14);
  --success-soft: rgba(76,175,80,.14);
  --danger-soft:  rgba(255,68,68,.14);
  --warning-soft: rgba(255,185,0,.14);
  --info-soft:    rgba(59,158,255,.14);
  --purple-soft:  rgba(139,92,246,.14);
  --muted-soft:   rgba(120,120,120,.14);

  /* Superfícies escuras */
  --bg:        #28243D;
  --panel-bg:  #28243D;
  --card:      #312D4B;
  --input-bg:  #3B3661;
  --input-bd:  #544F72;
  --text:      #E7E3FC;
  --muted:     #9089AC;
  --hover:     rgba(255,110,40,.06);
  --shadow:    0 6px 24px rgba(0,0,0,.45);

  /* Aliases */
  --accent: var(--primary);
  --error:  var(--danger);
}

/* ── Variáveis — Tema Claro ───────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:       #F5F5F9;
  --panel-bg: #F5F5F9;
  --card:     #FFFFFF;
  --input-bg: #FFFFFF;
  --input-bd: #D4D4DA;
  --text:     #3A3541;
  --muted:    #968DB5;
  --hover:    rgba(255,110,40,.06);
  --shadow:   0 6px 24px rgba(67,89,113,.14);

  --primary-soft: rgba(255,110,40,.10);
  --success-soft: rgba(76,175,80,.10);
  --danger-soft:  rgba(255,68,68,.10);
  --warning-soft: rgba(255,185,0,.10);
  --info-soft:    rgba(59,158,255,.10);
  --purple-soft:  rgba(139,92,246,.10);
  --muted-soft:   rgba(120,120,120,.10);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; height: 100%; }

body {
  font-family: 'Inter', 'Public Sans', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   AUTH LAYOUT — Two Column Sneat
   ══════════════════════════════════════════════════════════════════════════════ */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ── Painel esquerdo (cover) ─────────────────────────────────────────────── */
.auth-cover {
  flex: 0 0 42%;
  background: linear-gradient(150deg, #FF6E28 0%, #d95010 55%, #b33a08 100%);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  overflow: hidden;
}

/* Decoração circular no cover */
.auth-cover::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  top: -120px;
  right: -120px;
}
.auth-cover::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  bottom: -80px;
  left: -80px;
}

.auth-cover-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
}

.auth-cover-logo {
  height: 90px;
  width: auto;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: brightness(0) invert(1);
  opacity: .92;
  position: relative;
  z-index: 1;
}

.auth-cover-title {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .75rem;
  letter-spacing: -.01em;
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 1;
}

.auth-cover-subtitle,
.auth-cover-sub {
  font-size: .9375rem;
  opacity: .8;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ── Painel direito (form) ───────────────────────────────────────────────── */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--panel-bg);
  min-height: 100vh;
  overflow-y: auto;
}

/* ── Card do formulário ──────────────────────────────────────────────────── */
.auth-form-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: .75rem;
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow);
  animation: authFadeUp .3s ease both;
}

@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Brand no topo do card ───────────────────────────────────────────────── */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.auth-brand-logo {
  height: 130px;
  width: auto;
  object-fit: contain;
}

/* ── Tipografia do card ──────────────────────────────────────────────────── */
.auth-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .375rem;
  letter-spacing: -.01em;
}

.auth-subtitle {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ── Botão de tema ────────────────────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid var(--input-bd);
  cursor: pointer;
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  transition: background .3s, border-color .3s;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.theme-toggle:hover { border-color: var(--primary); }

.theme-icon-dark,
.theme-icon-light {
  font-size: .85rem;
  line-height: 1;
  transition: opacity .3s;
}

:root:not([data-theme="light"]) .theme-icon-light { opacity: .25; }
:root:not([data-theme="light"]) .theme-icon-dark  { opacity: 1;   }
[data-theme="light"] .theme-icon-dark  { opacity: .25; }
[data-theme="light"] .theme-icon-light { opacity: 1;   }

/* ══════════════════════════════════════════════════════════════════════════════
   FORMULÁRIO — Sneat style
   ══════════════════════════════════════════════════════════════════════════════ */
.form { display: flex; flex-direction: column; }

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.125rem;
}

/* Label Sneat: normal case, muted, font-weight 500 */
.field label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .375rem;
}

/* Label de senha com link "esqueci" inline */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .375rem;
}
.field-label-row label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

/* Inputs */
.field input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-bd);
  border-radius: .375rem;
  color: var(--text);
  font-family: inherit;
  font-size: .9375rem;
  font-weight: 400;
  padding: .5rem .875rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}
.field input::placeholder { color: var(--muted); opacity: .7; }
.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .125rem rgba(255,110,40,.18);
}

/* Input com ícone de olho */
.input-wrapper { position: relative; }
.input-wrapper input { padding-right: 2.75rem; }

/* Input com ícone prefix (envelope, cadeado etc.) */
.input-prefix-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: color .15s;
}
.input-has-icon input { padding-left: 2.5rem; }
.input-wrapper:focus-within .input-prefix-icon { color: var(--primary); }

.toggle-pw {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color .15s;
}
.toggle-pw:hover { color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════════════
   BOTÕES
   ══════════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid transparent;
  border-radius: .375rem;
  cursor: pointer;
  font-family: inherit;
  font-size: .9375rem;
  font-weight: 500;
  padding: .5rem 1.25rem;
  transition: background .2s, transform .1s, box-shadow .2s, color .2s, border-color .2s;
  text-decoration: none;
  white-space: nowrap;
  width: 100%;
  margin-top: .25rem;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 18px rgba(255,110,40,.38);
}

/* Legados */
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info    { background: var(--info);    color: #fff; }
.btn-purple  { background: var(--purple);  color: #fff; }

.btn-primary-soft { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.btn-success-soft { background: var(--success-soft); color: var(--success); border-color: transparent; }
.btn-danger-soft  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }

.btn-outline  { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--input-bd);
}
.btn-secondary:hover { border-color: var(--text); color: var(--text); }

/* Google — mantém fundo branco nos 2 temas */
.btn-google {
  background: #fff;
  color: #3C4043;
  border: 1px solid #dadce0;
  font-weight: 500;
  border-radius: .375rem;
}
.btn-google:hover { background: #f8f8f8; box-shadow: 0 2px 8px rgba(0,0,0,.14); }

/* Sizes */
.btn-sm { font-size: .8rem; padding: .35rem .85rem; }
.btn-lg { font-size: 1rem; padding: .65rem 1.5rem; }
.btn-block { width: 100%; }

/* Botão primário — classe canônica usada em todos os módulos */
.btn-laranja,
.prd-btn-novo,
.jp-btn-novo {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .47rem 1.1rem;
  border-radius: .5rem;
  border: none;
  background: var(--bs-primary, var(--primary));
  color: #fff;
  font-size: .87rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.5;
  box-shadow: 0 .15rem .5rem rgba(var(--bs-primary-rgb, 94, 86, 228), .28);
  transition: box-shadow .15s, transform .1s;
  font-family: inherit;
}
.btn-laranja:hover,
.prd-btn-novo:hover,
.jp-btn-novo:hover {
  box-shadow: 0 .25rem .8rem rgba(var(--bs-primary-rgb, 94, 86, 228), .42);
  transform: translateY(-1px);
}
.btn-laranja:disabled,
.prd-btn-novo:disabled,
.jp-btn-novo:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ALERTAS / FLASH
   ══════════════════════════════════════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: .375rem;
  font-size: .875rem;
  margin-bottom: 1rem;
  border-left: 3px solid;
  animation: authFadeUp .25s ease both;
}
.alert-icon { font-size: .9rem; flex-shrink: 0; margin-top: .05rem; }
.alert-error,
.alert-danger  { background: var(--danger-soft);  border-color: var(--danger);  color: #ff6b6b; }
.alert-success { background: var(--success-soft); border-color: var(--success); color: #6fcf6f; }
.alert-demo    { background: var(--warning-soft); border-color: var(--warning); color: #ffe080; }
.alert-info    { background: var(--info-soft);    border-color: var(--info);    color: #9fcfff; }
[data-theme="light"] .alert-error,
[data-theme="light"] .alert-danger  { color: #c0392b; }
[data-theme="light"] .alert-success { color: #27ae60; }

/* ══════════════════════════════════════════════════════════════════════════════
   SEPARADOR
   ══════════════════════════════════════════════════════════════════════════════ */
.separator {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: .8125rem;
}
.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--input-bd);
}

/* ══════════════════════════════════════════════════════════════════════════════
   LINKS & FOOTER
   ══════════════════════════════════════════════════════════════════════════════ */
.link { color: var(--primary); text-decoration: none; font-weight: 600; }
.link:hover { color: var(--primary-dark); text-decoration: underline; }
.link-muted { font-size: .875rem; color: var(--muted); text-decoration: none; }
.link-muted:hover { color: var(--primary); }
.link-sm { font-size: .8125rem; color: var(--primary); text-decoration: none; font-weight: 500; }
.link-sm:hover { text-decoration: underline; }

.footer-text {
  text-align: center;
  font-size: .875rem;
  color: var(--muted);
  margin-top: 1.25rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FORÇA DA SENHA
   ══════════════════════════════════════════════════════════════════════════════ */
.strength-bar {
  height: 4px;
  background: var(--input-bd);
  border-radius: 2px;
  margin-top: .5rem;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width .3s ease, background .3s ease;
}
.strength-label {
  font-size: .75rem;
  margin-top: .3rem;
  font-weight: 500;
  min-height: 1.1em;
  color: var(--muted);
}

.req-list {
  list-style: none;
  margin-top: .6rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.req-list li {
  font-size: .8125rem;
  color: var(--muted);
  padding-left: 1.2rem;
  position: relative;
  transition: color .2s;
}
.req-list li::before {
  content: '○';
  position: absolute;
  left: 0;
  color: var(--muted);
  transition: color .2s;
}
.req-list li.ok { color: var(--success); }
.req-list li.ok::before { content: '✓'; color: var(--success); }

.req-box {
  background: var(--input-bg);
  border: 1px solid var(--input-bd);
  border-radius: .375rem;
  padding: .875rem 1rem;
  margin-bottom: 1.25rem;
}
.req-title { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: .4rem; }
.req-list--static li { color: var(--muted); }
.req-list--static li::before { content: '✦'; font-size: .6rem; top: .1rem; }

/* ══════════════════════════════════════════════════════════════════════════════
   BADGES (compatibilidade com páginas de auth)
   ══════════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 700;
  padding: .22rem .65rem;
  border-radius: 999px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge-success, .badge-green  { background: var(--success-soft); color: var(--success); }
.badge-danger,  .badge-red    { background: var(--danger-soft);  color: var(--danger);  }
.badge-warning, .badge-amber  { background: var(--warning-soft); color: #9a6800; }
.badge-info                   { background: var(--info-soft);    color: var(--info);    }
.badge-muted,   .badge-grey   { background: var(--muted-soft);   color: var(--muted);   }

/* ══════════════════════════════════════════════════════════════════════════════
   ESTADOS LEGADOS (retrocompatibilidade: .page / .card)
   ══════════════════════════════════════════════════════════════════════════════ */
.page { width: 100%; max-width: 440px; }
.card {
  background: var(--card);
  border-radius: .75rem;
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow);
  animation: authFadeUp .3s ease both;
}
.heading    { font-size: 1.375rem; font-weight: 700; text-align: center; margin-bottom: .375rem; }
.subheading { font-size: .9rem; color: var(--muted); text-align: center; margin-bottom: 1.5rem; }
.icon-header { font-size: 3rem; text-align: center; margin-bottom: .8rem; }
.logo { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.logo img { height: 80px; width: auto; object-fit: contain; }
.row-right { display: flex; justify-content: flex-end; margin: -.25rem 0 .75rem; }

/* ── Dashboard logged state ─────────────────────────────────────────────── */
.dashboard-center { text-align: center; }
.dash-emoji  { font-size: 4rem; margin-bottom: .8rem; }
.dash-nome   { font-size: 1.1rem; margin: .8rem 0 .3rem; color: var(--text); }
.dash-info   { display: flex; justify-content: center; margin-top: 1.5rem; }
.dash-badge  {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--success-soft);
  border: 1px solid rgba(76,175,80,.3);
  color: var(--success);
  font-size: .82rem;
  padding: .4rem .9rem;
  border-radius: 999px;
}
.dash-badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

/* ── Modal (páginas de auth) ─────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0,0,0,.5);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}
.modal.open { display: flex; }
.modal-inner {
  background: var(--card);
  border-radius: .75rem;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: authFadeUp .25s ease both;
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }

/* ── Aliases para classes dos templates ──────────────────────────────────── */
.auth-sub       { font-size: .9rem; color: var(--muted); margin-bottom: 1.5rem; }
.auth-form      { display: flex; flex-direction: column; }
.auth-footer-text {
  text-align: center;
  font-size: .875rem;
  color: var(--muted);
  margin-top: 1.25rem;
}
.auth-separator {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: .8125rem;
}
.auth-separator::before,
.auth-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--input-bd);
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVO
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .auth-cover { display: none; }
  .auth-form-panel { padding: 1.5rem 1rem; }
  .auth-form-card { padding: 1.75rem 1.5rem; }
}

@media (max-width: 480px) {
  .auth-form-card { padding: 1.5rem 1.25rem; border-radius: .5rem; }
  .auth-brand-logo { height: 100px; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM GLOBAL — focus, acessibilidade, utilitários
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Focus Visible Global ──────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--bs-primary, #FF6E28);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Remove outline padrão feio, mantém só focus-visible */
:focus:not(:focus-visible) { outline: none; }

/* ── Touch Targets mínimos (44×44px) ─────────────────────────────────────── */
button, [role="button"], a, input[type="submit"], input[type="button"],
input[type="checkbox"], input[type="radio"], select {
  min-height: 24px; /* base — sobrescrito por componentes */
}
.prd-action-btn,
.btn-icon,
[class*="btn-acao"],
[class*="btn-icon"] {
  min-width:  44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Zebra Striping em tabelas ────────────────────────────────────────────── */
.prd-table tbody tr:nth-child(even),
.tabela tbody tr:nth-child(even),
.ec-table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, .02);
}
[data-bs-theme="dark"] .prd-table tbody tr:nth-child(even),
[data-bs-theme="dark"] .tabela tbody tr:nth-child(even),
[data-bs-theme="dark"] .ec-table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, .025);
}

/* ── Scroll Indicator horizontal em tabelas ─────────────────────────────── */
.table-scroll-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(var(--card-rgb, 49,45,75), .85));
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-200, .2s);
}
.table-scroll-wrap.has-overflow::after { opacity: 1; }

/* ── Skeleton Loader ─────────────────────────────────────────────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  display: block;
  border-radius: var(--radius-sm, 6px);
  background: linear-gradient(
    90deg,
    rgba(0,0,0,.06) 25%,
    rgba(0,0,0,.03) 50%,
    rgba(0,0,0,.06) 75%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
}
[data-bs-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.07) 25%,
    rgba(255,255,255,.035) 50%,
    rgba(255,255,255,.07) 75%
  );
  background-size: 800px 100%;
}
.skeleton-text     { height: 0.875rem; margin-bottom: 0.5rem; }
.skeleton-title    { height: 1.25rem; width: 60%; margin-bottom: 0.75rem; }
.skeleton-avatar   { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-badge    { height: 1.25rem; width: 70px; border-radius: var(--radius-full, 999px); }
.skeleton-btn      { height: 2.25rem; width: 120px; border-radius: var(--radius-md, 8px); }
.skeleton-kpi-val  { height: 2rem; width: 80px; }

/* Linhas de skeleton para tabela */
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--card-bd, rgba(208,211,232,.14));
}
.skeleton-row .skeleton { flex: 1; height: .875rem; }
.skeleton-row .skeleton:first-child { max-width: 120px; }
.skeleton-row .skeleton:last-child  { max-width: 80px; }

/* ── Toast Melhorado ─────────────────────────────────────────────────────── */
#g-toast-box {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast, 1070);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  pointer-events: none;
  width: max-content;
  max-width: min(420px, 90vw);
}
.g-toast {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1.1rem;
  border-radius: var(--radius-lg, 12px);
  font-size: var(--text-sm, .8125rem);
  font-weight: var(--fw-semibold, 600);
  color: #fff;
  pointer-events: all;
  box-shadow: var(--shadow-3);
  transform: translateY(12px);
  opacity: 0;
  transition: transform var(--dur-300, .3s) var(--ease-out, cubic-bezier(0,0,.2,1)),
              opacity  var(--dur-300, .3s) var(--ease-out);
  max-width: 100%;
  word-break: break-word;
}
.g-toast.show { transform: translateY(0); opacity: 1; }
.g-toast--ok   { background: var(--green-600, #16a34a); }
.g-toast--err  { background: var(--red-600, #dc2626); }
.g-toast--warn { background: var(--yellow-600, #d97706); color: #1a1a1a; }
.g-toast--info { background: var(--blue-600, #2563eb); }
.g-toast-icon  { font-size: 1rem; flex-shrink: 0; }

/* ── Progress Bar ────────────────────────────────────────────────────────── */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: var(--text-xs, .75rem);
  color: var(--muted);
}
.progress-bar-track {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-full, 999px);
  background: rgba(0,0,0,.08);
  overflow: hidden;
}
[data-bs-theme="dark"] .progress-bar-track {
  background: rgba(255,255,255,.1);
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full, 999px);
  background: var(--color-primary, #FF6E28);
  transition: width var(--dur-300, .3s) var(--ease, cubic-bezier(.4,0,.2,1));
}
.progress-bar-fill.fill-success { background: var(--color-success, #22c55e); }
.progress-bar-fill.fill-warning { background: var(--color-warning, #eab308); }
.progress-bar-fill.fill-danger  { background: var(--color-danger, #ef4444); }

/* ── Delta Indicator (trend nos KPI cards) ───────────────────────────────── */
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: var(--text-xs, .75rem);
  font-weight: var(--fw-semibold, 600);
  padding: .1rem .4rem;
  border-radius: var(--radius-full, 999px);
}
.kpi-delta--up   { background: var(--green-100, #dcfce7); color: var(--green-700, #15803d); }
.kpi-delta--down { background: var(--red-100, #fee2e2);   color: var(--red-700, #b91c1c);   }
.kpi-delta--flat { background: rgba(0,0,0,.06); color: var(--muted); }
[data-bs-theme="dark"] .kpi-delta--up   { background: rgba(34,197,94,.15); color: var(--green-400, #4ade80); }
[data-bs-theme="dark"] .kpi-delta--down { background: rgba(239,68,68,.15); color: var(--red-400, #f87171); }

/* ── Kanban Board ────────────────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: .75rem;
  align-items: flex-start;
  -webkit-overflow-scrolling: touch;
}
.kanban-col {
  flex: 0 0 280px;
  min-width: 280px;
  background: rgba(0,0,0,.03);
  border-radius: var(--radius-lg, 12px);
  border: 1.5px solid var(--card-bd);
  overflow: hidden;
}
[data-bs-theme="dark"] .kanban-col { background: rgba(255,255,255,.03); }
.kanban-col-hd {
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: var(--text-xs, .75rem);
  font-weight: var(--fw-bold, 700);
  text-transform: uppercase;
  letter-spacing: var(--ls-widest, .1em);
  color: var(--muted);
  border-bottom: 1.5px solid var(--card-bd);
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}
.kanban-col-hd .kanban-count {
  margin-left: auto;
  background: rgba(0,0,0,.08);
  border-radius: var(--radius-full, 999px);
  padding: .1rem .45rem;
  font-size: var(--text-2xs, .625rem);
}
[data-bs-theme="dark"] .kanban-col-hd .kanban-count { background: rgba(255,255,255,.1); }
.kanban-col-body {
  padding: .5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-height: 80px;
}
.kanban-card {
  background: var(--card);
  border: 1.5px solid var(--card-bd);
  border-radius: var(--radius-md, 8px);
  padding: .75rem;
  cursor: pointer;
  transition: box-shadow var(--dur-150, .15s), transform var(--dur-150, .15s);
}
.kanban-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.kanban-card-title {
  font-size: var(--text-sm, .8125rem);
  font-weight: var(--fw-semibold, 600);
  color: var(--text);
  margin-bottom: .3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-card-meta {
  font-size: var(--text-xs, .75rem);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

/* ── Command Palette ─────────────────────────────────────────────────────── */
#cmd-palette-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-modal, 1050) + 50);
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
#cmd-palette-backdrop.open { display: flex; }
#cmd-palette {
  background: var(--card);
  border: 1.5px solid var(--card-bd);
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-4);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  animation: cmd-in var(--dur-200, .2s) var(--ease-out, cubic-bezier(0,0,.2,1));
}
@keyframes cmd-in {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
#cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.1rem;
  border-bottom: 1.5px solid var(--card-bd);
}
#cmd-input-wrap i { font-size: 1.15rem; color: var(--muted); flex-shrink: 0; }
#cmd-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: var(--text-base, .875rem);
  color: var(--text);
  font-family: inherit;
}
#cmd-input::placeholder { color: var(--muted); }
#cmd-results {
  max-height: 340px;
  overflow-y: auto;
  padding: .4rem;
}
.cmd-group-label {
  font-size: var(--text-xs, .75rem);
  font-weight: var(--fw-bold, 700);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider, .05em);
  padding: .5rem .75rem .25rem;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: background var(--dur-100, .1s);
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-base, .875rem);
}
.cmd-item:hover,
.cmd-item.active {
  background: rgba(var(--bs-primary-rgb, 255,110,40), .1);
  color: var(--bs-primary, #FF6E28);
}
.cmd-item i { font-size: 1rem; color: var(--muted); flex-shrink: 0; }
.cmd-item:hover i,
.cmd-item.active i { color: var(--bs-primary, #FF6E28); }
.cmd-item-label { flex: 1; }
.cmd-item-hint  { font-size: var(--text-xs, .75rem); color: var(--muted); }
#cmd-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: var(--text-sm, .8125rem);
}
.cmd-kbd {
  display: inline-block;
  background: rgba(0,0,0,.07);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: var(--radius-xs, 4px);
  padding: .1rem .35rem;
  font-size: .7rem;
  font-family: monospace;
  color: var(--muted);
}
[data-bs-theme="dark"] .cmd-kbd {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
}
#cmd-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .55rem 1rem;
  border-top: 1.5px solid var(--card-bd);
  font-size: var(--text-xs, .75rem);
  color: var(--muted);
}

/* ── prefers-color-scheme auto-detection (JS override via data-theme) ─────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
  }
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
  }
}
