/* ===========================
   Portal de Vendas HTK — Design System (Healthink)
   Paleta oficial: Azul Escuro #005a96 · Azul Claro #00a0c8 · Amarelo #fac800
   Tipografia: Montserrat
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  /* Healthink theme */
  --accent:         #005a96;   /* Azul Escuro — principal */
  --accent-hover:   #004a7e;   /* Azul Escuro mais profundo */
  --accent-light:   #e6f4fa;   /* Tint do Azul Claro */
  --accent-border:  #b3e0ed;   /* Border do Azul Claro */
  --accent2:        #fac800;   /* Amarelo Healthink */
  --accent-secondary: #00a0c8; /* Azul Claro — destaques */
  --nav-bg:         #003a66;   /* Azul Escuro denso para topnav */
  --nav-border:     rgba(0,160,200,0.20);
  --nav-text:       rgba(255,255,255,0.55);
  --nav-text-hover: rgba(255,255,255,0.92);
  --nav-active:     #fac800;   /* Amarelo destaca o item ativo no fundo azul */
  --pill-bg:        rgba(250,200,0,0.16);
  --pill-border:    rgba(250,200,0,0.40);

  /* Global */
  --bg:             #f5f9fc;
  --surface:        #ffffff;
  --border:         #dde7ef;
  --text-primary:   #0b2a44;
  --text-secondary: #486581;
  --text-muted:     #8aa0b4;

  /* Aliases Bootstrap */
  --primary:        #005a96;
  --primary-dark:   #004a7e;
  --text:           #0b2a44;
  --success:        #16a34a;
  --danger:         #dc2626;
  --warning:        #d97706;

  --topnav-height: 54px;

  /* Bootstrap overrides */
  --bs-primary: #005a96;
  --bs-primary-rgb: 0,90,150;
  --bs-link-color: #005a96;
  --bs-link-hover-color: #00a0c8;
  --bs-border-radius: 8px;
}

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

body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background-color: var(--bg) !important;
  color: var(--text-primary);
  margin: 0;
}
#page-content { background-color: var(--bg); }

/* ── Bootstrap primary override ── */
.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-bg: var(--accent-hover);
  font-weight: 600; border-radius: 8px;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,90,150,0.35); }
.btn-primary:active { transform: none; }
.btn-outline-primary {
  --bs-btn-color: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  font-weight: 600; border-radius: 8px;
}

/* ── TOPNAV ── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  display: flex; align-items: stretch;
  height: var(--topnav-height);
  padding: 0 28px 0 20px;
  backdrop-filter: blur(12px);
}

.topnav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
  padding-right: 24px;
  border-right: 1px solid rgba(255,255,255,0.10);
  margin-right: 6px;
}
.brand-text {
  font-size: 15px; font-weight: 800; color: #fff; letter-spacing: -0.01em;
  font-family: 'Montserrat', sans-serif;
}

/* Nav + pill */
.topnav-nav {
  display: flex; align-items: stretch;
  position: relative;
}
.nav-indicator {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  height: 34px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 9px;
  transition: left 0.38s cubic-bezier(0.65,0,0.35,1),
              width 0.38s cubic-bezier(0.65,0,0.35,1),
              opacity 0.2s ease;
  pointer-events: none;
}
.nav-item {
  display: flex; align-items: center; gap: 7px;
  padding: 0 15px;
  font-size: 13.5px; font-weight: 500;
  color: var(--nav-text);
  text-decoration: none; white-space: nowrap;
  transition: color 0.25s ease;
  position: relative; z-index: 1;
}
.nav-item:hover { color: var(--nav-text-hover); }
.nav-item.active { color: var(--nav-active); font-weight: 700; }
.nav-item svg { flex-shrink: 0; opacity: 0.6; transition: opacity 0.2s; }
.nav-item:hover svg, .nav-item.active svg { opacity: 1; }

.topnav-spacer { flex: 1; }

/* User area */
.topnav-user {
  display: flex; align-items: center; gap: 9px;
  padding: 0 8px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.18s;
  border: 1px solid transparent;
  margin: 8px 0;
}
.topnav-user:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}
.user-info { text-align: right; line-height: 1.25; }
.user-name  { font-size: 13px; font-weight: 600; color: #fff; }
.user-role-label {
  font-size: 10.5px; font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.18);
}
.topnav-logout {
  color: rgba(255,255,255,0.45); font-size: 16px;
  padding: 5px 7px; border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.topnav-logout:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Mobile toggle */
.topnav-toggle {
  display: none;
  background: none; border: none;
  color: rgba(255,255,255,0.7); font-size: 22px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; margin-left: 6px;
}

/* Mobile nav dropdown */
.topnav-mobile {
  display: none;
  position: sticky; top: var(--topnav-height);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  z-index: 99;
  padding: 8px 12px 12px;
}
.topnav-mobile.open { display: block; }
.topnav-mobile ul { list-style: none; margin: 0; padding: 0; }
.topnav-mobile ul li a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--nav-text); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.topnav-mobile ul li a:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.92); }
.topnav-mobile ul li a.active { background: var(--pill-bg); color: var(--nav-active); border: 1px solid var(--pill-border); }

/* ── Page Content ── */
#page-content { min-height: calc(100vh - var(--topnav-height)); }
.content-wrapper {
  padding: 36px 24px;
  max-width: 1028px;
  margin: 0 auto;
}

/* Page animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.content-wrapper { animation: fadeUp 0.22s cubic-bezier(0.4,0,0.2,1); }

/* Page header */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 28px;
}
.page-header h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-primary); margin: 0;
}
.page-header p { font-size: 13.5px; color: var(--text-secondary); margin: 3px 0 0; }

/* Home grid */
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
@media (max-width: 768px) {
  .home-grid { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(11,42,68,0.04);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--border);
  padding: 16px 20px; font-weight: 600; font-size: 14px;
  color: var(--text-primary); border-radius: 0;
}
.card-body { padding: 24px; }
.card-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; margin-bottom: 22px;
  color: var(--text-primary);
}
.card-section-title i, .card-section-title svg { color: var(--accent); }

/* ── Stat Cards ── */
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px;
  transition: box-shadow 0.2s, transform 0.15s;
}
.stat-card:hover { box-shadow: 0 6px 20px rgba(0,90,150,0.10); transform: translateY(-2px); }
.stat-label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Legacy stat-icon (keep for pages that use it) */
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--accent-light); color: var(--accent); }
.stat-icon.green  { background: #f0fdf4; color: var(--success); }
.stat-icon.orange { background: #fffaeb; color: var(--accent2); }
.stat-icon.purple { background: #eef2ff; color: #6366f1; }

/* ── Forms ── */
.form-label {
  display: block; font-size: 12.5px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-control, .form-select {
  width: 100%; padding: 9px 12px;
  font-size: 13.5px; font-family: inherit; color: var(--text-primary);
  background: #fafbfc; border: 1px solid var(--border); border-radius: 8px;
  outline: none; transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus, .form-select:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(0,90,150,0.12);
  outline: none;
}
.form-control.filled {
  background: var(--accent-light);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Password toggle */
.input-password { position: relative; }
.input-password .form-control { padding-right: 44px; }
.input-password .pwd-toggle {
  position: absolute; right: 0; top: 0; bottom: 0; width: 42px;
  border: none; background: none;
  color: var(--text-muted); cursor: pointer; font-size: 16px;
  border-radius: 0 8px 8px 0; transition: color 0.15s;
}
.input-password .pwd-toggle:hover { color: var(--accent); }

/* Pipefy label badge */
.pipefy-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.pipefy-badge {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; letter-spacing: 0.02em;
}

/* Search */
.search-wrapper { position: relative; }
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.search-input { padding-left: 34px !important; }

/* ── Tables ── */
.users-table {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.table-head {
  display: grid; grid-template-columns: 2fr 2fr 1.2fr 1fr 80px;
  padding: 11px 20px;
  background: #f3f7fb; border-bottom: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.table-row {
  display: grid; grid-template-columns: 2fr 2fr 1.2fr 1fr 80px;
  padding: 13px 20px; border-bottom: 1px solid var(--border);
  align-items: center; font-size: 13.5px;
  transition: background 0.15s;
}
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: #f7fbfd; }

/* Bootstrap table override */
.table { font-size: 13.5px; border-color: var(--border); }
.table thead th {
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border); padding: 11px 16px;
  background: #f3f7fb;
}
.table tbody td { padding: 13px 16px; vertical-align: middle; border-color: var(--border); }
.table tbody tr:hover { background: #f7fbfd; }

/* ── Pills & Badges ── */
.pill {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.pill-blue  { background: var(--accent-light); color: var(--accent); }
.pill-gray  { background: #f3f4f6; color: #6b7280; }
.pill-green { background: #f0fdf4; color: #16a34a; }
.pill-teal  { background: var(--accent-light); color: var(--accent-secondary); }
.pill-amber { background: #fffaeb; color: #b88800; }

/* Legacy badge classes */
.badge-tipo { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.badge-seguro_saude { background: var(--accent-light); color: var(--accent); }
.badge-plano_saude  { background: #e6f9f3; color: #0a8a5a; }
.badge-odonto_puro  { background: #f4ecff; color: #6b21a8; }
.badge-role { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-border); font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

/* Action buttons */
.action-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px 6px; border-radius: 6px;
  transition: all 0.15s;
}
.action-btn:hover { color: var(--accent); background: var(--accent-light); }

/* Mini avatar */
.mini-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-cell { display: flex; align-items: center; gap: 10px; }

/* ── Option cards (pre-form) ── */
.option-card {
  border: 2px solid var(--border); border-radius: 12px; padding: 20px;
  cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  text-align: center; position: relative;
  background: var(--surface);
}
.option-card:hover { border-color: var(--accent); background: var(--accent-light); }
.option-card input[type="radio"],
.option-card input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.option-card.selected {
  border-color: var(--accent); background: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(0,90,150,0.18);
}
.option-card .option-icon { font-size: 32px; margin-bottom: 10px; }
.option-card .option-title { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.option-card .option-sub  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Pipefy iframe ── */
.pipefy-container {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
}
.pipefy-container iframe { width: 100%; border: none; min-height: 700px; }

/* ── Alerts ── */
.alert { border-radius: 9px; font-size: 13px; }
.alert-info    { background: var(--accent-light); border: 1px solid var(--accent-border); color: var(--accent); }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-warning { background: #fffaeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #005a96 0%, #00a0c8 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-box {
  background: #ffffff; border-radius: 20px; padding: 44px 40px;
  width: 100%; max-width: 420px; box-shadow: 0 25px 60px rgba(0,40,80,0.35);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon {
  width: 64px; height: 64px; background: var(--accent);
  border-radius: 18px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff; margin-bottom: 14px;
}
.login-logo h1 {
  font-size: 22px; font-weight: 800; color: var(--text-primary);
  margin: 0; letter-spacing: -0.02em;
  font-family: 'Montserrat', sans-serif;
}
.login-logo p  { font-size: 13px; color: var(--text-secondary); margin: 4px 0 0; }

/* ── Utilities ── */
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-accent { color: var(--accent); }
.text-muted-custom { color: var(--text-muted); }
.rounded-14 { border-radius: 14px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .topnav-nav    { display: none; }
  .topnav-toggle { display: block; }
  .user-info     { display: none !important; }
  .content-wrapper { padding: 16px; }
}
