/* ==========================================================================
   CrediSystem PRO Enterprise - Modern App Design System (CSS)
   ========================================================================== */


:root {
  /* Color Tokens - African Premium Financial Palette */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(30, 41, 59, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(16, 185, 129, 0.4);

  /* Primary Brand Tokens (Emerald Green + Gold Accents) */
  --primary: #059669;
  --primary-hover: #10b981;
  --primary-light: rgba(16, 185, 129, 0.15);
  --accent-gold: #f59e0b;
  --accent-gold-light: rgba(245, 158, 11, 0.15);
  
  /* Status Tokens */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);

  /* Typography */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;

  /* Dimensions */
  --sidebar-width: 260px;
  --topbar-height: 70px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-main: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --glass-backdrop: blur(12px);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

#app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Overlay para Mobile */
.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.brand-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #059669, #10b981);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.brand-title {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
}

.brand-title span {
  color: var(--primary-hover);
}

/* Custom Scrollbar System para Sidebar & Navegação */
.sidebar, .nav-menu {
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.4) rgba(15, 23, 42, 0.5);
  scroll-behavior: smooth;
}

.nav-menu::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.nav-menu::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 10px;
}

.nav-menu::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.5), rgba(5, 150, 105, 0.4));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease-in-out;
}

.nav-menu::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #10b981, #059669);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.nav-menu {
  list-style: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.nav-item a svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.nav-item:hover a, .nav-item.active a {
  color: var(--text-main);
  background: var(--primary-light);
  border-left: 3px solid var(--primary-hover);
}

.nav-item:hover a svg, .nav-item.active a svg {
  color: var(--primary-hover);
  transform: translateX(2px);
}

.sidebar-logout-item a {
  color: var(--danger, #ef4444) !important;
}

.sidebar-logout-item:hover a {
  background: rgba(239, 68, 68, 0.15) !important;
  border-left: 3px solid var(--danger, #ef4444) !important;
  color: var(--danger, #ef4444) !important;
}

.sidebar-logout-item:hover a svg {
  stroke: var(--danger, #ef4444) !important;
  transform: translateX(2px);
}

/* Main Layout */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Botão Hambúrguer Mobile Toggle */
.mobile-toggle-btn {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.mobile-toggle-btn:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.mobile-toggle-btn svg {
  width: 24px;
  height: 24px;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Notification Bell Dropdown */
.notification-bell-box {
  position: relative;
}

.bell-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  position: relative;
  transition: all 0.2s ease;
}

.bell-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-hover);
}

.bell-btn svg {
  width: 22px;
  height: 22px;
}

.bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid var(--bg-secondary);
}

.user-profile-box {
  position: relative !important;
}

/* Dropdown Menu Container */
.dropdown-menu-box {
  position: absolute;
  top: 100%;
  right: 0;
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  min-width: 220px;
  z-index: 999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.dropdown-menu-box.active,
.dropdown-menu-box.show {
  display: flex !important;
}

.dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropdown-body {
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notif-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.notif-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.notif-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* User Profile Header */
.user-profile-box {
  position: relative;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.05);
}

.avatar {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--primary-hover);
}

.user-info {
  line-height: 1.2;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dropdown-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
}

/* Content Body */
.content-body {
  padding: 32px;
  flex: 1;
}

/* View Sections */
.view-section {
  display: none;
}
.view-section.active {
  display: block;
}

/* Cards & Layouts */
.card-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-main);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metrics-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px;
  margin-bottom: 28px;
}

@media (max-width: 1200px) {
  .metrics-grid-4col {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .metrics-grid-4col {
    grid-template-columns: 1fr !important;
  }
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.metric-card.info .metric-value { color: var(--info); }
.metric-card.warning .metric-value { color: var(--warning); }
.metric-card.danger .metric-value { color: var(--danger); }

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-hover);
}

select.form-control,
select.form-control option,
select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Range Sliders */
.range-slider-group {
  margin-bottom: 24px;
}

.range-slider-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.range-slider-val {
  font-weight: 700;
  color: var(--primary-hover);
  font-size: 1.1rem;
}

input[type=range] {
  width: 100%;
  accent-color: var(--primary-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.table th, .table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 50px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ==========================================================================
   ULTRA-MODERN ENTERPRISE MODALS & TOAST SYSTEM
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 16px;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.7), 0 0 35px rgba(16, 185, 129, 0.08);
  transform: scale(0.92) translateY(15px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.modal-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-hover), transparent);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.modal-close:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
  transform: rotate(90deg);
}

/* Custom Toast Notifications Container */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  width: calc(100% - 48px);
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  color: var(--text-main);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: all 0.3s ease;
}

.toast-item.toast-success {
  border-left-color: var(--success);
}
.toast-item.toast-danger, .toast-item.toast-error {
  border-left-color: var(--danger);
}
.toast-item.toast-warning {
  border-left-color: var(--warning);
}
.toast-item.toast-info {
  border-left-color: var(--info);
}

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

.toast-item.toast-hiding {
  opacity: 0;
  transform: translateX(100%) scale(0.9);
}

.toast-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast-body {
  flex-grow: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
  color: var(--text-main);
}

.toast-message {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  margin-left: 6px;
  opacity: 0.7;
}

.toast-close:hover {
  opacity: 1;
  color: var(--text-main);
}

/* Mobile Bottom Navigation */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: #111827;
  border-top: 1px solid var(--border-color);
  z-index: 99;
  justify-content: space-around;
  align-items: center;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
}
.bottom-nav-item.active { color: var(--primary-hover); font-weight: bold; }
.bottom-nav-item svg { width: 20px; height: 20px; }

/* Media Queries Responsividade */
@media (max-width: 768px) {
  .mobile-toggle-btn { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .main-wrapper { margin-left: 0; padding-bottom: 65px; }
  .bottom-nav { display: flex; }
  .content-body { padding: 16px; }
  .topbar { padding: 0 16px; gap: 12px; }

  /* Stack form rows on mobile */
  .form-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* Override inline display:grid or flex-direction on mobile to stack */
  div[style*="display:grid"], 
  div[style*="display: grid"],
  div[style*="display:flex"],
  div[style*="display: flex"] {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 12px !important;
  }

  /* Flex sizing for form groups */
  .form-group {
    flex: 1 1 auto !important;
    width: 100% !important;
    margin-bottom: 12px !important;
  }

  /* Responsive Modals */
  .modal-content {
    padding: 20px 16px !important;
    border-radius: 12px !important;
    max-height: 95vh !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
  }

  .modal-backdrop {
    padding: 8px !important;
  }

  /* Responsive Topbar actions and user details */
  .user-info {
    display: none !important;
  }

  .hide-mobile {
    display: none !important;
  }

  /* Adjust buttons in modal footer to be stackable full width */
  .modal-content form div[style*="text-align:right"],
  .modal-content form div[style*="text-align: right"],
  div[id$="-actions-footer"] {
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
    text-align: center !important;
  }

  .modal-content form div[style*="text-align:right"] .btn,
  .modal-content form div[style*="text-align: right"] .btn,
  div[id$="-actions-footer"] .btn {
    width: 100% !important;
    margin: 0 !important;
  }
}

/* ==========================================================================
   LOGIN SCREEN STYLES
   ========================================================================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, rgba(5, 150, 105, 0.15) 0%, rgba(11, 15, 25, 0.98) 70%), var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.login-wrapper::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: pulseBlob 8s infinite alternate ease-in-out;
}

.login-wrapper::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: pulseBlob 10s infinite alternate-reverse ease-in-out;
}

@keyframes pulseBlob {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.15) translate(30px, 30px); }
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 2;
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.login-logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.5rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.4);
  margin-bottom: 16px;
}

.login-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.login-header h2 span {
  color: var(--primary-hover);
}

.login-header h2 small {
  font-size: 0.65rem;
  color: var(--accent-gold);
  background: var(--accent-gold-light);
  padding: 3px 8px;
  border-radius: 20px;
  vertical-align: middle;
  font-weight: 700;
}

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

.login-alert {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.4;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

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

.btn-block {
  width: 100%;
  display: block;
}

.btn-lg {
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  margin-top: 10px;
}

.login-demo-accounts {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.demo-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
  text-align: center;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
}

.demo-chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.demo-chip small {
  color: var(--text-muted);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Central de Notificações Toast Flutuantes */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

#toast-container > * {
  pointer-events: auto;
}

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

/* ==========================================================================
   Ultra-Modern & Professional Confirmation Modal System (Glassmorphism)
   ========================================================================== */
.confirm-modal-backdrop {
  z-index: 10000 !important;
  background: rgba(4, 7, 15, 0.85) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.confirm-modal-backdrop.active {
  opacity: 1 !important;
  visibility: visible !important;
}

.confirm-modal-card {
  max-width: 460px !important;
  width: 90% !important;
  border-radius: 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.4) !important;
  padding: 32px 28px 28px !important;
  text-align: center !important;
  background: linear-gradient(145deg, #0f172a, #0b1120) !important;
  position: relative !important;
  overflow: hidden !important;
  transform: scale(0.92) translateY(16px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.confirm-modal-backdrop.active .confirm-modal-card {
  transform: scale(1) translateY(0) !important;
}

.confirm-dialog-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  background: rgba(239, 68, 68, 0.3);
  filter: blur(70px);
  border-radius: 50%;
  pointer-events: none;
  transition: background 0.3s ease;
}

.confirm-dialog-icon-box {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  border-radius: 22px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.confirm-dialog-title {
  margin: 0 0 12px 0 !important;
  font-size: 1.4rem !important;
  font-weight: 800 !important;
  color: #f8fafc !important;
  line-height: 1.25 !important;
  letter-spacing: -0.4px !important;
}

.confirm-dialog-message {
  font-size: 0.95rem !important;
  color: #94a3b8 !important;
  line-height: 1.6 !important;
  margin-bottom: 28px !important;
  padding: 0 6px !important;
}

.confirm-dialog-actions {
  display: flex !important;
  gap: 12px !important;
  justify-content: center !important;
}

.btn-confirm-cancel {
  flex: 1;
  padding: 13px 20px;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-confirm-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-confirm-action {
  flex: 1;
  padding: 13px 20px;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 14px;
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ==========================================================================
   Network Status & Offline Sync Badge (.network-chip)
   ========================================================================== */
.network-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
}

.network-chip.online {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.network-chip.online:hover {
  background: rgba(16, 185, 129, 0.22);
}

.network-chip.offline {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  animation: pulseOffline 2s infinite ease-in-out;
}

@keyframes pulseOffline {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.3); }
}

.network-chip.syncing {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

/* =========================================================================
   SISTEMA DE PAGINAÇÃO UNIVERSAL (12 LINHAS POR PÁGINA)
   ========================================================================= */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 12px 12px;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: -1px;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.pagination-info strong {
  color: var(--primary-hover);
  font-weight: 700;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  color: #ffffff;
  border-color: var(--primary-hover);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.pagination-btn.active {
  background: var(--gradient-primary);
  color: #ffffff;
  border-color: var(--primary-hover);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}



