/* ==========================================================================
   iLayerCert v3 Design System — app-v3.css
   Comprehensive UI overhaul layered on top of Bootstrap 4 + material-dashboard.
   MUST be loaded AFTER material-dashboard.css and app.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. DESIGN TOKENS (CSS Custom Properties)
   -------------------------------------------------------------------------- */
:root {
  /* Sidebar */
  --sidebar-bg: #0F2B46;
  --sidebar-hover: #163a5c;
  --sidebar-active: #1a73e8;
  --sidebar-text: #a6b4c8;
  --sidebar-text-active: #fff;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;

  /* Backgrounds */
  --bg-primary: #f8fafc;
  --bg-card: #fff;
  --bg-secondary: #f1f5f9;

  /* Text */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #64748b;
  --text-inverse: #fff;

  /* Borders */
  --border-color: #e2e8f0;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Accent & Status */
  --accent: #1a73e8;
  --accent-hover: #1557b0;
  --accent-light: #e8f0fe;

  /* Status Colors */
  --green: #22c55e;
  --green-light: #dcfce7;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --red: #ef4444;
  --red-light: #fee2e2;
  --blue: #3b82f6;
  --blue-light: #dbeafe;
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.10);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.10);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.10);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.10);

  /* Texto de estado escuro (WCAG AA ≥4.5:1 sobre fundos claros) */
  --success-text: #166534;
  --warning-text: #92400e;
  --danger-text: #991b1b;
  --info-text: #1e40af;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.16);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.8125rem;  /* 13px */
  --font-size-base: 0.875rem; /* 14px */
  --font-size-md: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Z-index */
  --z-sidebar: 1040;
  --z-navbar: 1030;
  --z-overlay: 1050;
  --z-modal: 1060;
  --z-toast: 1070;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* --------------------------------------------------------------------------
   DARK MODE — data-theme="dark" overrides
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  /* Sidebar */
  --sidebar-bg: #0a1929;
  --sidebar-hover: #132f4c;
  --sidebar-active: #1a73e8;
  --sidebar-text: #7c8ea0;
  --sidebar-text-active: #fff;

  /* Backgrounds */
  --bg-primary: #0f172a;
  --bg-card: #1e293b;
  --bg-secondary: #0b1220;

  /* Text */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Borders */
  --border-color: #334155;
  --border: #334155;
  --border-light: #1e293b;

  /* Accent */
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: #1e3a5f;

  /* Status light variants (darker) */
  --green-light: #052e16;
  --amber-light: #422006;
  --red-light: #450a0a;
  --blue-light: #172554;

  /* Shadows — stronger for dark */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] body {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary);
}

[data-theme="dark"] .azulcards {
  background: linear-gradient(135deg, #1e293b 0%, #16213a 100%) !important;
}

[data-theme="dark"] .card-header {
  background: var(--bg-card) !important;
  border-bottom-color: var(--border-color) !important;
}

/* --------------------------------------------------------------------------
   1. GLOBAL RESET & TYPOGRAPHY
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-family) !important;
  background-color: var(--bg-primary) !important;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-family) !important;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1, .h1 { font-size: var(--font-size-3xl); }
h2, .h2 { font-size: var(--font-size-2xl); }
h3, .h3 { font-size: var(--font-size-xl); }
h4, .h4 { font-size: var(--font-size-lg); }
h5, .h5 { font-size: var(--font-size-md); }
h6, .h6 { font-size: var(--font-size-base); }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

::selection {
  background-color: var(--accent);
  color: #fff;
}

/* --------------------------------------------------------------------------
   2. LAYOUT — Wrapper, Main Panel, Content
   -------------------------------------------------------------------------- */
.wrapper {
  display: flex;
  min-height: 100vh;
}

.main-panel {
  width: calc(100% - var(--sidebar-width)) !important;
  margin-left: var(--sidebar-width) !important;
  background-color: var(--bg-primary) !important;
  transition: none !important;
  float: none !important;
}

/* Collapsed sidebar state */
body.sidebar-collapsed .main-panel {
  width: calc(100% - 72px) !important;
  margin-left: 72px !important;
}

.content {
  padding: var(--space-6) 0;
}

.mx-5 {
  padding-top: 0 !important;
}

/* --------------------------------------------------------------------------
   3. SIDEBAR — Dark Navy, Grouped Sections, Collapsible
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width) !important;
  background: var(--sidebar-bg) !important;
  background-image: none !important;
  z-index: var(--z-sidebar);
  overflow-x: hidden;
  transition: none !important;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15) !important;
}

body.sidebar-collapsed .sidebar {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
}

body.sidebar-collapsed .sidebar .sidebar-wrapper {
  width: var(--sidebar-collapsed) !important;
}

/* Sidebar brand / logo */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 18px;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 4px;
}
.brand-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.brand-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}
body.sidebar-collapsed .sidebar-brand {
  padding: 16px 12px;
  justify-content: center;
}
body.sidebar-collapsed .sidebar-brand > div:last-child {
  display: none;
}
body.sidebar-collapsed .brand-icon {
  width: 36px; height: 36px;
  font-size: 16px;
}
.brand-logo {
  width: 40px; height: 40px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  flex-shrink: 0;
}
body.sidebar-collapsed .brand-logo {
  width: 36px; height: 36px;
}

/* Sidebar hide/show toggle button (original) */
.sidebar_hideshow {
  display: none !important; /* we replace this with our own toggle */
}

/* V3 Sidebar collapse toggle */
.sidebar-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: color var(--transition-fast);
  margin-bottom: var(--space-2);
}

.sidebar-collapse-toggle:hover {
  color: var(--sidebar-text-active);
}

.sidebar-collapse-toggle i {
  font-size: 1.25rem;
  transition: transform var(--transition-base);
}

body.sidebar-collapsed .sidebar-collapse-toggle i {
  transform: rotate(180deg);
}

/* Sidebar wrapper / scrollable area */
.sidebar .sidebar-wrapper {
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - 90px);
  padding-bottom: var(--space-8);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar .sidebar-wrapper::-webkit-scrollbar {
  width: 4px;
}

.sidebar .sidebar-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar .sidebar-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

/* Section labels */
.nav-section-label {
  display: block;
  padding: var(--space-5) var(--space-5) var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.sidebar-collapsed .nav-section-label {
  font-size: 0;
  padding: var(--space-3) var(--space-2);
  text-align: center;
}

body.sidebar-collapsed .nav-section-label::after {
  content: '•••';
  font-size: var(--font-size-xs);
  letter-spacing: 0;
}

/* Navigation links */
.sidebar .nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar .nav .nav-item {
  margin: 1px 0;
}

.sidebar .nav .nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5) var(--space-3) 24px !important;
  margin: 0 var(--space-2) !important;
  color: var(--sidebar-text) !important;
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--radius-sm) !important;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar .nav .nav-item .nav-link i {
  font-size: 1.2rem;
  width: 22px;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.sidebar .nav .nav-item .nav-link span,
.sidebar .nav .nav-item .nav-link p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: inherit !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hover state */
.sidebar .nav .nav-item .nav-link:hover {
  background: var(--sidebar-hover) !important;
  color: var(--sidebar-text-active) !important;
}

.sidebar .nav .nav-item .nav-link:hover i {
  opacity: 1;
}

/* Active state — blue left bar */
.sidebar .nav .nav-item .nav-link.active {
  background: rgba(26, 115, 232, 0.12) !important;
  color: var(--sidebar-text-active) !important;
}

.sidebar .nav .nav-item .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--sidebar-active);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.sidebar .nav .nav-item .nav-link.active i {
  color: var(--sidebar-active) !important;
  opacity: 1;
}

/* Collapsed sidebar: hide labels */
body.sidebar-collapsed .sidebar .nav .nav-item .nav-link span,
body.sidebar-collapsed .sidebar .nav .nav-item .nav-link p {
  display: none;
}

body.sidebar-collapsed .sidebar .nav .nav-item .nav-link {
  justify-content: center;
  padding: var(--space-3) !important;
  margin: 1px var(--space-1) !important;
}

body.sidebar-collapsed .sidebar .nav .nav-item .nav-link i {
  margin: 0 auto;
  font-size: 1.4rem;
  opacity: 1 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Campos de formulário com borda azul */
.form-control {
  border: 1px solid #3b82f6 !important;
}

.form-control:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2) !important;
}

/* Erros de validação continuam vermelhos */
.form-control.is-invalid {
  border-color: #dc3545 !important;
}

.form-control.is-invalid:focus {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.custom-file-input,
.custom-file-label {
  border-color: #3b82f6 !important;
}

.custom-file-input:focus ~ .custom-file-label {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2) !important;
}

/* material-dashboard esconde o checkbox nativo (opacity:0, size:0, pointer-events:none)
   à espera de um .form-check-sign que não usamos — restaurar o checkbox nativo */
.form-check .form-check-input {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0.3rem 0.5rem 0 0 !important;
  opacity: 1 !important;
  z-index: auto !important;
  overflow: visible !important;
  left: auto !important;
  pointer-events: auto !important;
  border: 1px solid #3b82f6 !important;
}

.form-check .form-check-input:checked {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

/* Collapsed sidebar: hide badges */
body.sidebar-collapsed .sidebar .nav .nav-item .nav-link .badge {
  display: none !important;
}

/* Submenu styles */
.sidebar .nav .submenu {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar .nav .submenu.active {
  display: block;
}

.sidebar .nav .submenu li a.nav-link,
body.sidebar-collapsed .sidebar .nav .submenu li a.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5) var(--space-2) 56px !important;
  color: var(--sidebar-text);
  font-size: var(--font-size-xs);
  font-weight: 400;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
  margin: 0 var(--space-2);
}

.sidebar .nav .submenu li a:hover {
  color: var(--sidebar-text-active);
  background: var(--sidebar-hover);
}

.sidebar .nav .submenu li a i {
  font-size: 0.9rem;
  opacity: 0.6;
}

/* Submenu toggle arrow */
.submenu-toggle {
  margin-left: auto;
  font-size: 1rem;
  transition: transform var(--transition-fast);
}

/* Submenu section header (group label) */
.submenu-section {
  padding: 8px 20px 4px 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Has-submenu link */
.nav-link.has-submenu {
  cursor: pointer;
}

/* Sidebar collapse toggle hidden */
body.sidebar-collapsed .sidebar .submenu,
body.sidebar-collapsed .sidebar .submenu.active {
  display: none;
}

body.sidebar-collapsed .sidebar .submenu-toggle {
  display: none;
}

/* --------------------------------------------------------------------------
   4. TOP NAVBAR — White, Breadcrumbs
   -------------------------------------------------------------------------- */
.navbar {
  background: var(--bg-card) !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: var(--radius-md) !important;
  margin: var(--space-4) 0 !important;
  padding: var(--space-3) var(--space-5) !important;
  position: relative !important;
  z-index: var(--z-navbar);
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  min-height: 64px;
}

.navbar.navbar-transparent {
  background: var(--bg-card) !important;
  box-shadow: var(--shadow-sm) !important;
  border-bottom: 3px solid var(--blue) !important;
}

.navbar .page-header-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.navbar .page-header-title > i {
  font-size: 1.65rem;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
}

.navbar h1 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  white-space: nowrap;
  line-height: 1.3;
}

/* Breadcrumb area */
.v3-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.v3-breadcrumb .breadcrumb {
  background: none;
  margin: 0;
  padding: 0;
  font-size: var(--font-size-sm);
}

.v3-breadcrumb .breadcrumb-item {
  color: var(--text-secondary);
}

.v3-breadcrumb .breadcrumb-item a {
  color: var(--text-secondary);
}

.v3-breadcrumb .breadcrumb-item a:hover {
  color: var(--accent);
}

.v3-breadcrumb .breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.v3-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: '›';
  color: var(--text-muted);
  font-weight: 300;
}

/* Navbar icons */
.navbar .helpdesk_area a,
.navbar .notification_area a {
  color: var(--text-secondary);
  font-size: 1.25rem;
  position: relative;
  transition: color var(--transition-fast);
}

.navbar .helpdesk_area a:hover,
.navbar .notification_area a:hover {
  color: var(--accent);
}

/* Notification count badge */
.alert-count {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  background: var(--danger) !important;
  color: #fff !important;
  border-radius: var(--radius-full);
}

/* Widget drag handle (dashboard reorder) */
.widget-row {
  position: relative;
}
.widget-drag-handle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  cursor: grab;
  opacity: 0.45;
  transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-sm);
  font-size: 16px;
}
.widget-row:hover .widget-drag-handle {
  opacity: 1;
}
.widget-drag-handle:active {
  cursor: grabbing;
}
.widget-ghost {
  opacity: 0.4;
  border: 2px dashed var(--blue) !important;
  border-radius: var(--radius-md);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}
.theme-toggle:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}
[data-theme="dark"] .theme-toggle i.ri-moon-line::before {
  content: "\f1bc"; /* sun icon when dark */
}

/* Profile menu */
.profile-menu .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary) !important;
  font-weight: 500;
  font-size: var(--font-size-sm);
}

.profile-menu .dropdown-toggle .img img,
.profile-menu .dropdown-toggle img.img-svg {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--bg-secondary);
}

.profile-menu .dropdown-toggle .avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 2px solid var(--bg-secondary);
  flex-shrink: 0;
}

.profile-menu .dropdown-toggle::after {
  display: none;
}

/* Dropdowns */
.dropdown-menu {
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: var(--radius-md) !important;
  padding: var(--space-2) !important;
  animation: v3-dropdown-in 150ms ease;
}

@keyframes v3-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu .dropdown-item {
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.dropdown-menu .dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

.dropdown-menu .dropdown-item i {
  width: 20px;
  text-align: center;
}

/* Language flag */
.language_flag .nav-link {
  padding: 4px 8px !important;
}

.language-img {
  width: 22px;
  height: auto;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   5. CARDS — Rounded, Shadows
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: box-shadow var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md) !important;
}

.card .card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--bg-secondary);
  padding: var(--space-5) var(--space-5) var(--space-4);
  font-weight: 600;
}

.card .card-header .card-title {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
}

.card .card-body {
  padding: var(--space-5);
}

.card .card-footer {
  background: transparent;
  border-top: 1px solid var(--bg-secondary);
  padding: var(--space-4) var(--space-5);
}

/* Chart card */
.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.chart-card .chart-card-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.chart-card .chart-card-title i {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   6. STAT CARDS — Left Colored Border + Icon Circle
   -------------------------------------------------------------------------- */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: 
    0 1px 2px rgba(0,0,0,0.06),
    0 4px 12px rgba(0,0,0,0.08),
    0 8px 24px rgba(0,0,0,0.04) !important;
  border: 1px solid var(--border-light) !important;
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  border-left: 4px solid var(--accent);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.2) !important;
  margin-bottom: var(--space-5);
  position: relative;
  transform: translateY(0);
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 4px;
  right: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06), transparent);
  border-radius: 0 0 6px 6px;
}

.stat-card:hover {
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.08),
    0 8px 20px rgba(0,0,0,0.12),
    0 12px 32px rgba(0,0,0,0.06);
  transform: translateY(-4px);
  border-color: var(--border);
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  background: var(--accent-light);
  color: var(--accent);
}

.stat-card .stat-content {
  flex: 1;
  min-width: 0;
}

.stat-card .stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card .stat-label a {
  color: inherit;
  text-decoration: none;
}

.stat-card .stat-label a:hover {
  color: var(--accent);
}

/* Stat card color variants */
.stat-card.stat-accent  { border-left-color: var(--accent); }
.stat-card.stat-accent .stat-icon { background: var(--accent-light); color: var(--accent); }

.stat-card.stat-success { border-left-color: var(--success-text); }
.stat-card.stat-success .stat-icon { background: var(--success-light); color: var(--success-text); }

.stat-card.stat-warning { border-left-color: var(--warning-text); }
.stat-card.stat-warning .stat-icon { background: var(--warning-light); color: var(--warning-text); }

.stat-card.stat-danger  { border-left-color: var(--danger-text); }
.stat-card.stat-danger .stat-icon { background: var(--danger-light); color: var(--danger-text); }

/* --------------------------------------------------------------------------
   AZULCARDS — 3D Blue Border Cards (fresh class, zero cache)
   -------------------------------------------------------------------------- */
.azulcards {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border-radius: 14px !important;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.10),
    0 6px 16px rgba(0,0,0,0.12),
    0 10px 30px rgba(0,0,0,0.08) !important;
  border: 2px solid #3b82f6 !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.2) !important;
  transform: translateY(0) !important;
}

.azulcards:hover {
  box-shadow:
    0 4px 8px rgba(59,130,246,0.15),
    0 10px 25px rgba(0,0,0,0.18),
    0 16px 40px rgba(0,0,0,0.10) !important;
  transform: translateY(-6px) !important;
  border-color: #2563eb !important;
}

.azulcards .stat-icon {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

.stat-card.stat-info    { border-left-color: var(--info-text); }
.stat-card.stat-info .stat-icon { background: var(--info-light); color: var(--info-text); }

.stat-card.stat-teal    { border-left-color: #14b8a6; }
.stat-card.stat-teal .stat-icon { background: rgba(20, 184, 166, 0.10); color: #14b8a6; }

/* Legacy dashboard_points override */
.dashboard_points {
  border-radius: var(--radius-md) !important;
}

/* --------------------------------------------------------------------------
   7. TABLES & DATATABLES — Gray Headers, Row Hover, Pill Pagination
   -------------------------------------------------------------------------- */
.table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100% !important;
}

.table thead th {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-3) var(--space-4) !important;
  border-bottom: none !important;
  border-top: none !important;
  white-space: nowrap;
}

.table thead th:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.table thead th:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.table tbody td {
  padding: var(--space-3) var(--space-4) !important;
  border-top: 1px solid var(--bg-secondary) !important;
  vertical-align: middle;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

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

.table tbody tr:hover {
  background: var(--accent-light) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(248, 250, 252, 0.5);
}

/* DataTables specific */
.dataTables_wrapper {
  padding: 0;
}

.dataTables_wrapper .dataTables_filter {
  margin-bottom: var(--space-4);
}

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-full) !important;
  padding: var(--space-2) var(--space-4) !important;
  font-size: var(--font-size-sm);
  background: var(--bg-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-width: 240px;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-light) !important;
  outline: none;
}

.dataTables_wrapper .dataTables_length select {
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-sm) !important;
  padding: var(--space-1) var(--space-3) !important;
  font-size: var(--font-size-sm);
}

/* DataTables info text */
.dataTables_wrapper .dataTables_info {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  padding-top: var(--space-3);
}

/* Pill pagination */
.dataTables_wrapper .dataTables_paginate {
  padding-top: var(--space-3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .page-item .page-link,
.page-link {
  border: none !important;
  border-radius: var(--radius-full) !important;
  padding: 6px 14px !important;
  margin: 0 2px !important;
  font-size: var(--font-size-sm) !important;
  font-weight: 500;
  color: var(--text-secondary) !important;
  background: transparent !important;
  transition: all var(--transition-fast);
  line-height: 1.4 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .page-item .page-link:hover,
.page-link:hover {
  background: var(--bg-secondary) !important;
  color: var(--accent) !important;
  box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link,
.page-item.active .page-link {
  background: var(--accent) !important;
  color: #fff !important;
  box-shadow: var(--shadow-sm) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* DataTables export buttons */
.datatable_icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm) !important;
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  font-size: 1rem;
  border: none !important;
  padding: 0 !important;
  margin: 0 var(--space-1) !important;
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
}

.datatable_icon:hover {
  background: var(--accent) !important;
  color: #fff !important;
  box-shadow: var(--shadow-sm) !important;
}

.datatable_icon .tooltip_txt {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  font-size: var(--font-size-xs);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  pointer-events: none;
}

.datatable_icon:hover .tooltip_txt {
  display: block;
}

/* DataTables sorting icons */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after {
  opacity: 0.3;
}

table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before {
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   8. FORMS — Rounded Inputs, Blue Focus
   -------------------------------------------------------------------------- */
.form-control {
  border: 1px solid #3b82f6 !important;
  border-radius: var(--radius-sm) !important;
  padding: var(--space-2) var(--space-3) !important;
  font-size: var(--font-size-sm) !important;
  color: var(--text-primary) !important;
  background: var(--bg-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  height: auto !important;
}

.form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-light) !important;
  outline: none;
}

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

.form-control-sm {
  padding: 6px var(--space-3) !important;
  font-size: var(--font-size-sm) !important;
}

.form-group label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.form-group .text-danger {
  color: var(--danger-text) !important;
}

/* Custom file input */
.custom-file-label {
  border: 1px solid #3b82f6;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
}

.custom-file-label::after {
  background: var(--bg-secondary);
  border-left: 1px solid #3b82f6;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* --------------------------------------------------------------------------
   9. SELECT2 — Careful styling to not break functionality
   -------------------------------------------------------------------------- */
.select2-container--default .select2-selection--single {
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-sm) !important;
  height: 38px !important;
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  line-height: 38px;
  padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-light);
}

.select2-container--default .select2-selection--multiple {
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-sm) !important;
  min-height: 38px;
  padding: 2px var(--space-2);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: var(--accent-light);
  border: none;
  border-radius: var(--radius-xs);
  color: var(--accent);
  font-size: var(--font-size-xs);
  padding: 2px 8px;
}

.select2-dropdown {
  border: none !important;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm) !important;
}

.select2-results__option--highlighted[aria-selected] {
  background-color: var(--accent-light) !important;
  color: var(--accent) !important;
}

.select2-results__option[aria-selected="true"] {
  background-color: var(--bg-secondary);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}

/* --------------------------------------------------------------------------
   10. BUTTONS — Rounded, Variants
   -------------------------------------------------------------------------- */
.btn {
  border-radius: var(--radius-sm) !important;
  font-weight: 600;
  font-size: var(--font-size-sm);
  padding: var(--space-2) var(--space-4);
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn:focus {
  box-shadow: 0 0 0 3px var(--accent-light) !important;
}

.btn-primary {
  background: var(--accent) !important;
  color: #fff !important;
  border: none !important;
}

.btn-primary:hover {
  background: var(--accent-hover) !important;
  box-shadow: var(--shadow-sm) !important;
}

.btn-success {
  background: var(--success) !important;
  color: #fff !important;
  border: none !important;
}

.btn-success:hover {
  background: #16a34a !important;
}

.btn-danger {
  background: var(--danger) !important;
  color: #fff !important;
  border: none !important;
}

.btn-danger:hover {
  background: #dc2626 !important;
}

.btn-warning {
  background: var(--warning) !important;
  color: #fff !important;
  border: none !important;
}

.btn-warning:hover {
  background: #d97706 !important;
}

.btn-info {
  background: var(--info) !important;
  color: #fff !important;
  border: none !important;
}

.btn-info:hover {
  background: #2563eb !important;
}

.btn-secondary {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: none !important;
}

.btn-secondary:hover {
  background: #e2e8f0 !important;
}

.btn-outline-primary {
  background: transparent !important;
  color: var(--accent) !important;
  border: 1px solid var(--accent) !important;
}

.btn-outline-primary:hover {
  background: var(--accent) !important;
  color: #fff !important;
}

.btn-sm {
  padding: 4px var(--space-3) !important;
  font-size: var(--font-size-xs) !important;
}

.btn-lg {
  padding: var(--space-3) var(--space-6) !important;
  font-size: var(--font-size-md) !important;
}

.btn-circle {
  border-radius: var(--radius-full) !important;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm) !important;
}

/* --------------------------------------------------------------------------
   11. MODALS — Rounded
   -------------------------------------------------------------------------- */
.modal-content {
  border: none !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
  overflow: hidden;
}

.modal-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--bg-secondary) !important;
  padding: var(--space-5) var(--space-6) !important;
}

.modal-header .modal-title {
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}

.modal-header .close {
  font-size: 1.5rem;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
  padding: 0;
  margin: 0;
  background: none;
  border: none;
}

.modal-header .close:hover {
  opacity: 1;
}

.modal-body {
  padding: var(--space-5) var(--space-6) !important;
}

.modal-footer {
  border-top: 1px solid var(--bg-secondary) !important;
  padding: var(--space-4) var(--space-6) !important;
  gap: var(--space-2);
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.5);
}

/* --------------------------------------------------------------------------
   12. BADGES & STATUS PILLS
   -------------------------------------------------------------------------- */
.badge {
  font-weight: 600;
  font-size: var(--font-size-xs);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-primary, .badge-accent {
  background: var(--accent-light) !important;
  color: var(--accent) !important;
}

.badge-success {
  background: var(--success-light) !important;
  color: var(--success-text) !important;
}

.badge-warning {
  background: var(--warning-light) !important;
  color: var(--warning-text) !important;
}

.badge-danger {
  background: var(--danger-light) !important;
  color: var(--danger-text) !important;
}

.badge-info {
  background: var(--info-light) !important;
  color: var(--info-text) !important;
}

.badge-secondary {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
}

/* Status pills (larger, pill-shaped badges) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

.status-pill.status-active { background: var(--success-light); color: var(--success-text); }
.status-pill.status-pending { background: var(--warning-light); color: var(--warning-text); }
.status-pill.status-inactive { background: var(--danger-light); color: var(--danger-text); }
.status-pill.status-draft { background: var(--bg-secondary); color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   13. PROGRESS BARS
   -------------------------------------------------------------------------- */
.progress {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: none;
}

.progress-bar {
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.progress-bar.bg-primary,
.progress-bar-primary { background: var(--accent) !important; }
.progress-bar.bg-success,
.progress-bar-success { background: var(--success) !important; }
.progress-bar.bg-warning,
.progress-bar-warning { background: var(--warning) !important; }
.progress-bar.bg-danger,
.progress-bar-danger { background: var(--danger) !important; }

.progress-sm { height: 4px; }
.progress-lg { height: 12px; }

/* Progress with label */
.progress-labeled {
  position: relative;
}

.progress-labeled .progress-label {
  position: absolute;
  right: 0;
  top: -20px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   14. TIMELINE
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background: var(--bg-secondary);
}

.timeline-item {
  position: relative;
  padding: 0 0 var(--space-6) calc(20px + var(--space-6));
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--accent);
  z-index: 1;
}

.timeline-item.timeline-success::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-item.timeline-warning::before { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.timeline-item.timeline-danger::before  { background: var(--danger);  box-shadow: 0 0 0 2px var(--danger);  }

.timeline-item .timeline-date {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-item .timeline-content {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   15. BREADCRUMBS (standalone)
   -------------------------------------------------------------------------- */
.breadcrumb {
  background: transparent !important;
  padding: 0;
  margin: 0;
  font-size: var(--font-size-sm);
}

.breadcrumb-item a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
  color: var(--accent);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '›' !important;
  color: var(--text-muted);
  font-weight: 300;
}

/* --------------------------------------------------------------------------
   16. KANBAN COLUMNS
   -------------------------------------------------------------------------- */
.kanban-board {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding: var(--space-4) 0;
}

.kanban-column {
  min-width: 280px;
  max-width: 320px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  flex-shrink: 0;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 2px solid #e2e8f0;
}

.kanban-column-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.kanban-column-count {
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kanban-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  cursor: grab;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kanban-card:active {
  cursor: grabbing;
}

/* --------------------------------------------------------------------------
   17. TAB NAVIGATION
   -------------------------------------------------------------------------- */
.nav-tabs {
  border-bottom: 2px solid var(--bg-secondary) !important;
  gap: 0;
}

.nav-tabs .nav-link {
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  padding: var(--space-3) var(--space-4) !important;
  margin-bottom: -2px;
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.nav-tabs .nav-link:hover {
  color: var(--accent) !important;
  border-bottom-color: rgba(26, 115, 232, 0.3) !important;
  background: transparent !important;
}

.nav-tabs .nav-link.active {
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
  background: transparent !important;
  font-weight: 600;
}

.nav-pills .nav-link {
  border-radius: var(--radius-full) !important;
  padding: var(--space-2) var(--space-4) !important;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.nav-pills .nav-link.active {
  background: var(--accent) !important;
  color: #fff !important;
}

/* --------------------------------------------------------------------------
   18. SEARCH OVERLAY (Cmd+K)
   -------------------------------------------------------------------------- */
.v3-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: var(--z-overlay);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  backdrop-filter: blur(4px);
}

.v3-search-overlay.active {
  display: flex;
  animation: v3-overlay-in 200ms ease;
}

@keyframes v3-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.v3-search-container {
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: v3-search-slide-in 200ms ease;
}

@keyframes v3-search-slide-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.v3-search-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--bg-secondary);
}

.v3-search-header i {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.v3-search-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: var(--font-size-lg) !important;
  font-weight: 500;
  color: var(--text-primary) !important;
  padding: 0 !important;
  background: transparent;
}

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

.v3-search-kbd {
  font-size: var(--font-size-xs);
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-weight: 500;
}

.v3-search-filters {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--bg-secondary);
}

.v3-search-filter-pill {
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.v3-search-filter-pill:hover,
.v3-search-filter-pill.active {
  background: var(--accent);
  color: #fff;
}

.v3-search-results {
  max-height: 320px;
  overflow-y: auto;
  padding: var(--space-2);
}

.v3-search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.v3-search-result-item:hover {
  background: var(--bg-secondary);
}

.v3-search-result-item i {
  font-size: 1.1rem;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
}

.v3-search-result-item .v3-search-result-text {
  flex: 1;
}

.v3-search-result-item .v3-search-result-title {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.v3-search-result-item .v3-search-result-desc {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.v3-search-empty {
  padding: var(--space-8);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.v3-search-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--bg-secondary);
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}

.v3-search-footer-hint {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.v3-search-footer-hint kbd {
  font-size: 10px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   19. SCROLLBARS
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

/* --------------------------------------------------------------------------
   20. LOADING SPINNER
   -------------------------------------------------------------------------- */
.loading {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 9999;
  display: flex !important;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.loading-content {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-secondary);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  animation: v3-spin 0.7s linear infinite;
}

@keyframes v3-spin {
  to { transform: rotate(360deg); }
}

/* Skeleton loading */
.v3-skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, #e2e8f0 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: v3-skeleton 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes v3-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.v3-skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
}

.v3-skeleton-circle {
  border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   21. ANIMATIONS
   -------------------------------------------------------------------------- */
.animate {
  transition: all var(--transition-base);
}

.v3-fade-in {
  animation: v3-fade-in 300ms ease;
}

@keyframes v3-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.v3-slide-up {
  animation: v3-slide-up 300ms ease;
}

@keyframes v3-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.v3-slide-in-right {
  animation: v3-slide-in-right 300ms ease;
}

@keyframes v3-slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Hover lift */
.v3-hover-lift {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.v3-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   22. ACTIVITY CARD (What's New section)
   -------------------------------------------------------------------------- */
.activity-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-5);
}

.activity-card .activity-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.activity-card .activity-card-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.complex_table_section {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-secondary);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  transition: all var(--transition-fast);
}

.complex_table_section:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.complex_table_section h4 {
  font-size: var(--font-size-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.complex_table_section h4 a {
  color: var(--text-primary);
}

.complex_table_section h4 a:hover {
  color: var(--accent);
}

.complex_table_section p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* News cards — each ISO news item in its own card */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--blue);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.05);
  transition: all 0.25s ease;
}
.news-card:hover {
  border-left-color: var(--accent);
  border-color: rgba(59,130,246,0.35);
  box-shadow: 0 4px 8px rgba(59,130,246,0.14), 0 8px 22px rgba(0,0,0,0.10);
  transform: translateY(-3px);
}
.news-card:last-child {
  margin-bottom: 0;
}
.news-card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
}
.news-card-title a {
  color: var(--text-primary);
  text-decoration: none;
}
.news-card-title a:hover {
  color: var(--accent);
}
.news-card-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* --------------------------------------------------------------------------
   23. ALERTS & NOTIFICATIONS
   -------------------------------------------------------------------------- */
.alert {
  border: none !important;
  border-radius: var(--radius-sm) !important;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.alert-success {
  background: var(--success-light) !important;
  color: #15803d !important;
}

.alert-danger {
  background: var(--danger-light) !important;
  color: #b91c1c !important;
}

.alert-warning {
  background: var(--warning-light) !important;
  color: #92400e !important;
}

.alert-info {
  background: var(--info-light) !important;
  color: #1d4ed8 !important;
}

/* Notification dropdown */
.user_notification_list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
}

.user_notification_list li {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--bg-secondary);
  transition: background var(--transition-fast);
}

.user_notification_list li:last-child {
  border-bottom: none;
}

.user_notification_list li:hover {
  background: var(--bg-secondary);
}

/* --------------------------------------------------------------------------
   24. FOOTER
   -------------------------------------------------------------------------- */
.footer {
  padding: var(--space-5) 0 !important;
  font-size: var(--font-size-xs);
  color: var(--text-muted) !important;
  text-align: center;
  border-top: 1px solid var(--bg-secondary);
  margin-top: var(--space-8);
}

/* --------------------------------------------------------------------------
   25. TO-TOP BUTTON
   -------------------------------------------------------------------------- */
#to-top-button {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: none;
  opacity: 0;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 999;
  transition: all var(--transition-fast);
}

#to-top-button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   26. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .stat-card {
    padding: var(--space-4);
  }

  .stat-card .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .stat-card .stat-value {
    font-size: var(--font-size-xl);
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    left: 0 !important;
    right: auto !important;
    transform: translateX(-100%);
    z-index: var(--z-overlay);
  }

  .sidebar.show-sidebar,
  html.nav-open .sidebar,
  .nav-open .sidebar {
    transform: translateX(0) !important;
  }

  .main-panel {
    width: 100% !important;
    margin-left: 0 !important;
  }

  body.sidebar-collapsed .main-panel {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .navbar {
    margin: var(--space-2) 0 !important;
    padding: var(--space-2) var(--space-3) !important;
  }

  .v3-breadcrumb {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .mx-5 {
    padding-left: var(--space-3) !important;
    padding-right: var(--space-3) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .content {
    padding: var(--space-3) 0;
  }

  .stat-card {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
  }

  .stat-card .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .stat-card .stat-value {
    font-size: var(--font-size-lg);
  }

  .v3-search-container {
    max-width: calc(100% - var(--space-6));
    margin: 0 var(--space-3);
  }

  .kanban-board {
    flex-direction: column;
  }

  .kanban-column {
    max-width: 100%;
    min-width: 100%;
  }
}

@media (max-width: 575.98px) {
  .profile-menu .dropdown-toggle span:not(.img) {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   27. UTILITY CLASSES
   -------------------------------------------------------------------------- */
/* Text colors */
.text-accent  { color: var(--accent) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-primary-v3 { color: var(--text-primary) !important; }
.text-secondary-v3 { color: var(--text-secondary) !important; }

/* Background colors */
.bg-accent       { background-color: var(--accent) !important; }
.bg-accent-light { background-color: var(--accent-light) !important; }
.bg-card         { background-color: var(--bg-card) !important; }
.bg-primary-v3   { background-color: var(--bg-primary) !important; }

/* Radius utilities */
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }

/* Shadow utilities */
.shadow-sm-v3 { box-shadow: var(--shadow-sm) !important; }
.shadow-md-v3 { box-shadow: var(--shadow-md) !important; }
.shadow-lg-v3 { box-shadow: var(--shadow-lg) !important; }
.shadow-none-v3 { box-shadow: none !important; }

/* Gap utilities */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

/* Font size utilities */
.fs-xs  { font-size: var(--font-size-xs) !important; }
.fs-sm  { font-size: var(--font-size-sm) !important; }
.fs-base { font-size: var(--font-size-base) !important; }
.fs-md  { font-size: var(--font-size-md) !important; }
.fs-lg  { font-size: var(--font-size-lg) !important; }
.fs-xl  { font-size: var(--font-size-xl) !important; }
.fs-2xl { font-size: var(--font-size-2xl) !important; }
.fs-3xl { font-size: var(--font-size-3xl) !important; }

/* Font weight utilities */
.fw-normal  { font-weight: 400 !important; }
.fw-medium  { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold    { font-weight: 700 !important; }

/* Truncate */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   28. SWEETALERT2 — Careful override to keep functional
   -------------------------------------------------------------------------- */
.swal2-popup {
  border-radius: var(--radius-lg) !important;
  font-family: var(--font-family) !important;
}

.swal2-title {
  font-size: var(--font-size-xl) !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

.swal2-content,
.swal2-html-container {
  font-size: var(--font-size-sm) !important;
  color: var(--text-secondary) !important;
}

.swal2-confirm {
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  font-size: var(--font-size-sm) !important;
}

.swal2-cancel {
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  font-size: var(--font-size-sm) !important;
}

/* --------------------------------------------------------------------------
   29. TINYMCE — Do not break the editor
   -------------------------------------------------------------------------- */
.tox.tox-tinymce {
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-sm) !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__primary {
  border-bottom: 1px solid #e2e8f0 !important;
}

/* --------------------------------------------------------------------------
   30. CHART.JS — Canvas container
   -------------------------------------------------------------------------- */
canvas {
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   31. TOOLTIP (custom v3)
   -------------------------------------------------------------------------- */
.tooltip1 {
  position: relative;
}

.tooltip1 .tooltiptext {
  visibility: hidden;
  background-color: var(--text-primary);
  color: #fff;
  text-align: center;
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  white-space: nowrap;
  position: absolute;
  z-index: 100;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.tooltip1 .tooltiptext::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--text-primary) transparent transparent transparent;
}

.tooltip1:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   32. MISC OVERRIDES for material-dashboard.css conflicts
   -------------------------------------------------------------------------- */

/* Remove material-dashboard sidebar background image */
.sidebar[data-background-color] {
  background: var(--sidebar-bg) !important;
}

.sidebar[data-color] {
  background: var(--sidebar-bg) !important;
}

.sidebar::after {
  display: none !important;
}

/* Override material-dashboard card shadows */
.card[class*="card-"] {
  box-shadow: var(--shadow-sm) !important;
}

/* Remove material-dashboard unnecessary animations */
.sidebar .nav .nav-item .nav-link .ripple-container {
  display: none;
}

/* Fix material-dashboard fixed-top causing issues */
.navbar.fixed-top {
  position: relative !important;
}

/* Hide original sidebar toggle */
.sidebar_hideshow {
  display: none !important;
}

/* Ensure wrapper takes full width correctly */
.wrapper {
  overflow: visible;
}

/* Fix material-dashboard body height override */
body[style*="height: auto"] {
  min-height: 100vh;
}

/* Pagination container from Bootstrap 4 DataTables */
.dataTables_wrapper .dataTables_paginate {
  text-align: right;
}

/* Ensure text-link in notification area works */
.text-link {
  color: var(--accent);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
}

.text-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ==========================================================================
   v3.1 — Design System Refinements (Mockup-Driven)
   Enhanced cards, badges, shadows, and typography.
   ========================================================================== */

/* ---- 33.1 Refined Shadows ---- */
.card {
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card .card-header {
  border-bottom: 1px solid var(--border-light);
  background: #fff;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.2px;
}
.card .card-body { padding: 20px; }

/* ---- 33.2 Refined Buttons ---- */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  border-radius: var(--radius);
  font-weight: 500;
  letter-spacing: -0.1px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-info {
  border-radius: var(--radius);
  font-weight: 500;
}
.btn-sm { border-radius: var(--radius-sm); }
.btn-circle {
  border-radius: 50% !important;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-outline-secondary { border-radius: var(--radius); }

/* ---- 33.3 Refined Badges ---- */
.badge {
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.badge-success { background: var(--green-light); color: #166534; }
.badge-warning { background: var(--amber-light); color: #92400e; }
.badge-danger  { background: var(--red-light);   color: #991b1b; }
.badge-info    { background: var(--blue-light);  color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: var(--text-secondary); }

/* ---- 33.18 Client Detail Page ---- */
.client-header-card { display: flex; align-items: center; gap: 20px; padding: 24px; margin-bottom: 24px; }
.client-logo { width: 56px; height: 56px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--accent), #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #fff; flex-shrink: 0; }
.client-info h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.client-info .client-meta { display: flex; align-items: center; gap: 16px; margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.client-actions { margin-left: auto; display: flex; gap: 8px; }
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .overview-grid { grid-template-columns: 1fr; } }
.compliance-bar { padding: 16px 0; border-bottom: 1px solid var(--border-light); }
.compliance-bar:last-child { border-bottom: none; }
.compliance-bar .bar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.compliance-bar .bar-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.compliance-bar .bar-pct { font-size: 20px; font-weight: 700; }
.compliance-bar .bar-detail { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.audit-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.audit-row:last-child { border-bottom: none; }
.audit-icon { width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.audit-icon.audit-done { background: var(--green-light); color: var(--green); }
.audit-icon.audit-active { background: var(--blue-light); color: var(--blue); }
.audit-info { flex: 1; }
.audit-info h4 { font-size: 13px; font-weight: 500; margin: 0; }
.audit-info p { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }

/* ---- 33.14 Tab nav polish ---- */
.table {
  font-size: 13.5px;
  border-collapse: separate;
  border-spacing: 0;
}
.table thead th {
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 10px 14px;
}
.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.table tbody tr:hover { background-color: #f8fafc; }

/* ---- 33.5 Form Polish ---- */
.form-control {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13.5px;
  padding: 8px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.form-control[readonly] { background: #f8fafc; }

/* ---- 33.6 Header / Navbar Polish ---- */
.navbar {
  background: #fff !important;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border-light);
}
.navbar .navbar-brand { font-weight: 700; letter-spacing: -0.3px; }

/* ---- 33.7 Breadcrumb Polish ---- */
.breadcrumb {
  background: transparent;
  padding: 4px 0;
  font-size: 13px;
}
.breadcrumb .breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb .active { color: var(--text-secondary); font-weight: 500; }

/* ---- 33.8 Modal Polish ---- */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-xl);
}
.modal-header {
  border-bottom: 1px solid var(--border-light);
  padding: 16px 20px;
}
.modal-footer {
  border-top: 1px solid var(--border-light);
  padding: 14px 20px;
}

/* ---- 33.9 Select2 Polish ---- */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  min-height: 38px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px !important;
  padding-left: 14px !important;
}

/* ---- 33.10 Typography Polish ---- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { letter-spacing: -0.3px; }
.text-muted { color: var(--text-muted) !important; }

/* ---- 33.11 Layout Spacing ---- */
.content { padding-top: 8px; }
.filter_area { margin-bottom: 16px; }
.filter_area .breadcrumb { margin-bottom: 0; }

/* ---- 33.12 Notification area ---- */
.dropdown-notification .dropdown-menu {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  overflow: hidden;
}

/* ---- 33.13 Stat / Metric Cards ---- */
.stat-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: 
    0 1px 2px rgba(0,0,0,0.06),
    0 4px 12px rgba(0,0,0,0.08),
    0 8px 24px rgba(0,0,0,0.04) !important;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.2) !important;
  transform: translateY(0) !important;
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 4px;
  right: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06), transparent);
  border-radius: 0 0 6px 6px;
}
.stat-card:hover {
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.08),
    0 8px 20px rgba(0,0,0,0.12),
    0 12px 32px rgba(0,0,0,0.06);
  transform: translateY(-4px);
  border-color: var(--border);
}
.stat-card .stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}
.stat-card .stat-change { font-size: 12px; margin-top: 2px; }
.stat-card .stat-change.up { color: var(--green); }
.stat-card .stat-change.down { color: var(--red); }

.page-title-row { padding: 4px 0; }
.page-title-row .page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.page-title-row .page-subtitle { font-size: 14px; color: var(--text-muted); }
.btn-ghost { background: transparent; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.btn-ghost:hover { color: var(--accent); }

/* ---- 33.15 Document Kanban Board ---- */
.kanban-view-toggle { display: flex; gap: 4px; margin-bottom: 16px; }
.kanban-view-toggle .toggle-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.kanban-view-toggle .toggle-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.kanban-board { display: none; }
.kanban-board.active { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 16px; }
.kanban-column {
  min-width: 300px;
  flex: 1;
  background: #f8fafc;
  border-radius: var(--radius-lg);
  padding: 12px;
}
.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kanban-column-header .count {
  background: #e2e8f0;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.kanban-cards { display: flex; flex-direction: column; gap: 10px; }
.kanban-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kanban-card .card-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.kanban-card .card-title .doc-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.kanban-card .card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.kanban-card .card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.kanban-card .tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  background: var(--accent-light);
  color: var(--accent);
}
.kanban-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-secondary);
}
.kanban-empty { text-align: center; padding: 20px 10px; color: var(--text-muted); font-size: 13px; }

/* ---- 33.16 Bulk Action Bar ---- */
.bulk-bar { display: none; align-items: center; gap: 12px; padding: 10px 16px; background: var(--accent-light); border: 1px solid var(--accent); border-radius: var(--radius); margin-bottom: 16px; }
.bulk-bar.show { display: flex; }
.bulk-bar .bulk-count { font-size: 13px; font-weight: 600; color: var(--accent); }

/* ---- 33.17 Kanban responsive ---- */
@media (max-width: 768px) {
  .kanban-board.active { flex-direction: column; }
  .kanban-column { min-width: 100%; }
}
.nav-tabs .nav-link {
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.nav-tabs .nav-link.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  background: transparent;
}

/* --------------------------------------------------------------------------
   34. PRINT STYLES
   -------------------------------------------------------------------------- */
@media print {
  .sidebar,
  .navbar,
  #to-top-button,
  .v3-search-overlay {
    display: none !important;
  }

  .main-panel {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  body {
    background: #fff !important;
  }
}

/* --------------------------------------------------------------------------
   35. DASHBOARD — Stat change trend lines
   -------------------------------------------------------------------------- */
.stat-change { font-size: var(--font-size-xs); font-weight: 500; margin-top: 2px; }
.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* --------------------------------------------------------------------------
   36. DASHBOARD — Attention items, Compliance rows
   -------------------------------------------------------------------------- */
.attention-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); transition: background 0.15s; cursor: pointer; }
.attention-item:hover { background: var(--bg-secondary); }
.attention-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.attention-text h4 { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.attention-text p { font-size: 12px; color: var(--text-muted); margin: 0; }
.client-compliance-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.client-compliance-row:last-child { border-bottom: none; }
.client-compliance-row .client-name { width: 140px; font-size: 13px; font-weight: 500; flex-shrink: 0; }
.client-compliance-row .progress-wrap { flex: 1; }
.client-compliance-row .pct { width: 45px; text-align: right; font-size: 13px; font-weight: 600; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   37. DASHBOARD — Mini Calendar
   -------------------------------------------------------------------------- */
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-cal .day-header { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 6px 0; }
.mini-cal .day { font-size: 12px; padding: 6px 0; border-radius: 6px; cursor: pointer; transition: all 0.1s; color: var(--text-secondary); }
.mini-cal .day:hover { background: var(--accent-light); }
.mini-cal .day.today { background: var(--accent); color: #fff; font-weight: 600; }
.mini-cal .day.has-event { position: relative; }
.mini-cal .day.has-event::after { content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.mini-cal .day.today.has-event::after { background: #fff; }
.mini-cal .day.other-month { color: var(--border); }

/* --------------------------------------------------------------------------
   38. DASHBOARD — Timeline items + Deadlines
   -------------------------------------------------------------------------- */
.timeline-entry { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.timeline-entry:last-child { border-bottom: none; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.timeline-text { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.timeline-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.deadline-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.deadline-item:last-child { border-bottom: none; }
.deadline-item .dl-date { width: 44px; text-align: center; flex-shrink: 0; }
.deadline-item .dl-date .dl-day { font-size: 18px; font-weight: 700; line-height: 1; color: var(--text-primary); }
.deadline-item .dl-date .dl-month { font-size: 10px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.deadline-item .dl-info { flex: 1; }
.deadline-item .dl-title { font-weight: 500; color: var(--text-primary); }
.deadline-item .dl-client { font-size: 12px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   39. COMPLIANCE DASHBOARD — Gap analysis, clause sections
   -------------------------------------------------------------------------- */
.compliance-summary-card { text-align: center; padding: 16px 12px; }
.compliance-summary-card .cs-value { font-size: 28px; font-weight: 700; }
.compliance-summary-card .cs-label { font-size: 13px; color: var(--text-muted); }
.compliance-summary-card .cs-sub { font-size: 12px; color: var(--text-secondary); }
.compliance-summary-card .cs-bar { height: 6px; background: #f1f5f9; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.compliance-summary-card .cs-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }

.compliance-section-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border-light); }
.compliance-section-row:last-child { border-bottom: none; }
.compliance-section-row .cs-section-name { width: 80px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.compliance-section-row .cs-section-bar { flex: 1; height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.compliance-section-row .cs-section-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.compliance-section-row .cs-section-pct { width: 70px; text-align: right; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.compliance-section-row .cs-section-count { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* ==========================================================================
   END iLayerCert v3 Design System
   ========================================================================== */

/* FORCE: Collapsed sidebar icon visibility */
body.sidebar-collapsed .sidebar-wrapper .nav .nav-item .nav-link i {
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-flex !important;
  color: #94a3b8 !important;
}
body.sidebar-collapsed .sidebar-wrapper .nav .nav-item .nav-link:hover i {
  color: #fff !important;
}
body.sidebar-collapsed .sidebar-wrapper .nav .nav-item .nav-link.active i {
  color: #1a73e8 !important;
}

/* Datepicker (bootstrap-material-datetimepicker): setas de navegação mês/ano.
   O plugin renderiza <i class="material-icons">chevron_left/right</i>, mas a fonte
   Material Icons não está carregada na app — substituímos por setas Unicode. */
.dtp-select-month-before .material-icons,
.dtp-select-month-after .material-icons,
.dtp-select-year-before .material-icons,
.dtp-select-year-after .material-icons {
  font-size: 0;
}
.dtp-select-month-before .material-icons::before,
.dtp-select-year-before .material-icons::before {
  content: "\2039";
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  font-family: Arial, sans-serif;
}
.dtp-select-month-after .material-icons::before,
.dtp-select-year-after .material-icons::before {
  content: "\203A";
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  font-family: Arial, sans-serif;
}

/* ==========================================================================
   Acessibilidade (WCAG 2.1 AA) — #8
   ========================================================================== */

/* Foco visível em todos os elementos interativos (teclado) */
:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px !important;
}

/* Skip link — saltar para o conteúdo principal */
.skip-link {
  position: absolute;
  top: -48px;
  left: 0;
  z-index: 9999;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  color: #fff;
  text-decoration: none;
}

/* Respeitar prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Área de toque mínima para alvos em tablet/mobile (WCAG 2.5.8 / 2.5.5) */
@media (max-width: 1024px), (pointer: coarse) {
  .nav-link,
  .btn,
  .btn-sm,
  .dropdown-item,
  .nav-item > a,
  .pagination .page-link {
    min-height: 44px;
  }
  .btn-circle,
  .btn-icon,
  .icon-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }
}
