/* ========================================
   GGF — SISTEMA DE GESTÃO GILSON FERREIRA
   ESTILOS PRINCIPAIS
   ======================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #7c3aed;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --sidebar-w: 260px;
  --sidebar-collapsed: 70px;
  --topbar-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --transition: all .2s ease;
}

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

html, body { height: 100%; font-family: 'Inter', sans-serif; font-size: 14px; color: var(--gray-800); background: var(--gray-50); }

a { text-decoration: none; color: inherit; }
button { cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ===========================
   LOGIN
   =========================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #7c3aed 100%);
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 28px;
  color: white;
}

.login-logo h1 { font-size: 26px; font-weight: 800; color: var(--gray-900); }
.login-logo p { color: var(--gray-500); margin-top: 4px; font-size: 13px; }

.login-card .form-group { margin-bottom: 18px; }
.login-card label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--gray-700); font-size: 13px; }
.login-card label i { margin-right: 4px; color: var(--primary); }
.login-card input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: var(--transition);
  color: var(--gray-800);
}
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
  margin-top: 8px;
}
.btn-login:hover { opacity: .9; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.login-erro {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

.login-hint {
  margin-top: 24px;
  padding: 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--gray-500);
  border: 1px solid var(--gray-200);
  text-align: center;
  line-height: 1.8;
}
.login-hint strong { color: var(--gray-700); }

/* ===========================
   LAYOUT PRINCIPAL
   =========================== */
#app { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--gray-900);
  color: white;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width .25s ease;
  overflow: hidden;
  z-index: 100;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .nav-item span:not(.nav-badge),
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-details { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-toggle { margin: 0 auto; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.sidebar-logo i { font-size: 22px; color: #60a5fa; flex-shrink: 0; }
.sidebar-title { font-size: 17px; font-weight: 700; white-space: nowrap; }

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: white; background: rgba(255,255,255,.1); }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 14px 16px 4px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--gray-400);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}
.nav-item i { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active {
  background: rgba(37, 99, 235, .25);
  color: #93c5fd;
  border-left: 3px solid #3b82f6;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  transition: transform .2s;
}
.nav-badge:not(:empty) {
  animation: badge-pulso 2s ease-in-out infinite;
}
.nav-badge:empty { display: none; }
@keyframes badge-pulso {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220,38,38,.5); }
  50%       { transform: scale(1.1); box-shadow: 0 0 0 4px rgba(220,38,38,0); }
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info { display: flex; align-items: center; gap: 8px; flex: 1; overflow: hidden; }
.user-details { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.user-avatar.small { width: 30px; height: 30px; font-size: 12px; }

.btn-logout {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 16px;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
}
.btn-logout:hover { color: #f87171; background: rgba(239,68,68,.15); }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-menu-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray-500);
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
  display: none;
}
.topbar-menu-btn:hover { background: var(--gray-100); color: var(--gray-800); }

.breadcrumb { font-size: 14px; font-weight: 600; color: var(--gray-600); display: flex; align-items: center; gap: 6px; }
.breadcrumb i { color: var(--primary); }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-date { font-size: 12px; color: var(--gray-400); }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--gray-700); }

/* VIEWS */
.view-container { flex: 1; overflow: hidden; }
.view { display: none; height: 100%; overflow-y: auto; padding: 24px; }
.view.active { display: block; }
.view::-webkit-scrollbar { width: 6px; }
.view::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 3px; }

/* ===========================
   COMPONENTES REUTILIZÁVEIS
   =========================== */

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left h2 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.page-header-left p { color: var(--gray-500); margin-top: 3px; font-size: 13px; }
.page-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* CARDS GRID */
.cards-grid { display: grid; gap: 16px; }
.cards-grid-4 { grid-template-columns: repeat(4, 1fr); }
.cards-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cards-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* METRIC CARD */
.metric-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.metric-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.metric-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.metric-card-value { font-size: 28px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.metric-card-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; font-weight: 500; }
.metric-card-change { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.change-up { color: var(--success); }
.change-down { color: var(--danger); }
.change-neutral { color: var(--gray-400); }

/* DASHBOARD — CARDS CLICÁVEIS (DRILL-DOWN) */
.dash-card-clickable {
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .12s, border-color .15s;
  position: relative;
}
.dash-card-clickable:hover {
  background: var(--gray-50) !important;
  box-shadow: 0 0 0 2px var(--primary-light);
  border-radius: 8px;
  transform: translateX(2px);
}
/* KPI metric-card clicável */
.metric-card.dash-card-clickable {
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition), border-color .15s;
}
.metric-card.dash-card-clickable:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  background: #f8faff;
  border-bottom-color: var(--primary);
}
/* Hint de "clique para ver" */
.dash-drill-hint {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  opacity: 0;
  transition: opacity .2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dash-card-clickable:hover .dash-drill-hint,
.metric-card.dash-card-clickable:hover .dash-drill-hint {
  opacity: 1;
}
/* Indicador visual sutil nos metric-cards (sempre visível) */
.metric-card.dash-card-clickable::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-light), transparent);
  border-radius: 0 0 var(--radius) var(--radius);
  opacity: .6;
  transition: opacity .15s;
}
.metric-card.dash-card-clickable:hover::after {
  background: var(--primary);
  opacity: 1;
}

/* INDICADOR ROW MINI (painel do dashboard) */
.indicador-row-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--gray-100);
  border-radius: 6px;
}
.indicador-row-mini:last-child { border-bottom: none; }
.indicador-info { flex: 1; min-width: 0; }
.indicador-info-nome { font-size: 13px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.indicador-info-sub { font-size: 11px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.indicador-valor { font-size: 15px; font-weight: 800; white-space: nowrap; }

/* CARD PADRÃO */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.card-subtitle { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

/* TABELAS */
.table-wrapper { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: var(--gray-50);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody td {
  padding: 12px 14px;
  color: var(--gray-700);
  vertical-align: middle;
}
.data-table tbody tr:last-child { border-bottom: none; }

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* STATUS SEMÁFORO */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
.dot-green { background: var(--success); }
.dot-yellow { background: var(--warning); }
.dot-red { background: var(--danger); }
.dot-gray { background: var(--gray-400); }

/* BOTÕES */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:hover { opacity: .9; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-outline { background: white; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

/* FILTERS / SEARCH BAR */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-input-wrapper i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: var(--transition);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: white;
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition);
  min-width: 140px;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

/* FORMULÁRIOS NO MODAL */
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-group-modal { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }
.form-control {
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: var(--transition);
  width: 100%;
  font-family: inherit;
  color: var(--gray-800);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: white;
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0,0,0,.25);
}
.modal-box.modal-lg { max-width: 900px; }
.modal-box.modal-md { max-width: 640px; }
.modal-box.modal-sm { max-width: 480px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.modal-close {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 18px;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}
.modal-close:hover { color: var(--danger); background: var(--danger-light); }

.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  font-size: 13px;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  animation: slideInRight .25s ease;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast i { font-size: 16px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 14px;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}
.empty-state i { font-size: 48px; margin-bottom: 14px; opacity: .4; }
.empty-state h4 { font-size: 16px; font-weight: 600; color: var(--gray-500); }
.empty-state p { font-size: 13px; margin-top: 6px; }

/* PROGRESS BAR */
.progress-bar-wrapper { background: var(--gray-100); border-radius: 10px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 10px; transition: width .4s ease; }
.progress-success { background: var(--success); }
.progress-warning { background: var(--warning); }
.progress-danger { background: var(--danger); }
.progress-primary { background: var(--primary); }

/* PDCA STEPPER */
.pdca-stepper {
  display: flex;
  gap: 0;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.pdca-step {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-400);
  border-right: 1px solid var(--gray-200);
  transition: var(--transition);
  cursor: pointer;
}
.pdca-step:last-child { border-right: none; }
.pdca-step.active { background: var(--primary); color: white; }
.pdca-step.done { background: var(--success-light); color: var(--success); }
.pdca-step span { display: block; font-size: 10px; font-weight: 500; margin-top: 2px; }

/* DETAIL GRID */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 16px; }
.detail-item { }
.detail-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); margin-bottom: 3px; }
.detail-value { font-size: 13px; color: var(--gray-800); font-weight: 500; }

/* TABS */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* PRAZO STATUS CARDS */
.prazo-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--gray-300);
  margin-bottom: 10px;
  transition: var(--transition);
}
.prazo-card:hover { box-shadow: var(--shadow-md); }
.prazo-card.atrasado { border-left-color: var(--danger); }
.prazo-card.urgente { border-left-color: var(--warning); }
.prazo-card.ok { border-left-color: var(--success); }
.prazo-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.prazo-codigo { font-size: 11px; font-weight: 700; color: var(--gray-500); }
.prazo-titulo { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.prazo-info { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--gray-500); }
.prazo-info i { margin-right: 3px; }

/* CHART CONTAINER */
.chart-container { position: relative; width: 100%; }
.chart-container canvas { max-width: 100%; }

/* INDICADOR ROW MINI */
.indicador-row-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.indicador-row-mini:last-child { border-bottom: none; }
.indicador-info { flex: 1; }
.indicador-info-nome { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.indicador-info-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.indicador-valor { font-size: 18px; font-weight: 800; min-width: 60px; text-align: right; }

/* ===========================
   MÓDULO DE DOCUMENTOS
   =========================== */

/* Grade de cards de documentos */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Card individual de documento */
.doc-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.doc-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}
.doc-card-titulo {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.doc-card-desc {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===========================
   MÓDULO DE COMPRAS
   =========================== */

/* Card principal de requisição */
.compra-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}
.compra-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--primary-light);
}
.compra-card-barra {
  width: 5px;
  flex-shrink: 0;
}
.compra-card-body {
  flex: 1;
  padding: 14px 16px;
  min-width: 0;
}
.compra-card-acoes {
  flex-shrink: 0;
  padding: 14px 16px;
  border-left: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 140px;
}

/* Linha de item no formulário */
.cmp-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}
.cmp-item-row:last-child { margin-bottom: 0; }

/* Modal extra-large */
.modal-xl {
  max-width: 860px;
  width: 95vw;
}

/* ── MARKETING KANBAN CARDS ───────────────── */
.mkt-kanban-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  font-size: 0.85rem;
}
.mkt-kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  transform: translateY(-1px);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .cards-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { position: fixed; left: -260px; height: 100vh; }
  .sidebar.mobile-open { left: 0; }
  .main-content { width: 100%; }
  .topbar-menu-btn { display: flex !important; }
  .cards-grid-4, .cards-grid-3, .cards-grid-2 { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
  .view { padding: 16px; }
  .topbar-date { display: none; }
}

/* LOADING */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--gray-400);
}
.loading-spinner i { font-size: 24px; animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ALERTA INLINE */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-light); color: #14532d; border: 1px solid #86efac; }
.alert-info { background: var(--info-light); color: #164e63; border: 1px solid #67e8f9; }
