/* ============================================================
   IndexaContábil — Global Styles & Design System
   Otimizado para Alta Performance, Responsividade e Acessibilidade
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Scrollbar Customizada e Discreta --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --- Cards --- */
.card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
  padding: 24px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (max-width: 640px) {
  .card {
    padding: 18px;
    border-radius: 14px;
  }
}

/* --- Botões de Ação --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1E3A5F, #2E86AB);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(30, 58, 95, 0.22);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(30, 58, 95, 0.32);
  filter: brightness(1.06);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 12px;
  background: #ef4444;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.22);
  transition: all 0.2s ease;
  user-select: none;
}
.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(239, 68, 68, 0.32);
}
.btn-danger:active {
  transform: translateY(0) scale(0.98);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  background: transparent;
  color: #64748b;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover {
  background: #f1f5f9;
  color: #2E86AB;
}
.btn-icon-danger:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* --- Formulários & Inputs --- */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}
.form-input:focus {
  border-color: #2E86AB;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(46, 134, 171, 0.14);
}
.form-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}
.form-input::placeholder {
  color: #94a3b8;
}

/* --- Sidebar Navigation --- */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
}
.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(2px);
}
.sidebar-nav-item.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-green  { background: #f0fdf4; color: #15803d; border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-gray   { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.badge-blue   { background: #eff6ff; color: #1d4ed8; border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-amber  { background: #fffbeb; color: #b45309; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-red    { background: #fef2f2; color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.2); }

/* --- Tabelas Otimizadas --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: 13px 20px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}
.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(248, 250, 252, 0.8);
}
.data-table tr:last-child td {
  border-bottom: none;
}

/* --- Animações e Transições Fluídas --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-fade-in  { animation: fadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1); }
.animate-slide-in { animation: slideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1); }
.animate-spin     { animation: spin 0.8s linear infinite; }
