/* =====================================================
   ConfecSystem — Styles
   ===================================================== */

:root {
  --brand-50: #eef4ff;
  --brand-500: #3a62fb;
  --brand-600: #2442f0;
  --brand-700: #1e33d8;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  height: 100%;
}

/* Scrollbar moderno */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.6); }
.dark ::-webkit-scrollbar-thumb { background: rgba(71, 85, 105, 0.6); }

/* Gradiente de topo animado */
.gradient-bg {
  background: linear-gradient(135deg, #3a62fb 0%, #7c3aed 50%, #ec4899 100%);
  background-size: 200% 200%;
  animation: gradient-move 12s ease infinite;
}
@keyframes gradient-move {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Cards com hover suave */
.kpi-card {
  transition: transform .2s ease, box-shadow .2s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(58, 98, 251, 0.25);
}

/* Progress bar custom */
.bar-bg {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
  height: 6px;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.bar-high { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-med { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-low { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-alto { background: rgba(16, 185, 129, 0.12); color: #059669; }
.badge-medio { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.badge-baixo { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.dark .badge-alto { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.dark .badge-medio { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.dark .badge-baixo { background: rgba(239, 68, 68, 0.18); color: #f87171; }

/* Navegação */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  color: rgb(71 85 105);
  transition: all .15s ease;
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(58, 98, 251, 0.08);
  color: var(--brand-600);
}
.nav-item.active {
  background: linear-gradient(135deg, #3a62fb, #2442f0);
  color: white;
  box-shadow: 0 6px 16px -6px rgba(58, 98, 251, 0.6);
}
.dark .nav-item { color: rgb(148 163 184); }
.dark .nav-item:hover { background: rgba(58, 98, 251, 0.12); color: #93b3ff; }

/* Tabelas */
.t-row {
  transition: background .15s ease;
}
.t-row:hover {
  background: rgba(58, 98, 251, 0.04);
}
.dark .t-row:hover { background: rgba(58, 98, 251, 0.08); }

/* Loader */
.loader {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(58, 98, 251, 0.15);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Fade in */
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Print otimizado para PDF */
@media print {
  .no-print { display: none !important; }
  body { background: white !important; color: black !important; }
  .card { box-shadow: none !important; border: 1px solid #e5e7eb !important; }
  .page-break { page-break-after: always; }
}

/* Inputs consistentes em ambos temas */
.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgb(226 232 240);
  background: white;
  color: rgb(15 23 42);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(58, 98, 251, 0.15);
}
.dark .input {
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
  color: rgb(226 232 240);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: all .15s ease;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, #3a62fb, #2442f0);
  color: white;
  box-shadow: 0 4px 12px -4px rgba(58, 98, 251, 0.5);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(58, 98, 251, 0.6); }
.btn-secondary {
  background: rgb(241 245 249);
  color: rgb(51 65 85);
}
.btn-secondary:hover { background: rgb(226 232 240); }
.dark .btn-secondary { background: rgb(30 41 59); color: rgb(226 232 240); }
.dark .btn-secondary:hover { background: rgb(51 65 85); }
.btn-danger {
  background: rgb(239 68 68);
  color: white;
}
.btn-danger:hover { background: rgb(220 38 38); }
.btn-ghost {
  background: transparent;
  color: rgb(71 85 105);
}
.btn-ghost:hover { background: rgba(148, 163, 184, 0.15); }
.dark .btn-ghost { color: rgb(148 163 184); }

/* Card */
.card {
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.dark .card {
  background: rgb(15 23 42);
  border-color: rgb(30 41 59);
}

/* Toast */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  padding: 14px 20px;
  border-radius: 12px;
  background: rgb(15 23 42);
  color: white;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.3);
  animation: slideIn .3s ease;
}
.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal {
  background: white;
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .25s ease;
}
.dark .modal { background: rgb(15 23 42); }
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Ring de eficiência */
.efi-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  position: relative;
}
