
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f2f5; color: #333; min-height: 100vh; }

/* NAVBAR */
.navbar {
  background: #2c3e50; color: white;
  padding: 0.85rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.navbar .logo { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.02em; }
.navbar .logo span { color: #a78bfa; }
.nav-links { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }
.nav-links a {
  color: #94a3b8; text-decoration: none;
  padding: 0.45rem 0.85rem; border-radius: 6px;
  font-size: 0.85rem; font-weight: 500; transition: all 0.2s;
}
.nav-links a:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-links a.active { color: white; background: rgba(102,126,234,0.35); }
.nav-links a.danger { color: #f87171; }
.nav-links a.danger:hover { background: rgba(248,113,113,0.15); }

/* CONTAINER */
.page-container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

/* PAGE HEADER */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.75rem; }
.page-header h1 { font-size: 1.6rem; color: #1e293b; font-weight: 800; margin-bottom: 0.2rem; }
.page-header p { color: #94a3b8; font-size: 0.9rem; }

/* CARDS */
.card { background: white; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.07); overflow: hidden; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; }
.card-header h2 { font-size: 1rem; font-weight: 700; color: #1e293b; }
.card-body { padding: 1.5rem; }

/* KPI GRID */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.kpi-card { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: 0 2px 12px rgba(0,0,0,0.07); border-left: 4px solid #667eea; transition: transform 0.2s; }
.kpi-card:hover { transform: translateY(-2px); }
.kpi-card .kpi-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 0.5rem; }
.kpi-card .kpi-value { font-size: 2rem; font-weight: 800; color: #1e293b; }
.kpi-card .kpi-sub { font-size: 0.8rem; color: #94a3b8; margin-top: 0.3rem; }
.kpi-card.verde { border-left-color: #22c55e; }
.kpi-card.azul { border-left-color: #3b82f6; }
.kpi-card.roxo { border-left-color: #8b5cf6; }
.kpi-card.laranja { border-left-color: #f59e0b; }
.kpi-card.vermelho { border-left-color: #ef4444; }

/* TABELA */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: #f8fafc; }
th { padding: 0.85rem 1.25rem; text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }
td { padding: 1rem 1.25rem; font-size: 0.9rem; color: #374151; border-bottom: 1px solid #f1f5f9; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: none; }

/* BADGES */
.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-roxo { background: #ede9fe; color: #7c3aed; }
.badge-azul { background: #dbeafe; color: #1d4ed8; }
.badge-verde { background: #dcfce7; color: #16a34a; }
.badge-laranja { background: #fef3c7; color: #d97706; }
.badge-vermelho { background: #fee2e2; color: #dc2626; }
.badge-cinza { background: #f1f5f9; color: #64748b; }

/* BOTÕES */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.65rem 1.25rem; border: none; border-radius: 8px; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,0.35); }
.btn-secondary { background: #f1f5f9; color: #64748b; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-success { background: #dcfce7; color: #16a34a; }
.btn-success:hover { background: #bbf7d0; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-wpp { background: #25D366; color: white; }
.btn-wpp:hover { background: #1ebe57; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-icon { padding: 0.4rem; border-radius: 6px; }

/* FORMULÁRIOS */
.form-grid { display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.8rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  padding: 0.7rem 0.9rem; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 0.9rem; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.12);
}
.field textarea { resize: vertical; min-height: 80px; }

/* MODAL */
.modal-overlay {
  display: none; position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15,23,42,0.6);
  z-index: 1000; justify-content: center; align-items: center; padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: white; border-radius: 16px;
  width: 100%; max-width: 520px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  overflow: hidden; animation: modalIn 0.25s ease;
}
.modal-lg { max-width: 720px; }
@keyframes modalIn { from { opacity:0; transform:scale(0.95) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-header { background: linear-gradient(135deg, #667eea, #764ba2); color: white; padding: 1.25rem 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 1.05rem; font-weight: 700; }
.modal-close { background: none; border: none; color: rgba(255,255,255,0.8); font-size: 1.3rem; cursor: pointer; padding: 0.2rem; line-height: 1; }
.modal-close:hover { color: white; }
.modal-body { padding: 1.5rem; max-height: 75vh; overflow-y: auto; }
.modal-footer { padding: 1rem 1.5rem; background: #f8fafc; border-top: 1px solid #f1f5f9; display: flex; gap: 0.75rem; justify-content: flex-end; }

/* SEARCH BAR */
.search-filter-bar { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-filter-bar input { flex: 1; min-width: 200px; padding: 0.65rem 1rem; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 0.9rem; transition: border-color 0.2s; }
.search-filter-bar input:focus { outline: none; border-color: #667eea; }
.search-filter-bar select { padding: 0.65rem 0.9rem; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 0.88rem; color: #64748b; background: white; }

/* ALERTAS */
.alert { padding: 0.85rem 1.1rem; border-radius: 8px; font-size: 0.88rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* TOGGLE */
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 0; border-bottom: 1px solid #f8fafc; }
.toggle-row label { font-size: 0.88rem; color: #374151; }
.toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top:0; left:0; right:0; bottom:0; background:#cbd5e1; border-radius:24px; transition:0.3s; }
.slider:before { position:absolute; content:""; height:18px; width:18px; left:3px; bottom:3px; background:white; border-radius:50%; transition:0.3s; }
input:checked + .slider { background: #667eea; }
input:checked + .slider:before { transform: translateX(18px); }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 3.5rem 2rem; color: #94a3b8; }
.empty-state .icon { font-size: 3.5rem; display: block; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1rem; color: #64748b; margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.88rem; }

/* LOADING */
.loading { text-align:center; padding:3rem; color:#94a3b8; }
.loading::after { content:''; display:inline-block; width:24px; height:24px; border:3px solid #e2e8f0; border-top-color:#667eea; border-radius:50%; animation:spin 0.7s linear infinite; margin-left:0.5rem; vertical-align:middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* AVATAR */
.avatar { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,#667eea,#764ba2); color:white; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:0.9rem; flex-shrink:0; }

/* STAT MINI */
.stat-mini { display:flex; align-items:center; gap:0.75rem; padding:0.75rem; background:#f8fafc; border-radius:8px; }
.stat-mini .icon { font-size:1.5rem; }
.stat-mini .info .val { font-weight:700; font-size:1rem; color:#1e293b; }
.stat-mini .info .lbl { font-size:0.75rem; color:#94a3b8; }

/* RESPONSIVO */
@media (max-width: 768px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 1rem; }
  .navbar { padding: 0.75rem 1rem; }
  .page-container { padding: 1rem; }
}
