/* ================================================================
   VALE FIDELIDADE — Design System Global
   Versão: 1.0
   Carregado em todas as páginas via assets/vf/vf-head.php
================================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Cores principais */
  --vf-blue:       #2563eb;
  --vf-blue-dark:  #1d4ed8;
  --vf-blue-light: #eff6ff;
  --vf-indigo:     #4f46e5;

  /* Neutros */
  --vf-gray-50:  #f9fafb;
  --vf-gray-100: #f3f4f6;
  --vf-gray-200: #e5e7eb;
  --vf-gray-300: #d1d5db;
  --vf-gray-400: #9ca3af;
  --vf-gray-500: #6b7280;
  --vf-gray-700: #374151;
  --vf-gray-900: #111827;

  /* Semânticos */
  --vf-success:       #16a34a;
  --vf-success-light: #f0fdf4;
  --vf-success-border:#bbf7d0;
  --vf-warning:       #f59e0b;
  --vf-warning-light: #fffbeb;
  --vf-warning-border:#fde68a;
  --vf-danger:        #dc2626;
  --vf-danger-light:  #fef2f2;
  --vf-danger-border: #fecaca;
  --vf-purple:        #7c3aed;
  --vf-purple-light:  #faf5ff;
  --vf-purple-border: #ddd6fe;

  /* Tipografia */
  --vf-font: 'DM Sans', system-ui, -apple-system, sans-serif;

  /* Espaços */
  --vf-page-max:  1400px;
  --vf-page-pad:  20px 16px 80px;
  --vf-topbar-h:  56px;

  /* Bordas */
  --vf-radius-sm: 6px;
  --vf-radius:    8px;
  --vf-radius-md: 10px;
  --vf-radius-lg: 12px;
  --vf-radius-xl: 14px;

  /* Sombras */
  --vf-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --vf-shadow:    0 4px 12px rgba(0,0,0,.07);
  --vf-shadow-md: 0 8px 24px rgba(0,0,0,.09);
}

body {
  font-family: var(--vf-font);
  background: #f4f5f7;
  color: var(--vf-gray-900);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ── Topbar ───────────────────────────────────────────────── */
.vf-topbar {
  background: #fff;
  border-bottom: 1px solid var(--vf-gray-200);
  padding: 0 16px;
  height: var(--vf-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 12px;
}
.vf-topbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
  flex-shrink: 0;
}
.vf-topbar-brand img { height: 28px; border-radius: 6px; }
.vf-topbar-brand-name { font-weight: 700; font-size: .95rem; color: var(--vf-gray-900); }
.vf-topbar-right { display: flex; align-items: center; gap: 8px; }
.vf-topbar-center { flex: 1; display: flex; justify-content: center; }

/* ── Avatar ───────────────────────────────────────────────── */
.vf-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .75rem; color: #fff;
  flex-shrink: 0; overflow: hidden;
}
.vf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vf-avatar-lg { width: 48px; height: 48px; font-size: .9rem; }
.vf-avatar-sm { width: 28px; height: 28px; font-size: .65rem; }

/* ── Page wrapper ─────────────────────────────────────────── */
.vf-main {
  max-width: var(--vf-page-max);
  margin: 0 auto;
  padding: var(--vf-page-pad);
}
.vf-main-sm  { max-width: 720px;  margin: 0 auto; padding: var(--vf-page-pad); }
.vf-main-md  { max-width: 960px;  margin: 0 auto; padding: var(--vf-page-pad); }
.vf-main-lg  { max-width: 1200px; margin: 0 auto; padding: var(--vf-page-pad); }

/* ── Page header ──────────────────────────────────────────── */
.vf-page-header { margin-bottom: 20px; }
.vf-page-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 2px; }
.vf-page-sub   { font-size: .82rem; color: var(--vf-gray-500); }

/* ── Section label ────────────────────────────────────────── */
.vf-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--vf-gray-500); margin-bottom: 8px;
  display: block;
}

/* ── Cards ────────────────────────────────────────────────── */
.vf-card {
  background: #fff;
  border: 1px solid var(--vf-gray-200);
  border-radius: var(--vf-radius-lg);
  overflow: hidden;
}
.vf-card-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--vf-gray-100);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.vf-card-head h6, .vf-card-title {
  margin: 0; font-weight: 700; font-size: .875rem;
  display: flex; align-items: center; gap: 8px; color: var(--vf-gray-900);
}
.vf-card-head h6 i, .vf-card-title i { font-size: 1rem; }
.vf-card-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vf-card-body  { padding: 16px; }
.vf-card-foot  {
  padding: 12px 16px;
  border-top: 1px solid var(--vf-gray-100);
  background: var(--vf-gray-50);
  font-size: .78rem; color: var(--vf-gray-500);
}

/* ── KPI tiles ────────────────────────────────────────────── */
.vf-kpi {
  background: #fff;
  border: 1px solid var(--vf-gray-200);
  border-radius: var(--vf-radius-lg);
  padding: 16px;
}
.vf-kpi-label { font-size: .75rem; color: var(--vf-gray-500); font-weight: 500; margin-bottom: 4px; }
.vf-kpi-value { font-size: 1.5rem; font-weight: 700; color: var(--vf-gray-900); line-height: 1; }
.vf-kpi-sub   { font-size: .72rem; color: var(--vf-gray-400); margin-top: 3px; }

/* Destaque colorido */
.vf-kpi-blue   { background: linear-gradient(135deg, var(--vf-blue), var(--vf-indigo)); color: #fff; }
.vf-kpi-blue .vf-kpi-label,
.vf-kpi-blue .vf-kpi-value,
.vf-kpi-blue .vf-kpi-sub { color: rgba(255,255,255,.9); }
.vf-kpi-blue .vf-kpi-sub { opacity: .7; }

/* ── Inputs ───────────────────────────────────────────────── */
.vf-input {
  width: 100%; border: 1px solid var(--vf-gray-200); border-radius: var(--vf-radius);
  padding: 9px 12px; font-family: var(--vf-font); font-size: .875rem;
  color: var(--vf-gray-900); background: var(--vf-gray-50); outline: none;
  transition: border-color .15s, background .15s;
  display: block;
}
.vf-input:focus        { border-color: var(--vf-blue); background: #fff; }
.vf-input[readonly]    { cursor: default; }
.vf-input::placeholder { color: var(--vf-gray-400); }
.vf-input.lg           { padding: 11px 14px; font-size: .95rem; }

select.vf-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.vf-input-group { display: flex; gap: 6px; align-items: center; }
.vf-input-group .vf-input { flex: 1; }

/* ── Buttons ──────────────────────────────────────────────── */
.vf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: var(--vf-radius);
  padding: 9px 16px; font-family: var(--vf-font); font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: background .15s, opacity .15s, transform .12s;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.vf-btn:disabled { opacity: .6; cursor: default; }
.vf-btn i { font-size: 1rem; }

/* Tamanhos */
.vf-btn-sm  { padding: 6px 10px; font-size: .78rem; border-radius: var(--vf-radius-sm); }
.vf-btn-sm i { font-size: .9rem; }
.vf-btn-lg  { padding: 12px 20px; font-size: .95rem; border-radius: var(--vf-radius-md); }
.vf-btn-full { width: 100%; }
.vf-btn-icon { padding: 8px; border-radius: var(--vf-radius); }

/* Variantes */
.vf-btn-primary   { background: var(--vf-blue);   color: #fff; }
.vf-btn-primary:hover   { background: var(--vf-blue-dark); color: #fff; }

.vf-btn-secondary { background: var(--vf-gray-100); color: var(--vf-gray-700); border: 1px solid var(--vf-gray-200); }
.vf-btn-secondary:hover { background: var(--vf-gray-200); }

.vf-btn-success { background: var(--vf-success-light); color: var(--vf-success); border: 1px solid var(--vf-success-border); }
.vf-btn-success:hover { background: #dcfce7; }

.vf-btn-danger  { background: var(--vf-danger-light);  color: var(--vf-danger);  border: 1px solid var(--vf-danger-border); }
.vf-btn-danger:hover  { background: #fee2e2; }

.vf-btn-purple  { background: var(--vf-purple-light);  color: var(--vf-purple);  border: 1px solid var(--vf-purple-border); }
.vf-btn-purple:hover  { background: #ede9fe; }

.vf-btn-ghost   { background: transparent; color: var(--vf-gray-700); border: 1px solid var(--vf-gray-200); }
.vf-btn-ghost:hover   { background: var(--vf-gray-50); }

.vf-btn-dark    { background: var(--vf-gray-900); color: #fff; }
.vf-btn-dark:hover    { background: #1f2937; color: #fff; }

/* ── Badges ───────────────────────────────────────────────── */
.vf-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.vf-badge-blue    { background: #dbeafe; color: #1d4ed8; }
.vf-badge-green   { background: #dcfce7; color: #15803d; }
.vf-badge-yellow  { background: #fef9c3; color: #a16207; }
.vf-badge-red     { background: #fee2e2; color: #b91c1c; }
.vf-badge-purple  { background: #ede9fe; color: #6d28d9; }
.vf-badge-gray    { background: var(--vf-gray-100); color: var(--vf-gray-700); }
.vf-badge-dark    { background: var(--vf-gray-900); color: #fff; }

/* ── Chips (filtros) ──────────────────────────────────────── */
.vf-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--vf-gray-200); background: #fff;
  font-size: .78rem; font-weight: 600; color: var(--vf-gray-700);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.vf-chip:hover  { border-color: var(--vf-blue); color: var(--vf-blue); }
.vf-chip.active { background: var(--vf-blue); border-color: var(--vf-blue); color: #fff; }
.vf-chips       { display: flex; gap: 6px; flex-wrap: wrap; }
.vf-chips-scroll { display: flex; gap: 6px; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; padding-bottom: 2px; }
.vf-chips-scroll::-webkit-scrollbar { height: 3px; }
.vf-chips-scroll::-webkit-scrollbar-thumb { background: var(--vf-gray-200); border-radius: 2px; }

/* ── Alerts ───────────────────────────────────────────────── */
.vf-alert {
  border-radius: var(--vf-radius-md); padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 10px; font-size: .85rem;
}
.vf-alert i { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.vf-alert-content strong { font-weight: 700; display: block; margin-bottom: 2px; }
.vf-alert-content a { font-weight: 700; text-decoration: none; }
.vf-alert-content a:hover { text-decoration: underline; }
.vf-alert-warning { background: var(--vf-warning-light); border: 1px solid var(--vf-warning-border); color: #92400e; }
.vf-alert-warning a { color: #92400e; }
.vf-alert-info    { background: var(--vf-blue-light);    border: 1px solid #bfdbfe;  color: #1e40af; }
.vf-alert-info a  { color: #1e40af; }
.vf-alert-success { background: var(--vf-success-light); border: 1px solid var(--vf-success-border); color: #15803d; }
.vf-alert-danger  { background: var(--vf-danger-light);  border: 1px solid var(--vf-danger-border);  color: #991b1b; }

/* ── Divider ──────────────────────────────────────────────── */
.vf-divider { height: 1px; background: var(--vf-gray-100); margin: 14px 0; }
.vf-divider-dashed { border: none; border-top: 1px dashed var(--vf-gray-200); margin: 14px 0; }

/* ── Tables ───────────────────────────────────────────────── */
.vf-table-wrap { overflow-x: auto; }
.vf-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.vf-table th {
  padding: 10px 14px; background: var(--vf-gray-50);
  border-bottom: 1px solid var(--vf-gray-200);
  font-weight: 700; color: var(--vf-gray-500);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .4px;
  text-align: left; white-space: nowrap;
}
.vf-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--vf-gray-100);
  vertical-align: middle; color: var(--vf-gray-900);
}
.vf-table tr:last-child td { border-bottom: none; }
.vf-table tr:hover td { background: var(--vf-gray-50); }
.vf-table .vf-td-right { text-align: right; }
.vf-table .vf-td-muted { color: var(--vf-gray-400); font-size: .78rem; }

/* ── Forms ────────────────────────────────────────────────── */
.vf-form-group  { margin-bottom: 14px; }
.vf-form-check  { display: flex; align-items: flex-start; gap: 8px; font-size: .82rem; color: var(--vf-gray-700); cursor: pointer; }
.vf-form-check input { margin-top: 2px; cursor: pointer; flex-shrink: 0; }
.vf-form-check a { color: var(--vf-blue); text-decoration: none; }

/* Strength bar */
.vf-strength-bar { height: 3px; background: var(--vf-gray-200); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.vf-strength-fill { height: 100%; width: 0; border-radius: 2px; transition: width .3s, background .3s; }

/* ── Toast ────────────────────────────────────────────────── */
.vf-toast-container {
  position: fixed; bottom: 20px; right: 16px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.vf-toast {
  background: var(--vf-gray-900); color: #fff; border-radius: var(--vf-radius-md);
  padding: 12px 16px; min-width: 240px; max-width: 320px;
  display: flex; align-items: flex-start; gap: 10px;
  box-shadow: var(--vf-shadow-md);
  animation: vfToastIn .2s ease;
  pointer-events: all;
}
.vf-toast i    { font-size: 1.1rem; margin-top: 1px; flex-shrink: 0; }
.vf-toast-body .t-title { font-weight: 700; font-size: .82rem; line-height: 1.3; }
.vf-toast-body .t-msg   { font-size: .78rem; opacity: .8; margin-top: 2px; }
@keyframes vfToastIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Modal ────────────────────────────────────────────────── */
.vf-modal .modal-content { border: 0 !important; border-radius: var(--vf-radius-xl) !important; box-shadow: var(--vf-shadow-md) !important; }
.vf-modal .modal-header  { border-bottom: 1px solid var(--vf-gray-100) !important; padding: 16px !important; }
.vf-modal .modal-footer  { border-top: 1px solid var(--vf-gray-100) !important; padding: 12px 16px !important; }
.vf-modal .modal-body    { padding: 16px !important; }
.vf-modal .modal-title   { font-weight: 700 !important; font-size: .95rem !important; }

/* ── FAB ──────────────────────────────────────────────────── */
.vf-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px;
}
.vf-fab-btn {
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: var(--vf-blue); color: #fff; font-size: 1.3rem;
  box-shadow: 0 6px 20px rgba(37,99,235,.35);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.vf-fab-btn:hover { transform: scale(1.06); }
.vf-fab-actions { display: none; flex-direction: column; gap: 8px; }
.vf-fab-actions.open { display: flex; }
.vf-fab-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--vf-gray-200);
  border-radius: 999px; padding: 9px 14px;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  box-shadow: var(--vf-shadow-sm);
  white-space: nowrap; transition: box-shadow .15s;
}
.vf-fab-item:hover { box-shadow: var(--vf-shadow); }

/* ── Sticky bar (mobile) ──────────────────────────────────── */
.vf-sticky {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.95); border-top: 1px solid var(--vf-gray-200);
  backdrop-filter: blur(10px); padding: 10px 14px; z-index: 99; gap: 8px;
}
@media (max-width: 768px) { .vf-sticky { display: flex; } }

/* ── Chat modal ───────────────────────────────────────────── */
.vf-chat-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: none; z-index: 9998; align-items: flex-end; justify-content: flex-end;
  padding: 16px;
}
.vf-chat-modal.open { display: flex; }
.vf-chat-window {
  width: 340px; height: 460px; background: #fff;
  border-radius: var(--vf-radius-xl); display: flex; flex-direction: column;
  box-shadow: var(--vf-shadow-md);
}
.vf-chat-head {
  background: var(--vf-gray-900); color: #fff; padding: 12px 14px;
  border-radius: var(--vf-radius-xl) var(--vf-radius-xl) 0 0;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: .85rem;
}
.vf-chat-head button { background: none; border: none; color: #fff; cursor: pointer; font-size: 1.1rem; }
.vf-chat-msgs { flex: 1; padding: 12px; overflow-y: auto; background: var(--vf-gray-50); font-size: .82rem; }
.vf-chat-msg  { margin-bottom: 8px; }
.vf-chat-msg.USUARIO { color: var(--vf-gray-900); }
.vf-chat-msg.SUPORTE,
.vf-chat-msg.EVA     { color: var(--vf-blue); }
.vf-chat-inp { border-top: 1px solid var(--vf-gray-200); }
.vf-chat-inp input {
  width: 100%; border: none; padding: 12px 14px;
  font-family: var(--vf-font); font-size: .83rem; outline: none;
  border-radius: 0 0 var(--vf-radius-xl) var(--vf-radius-xl);
}

/* ── Kanban ───────────────────────────────────────────────── */
.vf-kanban {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px; align-items: start;
}
@media (max-width: 1280px) { .vf-kanban { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .vf-kanban { grid-template-columns: 1fr; } }

.vf-kanban-col { background: #fff; border: 1px solid var(--vf-gray-200); border-radius: var(--vf-radius-lg); overflow: hidden; min-height: 120px; }
.vf-kanban-head {
  padding: 10px 12px; border-bottom: 1px solid var(--vf-gray-100);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--vf-gray-50);
}
.vf-kanban-title { font-size: .8rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.vf-kanban-count { background: var(--vf-gray-200); color: var(--vf-gray-700); border-radius: 999px; padding: 2px 8px; font-size: .72rem; font-weight: 700; }
.vf-kanban-drop { padding: 10px; min-height: 120px; transition: background .15s; }
.vf-kanban-drop.drag-over { background: var(--vf-blue-light); outline: 2px dashed #93c5fd; outline-offset: -4px; border-radius: 8px; }

.vf-lead-card {
  background: #fff; border: 1px solid var(--vf-gray-200);
  border-radius: var(--vf-radius-md); padding: 10px 12px; margin-bottom: 8px;
  cursor: grab; transition: box-shadow .15s, border-color .15s;
}
.vf-lead-card:hover   { box-shadow: var(--vf-shadow-sm); border-color: var(--vf-gray-300); }
.vf-lead-card:active  { cursor: grabbing; }
.vf-lead-card strong  { font-size: .82rem; font-weight: 700; display: block; margin-bottom: 3px; }
.vf-lead-card .meta   { font-size: .75rem; color: var(--vf-gray-500); line-height: 1.45; }
.vf-lead-card .tools  { margin-top: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
.vf-lead-card.dragging { opacity: .5; }

/* ── Empty state ──────────────────────────────────────────── */
.vf-empty { font-size: .78rem; color: var(--vf-gray-400); padding: 16px; text-align: center; }
.vf-empty-lg {
  padding: 40px 20px; text-align: center; color: var(--vf-gray-400);
}
.vf-empty-lg i { font-size: 2.5rem; display: block; margin-bottom: 10px; opacity: .4; }
.vf-empty-lg p { font-size: .875rem; margin: 0; }

/* ── Utilities ────────────────────────────────────────────── */
.vf-text-muted { color: var(--vf-gray-400) !important; }
.vf-text-sm    { font-size: .78rem !important; }
.vf-text-xs    { font-size: .72rem !important; }
.vf-fw-700     { font-weight: 700 !important; }
.vf-truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Responsive helpers ───────────────────────────────────── */
@media (max-width: 768px) {
  .vf-hide-mobile { display: none !important; }
  .vf-main, .vf-main-sm, .vf-main-md, .vf-main-lg { padding: 16px 12px 80px; }
}
@media (min-width: 769px) {
  .vf-hide-desktop { display: none !important; }
}
