/* ============================================================
   VARIÁVEIS BÁSICAS (PADRÃO DO SISTEMA)
============================================================ */
:root{
  /* Cor “brand” default (caso não esteja no home-theme) */
  --brand: #3A506B;
  --brand-dark: #1F2E3A;

  /* Neutros (claro) */
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-color: #111827;
  --muted: #6b7280;

  --stroke: rgba(0,0,0,.10);
  --shadow: 0 8px 18px rgba(0,0,0,.10);

  /* Acessibilidade */
  --focus: rgba(48,110,242,.35);

  /* Componentes */
  --surface-2: rgba(0,0,0,.03);
  --surface-3: rgba(0,0,0,.06);
}

/* ============================================================
   TEMA ESCURO (NEUTROS PADRÃO DAS PALETAS)
   - Baseado em: #262626, #595959, #C2C2C2, #F7F7F7
============================================================ */
html[data-theme="dark"],
.dark-mode{
  --bg-color: #262626;     /* fundo principal (paleta) */
  --card-bg: #303030;      /* cards um pouco mais claros para separar */
  --text-color: #F7F7F7;   /* texto principal (paleta) */
  --muted: #C2C2C2;        /* texto secundário (paleta) */

  --stroke: rgba(247,247,247,.16);
  --shadow: 0 10px 26px rgba(0,0,0,.60);

  --surface-2: rgba(247,247,247,.06);
  --surface-3: rgba(247,247,247,.10);

  /* foco mais visível no dark */
  --focus: rgba(247,247,247,.22);
}

/* ============================================================
   BASE
============================================================ */
html, body{
  background: var(--bg-color);
  color: var(--text-color);
}

.text-muted{
  color: var(--muted) !important;
}

a{
  color: var(--brand);
  text-decoration: none;
}
a:hover{
  text-decoration: underline;
}

/* Foco acessível */
:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ============================================================
   NAVBAR
============================================================ */
.navbar{
  min-height: 64px;
}

.brand-logo{
  height: clamp(32px, 4.2vw, 44px);
  object-fit: contain;
}

.brand-text{
  color:#fff;
  font-weight:600;
}

/* ============================================================
   LOGIN (SEMPRE AZUL – NÃO MUDA POR EMPRESA)
============================================================ */
.login-page{
  --brand: #306EF2;
  --brand-dark: #081126;

  --bg-color: #F7F7F7;
  --card-bg: #ffffff;
  --text-color: #262626;
  --muted: #595959;

  background: var(--bg-color);
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:60px 16px;
}

.login-box{
  background: var(--card-bg);
  border-radius:18px;
  padding:2.5rem 2rem;
  width:100%;
  max-width:420px;
  border:1px solid rgba(0,0,0,.15);
  box-shadow: var(--shadow);
}

.login-logo{
  height:80px;
  object-fit:contain;
}

.login-divider{
  height:3px;
  border-radius:999px;
  background:linear-gradient(
    90deg,
    rgba(48,110,242,.9),
    rgba(48,110,242,.3)
  );
}

.login-input{
  border-radius:999px;
  height:46px;
  padding-left:1rem;
  border:1px solid #ccc;
}

.login-input:focus{
  border-color: var(--brand);
  box-shadow:0 0 0 .2rem rgba(48,110,242,.25);
}

.btn-eye{
  position:absolute;
  right:.75rem;
  top:50%;
  transform:translateY(-50%);
  background:none;
  border:0;
  cursor:pointer;
  opacity:.65;
}
.btn-eye:hover{ opacity:1; }

/* ============================================================
   BOTÕES (PADRONIZADO)
============================================================ */
.btn-brand{
  background:linear-gradient(135deg,var(--brand),var(--brand-dark));
  color:#fff;
  border-radius:999px;
  height:46px;
  font-weight:700;
  border:0;
  padding: 0 18px;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

.btn-brand:hover{
  filter: brightness(1.03);
}

.btn-brand:active{
  transform: translateY(1px);
}

.btn-outline-brand{
  background: transparent;
  color: var(--text-color);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  height: 40px;
  padding: 0 14px;
  font-weight: 600;
}
.btn-outline-brand:hover{
  background: var(--surface-2);
}

/* Botões pequenos (ex.: ações em tabela) */
.btn-xs{
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: .85rem;
}

/* ============================================================
   HOME / DASHBOARD (BASE)
============================================================ */
.hero{
  background:
    radial-gradient(110% 140% at 0% 0%, var(--surface-3), transparent),
    linear-gradient(180deg, var(--card-bg), rgba(0,0,0,0));
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:20px;
}

html[data-theme="dark"] .hero,
.dark-mode .hero{
  background:
    radial-gradient(110% 140% at 0% 0%, rgba(247,247,247,.08), transparent),
    linear-gradient(180deg, rgba(247,247,247,.06), rgba(0,0,0,0));
}

.kpis{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:16px;
}

.kpi{
  grid-column:span 3;
  background:var(--card-bg);
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:18px;
  box-shadow:var(--shadow);
}

.kpi .label{ color:var(--muted); font-size:.85rem; }
.kpi .value{ font-size:2rem; font-weight:800; }

.panel{
  background:var(--card-bg);
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:16px;
  box-shadow:var(--shadow);
}

/* ============================================================
   PROGRESS BAR (PADRONIZADO)
============================================================ */
.progress-slim{
  height:12px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius:999px;
  overflow:hidden;
}
.progress-slim-bar{
  height:100%;
  background: var(--brand);
  border-radius:inherit;
  transition:width .6s ease;
}

/* ============================================================
   BADGES (PADRONIZADO)
============================================================ */
.badge-soft{
  background: var(--surface-2);
  color: var(--text-color);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: .25rem .55rem;
  font-weight: 700;
  font-size: .78rem;
}

.badge-brand{
  background: rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.14);
  color: var(--brand);
}
html[data-theme="dark"] .badge-brand,
.dark-mode .badge-brand{
  background: rgba(247,247,247,.08);
  border: 1px solid rgba(247,247,247,.14);
  color: #F7F7F7;
}

/* ============================================================
   HOME-THEME → CORES POR EMPRESA (SÓ NO HOME)
   (essas variáveis “pintam” botões, progress, links e detalhes)
============================================================ */
.home-theme.company-apoio{
  --brand:#E6A22E;
  --brand-dark:#262626;
}
.home-theme.company-wq{
  --brand:#4CBF57;
  --brand-dark:#0F2611;
}
.home-theme.company-apbvix{
  --brand:#F23030;
  --brand-dark:#262626;
}
.home-theme.company-industech{
  --brand:#F27A30;
  --brand-dark:#262626;
}

/* ============================================================
   RESPONSIVO
============================================================ */
@media (max-width:1200px){
  .kpi{ grid-column:span 6; }
}
@media (max-width:680px){
  .kpi{ grid-column:span 12; }
}
