/* ============================================================
   DESIGN SYSTEM — TRIADE FREITAS CORPORE
   Cores: Vermelho Ferrari + Amarelo Ouro + Azul Petróleo
   ============================================================ */

:root {
  /* Cores da marca */
  --cor-primaria:   #C8102E;
  --cor-secundaria: #D4AF37;
  --cor-terciaria:  #FFFFFF;
  --cor-fundo:      #FFFFFF;
  --cor-texto:      #2C3E50;
  --cor-texto-suave:#6B7B8C;
  --cor-borda:      #E0DCD5;

  /* Status */
  --cor-sucesso:    #27AE60;
  --cor-erro:       #E74C3C;
  --cor-aviso:      #F39C12;
  --cor-info:       #3498DB;

  /* Fontes */
  --fonte-principal: 'Inter', 'Segoe UI', -apple-system, sans-serif;
  --fs-xs:  12px;
  --fs-sm:  14px;
  --fs-md:  16px;
  --fs-lg:  20px;
  --fs-xl:  24px;
  --fs-2xl: 32px;
  --fs-3xl: 40px;

  /* Espaçamento (múltiplos de 4) */
  --esp-xs: 4px;
  --esp-sm: 8px;
  --esp-md: 16px;
  --esp-lg: 24px;
  --esp-xl: 32px;
  --esp-2xl: 48px;

  /* Bordas */
  --raio-sm: 4px;
  --raio:    8px;
  --raio-lg: 8px;
  --sombra:  0 2px 8px rgba(0,0,0,0.08);
  --sombra-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--fonte-principal);
  font-size: var(--fs-md);
  background: var(--cor-fundo);
  color: var(--cor-texto);
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--fonte-principal); font-weight: 700; }
h1 { font-size: var(--fs-2xl); margin-bottom: var(--esp-md); }
h2 { font-size: var(--fs-xl); margin-bottom: var(--esp-md); }
h3 { font-size: var(--fs-lg); margin-bottom: var(--esp-sm); }

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

/* ============================================================
   BOTÕES — padronizados (tamanho único, sem torto)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--esp-sm);
  padding: var(--esp-sm) var(--esp-lg);
  min-height: 44px;
  height: auto;
  width: auto;
  min-width: 140px;
  font-family: var(--fonte-principal);
  font-size: var(--fs-md);
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--raio);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--sombra); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--cor-primaria); color: #fff; }
.btn-primary:hover { background: #a50d26; }

.btn-secondary { background: var(--cor-secundaria); color: var(--cor-texto); }
.btn-secondary:hover { background: #c49b2f; }

.btn-ghost {
  background: transparent;
  color: var(--cor-primaria);
  border-color: var(--cor-primaria);
}
.btn-ghost:hover { background: var(--cor-primaria); color: #fff; }

.btn-danger { background: var(--cor-erro); color: #fff; }
.btn-success { background: var(--cor-sucesso); color: #fff; }
.btn-info { background: var(--cor-info); color: #fff; }

.btn-sm, .btn-lg { min-height: 44px; height: auto; width: auto; min-width: 140px; font-size: var(--fs-md); padding: var(--esp-sm) var(--esp-lg); }

button:not(.olho-senha-flutuante), .aba-btn, .btn-primario, .btn-secundario, .btn-perigo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  height: auto;
  width: auto;
  min-width: 140px;
  font-size: var(--fs-md);
  white-space: nowrap;
  border-radius: var(--raio);
  padding: var(--esp-sm) var(--esp-md);
}
.btn-full, button.btn-full { width: 100%; }

button:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-success):not(.btn-info):not(.btn-ghost):not(.olho-senha-flutuante) {
  background: var(--cor-secundaria);
  color: var(--cor-texto);
}

/* ============================================================
   ABAS — botão de cada aba (padrão único)
   ============================================================ */
.abas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-xs);
  border-bottom: 2px solid var(--cor-borda);
  margin-bottom: var(--esp-lg);
  padding: 0 var(--esp-md);
}
.aba {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--esp-sm) var(--esp-md);
  min-height: 44px;
  height: auto;
  width: auto;
  min-width: 140px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--cor-texto-suave);
  background: transparent;
  border: 1px solid var(--cor-borda);
  border-radius: var(--raio-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.aba:hover { color: var(--cor-primaria); border-color: var(--cor-primaria); }
.aba.ativa {
  background: var(--cor-primaria);
  color: #fff;
  border-color: var(--cor-primaria);
  font-weight: 700;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #fff;
  border-radius: var(--raio-lg);
  box-shadow: var(--sombra);
  padding: var(--esp-lg);
  margin-bottom: var(--esp-lg);
}
.card-titulo {
  font-size: var(--fs-lg);
  color: var(--cor-texto);
  margin-bottom: var(--esp-md);
  font-weight: 700;
}

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.campo { margin-bottom: var(--esp-md); }
.campo label {
  display: block;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--cor-texto);
  margin-bottom: var(--esp-xs);
}
.campo input,
.campo select,
.campo textarea {
  width: 100%;
  padding: var(--esp-sm) var(--esp-md);
  min-height: 44px;
  font-size: var(--fs-md);
  font-family: var(--fonte-principal);
  border: 1px solid var(--cor-borda);
  border-radius: var(--raio);
  background: #fff;
  color: var(--cor-texto);
}
.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  outline: none;
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.15);
}

/* ============================================================
   ALERTAS
   ============================================================ */
.alerta {
  padding: var(--esp-md);
  border-radius: var(--raio);
  margin-bottom: var(--esp-md);
  border-left: 4px solid;
  font-size: var(--fs-sm);
}
.alerta-sucesso { background: #d4edda; color: #155724; border-color: var(--cor-sucesso); }
.alerta-erro    { background: #f8d7da; color: #721c24; border-color: var(--cor-erro); }
.alerta-aviso   { background: #fff3cd; color: #856404; border-color: var(--cor-aviso); }
.alerta-info    { background: #d1ecf1; color: #0c5460; border-color: var(--cor-info); }

/* ============================================================
   TOPBAR (cabeçalho global)
   ============================================================ */
.topbar {
  background: var(--cor-texto);
  color: #fff;
  padding: var(--esp-md) var(--esp-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--sombra);
  margin-bottom: var(--esp-lg);
}

.topbar .logo {
  display: flex;
  align-items: center;
  gap: var(--esp-sm);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--cor-secundaria);
}

.topbar .logo .logo-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--cor-secundaria);
}

.topbar .usuario {
  display: flex;
  align-items: center;
  gap: var(--esp-sm);
  font-size: var(--fs-sm);
}

.status-online {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  color: #fff;
  font-size: var(--fs-sm);
}
.status-online i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #27AE60;
  box-shadow: 0 0 0 3px rgba(39,174,96,.18);
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--esp-md);
}

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mb-sm { margin-bottom: var(--esp-sm); }
.mb-md { margin-bottom: var(--esp-md); }
.mb-lg { margin-bottom: var(--esp-lg); }
.mt-md { margin-top: var(--esp-md); }
.mt-lg { margin-top: var(--esp-lg); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-md { gap: var(--esp-md); }









/* O wrapper do input precisa ser relative */
.campo .input-senha-wrapper {
  position: relative;
  display: block;
}

.olho-senha-flutuante {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  font-size: 18px;
  color: var(--cor-texto-suave);
  transition: background 0.15s, color 0.15s;
  z-index: 10;
  padding: 0;
  line-height: 1;
}
.olho-senha-flutuante:hover {
  background: rgba(200, 16, 46, 0.08);
  color: var(--cor-primaria);
}
.olho-senha-flutuante:active {
  background: rgba(200, 16, 46, 0.15);
}


/* ============================================================
   OLHO DA SENHA — patch cirurgico (alinhado ao input)
   ============================================================ */
.campo input[type="password"],
.campo input[type="text"] {
  padding-right: 48px;
}

.olho-senha-flutuante {
  position: absolute;
  right: 6px;
  bottom: 6px;                  /* alinha pelo FUNDO do input (nao pelo topo do campo) */
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  font-size: 16px;
  color: var(--cor-texto-suave);
  transition: background 0.15s, color 0.15s;
  z-index: 10;
  padding: 0;
  line-height: 1;
}
.olho-senha-flutuante:hover {
  background: rgba(200, 16, 46, 0.08);
  color: var(--cor-primaria);
}
.olho-senha-flutuante:active {
  background: rgba(200, 16, 46, 0.15);
}


/* ============================================================
   BOTÕES DA TABELA MASTER (largura padrão)
   ============================================================ */
.btn-tabela {
    width: min(140px, 100%) !important;
    min-width: 0 !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
}

@media (max-width: 480px) {
  .btn, button:not(.olho-senha-flutuante), .aba, .aba-btn { min-width: 140px; width: auto; }
  .topbar .logo .logo-img { width: 52px; height: 52px; }
}
