/* 5.12 View Transitions API — smooth page navigation */
@view-transition { navigation: auto; }

/* ============================================
   DESIGN TOKENS — Obras Pro SaaS
   ============================================ */

:root {
  /* Primary brand — #003366 scale */
  --brand-50: #e6f0fa;
  --brand-100: #cce0f5;
  --brand-200: #99c1eb;
  --brand-300: #66a2e1;
  --brand-400: #3383d7;
  --brand-500: #003366;
  --brand-600: #002e5c;
  --brand-700: #002852;
  --brand-800: #002248;
  --brand-900: #001633;

  /* Neutral scale */
  --neutral-50: #f8f9fa;
  --neutral-100: #f1f3f5;
  --neutral-200: #e9ecef;
  --neutral-300: #dee2e6;
  --neutral-400: #ced4da;
  --neutral-500: #adb5bd;
  --neutral-600: #868e96;
  --neutral-700: #495057;
  --neutral-800: #343a40;
  --neutral-900: #212529;

  /* Semantic colors */
  --success-50: #d1e7dd;
  --success-400: #21a75e;
  --success-500: #198754;
  --success-700: #0f5132;
  --warning-50: #fff3cd;
  --warning-400: #ffca2a;
  --warning-500: #ffc107;
  --warning-700: #664d03;
  --danger-50: #f8d7da;
  --danger-400: #e44d5b;
  --danger-500: #dc3545;
  --danger-700: #842529;
  --info-50: #cff4fc;
  --info-400: #25d5f8;
  --info-500: #0dcaf0;
  --info-700: #055160;

  /* Surface tokens */
  --surface-base: #ffffff;
  --surface-raised: #ffffff;
  --surface-overlay: #ffffff;
  --surface-backdrop: rgba(0, 0, 0, 0.5);

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Z-index scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* Sidebar */
  --sb-width: 280px;
  --sb-collapsed-width: 72px;
}

/* ============================================
   5.10 DARK MODE
   ============================================ */

[data-theme="dark"] {
  --brand-50: #1a2744;
  --brand-100: #1e3352;
  --brand-200: #244268;
  --brand-300: #2a517e;
  --brand-400: #306094;
  --brand-500: #4a8bc7;
  --brand-600: #6aa3d9;
  --brand-700: #8abbeb;
  --brand-800: #aad3fd;
  --brand-900: #cce6ff;
  --neutral-50: #0f172a;
  --neutral-100: #16213e;
  --neutral-200: #1e2a4a;
  --neutral-300: #2a3655;
  --neutral-400: #3d4f6f;
  --neutral-500: #6b7c99;
  --neutral-600: #9ba8be;
  --neutral-700: #c5cdd9;
  --neutral-800: #e2e8f0;
  --neutral-900: #f1f5f9;
  --surface-base: #0f172a;
  --surface-raised: #1e293b;
  --surface-overlay: #334155;
  --success-50: #0a2e1a;
  --success-400: #5ee890;
  --success-500: #4ade80;
  --success-700: #86efac;
  --warning-50: #2e2506;
  --warning-400: #fcc94d;
  --warning-500: #fbbf24;
  --warning-700: #fde68a;
  --danger-50: #2e0a0e;
  --danger-400: #fa8585;
  --danger-500: #f87171;
  --danger-700: #fca5a5;
  --info-50: #082a33;
  --info-400: #4ddcf0;
  --info-500: #22d3ee;
  --info-700: #67e8f9;
}

[data-theme="dark"] body {
  background-color: var(--neutral-50);
  color: var(--neutral-900);
}

/* Bootstrap utility overrides */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .card-header.bg-white,
[data-theme="dark"] .modal-header.bg-white,
[data-theme="dark"] .modal-footer.bg-white {
  background: var(--surface-raised) !important;
}

[data-theme="dark"] .bg-light,
[data-theme="dark"] thead.bg-light,
[data-theme="dark"] .table thead.bg-light th {
  background: var(--neutral-200) !important;
}

[data-theme="dark"] .bg-dark.text-white {
  background: var(--surface-raised) !important;
  color: var(--neutral-900) !important;
}

[data-theme="dark"] .text-dark {
  color: var(--neutral-800) !important;
}

[data-theme="dark"] .text-muted {
  color: var(--neutral-400) !important;
}

[data-theme="dark"] .text-secondary {
  color: var(--neutral-500) !important;
}

[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-top,
[data-theme="dark"] hr {
  border-color: var(--neutral-300) !important;
}

[data-theme="dark"] .border-secondary {
  border-color: var(--neutral-400) !important;
}

[data-theme="dark"] .badge.bg-secondary {
  background: var(--neutral-500) !important;
  color: #fff;
}

[data-theme="dark"] .badge.bg-info {
  background: var(--info-500) !important;
  color: #fff;
}

[data-theme="dark"] .badge.bg-success {
  background: var(--success-500) !important;
}

[data-theme="dark"] .badge.bg-danger {
  background: var(--danger-500) !important;
}

[data-theme="dark"] .badge.bg-warning {
  background: var(--warning-500) !important;
  color: #000 !important;
}

[data-theme="dark"] .btn-outline-secondary {
  color: var(--neutral-300);
  border-color: var(--neutral-500);
}

[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: var(--neutral-600);
  border-color: var(--neutral-400);
  color: var(--neutral-100);
}

[data-theme="dark"] .btn-outline-primary {
  color: var(--brand-500);
  border-color: var(--brand-500);
}

[data-theme="dark"] .btn-outline-primary:hover {
  background: var(--brand-500);
  color: #fff;
}

[data-theme="dark"] .btn-outline-danger {
  color: var(--danger-500);
  border-color: var(--danger-500);
}

[data-theme="dark"] .btn-outline-danger:hover {
  background: var(--danger-500);
  color: #fff;
}

[data-theme="dark"] canvas {
  background: var(--surface-raised);
  border-radius: var(--radius-md);
}

/* Semantic component overrides */
[data-theme="dark"] .card {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
}

[data-theme="dark"] .card-header {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
}

[data-theme="dark"] .card-footer {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
}

[data-theme="dark"] .modal-content {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  border-color: var(--neutral-300);
}

[data-theme="dark"] .modal-backdrop.show {
  opacity: 0.7;
}

[data-theme="dark"] .offcanvas {
  background: var(--surface-base);
}

[data-theme="dark"] .dropdown-menu {
  background: var(--surface-overlay);
  border-color: var(--neutral-300);
}

[data-theme="dark"] .dropdown-item {
  color: var(--neutral-800);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background: var(--brand-100);
  color: var(--brand-700);
}

[data-theme="dark"] .dropdown-header {
  color: var(--neutral-500);
}

[data-theme="dark"] .dropdown-divider {
  border-color: var(--neutral-300);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
  color: var(--neutral-900);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(74, 139, 199, 0.2);
}

[data-theme="dark"] .form-control::placeholder {
  color: var(--neutral-500);
}

[data-theme="dark"] .form-floating > label {
  color: var(--neutral-500);
}

[data-theme="dark"] .input-group-text {
  background: var(--neutral-200);
  border-color: var(--neutral-300);
  color: var(--neutral-600);
}

[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--neutral-900);
  color: var(--neutral-900);
}

[data-theme="dark"] table {
  color: var(--neutral-900);
}

[data-theme="dark"] .table-sm {
  color: var(--neutral-900);
}

[data-theme="dark"] .table-sm thead th {
  background-color: var(--neutral-200);
  border-color: var(--neutral-300);
  color: var(--neutral-700);
}

[data-theme="dark"] .table-sm tbody td {
  border-color: var(--neutral-300);
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: rgba(255, 255, 255, 0.03);
  color: var(--neutral-900);
}

[data-theme="dark"] .table thead th {
  background-color: var(--neutral-200);
  border-color: var(--neutral-300);
  color: var(--neutral-700);
}

[data-theme="dark"] .table-light,
[data-theme="dark"] thead.table-light,
[data-theme="dark"] .table > thead.table-light > tr > th,
[data-theme="dark"] table > thead.table-light > tr > th {
  --bs-table-bg: var(--neutral-200) !important;
  --bs-table-color: var(--neutral-700) !important;
  background-color: var(--neutral-200) !important;
  color: var(--neutral-700) !important;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .table tbody td {
  border-color: var(--neutral-300);
}

[data-theme="dark"] .table-hover tbody tr:hover {
  background-color: var(--neutral-200);
}

[data-theme="dark"] .list-group-item {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
  color: var(--neutral-900);
}

[data-theme="dark"] .navbar-main {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--neutral-300);
}

[data-theme="dark"] .sidebar-menu {
  background: var(--neutral-900);
}

[data-theme="dark"] .sidebar-nav-link {
  color: var(--neutral-500);
}

[data-theme="dark"] .sidebar-nav-link:hover {
  color: var(--neutral-900);
}

[data-theme="dark"] .sidebar-nav-link.active {
  background: rgba(74, 139, 199, 0.2);
  color: var(--brand-500);
}

[data-theme="dark"] .sidebar-divider {
  border-color: var(--neutral-300);
}

[data-theme="dark"] .sidebar-section-label {
  color: var(--neutral-500);
}

[data-theme="dark"] .toast-custom {
  background: var(--surface-overlay);
}

[data-theme="dark"] .toast-custom .toast-header {
  background: var(--surface-overlay);
  border-color: var(--neutral-300);
}

[data-theme="dark"] .toast-body {
  color: var(--neutral-900);
}

[data-theme="dark"] .alert-success { background-color: var(--success-50); color: var(--success-700); border-color: var(--success-50); }
[data-theme="dark"] .alert-danger { background-color: var(--danger-50); color: var(--danger-700); border-color: var(--danger-50); }
[data-theme="dark"] .alert-warning { background-color: var(--warning-50); color: var(--warning-700); border-color: var(--warning-50); }
[data-theme="dark"] .alert-info { background-color: var(--info-50); color: var(--info-700); border-color: var(--info-50); }

[data-theme="dark"] .progress {
  background: var(--neutral-200);
}

[data-theme="dark"] .empty-state-icon {
  background: var(--neutral-200);
}

[data-theme="dark"] .accordion-custom .accordion-item {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
}

[data-theme="dark"] .accordion-custom .accordion-button {
  background: var(--surface-raised);
  color: var(--neutral-900);
}

[data-theme="dark"] .accordion-custom .accordion-button:not(.collapsed) {
  background: var(--brand-100);
  color: var(--brand-600);
}

[data-theme="dark"] .tabs-custom {
  border-color: var(--neutral-300);
}

[data-theme="dark"] .tabs-custom .nav-link {
  color: var(--neutral-500);
}

[data-theme="dark"] .tabs-custom .nav-link:hover {
  color: var(--brand-600);
}

[data-theme="dark"] .tabs-custom .nav-link.active {
  color: var(--brand-500);
  border-color: var(--brand-500);
}

[data-theme="dark"] .pagination-custom .page-link {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
  color: var(--neutral-800);
}

[data-theme="dark"] .pagination-custom .page-item.active .page-link {
  background: var(--brand-500);
  border-color: var(--brand-500);
}

[data-theme="dark"] .pagination-custom .page-item.disabled .page-link {
  background: var(--neutral-200);
  color: var(--neutral-500);
}

[data-theme="dark"] .page-header {
  border-color: var(--neutral-300);
}

[data-theme="dark"] .footer {
  background: var(--surface-base) !important;
  border-color: var(--neutral-300) !important;
}

[data-theme="dark"] .breadcrumb-item {
  color: var(--neutral-500);
}

[data-theme="dark"] .breadcrumb-item.active {
  color: var(--neutral-700);
}

[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
  color: var(--neutral-500);
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, var(--neutral-200) 25%, var(--neutral-100) 50%, var(--neutral-200) 75%);
}

[data-theme="dark"] .search-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7c99' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .table-toolbar {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
}

[data-theme="dark"] .hero-section .page-title {
  color: var(--brand-300) !important;
}

[data-theme="dark"] .page-title {
  color: var(--brand-300) !important;
}

[data-theme="dark"] .hero-section .page-subtitle {
  color: var(--neutral-400) !important;
}

[data-theme="dark"] .page-subtitle {
  color: var(--neutral-400) !important;
}

[data-theme="dark"] .btn-brand {
  background-color: var(--brand-400);
  border-color: var(--brand-400);
}
[data-theme="dark"] .btn-brand:hover {
  background-color: var(--brand-300);
  border-color: var(--brand-300);
}

[data-theme="dark"] .stat-card .text-brand {
  color: var(--brand-500) !important;
}

[data-theme="dark"] .avatar {
  color: var(--neutral-900);
}

[data-theme="dark"] .hover-lift:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(-2px);
}

[data-theme="dark"] .btn-group .btn-outline-secondary {
  border-color: var(--neutral-400);
}

[data-theme="dark"] .btn-group .btn-outline-secondary.active {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
}

[data-theme="dark"] .btn-outline-brand {
  color: var(--brand-500);
  border-color: var(--brand-500);
}

[data-theme="dark"] .btn-outline-brand:hover {
  background: var(--brand-500);
  color: #fff;
}

[data-theme="dark"] .bg-brand {
  background-color: var(--brand-400) !important;
}

[data-theme="dark"] .text-brand {
  color: var(--brand-400) !important;
}

[data-theme="dark"] .badge-soft-danger {
  background-color: var(--danger-50);
  color: var(--danger-500);
}

[data-theme="dark"] .badge-soft-success {
  background-color: var(--success-50);
  color: var(--success-500);
}

[data-theme="dark"] .badge-soft-warning {
  background-color: var(--warning-50);
  color: var(--warning-500);
}

[data-theme="dark"] .delta-positive {
  background-color: var(--success-50);
  color: var(--success-500);
}

[data-theme="dark"] .delta-negative {
  background-color: var(--danger-50);
  color: var(--danger-500);
}

/* Focus visible */
[data-theme="dark"] :focus-visible {
  outline-color: var(--brand-500);
}

[data-theme="dark"] .sidebar-nav-link:focus-visible {
  outline-color: var(--brand-500);
}

[data-theme="dark"] #sidebarMenu {
  background: var(--surface-base) !important;
}

[data-theme="dark"] .dropdown-item:focus-visible {
  outline-color: var(--brand-400);
}

/* ===== ITEM 13: Dark Mode QA — faltantes ===== */

/* P0: Solid buttons */
[data-theme="dark"] .btn-primary {
  background-color: var(--brand-500);
  border-color: var(--brand-500);
}
[data-theme="dark"] .btn-primary:hover {
  background-color: var(--brand-400);
  border-color: var(--brand-400);
}
[data-theme="dark"] .btn-success {
  background-color: var(--success-500);
  border-color: var(--success-500);
}
[data-theme="dark"] .btn-success:hover {
  background-color: var(--success-400);
  border-color: var(--success-400);
}
[data-theme="dark"] .btn-danger {
  background-color: var(--danger-500);
  border-color: var(--danger-500);
}
[data-theme="dark"] .btn-danger:hover {
  background-color: var(--danger-400);
  border-color: var(--danger-400);
}
[data-theme="dark"] .btn-warning {
  background-color: var(--warning-500);
  border-color: var(--warning-500);
  color: #212529;
}
[data-theme="dark"] .btn-warning:hover {
  background-color: var(--warning-400);
  border-color: var(--warning-400);
  color: #212529;
}
[data-theme="dark"] .btn-info {
  background-color: var(--info-500);
  border-color: var(--info-500);
  color: #212529;
}
[data-theme="dark"] .btn-info:hover {
  background-color: var(--info-400);
  border-color: var(--info-400);
  color: #212529;
}

/* P0: btn-close — invert for dark backgrounds */
[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* P1: Standard toast (flash messages) */
[data-theme="dark"] .toast {
  background-color: var(--surface-raised);
  border-color: var(--neutral-300);
}
[data-theme="dark"] .toast-header {
  background-color: var(--surface-base);
  color: var(--neutral-700);
  border-bottom-color: var(--neutral-200);
}
[data-theme="dark"] .toast-body {
  color: var(--neutral-800);
}

/* P1: Nav links — standard Bootstrap */
[data-theme="dark"] .nav-link {
  color: var(--neutral-600);
}
[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link:focus {
  color: var(--neutral-800);
}
[data-theme="dark"] .nav-tabs .nav-link {
  border-color: transparent;
}
[data-theme="dark"] .nav-tabs .nav-link:hover {
  border-color: var(--neutral-200);
}
[data-theme="dark"] .nav-tabs .nav-link.active {
  color: var(--brand-500);
  background-color: var(--surface-base);
  border-color: var(--neutral-200);
  border-bottom-color: transparent;
}

/* P2: Popover */
[data-theme="dark"] .popover {
  background-color: var(--surface-raised);
  border-color: var(--neutral-300);
}
[data-theme="dark"] .popover-header {
  background-color: var(--surface-base);
  color: var(--neutral-900);
  border-bottom-color: var(--neutral-200);
}
[data-theme="dark"] .popover-body {
  color: var(--neutral-700);
}
[data-theme="dark"] .bs-popover-top .popover-arrow::after,
[data-theme="dark"] .bs-popover-auto[data-popper-placement^=top] .popover-arrow::after {
  border-top-color: var(--surface-raised);
}

/* P2: Tooltip — override light bg in dark mode */
[data-theme="dark"] .tooltip-inner {
  background-color: var(--neutral-200);
}
[data-theme="dark"] .bs-tooltip-top .tooltip-arrow::before,
[data-theme="dark"] .bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
  border-top-color: var(--neutral-200);
}
[data-theme="dark"] .bs-tooltip-bottom .tooltip-arrow::before,
[data-theme="dark"] .bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
  border-bottom-color: var(--neutral-200);
}
[data-theme="dark"] .bs-tooltip-start .tooltip-arrow::before,
[data-theme="dark"] .bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before {
  border-left-color: var(--neutral-200);
}
[data-theme="dark"] .bs-tooltip-end .tooltip-arrow::before,
[data-theme="dark"] .bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before {
  border-right-color: var(--neutral-200);
}

/* P2: Progress bar */
[data-theme="dark"] .progress-bar {
  background-color: var(--brand-500);
}

/* P2: Table dark */
[data-theme="dark"] .table-dark {
  --bs-table-bg: var(--neutral-900);
  --bs-table-color: var(--neutral-100);
  --bs-table-border-color: var(--neutral-700);
}

/* P3: Spinner */
[data-theme="dark"] .spinner-border {
  color: var(--neutral-500);
}

/* P3: Scrollbar dark */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--neutral-100);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--neutral-400);
  border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-500);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  [data-theme="dark"] {
    --neutral-200: #2a3050;
    --neutral-300: #3a4060;
    --neutral-500: #8a98b0;
    --neutral-600: #aab8d0;
  }
}


/* ============================================
   5.1 TIPOGRAFIA — Inter font
   ============================================ */

body {
  background-color: var(--neutral-50);
  color: var(--neutral-900);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography scale */
h1, .h1 { font-size: 1.875rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; }
h2, .h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
h3, .h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
h4, .h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
h5, .h5 { font-size: 1rem; font-weight: 600; line-height: 1.4; }
h6, .h6 { font-size: 0.875rem; font-weight: 600; line-height: 1.45; }

small, .small { font-size: 0.8125rem; font-weight: 400; }
.text-muted { color: var(--neutral-600) !important; }

/* ============================================
   DS — Section & Headline
   ============================================ */
section { padding: 4rem 0; }

.section-headline {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  color: var(--neutral-900);
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--neutral-600);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.hero-headline {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--neutral-900);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--neutral-600);
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-meta {
  font-size: 0.875rem;
  color: var(--neutral-500);
  margin-top: 1rem;
}
.hero-meta i { margin-right: 0.25rem; }

[data-theme="dark"] .hero-headline { color: var(--neutral-900); }
[data-theme="dark"] .hero-subtitle { color: var(--neutral-600); }

/* ============================================
   5.3 NAVBAR — Glassmorphism
   ============================================ */

.navbar-main {
  background: rgba(0, 51, 102, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-sm);
}

.navbar-main .navbar-brand {
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ============================================
   5.3 SIDEBAR — Premium
   ============================================ */

.sidebar-menu {
  background: var(--neutral-900);
}

.sidebar-heading {
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-heading h5 {
  color: #fff;
  letter-spacing: 0.05em;
}

.sidebar-section-label {
  color: var(--neutral-500);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-md) var(--space-md) var(--space-xs);
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  margin: 0.125rem 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav-link.text-danger:hover {
  background: rgba(220, 53, 69, 0.15);
}

.sidebar-nav-link i {
  width: 1.25rem;
  margin-right: 0.75rem;
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.8;
}

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

.sidebar-nav-link.active {
  color: #fff;
  background: rgba(0, 51, 102, 0.8);
  font-weight: 600;
}

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

.sidebar-nav-link.active i {
  opacity: 1;
  color: var(--brand-200);
}

.sidebar-divider {
  border-color: rgba(255, 255, 255, 0.08);
  margin: var(--space-sm) var(--space-md);
  opacity: 1;
}

/* ============================================
   5.9 AVATAR COMPONENT
   ============================================ */

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.25rem; }

.avatar-success { background: linear-gradient(135deg, var(--success-500), #146c43); }
.avatar-warning { background: linear-gradient(135deg, var(--warning-500), #e0a800); color: var(--neutral-900); }
.avatar-danger { background: linear-gradient(135deg, var(--danger-500), #b02a37); }
.avatar-info { background: linear-gradient(135deg, var(--info-500), #0aa2c0); }

/* ============================================
   5.9 BADGE / TAG SYSTEM
   ============================================ */

.badge {
  font-weight: 500;
  padding: 0.35em 0.75em;
  border-radius: var(--radius-sm);
  letter-spacing: 0.01em;
}

.badge-soft {
  background-color: transparent;
  padding: 0.3em 0.65em;
}

.badge-soft-success { background-color: var(--success-50); color: var(--success-700); }
.badge-soft-warning { background-color: var(--warning-50); color: var(--warning-700); }
.badge-soft-danger { background-color: var(--danger-50); color: var(--danger-700); }
.badge-soft-info { background-color: var(--info-50); color: var(--info-700); }
.badge-soft-primary { background-color: var(--brand-50); color: var(--brand-700); }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(74, 139, 199, 0.12);
  border: 1px solid rgba(74, 139, 199, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  color: var(--brand-500);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .hero-badge {
  background: rgba(74, 139, 199, 0.12);
  border-color: rgba(74, 139, 199, 0.2);
  color: var(--brand-500);
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.75rem;
  background: var(--surface-raised);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--neutral-700);
  transition: all var(--transition-base);
}

.tool-badge:hover {
  border-color: var(--brand-400);
  color: var(--brand-500);
  transform: translateY(-1px);
}

[data-theme="dark"] .tool-badge {
  background: var(--neutral-200);
  border-color: var(--neutral-300);
  color: var(--neutral-600);
}

[data-theme="dark"] .tool-badge:hover {
  border-color: var(--brand-500);
  color: var(--brand-500);
}

.badge-status-em-andamento { background-color: var(--brand-50); color: var(--brand-600); }
.badge-status-atrasada { background-color: var(--danger-50); color: var(--danger-700); }
.badge-status-concluida { background-color: var(--success-50); color: var(--success-700); }

/* ============================================
   5.6 FORMULÁRIOS POLIDOS
   ============================================ */

.form-control,
.form-select {
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background-color: var(--surface-base);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.12);
}

.form-control.is-invalid { border-color: var(--danger-500); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15); }
.form-control.is-valid { border-color: var(--success-500); }
.form-control.is-valid:focus { box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15); }

.form-label {
  font-weight: 500;
  color: var(--neutral-700);
  margin-bottom: var(--space-xs);
  font-size: 0.875rem;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--neutral-500);
  margin-top: 0.25rem;
}

/* Inline validation icons */
.was-validated .form-control:valid ~ .validation-icon,
.was-validated .form-control:invalid ~ .validation-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Character counter */
.char-counter {
  font-size: 0.75rem;
  color: var(--neutral-500);
  text-align: right;
  margin-top: 0.25rem;
}

.char-counter.limit-near { color: var(--warning-500); }
.char-counter.limit-exceeded { color: var(--danger-500); font-weight: 600; }

/* Floating labels */
.form-floating > .form-control {
  border-radius: var(--radius-md);
}

.form-floating > label {
  color: var(--neutral-500);
  border-radius: var(--radius-md);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--brand-500);
}

/* Input groups */
.input-group-text {
  background-color: var(--neutral-50);
  border-color: var(--neutral-300);
  color: var(--neutral-600);
  border-radius: var(--radius-md);
}

.input-group > .form-control {
  border-radius: var(--radius-md);
}

/* Search input */
.search-input {
  border-radius: var(--radius-full);
  padding-left: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23868e96' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.875rem center;
  background-size: 1rem;
}

/* Checkbox / Radio */
.form-check-input:checked {
  background-color: var(--brand-500);
  border-color: var(--brand-500);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.15);
}

/* ============================================
   5.9 BREADCRUMBS
   ============================================ */

.breadcrumb-custom {
  background: transparent;
  padding: 0;
  margin-bottom: var(--space-sm);
}

.breadcrumb-custom .breadcrumb-item a {
  color: var(--neutral-600);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.breadcrumb-custom .breadcrumb-item a:hover {
  color: var(--brand-500);
}

.breadcrumb-custom .breadcrumb-item.active {
  color: var(--neutral-800);
  font-weight: 500;
  font-size: 0.8125rem;
}

.breadcrumb-custom .breadcrumb-item + .breadcrumb-item::before {
  color: var(--neutral-400);
  content: var(--bs-breadcrumb-divider, "/");
}

/* ============================================
   5.9 TABS COMPONENT
   ============================================ */

.tabs-custom {
  border-bottom: 2px solid var(--neutral-200);
  margin-bottom: var(--space-lg);
}

.tabs-custom .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--neutral-600);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.tabs-custom .nav-link:hover {
  color: var(--brand-500);
  border-bottom-color: var(--brand-200);
}

.tabs-custom .nav-link.active {
  color: var(--brand-500);
  border-bottom-color: var(--brand-500);
  background: transparent;
  font-weight: 600;
}

/* ============================================
   5.9 ACCORDION
   ============================================ */

.accordion-custom .accordion-item {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.accordion-custom .accordion-button {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--neutral-800);
  background: var(--surface-base);
  padding: var(--space-sm) var(--space-md);
}

.accordion-custom .accordion-button:not(.collapsed) {
  background: var(--brand-50);
  color: var(--brand-600);
  box-shadow: none;
}

.accordion-custom .accordion-button:focus {
  box-shadow: none;
  border-color: var(--brand-200);
}

/* ============================================
   5.9 TOOLTIPS
   ============================================ */

.tooltip-inner {
  background-color: var(--neutral-800);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.bs-tooltip-top .tooltip-arrow::before { border-top-color: var(--neutral-800); }
.bs-tooltip-bottom .tooltip-arrow::before { border-bottom-color: var(--neutral-800); }
.bs-tooltip-start .tooltip-arrow::before { border-left-color: var(--neutral-800); }
.bs-tooltip-end .tooltip-arrow::before { border-right-color: var(--neutral-800); }

/* ============================================
   5.9 EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--neutral-500);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon i {
  font-size: 1.75rem;
  color: var(--neutral-400);
}

.empty-state h5 {
  color: var(--neutral-700);
  margin-bottom: var(--space-xs);
}

.empty-state p {
  font-size: 0.875rem;
  max-width: 320px;
  margin: 0 auto var(--space-md);
}

/* ============================================
   5.9 CONFIRMATION DIALOG
   ============================================ */

.confirm-dialog .modal-content {
  border: none;
  border-radius: var(--radius-lg);
}

.confirm-dialog .modal-header {
  border-bottom: none;
  padding: var(--space-lg) var(--space-lg) 0;
}

.confirm-dialog .modal-body {
  padding: var(--space-md) var(--space-lg);
}

.confirm-dialog .modal-footer {
  border-top: none;
  padding: 0 var(--space-lg) var(--space-lg);
}

/* ============================================
   CARDS
   ============================================ */

.card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-slow);
  border: 1px solid var(--neutral-200);
  background: var(--surface-raised);
  position: relative;
}

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

.card-header {
  border-bottom: 1px solid var(--neutral-200);
  background: var(--surface-base);
  font-weight: 600;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-gradient {
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--surface-base) 100%);
  border: none;
}

/* Stat cards */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.stat-primary::before { background: linear-gradient(180deg, var(--brand-500) 0%, var(--brand-300) 100%); }
.stat-card.stat-success::before { background: linear-gradient(180deg, var(--success-500) 0%, #75b798 100%); }
.stat-card.stat-warning::before { background: linear-gradient(180deg, var(--warning-500) 0%, #ffda6a 100%); }
.stat-card.stat-danger::before { background: linear-gradient(180deg, var(--danger-500) 0%, #e4606d 100%); }
.stat-card.stat-info::before { background: linear-gradient(180deg, var(--info-500, #0d6efd) 0%, #6ea8fe 100%); }

/* ============================================
   TABLES
   ============================================ */

.table {
  --bs-table-hover-bg: rgba(0, 51, 102, 0.04);
  margin-bottom: 0;
}

.table thead th {
  background-color: var(--neutral-50);
  border-bottom: 2px solid var(--neutral-200);
  color: var(--neutral-700);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-color: var(--neutral-200);
}

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

.table-hover tbody tr:hover {
  cursor: pointer;
  background-color: var(--neutral-50);
}

.table > tbody > tr.clickable-row:hover {
  background-color: var(--brand-50);
}

.table.table-compact tbody td {
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn:active { transform: scale(0.98); }

.btn-lg-custom {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-primary {
  background-color: var(--brand-500);
  border-color: var(--brand-500);
}

.btn-primary:hover {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary {
  border-color: var(--brand-500);
  color: var(--brand-500);
}

.btn-outline-primary:hover {
  background-color: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}

.btn-action {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

/* ============================================
   5.12 PERFORMANCE
   ============================================ */

/* Font display swap */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900') format('woff2');
}

/* Reduce repaints */
.card,
.btn,
.nav-link,
.form-control,
.dropdown-menu {
  will-change: auto;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

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

.card,
.alert,
.stat-card {
  animation: fadeIn 0.3s ease-out;
}

.row.g-4 > *:nth-child(1) { animation-delay: 0ms; }
.row.g-4 > *:nth-child(2) { animation-delay: 50ms; }
.row.g-4 > *:nth-child(3) { animation-delay: 100ms; }
.row.g-4 > *:nth-child(4) { animation-delay: 150ms; }

.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-slide-up { animation: fadeInUp 0.4s ease-out forwards; }
.animate-fade-in-delay-1 { animation: fadeIn 0.4s ease-out 0.1s forwards; opacity: 0; }
.animate-fade-in-delay-2 { animation: fadeIn 0.4s ease-out 0.2s forwards; opacity: 0; }
.animate-fade-in-delay-3 { animation: fadeIn 0.4s ease-out 0.3s forwards; opacity: 0; }

.hover-lift {
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.skeleton {
  background: linear-gradient(90deg, var(--neutral-200) 25%, var(--neutral-100) 50%, var(--neutral-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-top: -0.5rem;
  margin-left: -0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}

/* ============================================
   DROPDOWNS
   ============================================ */

.dropdown-menu {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--neutral-200);
  z-index: 1050;
}

.dropdown-item {
  transition: background-color var(--transition-fast);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.dropdown-item:hover {
  background-color: var(--brand-50);
  color: var(--brand-600);
}

/* ============================================
   MODALS
   ============================================ */

.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  border-bottom: 1px solid var(--neutral-200);
}

.modal-footer {
  border-top: 1px solid var(--neutral-200);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.alert-success { background-color: var(--success-50); color: var(--success-700); }
.alert-danger { background-color: var(--danger-50); color: var(--danger-700); }
.alert-warning { background-color: var(--warning-50); color: var(--warning-700); }
.alert-info { background-color: var(--info-50); color: var(--info-700); }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-custom {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.toast-custom .toast-header {
  border-bottom: 1px solid var(--neutral-200);
  background: var(--surface-base);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
  border-bottom: 1px solid var(--neutral-200);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}

.page-header .page-title {
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: 0.125rem;
}

.page-header .page-subtitle {
  color: var(--neutral-500);
  font-size: 0.875rem;
}

.page-title {
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: 0.125rem;
}
.page-subtitle {
  color: var(--neutral-500);
  font-size: 0.875rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 575.98px) {
  .form-control,
  .form-select,
  .btn {
    width: 100%;
  }

  .container-fluid.p-4 {
    padding: var(--space-md) !important;
  }

  .table {
    font-size: 0.875rem;
  }

  .table th,
  .table td {
    padding: 0.5rem;
  }

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

  .btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .btn-group .btn {
    width: 100%;
  }

  h1, .h1 { font-size: 1.5rem; }
  h2, .h2 { font-size: 1.25rem; }
  h3, .h3 { font-size: 1.125rem; }
}

/* ============================================
   SMOOTH PAGE TRANSITIONS (5.8)
   ============================================ */

body {
  animation: pageFadeIn 0.3s ease-in-out;
}

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

.card {
  animation: cardFadeIn 0.4s ease-out both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }

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

/* ============================================
   ACCESSIBILITY
   ============================================ */

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-500);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* 5.11 Keyboard navigation - sidebar */
.sidebar-nav-link:focus-visible {
  outline: 2px solid var(--brand-400);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* 5.11 WCAG AA contrast improvements */
.text-muted {
  color: var(--neutral-600) !important;
}

.badge.bg-secondary {
  background-color: var(--neutral-600) !important;
  color: #fff;
}

.btn-outline-secondary {
  color: var(--neutral-700);
  border-color: var(--neutral-400);
}

.btn-outline-secondary:hover {
  background-color: var(--neutral-200);
  border-color: var(--neutral-500);
  color: var(--neutral-900);
}

/* 5.11 Keyboard nav for dropdowns */
.dropdown-item:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* 5.11 High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --neutral-200: #d1d5db;
    --neutral-300: #9ca3af;
    --neutral-500: #4b5563;
    --neutral-600: #374151;
  }

  .btn-outline-secondary {
    border-width: 2px;
  }

  :focus-visible {
    outline-width: 3px;
  }
}

/* ============================================
   TABLE TOOLBAR (5.9)
   ============================================ */

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--surface-base);
  border-bottom: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.table-toolbar .table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Pagination styled */
.pagination-custom .page-link {
  border: 1px solid var(--neutral-300);
  color: var(--neutral-700);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.pagination-custom .page-item.active .page-link {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}

.pagination-custom .page-link:hover {
  background: var(--brand-50);
  border-color: var(--brand-300);
  color: var(--brand-600);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-brand { color: var(--brand-500) !important; }
.bg-brand { background-color: var(--brand-500) !important; }
.bg-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .bg-glass {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--neutral-300);
}

.border-custom { border-color: rgba(0, 51, 102, 0.1) !important; }
.shadow-sm-custom { box-shadow: var(--shadow-sm) !important; }

.tracking-wider { letter-spacing: 0.05em; }
.tracking-tight { letter-spacing: -0.025em; }
.x-small { font-size: 0.6875rem; }
.check-icon {
  color: var(--success-500);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.conteudo-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.625rem 0;
  align-items: flex-start;
}
.conteudo-item::before {
  content: '\25B9';
  color: var(--brand-500);
  font-weight: 700;
  flex-shrink: 0;
}

.noite-label {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.noite-label-1 {
  background: rgba(74, 139, 199, 0.12);
  color: var(--brand-500);
}
.noite-label-2 {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success-500);
}

/* Bootstrap overrides */
.btn-primary {
  background-color: var(--brand-500) !important;
  border-color: var(--brand-500) !important;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
}
.btn-outline-primary {
  border-color: var(--brand-500) !important;
  color: var(--brand-500) !important;
}
.btn-outline-primary:hover {
  background-color: var(--brand-500) !important;
  border-color: var(--brand-500) !important;
  color: #fff !important;
}

.btn-outline-brand {
  border-color: var(--brand-300);
  color: var(--brand-600);
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
}
.btn-outline-brand:hover {
  background-color: var(--brand-50);
  border-color: var(--brand-400);
  color: var(--brand-700);
}

.btn-brand {
  background-color: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}
.btn-brand:hover {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}

/* ============================================
   5.7 DASHBOARD HERO + QUICK ACTIONS
   ============================================ */

.hero-section {
  animation: fadeIn 0.4s ease-out;
  padding-top: 6rem;
  padding-bottom: 4rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(74, 139, 199, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(100, 162, 225, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

@media (max-width: 768px) {
  .hero-section { padding-top: 5rem; padding-bottom: 3rem; }
  .hero-headline { font-size: 1.75rem; }
  .hero-subtitle { font-size: 1rem; }
}

.section-problema { background: var(--neutral-100); }
.section-solucao { background: var(--surface-base); }
.section-conteudo { background: var(--neutral-100); }
.section-ferramentas { background: var(--surface-base); }
.section-paraquem { background: var(--neutral-100); }

.quick-actions .btn {
  white-space: nowrap;
}

/* ============================================
   5.3 MINI-SIDEBAR
   ============================================ */

@media (min-width: 992px) and (max-width: 1199.98px) {
  #sidebarMenu {
    width: 72px !important;
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100% !important;
    z-index: var(--z-fixed);
    display: flex;
    flex-direction: column;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 3rem !important; /* Espaço extra no final para os últimos ícones */
  }

  /* Estilização da rolagem para o estado mini sidebar */
  #sidebarMenu .sidebar-heading h5 span,
  #sidebarMenu .sidebar-section-label,
  #sidebarMenu .sidebar-nav-link span:not(.bi),
  #sidebarMenu .sidebar-nav-link .bi + *,
  #sidebarMenu .sidebar-user-card .flex-grow-1,
  #sidebarMenu .sidebar-user-card .bi-three-dots {
    display: none !important;
  }

  #sidebarMenu .sidebar-nav-link {
    justify-content: center;
    min-height: 44px;
    padding: 0.5rem;
    margin: 0.125rem 0.25rem;
  }

  #sidebarMenu .sidebar-nav-link i {
    margin-right: 0;
    font-size: 1.25rem;
  }

  #sidebarMenu .sidebar-divider {
    margin: var(--space-sm) 0.25rem;
  }

  #sidebarMenu .sidebar-user-card {
    justify-content: center;
  }

  .main-wrapper {
    margin-left: 72px !important;
  }

  /* Show full text on hover */
  #sidebarMenu:hover {
    width: 280px !important;
    transition: width var(--transition-slow);
    overflow-y: auto !important;
    z-index: calc(var(--z-fixed) + 1);
  }

  #sidebarMenu:hover .sidebar-heading h5 span,
  #sidebarMenu:hover .sidebar-section-label,
  #sidebarMenu:hover .sidebar-nav-link span:not(.bi),
  #sidebarMenu:hover .sidebar-nav-link .bi + *,
  #sidebarMenu:hover .sidebar-user-card .flex-grow-1,
  #sidebarMenu:hover .sidebar-user-card .bi-three-dots {
    display: inline !important;
  }

  #sidebarMenu:hover .sidebar-nav-link {
    justify-content: flex-start;
    padding: 0.5rem 0.75rem;
    margin: 0.125rem 0.5rem;
  }

  #sidebarMenu:hover .sidebar-nav-link i {
    margin-right: 0.75rem;
    font-size: 1rem;
  }

  #sidebarMenu:hover .sidebar-user-card {
    justify-content: flex-start;
  }
}

.sparkline-container {
  position: relative;
}

.delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.01em;
}

.delta-positive {
  background-color: var(--success-50);
  color: var(--success-700);
}

.delta-negative {
  background-color: var(--danger-50);
  color: var(--danger-700);
}

/* ============================================
   5.5 TABLE ENHANCEMENTS
   ============================================ */

.sort-icon {
  display: inline-block;
  font-size: 0.75rem;
  transition: opacity var(--transition-fast);
}

th:hover .sort-icon {
  opacity: 0.6 !important;
}

[data-bulk-bar] {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
}

[data-theme="dark"] [data-bulk-bar] {
  background: var(--brand-100);
  border-color: var(--brand-300);
}

[data-bulk-bar] .btn {
  font-size: 0.8125rem;
  padding: 0.25rem 0.625rem;
}

.table tbody tr.table-active {
  background-color: var(--brand-50) !important;
}

[data-theme="dark"] .table tbody tr.table-active {
  background-color: var(--brand-100) !important;
}

/* ============================================
   5.7 ALERT WIDGET
   ============================================ */

.alert-widget {
  max-height: 320px;
  overflow-y: auto;
}

.alert-widget .alert-item {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--neutral-100);
  transition: background var(--transition-fast);
}

.alert-widget .alert-item:hover {
  background: var(--neutral-50);
}

.alert-widget .alert-item:last-child {
  border-bottom: none;
}

/* 5.12 View Transitions — smooth navigation */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: 200ms ease-out both fade-out;
}

::view-transition-new(root) {
  animation: 300ms ease-out both fade-in;
}

@keyframes fade-out {
  to { opacity: 0; }
}

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

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

/* 5.6 Command Palette (Ctrl+K) */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.command-palette-overlay.open {
  opacity: 1;
  visibility: visible;
}

.command-palette {
  width: 100%;
  max-width: 560px;
  background: var(--surface-primary, #fff);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transform: translateY(-20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.command-palette-overlay.open .command-palette {
  transform: translateY(0) scale(1);
}

[data-theme="dark"] .command-palette {
  background: var(--surface-primary, #1e293b);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.command-palette-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--neutral-200, #e9ecef);
}

[data-theme="dark"] .command-palette-header {
  border-bottom-color: var(--neutral-700, #334155);
}

.command-palette-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  background: transparent;
  color: inherit;
}

.command-palette-input::placeholder { color: var(--neutral-400, #adb5bd); }

.command-palette-hint {
  font-size: 0.625rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm, 4px);
  background: var(--neutral-100, #f1f3f5);
  color: var(--neutral-600, #868e96);
  border: 1px solid var(--neutral-200, #e9ecef);
}

.command-palette-body {
  max-height: 40vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.command-palette-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.command-palette-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  color: var(--neutral-800, #333);
  cursor: pointer;
  transition: background 0.15s;
}

.command-palette-item:hover,
.command-palette-item.highlighted {
  background: var(--brand-50, #e6f0fa);
}

[data-theme="dark"] .command-palette-item {
  color: var(--neutral-100, #f1f3f5);
}

[data-theme="dark"] .command-palette-item:hover,
[data-theme="dark"] .command-palette-item.highlighted {
  background: rgba(74, 139, 199, 0.15);
}

.command-palette-item-icon {
  width: 1.5rem;
  text-align: center;
  color: var(--brand-500, #003366);
}

[data-theme="dark"] .command-palette-item-icon {
  color: var(--brand-300, #66a2e1);
}

.command-palette-item-label { flex: 1; font-size: 0.875rem; }

.command-palette-item-label mark {
  background: rgba(0, 51, 102, 0.12);
  color: inherit;
  font-weight: 600;
  border-radius: 2px;
  padding: 0 1px;
}

[data-theme="dark"] .command-palette-item-label mark {
  background: rgba(74, 139, 199, 0.3);
}

/* ============================================
   PycodeBR DS — Card Custom
   ============================================ */
.card-custom {
  background: var(--surface-raised);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
}
.card-custom:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
[data-theme="dark"] .card-custom {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
}

/* ============================================
   PycodeBR DS — Stat Card (card_grid.html)
   ============================================ */
.stat-card-ds {
  background: var(--surface-raised);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition-base);
}
.stat-card-ds:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
[data-theme="dark"] .stat-card-ds {
  background: var(--surface-raised);
  border-color: var(--neutral-300);
}

/* ============================================
   PycodeBR DS — Icon Containers
   ============================================ */
.icon-container {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.icon-container-primary { background: var(--brand-50); color: var(--brand-500); }
.icon-container-success { background: var(--success-50); color: var(--success-500); }
.icon-container-warning { background: var(--warning-50); color: var(--warning-500); }
.icon-container-info    { background: var(--info-50); color: var(--info-500); }
.icon-container-danger  { background: var(--danger-50); color: var(--danger-500); }
[data-theme="dark"] .icon-container-primary { background: rgba(74,139,199,.15); color: var(--brand-500); }
[data-theme="dark"] .icon-container-success { background: rgba(74,222,128,.15); color: var(--success-500); }
[data-theme="dark"] .icon-container-warning { background: rgba(251,191,36,.15); color: var(--warning-500); }
[data-theme="dark"] .icon-container-info    { background: rgba(34,211,238,.15); color: var(--info-500); }
[data-theme="dark"] .icon-container-danger  { background: rgba(248,113,113,.15); color: var(--danger-500); }

/* ============================================
   PycodeBR DS — Utilities
   ============================================ */
.text-brand { color: var(--brand-500) !important; }
.bg-brand { background-color: var(--brand-500) !important; }
[data-theme="dark"] .text-brand { color: var(--brand-500) !important; }
[data-theme="dark"] .bg-brand { background-color: var(--brand-400) !important; }

.bg-glass {
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.08);
}

.hover-lift {
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.hover-lift:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

