/* ============================================
   Disparo+ — Premium Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161e;
  --bg-card-hover: #1c1c28;
  --bg-sidebar: #0d0d14;
  --bg-input: #1a1a24;
  
  --border-primary: rgba(255, 255, 255, 0.06);
  --border-secondary: rgba(255, 255, 255, 0.10);
  --border-focus: #BC0E12;
  
  --text-primary: #f0f0f5;
  --text-secondary: #9ca3b0;
  --text-muted: #5a5f72;
  --text-heading: #ffffff;
  
  --accent: #BC0E12;
  --accent-hover: #9a0b0f;
  --accent-aux: #DC1217;
  --accent-glow: rgba(188, 14, 18, 0.18);
  --accent-subtle: rgba(188, 14, 18, 0.10);
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-subtle: rgba(239, 68, 68, 0.10);
  
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.10);
  
  --info: #3b82f6;
  --info-subtle: rgba(59, 130, 246, 0.10);
  
  --purple: #8b5cf6;
  --purple-subtle: rgba(139, 92, 246, 0.10);
  
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
  
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- Layout ---------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 4px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 50;
}

.sidebar-brand {
  padding: 0 12px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-primary);
}

.sidebar-brand .brand-logo {
  display: block;
  height: 150px;
  width: auto;
  mix-blend-mode: lighten;
  filter: brightness(2.2) saturate(1.3);
  margin: -18px -35px;
}

.sidebar-brand p {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-link .icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-link:hover .icon,
.nav-link.active .icon {
  opacity: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-primary);
}

.user-info {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  margin-bottom: 8px;
}

.user-info .user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-info .user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: capitalize;
  margin-top: 2px;
}

.nav-link.logout {
  color: var(--danger);
}

.nav-link.logout:hover {
  background: var(--danger-subtle);
  color: var(--danger);
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px 40px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.page-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-secondary);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* ---------- Stat Cards ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.stat-card .stat-icon.green {
  background: var(--accent-subtle);
  color: var(--accent);
}

.stat-card .stat-icon.red {
  background: var(--danger-subtle);
  color: var(--danger);
}

.stat-card .stat-icon.blue {
  background: var(--info-subtle);
  color: var(--info);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 4px;
}

.stat-card .stat-value.green { color: var(--accent); }
.stat-card .stat-value.red { color: var(--danger); }
.stat-card .stat-value.blue { color: var(--text-primary); }

/* ---------- Form Elements ---------- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Premium Select styling */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px !important;
  cursor: pointer;
}

.form-select:hover {
  border-color: var(--border-secondary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23BC0E12' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.form-select option {
  background-color: #16161e;
  color: #f0f0f5;
  padding: 12px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.form-span-full {
  grid-column: 1 / -1;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-aux));
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-secondary);
}

.btn-danger {
  background: var(--danger-subtle);
  color: var(--danger);
  border: 1px solid transparent;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

/* ---------- Tables ---------- */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  font-size: 0.85rem;
  border-collapse: collapse;
}

.data-table thead {
  background: rgba(255, 255, 255, 0.02);
}

.data-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-primary);
}

.data-table td {
  padding: 14px 20px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-primary);
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--glass-bg);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table td.text-bold {
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-green {
  background: rgba(34, 197, 94, 0.10);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.badge-red {
  background: var(--danger-subtle);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.badge-blue {
  background: var(--info-subtle);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.badge-purple {
  background: var(--purple-subtle);
  color: var(--purple);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.badge-yellow {
  background: var(--warning-subtle);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

/* ---------- Upload Zone ---------- */
.upload-zone {
  border: 2px dashed var(--border-secondary);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--glass-bg);
  position: relative;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: var(--shadow-glow);
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: var(--shadow-glow);
}

.upload-zone .upload-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent);
}

.upload-zone .upload-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.upload-zone .upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---------- Alerts ---------- */
.alert {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.alert-error {
  background: var(--danger-subtle);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.alert-error .alert-icon {
  color: var(--danger);
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-error .alert-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 4px;
}

.alert-error .alert-text {
  font-size: 0.8rem;
  color: rgba(239, 68, 68, 0.8);
}

.alert-success {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ---------- Login Page (Premium Card Redesign) ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060609;
  position: relative;
  overflow: hidden;
  padding: 24px;
}

/* Orbes Dinâmicos de Fundo */
.login-wrapper .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  z-index: 0;
  pointer-events: none;
}
.login-wrapper .orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -10%;
  left: -5%;
  animation: float-orb 25s infinite alternate ease-in-out;
}
.login-wrapper .orb-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  bottom: -15%;
  right: -5%;
  animation: float-orb 30s infinite alternate-reverse ease-in-out;
}
.login-wrapper .orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float-orb 20s infinite alternate ease-in-out;
}

@keyframes float-orb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -50px) scale(1.1); }
  100% { transform: translate(-15px, 25px) scale(0.95); }
}

/* Card de Login Premium Glassmorphism */
.login-card-premium {
  background: rgba(22, 22, 30, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  position: relative;
  z-index: 10;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(188, 14, 18, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}

.login-card-premium::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(188, 14, 18, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

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

.login-form-header .form-logo-icon {
  height: 150px;
  width: auto;
  margin: -30px auto -10px;
  display: block;
  mix-blend-mode: lighten;
  filter: brightness(2.2) saturate(1.3);
}

.login-form-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  margin-top: 8px;
}

.login-form-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Premium Inputs with Inline Icons */
.input-with-icon-wrapper {
  position: relative;
}

.input-with-icon-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.input-with-icon-wrapper .form-input {
  padding-left: 44px;
}

.input-with-icon-wrapper:focus-within .input-icon {
  color: var(--accent);
}

/* Password Toggle Ajustado para Input com Ícone */
.login-card-premium .password-toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.login-card-premium .password-toggle:hover {
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .login-card-premium {
    padding: 40px 24px;
  }
}

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.max-w-xl { max-width: 640px; }

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.4s ease-out forwards;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 80ms; }
.animate-in:nth-child(3) { animation-delay: 160ms; }

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

@media (max-width: 768px) {
  .sidebar {
    width: 72px;
    padding: 16px 8px;
  }
  
  .sidebar-brand h1 span,
  .sidebar-brand p,
  .nav-link span,
  .user-info .user-name,
  .user-info .user-role {
    display: none;
  }
  
  .nav-link {
    justify-content: center;
    padding: 10px;
  }
  
  .main-content {
    margin-left: 72px;
    padding: 24px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 750px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
  overflow: hidden;
}

.modal-backdrop.show .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.modal-stat-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.modal-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.modal-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 4px;
}

.modal-stat-value.green { color: #22c55e; }
.modal-stat-value.red { color: var(--danger); }
.modal-stat-value.gray { color: var(--text-primary); }

.justification-box {
  background: var(--danger-subtle);
  border: 1px solid rgba(239, 68, 68, 0.12);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  color: #f87171;
  margin-top: 4px;
  word-break: break-word;
  max-width: 320px;
  line-height: 1.3;
}

/* Skeleton Loading */
.skeleton-line {
  height: 16px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

@keyframes loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-table td {
  padding: 12px 0;
}

/* =========================================
   Loading States e Spinner Animado
   ========================================= */
@keyframes spin-border {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner-border {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin-border 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.btn-loading .icon {
  display: none !important;
}

/* Efeito de click em todos os botões para melhor feedback tátil */
.btn:active:not(.btn-loading):not([disabled]) {
  transform: scale(0.96) !important;
  transition: transform 0.1s;
}

/* ============================================
   Custom Dropdown (Selects) & Premium Tooltips
   ============================================ */

/* Hide original select without breaking accessibility or form features */
.original-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.custom-select-trigger:hover {
  border-color: var(--border-secondary);
}

.custom-select-trigger.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.custom-select-trigger.disabled {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

.custom-select-arrow {
  width: 16px;
  height: 16px;
  stroke: var(--text-secondary);
  transition: transform var(--transition-fast);
}

.custom-select-trigger.active .custom-select-arrow {
  transform: rotate(180deg);
  stroke: #ffffff;
}

.custom-options-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  width: max-content;
  max-width: 320px;
  background-color: #16161e !important;
  border: 1px solid var(--border-secondary) !important;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
  z-index: 1010;
  max-height: 250px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  padding: 6px 0;
}

.custom-options-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-option {
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  white-space: nowrap;
}

.custom-option:hover {
  background: var(--bg-card-hover);
  color: var(--text-heading);
}

.custom-option.selected {
  background: var(--accent-subtle);
  color: var(--text-heading);
  font-weight: 500;
  border-left: 3px solid var(--accent);
}

/* ---------- Visual Enhancements (Animações & Glow) ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

/* Delays para efeito cascata nos cards de estatísticas */
.stats-grid .stats-card:nth-child(1) { animation-delay: 50ms; }
.stats-grid .stats-card:nth-child(2) { animation-delay: 120ms; }
.stats-grid .stats-card:nth-child(3) { animation-delay: 190ms; }

/* Transições e hover para os cards de estatísticas */
.stats-card {
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base) !important;
}

.stats-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-secondary) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 255, 255, 0.01) !important;
}

/* Glow nos botões primários no hover */
.btn-primary {
  transition: all var(--transition-fast) !important;
}

.btn-primary:hover:not([disabled]) {
  background: var(--accent-hover) !important;
  box-shadow: 0 0 16px rgba(188, 14, 18, 0.4) !important;
}

/* Glow e transições premium nos campos de entrada */
.form-input {
  transition: all var(--transition-fast) !important;
}

.form-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 8px rgba(188, 14, 18, 0.15) !important;
}


