/* ============================================
   GoImpex App - Clean & Modern CSS
   ============================================ */

/* Smooth theme transition for major elements */
body, main, .sidebar, .header, .card, .card-header, .card-body,
.table, .table th, .table td, thead, tbody,
.modal-content, .form-control, .form-select, input, select, textarea,
.nav-tabs, .nav-link, .badge, .btn, .alert, .list-group-item {
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, box-shadow 0.15s ease-out !important;
}

/* Ensure transitions work during theme switch */
[data-sidebar-theme] body, [data-sidebar-theme] main,
[data-sidebar-theme] .sidebar, [data-sidebar-theme] .header,
[data-sidebar-theme] .card, [data-sidebar-theme] .card-header, [data-sidebar-theme] .card-body,
[data-sidebar-theme] .table, [data-sidebar-theme] .table th, [data-sidebar-theme] .table td,
[data-sidebar-theme] thead, [data-sidebar-theme] tbody,
[data-sidebar-theme] .form-control, [data-sidebar-theme] .form-select,
[data-sidebar-theme] input, [data-sidebar-theme] select, [data-sidebar-theme] textarea {
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out !important;
}

/* ============================================
   1. CSS VARIABLES (Design System)
   ============================================ */
:root {
  /* Primary Colors - Professional Blue */
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;

  /* Status Colors */
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;

  /* Neutral Colors */
  --gray-100: #f8fafc;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --black: #000000;

  /* Table Colors (Light Mode) */
  --table-bg: #ffffff;
  --table-text: #212529;
  --table-border: #dee2e6;
  --table-striped-bg: rgba(0, 0, 0, 0.05);
  --table-hover-bg: rgba(0, 0, 0, 0.075);
  --table-head-bg: #f8f9fa;
  --table-head-text: #212529;

  /* Sidebar Colors - Default (Modern/Mint) */
  --sidebar-bg: #e8f5f3;
  --sidebar-hover: rgba(0, 150, 136, 0.08);
  --sidebar-active: rgba(0, 150, 136, 0.15);
  --sidebar-text: #546e7a;
  --sidebar-text-active: #00695c;
  --sidebar-border: rgba(0, 150, 136, 0.12);
}

/* ============================================
   SIDEBAR THEMES (Switchable)
   ============================================ */

/* Theme 1: Modern (Cool Mint) */
[data-sidebar-theme="modern"] {
  --sidebar-bg: linear-gradient(180deg, #e0f2f1 0%, #f5f5f5 100%);
  --sidebar-bg-solid: #e8f5f3;
  --sidebar-hover: rgba(0, 150, 136, 0.08);
  --sidebar-active: rgba(0, 150, 136, 0.15);
  --sidebar-text: #546e7a;
  --sidebar-text-active: #00695c;
  --sidebar-border: rgba(0, 150, 136, 0.12);
}

/* Theme 2: Dark Mode */
[data-sidebar-theme="dark"] {
  --sidebar-bg: #1a1d21;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(99, 179, 237, 0.15);
  --sidebar-text: rgba(255, 255, 255, 0.7);
  --sidebar-text-active: #63b3ed;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --dark-bg: #0d1117;
  --dark-card: #161b22;
  --dark-border: #30363d;
  --dark-text: #c9d1d9;
  --dark-text-muted: #8b949e;
  --dark-accent: #63b3ed;
  /* Table Colors (Dark Mode) */
  --table-bg: #161b22;
  --table-text: #c9d1d9;
  --table-border: #30363d;
  --table-striped-bg: #1a1d21;
  --table-hover-bg: #21262d;
  --table-head-bg: #1a1d21;
  --table-head-text: #c9d1d9;
}

/* Modern theme gradient background */
[data-sidebar-theme="modern"] .sidebar {
  background: linear-gradient(180deg, #e0f2f1 0%, #f5f5f5 100%) !important;
  border-right: 1px solid rgba(0, 150, 136, 0.15) !important;
}

[data-sidebar-theme="modern"] .sidebar .nav-link:not([data-bs-toggle="collapse"]).active,
[data-sidebar-theme="modern"] .sidebar .nav-link:not([data-bs-toggle="collapse"]).veer {
  background: rgba(0, 150, 136, 0.15) !important;
  color: #00695c !important;
}

[data-sidebar-theme="modern"] .sidebar .nav-link:not([data-bs-toggle="collapse"]).active i,
[data-sidebar-theme="modern"] .sidebar .nav-link:not([data-bs-toggle="collapse"]).veer i {
  color: #00897b !important;
}

[data-sidebar-theme="modern"] .sidebar .nav-content .nav-link.active {
  color: #00695c !important;
  background: rgba(0, 150, 136, 0.12) !important;
}

/* Modern theme - main content area */
[data-sidebar-theme="modern"] main {
  background: linear-gradient(135deg, #f0fdf9 0%, #f8fafc 50%, #f0fdfa 100%);
}

[data-sidebar-theme="modern"] .header {
  background: linear-gradient(90deg, #ffffff 0%, #f0fdfa 100%);
  border-bottom: 1px solid rgba(0, 150, 136, 0.1);
}

/* Dark theme - Sidebar */
[data-sidebar-theme="dark"] .sidebar {
  background: #1a1d21 !important;
  border-right: 1px solid #30363d !important;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

[data-sidebar-theme="dark"] .sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
}

[data-sidebar-theme="dark"] .sidebar .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
}

[data-sidebar-theme="dark"] .sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

[data-sidebar-theme="dark"] .sidebar .nav-link:not([data-bs-toggle="collapse"]).active,
[data-sidebar-theme="dark"] .sidebar .nav-link:not([data-bs-toggle="collapse"]).veer {
  background: rgba(99, 179, 237, 0.15) !important;
  color: #63b3ed !important;
}

[data-sidebar-theme="dark"] .sidebar .nav-link:not([data-bs-toggle="collapse"]).active i,
[data-sidebar-theme="dark"] .sidebar .nav-link:not([data-bs-toggle="collapse"]).veer i {
  color: #63b3ed !important;
}

[data-sidebar-theme="dark"] .sidebar .nav-content .nav-link.active {
  color: #63b3ed !important;
  background: rgba(99, 179, 237, 0.12) !important;
}

/* Dark theme - Header */
[data-sidebar-theme="dark"] .header {
  background: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
}

[data-sidebar-theme="dark"] .header .nav-link,
[data-sidebar-theme="dark"] .header span {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .logo-text {
  color: #fff !important;
}

/* Dark theme - Main content */
[data-sidebar-theme="dark"] main {
  background: #0d1117 !important;
}

[data-sidebar-theme="dark"] .pagetitle h1,
[data-sidebar-theme="dark"] .card-title {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .breadcrumb-item a {
  color: #63b3ed !important;
}

[data-sidebar-theme="dark"] .breadcrumb-item.active {
  color: #8b949e !important;
}

/* Dark theme - Cards */
[data-sidebar-theme="dark"] .card {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .card-header {
  background: #1a1d21 !important;
  border-bottom-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .card-body {
  color: #c9d1d9 !important;
}

/* Theme-aware Tables (uses CSS variables for fast switching) */
.table {
  --bs-table-bg: var(--table-bg);
  --bs-table-striped-bg: var(--table-striped-bg);
  --bs-table-hover-bg: var(--table-hover-bg);
  --bs-table-border-color: var(--table-border);
  color: var(--table-text);
}

.table > :not(caption) > * > * {
  background-color: var(--table-bg);
  border-bottom-color: var(--table-border);
  color: var(--table-text);
}

.table-light,
.table-light th,
.table-light td,
thead.table-light {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  border-color: var(--table-border);
}

.table thead th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  border-color: var(--table-border);
}

.table td,
.table th {
  border-color: var(--table-border);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: var(--table-striped-bg);
}

.table-hover > tbody > tr:hover > * {
  background-color: var(--table-hover-bg);
  color: var(--table-text);
}

.table-hover > tbody > tr:hover {
  background-color: var(--table-hover-bg);
}

.table-responsive {
  border-color: var(--table-border);
}

/* Dark theme - Scrollbar */
[data-sidebar-theme="dark"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

[data-sidebar-theme="dark"] ::-webkit-scrollbar-track {
  background: #161b22;
  border-radius: 5px;
}

[data-sidebar-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 5px;
}

[data-sidebar-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

[data-sidebar-theme="dark"] ::-webkit-scrollbar-corner {
  background: #161b22;
}

/* Firefox scrollbar */
[data-sidebar-theme="dark"] * {
  scrollbar-width: thin;
  scrollbar-color: #30363d #161b22;
}

/* Dark theme - Badges */
[data-sidebar-theme="dark"] .badge.bg-light {
  background: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .badge.bg-secondary {
  background: #484f58 !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .badge.bg-primary {
  background: #1f6feb !important;
  color: #fff !important;
}

[data-sidebar-theme="dark"] .badge.bg-success {
  background: #238636 !important;
  color: #fff !important;
}

[data-sidebar-theme="dark"] .badge.bg-danger {
  background: #da3633 !important;
  color: #fff !important;
}

[data-sidebar-theme="dark"] .badge.bg-warning {
  background: #d4a51a !important;
  color: #1a1d21 !important;
}

[data-sidebar-theme="dark"] .badge.bg-info {
  background: #3d8fa8 !important;
  color: #fff !important;
}

[data-sidebar-theme="dark"] .badge.bg-dark {
  background: #0d1117 !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .badge.text-dark {
  color: #1a1d21 !important;
}

/* Dark theme - Alerts */
[data-sidebar-theme="dark"] .alert-light {
  background: #1a1d21 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .alert-secondary {
  background: #1a1d21 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .alert-info {
  background: #1a3542 !important;
  border-color: #3d8fa8 !important;
  color: #8ec8db !important;
}

[data-sidebar-theme="dark"] .alert-warning {
  background: #3d3520 !important;
  border-color: #d4a51a !important;
  color: #f0d56e !important;
}

[data-sidebar-theme="dark"] .alert-danger {
  background: #3d1a1a !important;
  border-color: #da3633 !important;
  color: #f85149 !important;
}

[data-sidebar-theme="dark"] .alert-success {
  background: #1a3527 !important;
  border-color: #238636 !important;
  color: #3fb950 !important;
}

/* Dark theme - Tables */
[data-sidebar-theme="dark"] .table {
  color: #c9d1d9 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .table > :not(caption) > * > * {
  background-color: #161b22 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .table-light,
[data-sidebar-theme="dark"] .table-light > th,
[data-sidebar-theme="dark"] .table-light > td,
[data-sidebar-theme="dark"] thead.table-light > tr > th {
  background-color: #21262d !important;
  color: #c9d1d9 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .table-warning,
[data-sidebar-theme="dark"] .table-warning > th,
[data-sidebar-theme="dark"] .table-warning > td,
[data-sidebar-theme="dark"] tfoot.table-warning > tr > td {
  background-color: #3d3520 !important;
  color: #f0d56e !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .table-danger,
[data-sidebar-theme="dark"] .table-danger > th,
[data-sidebar-theme="dark"] .table-danger > td,
[data-sidebar-theme="dark"] tr.table-danger > td {
  background-color: #3d1a1a !important;
  color: #f85149 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .table-success,
[data-sidebar-theme="dark"] .table-success > th,
[data-sidebar-theme="dark"] .table-success > td {
  background-color: #1a3527 !important;
  color: #3fb950 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .table-hover > tbody > tr:hover > * {
  background-color: #1a1d21 !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: #1a1d21 !important;
}

/* Dark theme - List groups */
[data-sidebar-theme="dark"] .list-group-item {
  background: #161b22 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .list-group-item:hover {
  background: #1a1d21 !important;
}

/* Dark theme - Modals */
[data-sidebar-theme="dark"] .modal-content {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .modal-header {
  border-bottom-color: #30363d !important;
}

[data-sidebar-theme="dark"] .modal-footer {
  border-top-color: #30363d !important;
}

[data-sidebar-theme="dark"] .modal-title {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .btn-close {
  filter: invert(1) !important;
}

/* Dark theme - Nav tabs */
[data-sidebar-theme="dark"] .nav-tabs {
  border-bottom-color: #30363d !important;
}

[data-sidebar-theme="dark"] .nav-tabs .nav-link {
  color: #8b949e !important;
}

[data-sidebar-theme="dark"] .nav-tabs .nav-link:hover {
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .nav-tabs .nav-link.active {
  background: #161b22 !important;
  border-color: #30363d #30363d #161b22 !important;
  color: #63b3ed !important;
}

[data-sidebar-theme="dark"] .tab-content {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .tab-pane {
  background: #161b22 !important;
}

/* Dark theme - Pagination */
[data-sidebar-theme="dark"] .page-link {
  background: #161b22 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .page-link:hover {
  background: #1a1d21 !important;
  color: #63b3ed !important;
}

[data-sidebar-theme="dark"] .page-item.active .page-link {
  background: #63b3ed !important;
  border-color: #63b3ed !important;
}

[data-sidebar-theme="dark"] .page-item.disabled .page-link {
  background: #0d1117 !important;
  color: #8b949e !important;
}

/* Dark theme - Progress bars */
[data-sidebar-theme="dark"] .progress {
  background: #30363d !important;
}

/* Dark theme - Borders */
[data-sidebar-theme="dark"] .border,
[data-sidebar-theme="dark"] .border-top,
[data-sidebar-theme="dark"] .border-bottom,
[data-sidebar-theme="dark"] .border-start,
[data-sidebar-theme="dark"] .border-end {
  border-color: #30363d !important;
}

/* Dark theme - Background utilities */
[data-sidebar-theme="dark"] .bg-light {
  background: #1a1d21 !important;
}

[data-sidebar-theme="dark"] .bg-white {
  background: #161b22 !important;
}

/* Dark theme - Text utilities */
[data-sidebar-theme="dark"] .text-dark {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .text-body {
  color: #c9d1d9 !important;
}

/* Dark theme - Section backgrounds */
[data-sidebar-theme="dark"] .section {
  background: #0d1117 !important;
}

/* Dark theme - Stat cards/info boxes */
[data-sidebar-theme="dark"] .info-box,
[data-sidebar-theme="dark"] .stat-card,
[data-sidebar-theme="dark"] .dashboard-card {
  background: #161b22 !important;
  border-color: #30363d !important;
}

/* Dark theme - Inputs with backgrounds */
[data-sidebar-theme="dark"] input,
[data-sidebar-theme="dark"] textarea,
[data-sidebar-theme="dark"] select {
  background-color: #0d1117 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] input::placeholder,
[data-sidebar-theme="dark"] textarea::placeholder {
  color: #8b949e !important;
}

[data-sidebar-theme="dark"] input:focus,
[data-sidebar-theme="dark"] textarea:focus,
[data-sidebar-theme="dark"] select:focus {
  border-color: #63b3ed !important;
  box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25) !important;
}

/* Dark theme - Headings */
[data-sidebar-theme="dark"] h1,
[data-sidebar-theme="dark"] h2,
[data-sidebar-theme="dark"] h3,
[data-sidebar-theme="dark"] h4,
[data-sidebar-theme="dark"] h5,
[data-sidebar-theme="dark"] h6 {
  color: #c9d1d9 !important;
}

/* Dark theme - Strong/Bold text */
[data-sidebar-theme="dark"] strong {
  color: #e6edf3 !important;
}

/* Dark theme - Import workflow specific */
[data-sidebar-theme="dark"] .import-header {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .import-header h1 {
  color: #c9d1d9 !important;
}

/* Dark theme - Info cards */
[data-sidebar-theme="dark"] .info-card,
[data-sidebar-theme="dark"] .card.info-card {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .info-card .card-body,
[data-sidebar-theme="dark"] .card.info-card .card-body {
  background: #161b22 !important;
}

/* Dark theme - Card footer */
[data-sidebar-theme="dark"] .card-footer {
  background: #1a1d21 !important;
  border-top-color: #30363d !important;
}

/* Dark theme - Outline buttons */
[data-sidebar-theme="dark"] .btn-outline-primary {
  color: #58a6ff !important;
  border-color: #58a6ff !important;
  background: transparent !important;
}

[data-sidebar-theme="dark"] .btn-outline-primary:hover {
  background: rgba(88, 166, 255, 0.15) !important;
  color: #58a6ff !important;
  border-color: #58a6ff !important;
}

[data-sidebar-theme="dark"] .btn-outline-info {
  color: #3d8fa8 !important;
  border-color: #3d8fa8 !important;
  background: transparent !important;
}

[data-sidebar-theme="dark"] .btn-outline-info:hover {
  background: rgba(61, 143, 168, 0.15) !important;
  color: #58c4dc !important;
  border-color: #58c4dc !important;
}

[data-sidebar-theme="dark"] .btn-outline-success {
  color: #3fb950 !important;
  border-color: #3fb950 !important;
  background: transparent !important;
}

[data-sidebar-theme="dark"] .btn-outline-success:hover {
  background: rgba(63, 185, 80, 0.15) !important;
  color: #56d364 !important;
  border-color: #56d364 !important;
}

[data-sidebar-theme="dark"] .btn-outline-danger {
  color: #f85149 !important;
  border-color: #f85149 !important;
  background: transparent !important;
}

[data-sidebar-theme="dark"] .btn-outline-danger:hover {
  background: rgba(248, 81, 73, 0.15) !important;
  color: #ff7b72 !important;
  border-color: #ff7b72 !important;
}

[data-sidebar-theme="dark"] .btn-outline-warning {
  color: #d4a51a !important;
  border-color: #d4a51a !important;
  background: transparent !important;
}

[data-sidebar-theme="dark"] .btn-outline-warning:hover {
  background: rgba(212, 165, 26, 0.15) !important;
  color: #f0d56e !important;
  border-color: #f0d56e !important;
}

/* Dark theme - Trader Dashboard specific */
[data-sidebar-theme="dark"] .dash-header,
[data-sidebar-theme="dark"] .trader-dash .dash-header {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .dash-header h1 {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .date-badge {
  background: #30363d !important;
  color: #8b949e !important;
}

[data-sidebar-theme="dark"] .kpi,
[data-sidebar-theme="dark"] .kpi-strip .kpi {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .kpi-label {
  color: #8b949e !important;
}

[data-sidebar-theme="dark"] .kpi-value {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .panel,
[data-sidebar-theme="dark"] .dash-panel {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .panel-header,
[data-sidebar-theme="dark"] .dash-panel h3 {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .alert-item {
  background: #1a1d21 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .alert-item:hover {
  background: rgba(99, 179, 237, 0.08) !important;
}

[data-sidebar-theme="dark"] .funnel-item,
[data-sidebar-theme="dark"] .pipeline-step {
  background: #1a1d21 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .funnel-count {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .funnel-label {
  color: #8b949e !important;
}

[data-sidebar-theme="dark"] .sidebar-card,
[data-sidebar-theme="dark"] .dash-sidebar .sidebar-card {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .sidebar-card h4 {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .contract-item,
[data-sidebar-theme="dark"] .nom-item,
[data-sidebar-theme="dark"] .recent-item {
  background: #1a1d21 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .contract-item:hover,
[data-sidebar-theme="dark"] .nom-item:hover,
[data-sidebar-theme="dark"] .recent-item:hover {
  background: rgba(99, 179, 237, 0.08) !important;
}

[data-sidebar-theme="dark"] .license-item {
  background: #1a1d21 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .aging-box {
  background: #1a1d21 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .metric-box {
  background: #1a1d21 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .container-item {
  background: #1a1d21 !important;
  border-color: #30363d !important;
}

/* Dark theme - Generic divs with white backgrounds */
[data-sidebar-theme="dark"] div[style*="background: #fff"],
[data-sidebar-theme="dark"] div[style*="background:#fff"],
[data-sidebar-theme="dark"] div[style*="background-color: #fff"],
[data-sidebar-theme="dark"] div[style*="background-color:#fff"],
[data-sidebar-theme="dark"] div[style*="background: white"],
[data-sidebar-theme="dark"] div[style*="background:white"],
[data-sidebar-theme="dark"] div[style*="background-color: white"],
[data-sidebar-theme="dark"] div[style*="background-color:white"] {
  background: #161b22 !important;
}

/* Dark theme - Forms */
[data-sidebar-theme="dark"] .form-control,
[data-sidebar-theme="dark"] .form-select {
  background: #0d1117 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .form-control:focus,
[data-sidebar-theme="dark"] .form-select:focus {
  border-color: #63b3ed !important;
  box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25) !important;
}

[data-sidebar-theme="dark"] .form-label {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .input-group-text {
  background: #21262d !important;
  border-color: #30363d !important;
  color: #8b949e !important;
}

[data-sidebar-theme="dark"] .form-control::placeholder {
  color: #6e7681 !important;
}

/* Dark theme - Buttons */
[data-sidebar-theme="dark"] .btn-outline-secondary {
  color: #8b949e !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .btn-outline-secondary:hover {
  background: #30363d !important;
  color: #c9d1d9 !important;
}

/* Dark theme - Text colors */
[data-sidebar-theme="dark"] .text-muted {
  color: #8b949e !important;
}

[data-sidebar-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item) {
  color: #63b3ed;
}

/* Dark theme - Select2 */
[data-sidebar-theme="dark"] .select2-container--default .select2-selection--single {
  background-color: #0d1117 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #8b949e !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #8b949e transparent transparent transparent !important;
}

[data-sidebar-theme="dark"] .select2-dropdown {
  background-color: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .select2-search--dropdown .select2-search__field {
  background-color: #0d1117 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .select2-results__option {
  color: #c9d1d9 !important;
  background-color: #161b22 !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #1f6feb !important;
  color: #fff !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #238636 !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-selection--multiple {
  background-color: #0d1117 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #30363d !important;
  border-color: #484f58 !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: #f85149 !important;
}

/* Select2 sizing to match Bootstrap form-control */
.select2-container {
  width: 100% !important;
}

.select2-container .select2-selection--single {
  height: 38px !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  border: 1px solid #ced4da !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 28px !important;
  padding-left: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px !important;
}

[data-sidebar-theme="dark"] .select2-container .select2-selection--single {
  border-color: #30363d !important;
}

/* Dark theme - Dropdown */
[data-sidebar-theme="dark"] .dropdown-menu {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .dropdown-item {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .dropdown-item:hover {
  background: #1a1d21 !important;
}

[data-sidebar-theme="dark"] .dropdown-header {
  color: #8b949e !important;
}

/* Dark theme - Import Workflow Steps */
[data-sidebar-theme="dark"] .flow-step {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .step-header {
  background: #1a1d21 !important;
}

[data-sidebar-theme="dark"] .step-title {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .step-number {
  background: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .step-content {
  background: #161b22 !important;
}

[data-sidebar-theme="dark"] .action-item {
  background: #1a1d21 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .action-icon {
  color: #8b949e !important;
}

[data-sidebar-theme="dark"] .documents-section {
  background: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .documents-header {
  background: #1a1d21 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .documents-title {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .document-card {
  background: #1a1d21 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .document-name {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .document-meta {
  color: #8b949e !important;
}

/* Dark theme - Page titles */
[data-sidebar-theme="dark"] .pagetitle h1 {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .pagetitle {
  color: #c9d1d9 !important;
}

/* ============================================
   STANDARDIZED BUTTON STYLES
   ============================================ */

/* Filter Button Group - Consistent styling for status filter tabs */
.filter-btn-group {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #dee2e6;
}

.filter-btn-group .btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid #dee2e6;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: #6c757d;
  transition: all 0.15s ease;
}

.filter-btn-group .btn:last-child {
  border-right: none;
}

.filter-btn-group .btn:hover {
  background: #f8f9fa;
  color: #495057;
}

.filter-btn-group .btn.active {
  background: #0d6efd;
  color: #fff;
}

/* Dark mode filter buttons */
[data-sidebar-theme="dark"] .filter-btn-group {
  border-color: #30363d;
}

[data-sidebar-theme="dark"] .filter-btn-group .btn {
  color: #8b949e;
  border-right-color: #30363d;
}

[data-sidebar-theme="dark"] .filter-btn-group .btn:hover {
  background: #21262d;
  color: #c9d1d9;
}

[data-sidebar-theme="dark"] .filter-btn-group .btn.active {
  background: #238636;
  color: #fff;
}

/* Primary Action Button - Create, Add, Submit */
.btn-action-primary {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-action-primary:hover {
  background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.btn-action-primary i {
  font-size: 14px;
}

/* Secondary Action Button - View, Edit, Details */
.btn-action-secondary {
  background: transparent;
  color: #0d6efd;
  border: 1px solid #0d6efd;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-action-secondary:hover {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
}

/* Danger Action Button - Delete, Reject, Close */
.btn-action-danger {
  background: transparent;
  color: #dc3545;
  border: 1px solid #dc3545;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-action-danger:hover {
  background: #dc3545;
  color: #fff;
}

/* Success Action Button - Approve, Confirm */
.btn-action-success {
  background: transparent;
  color: #198754;
  border: 1px solid #198754;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-action-success:hover {
  background: #198754;
  color: #fff;
}

/* Icon-only action buttons */
.btn-action-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dee2e6;
  background: transparent;
  color: #6c757d;
  transition: all 0.15s ease;
}

.btn-action-icon:hover {
  background: #f8f9fa;
  color: #495057;
  border-color: #adb5bd;
}

.btn-action-icon.view:hover {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  border-color: #0d6efd;
}

.btn-action-icon.edit:hover {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
  border-color: #ffc107;
}

.btn-action-icon.delete:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border-color: #dc3545;
}

/* Dark mode action buttons */
[data-sidebar-theme="dark"] .btn-action-icon {
  border-color: #30363d;
  color: #8b949e;
}

[data-sidebar-theme="dark"] .btn-action-icon:hover {
  background: #21262d;
  color: #c9d1d9;
  border-color: #484f58;
}

[data-sidebar-theme="dark"] .btn-action-secondary {
  color: #58a6ff;
  border-color: #58a6ff;
}

[data-sidebar-theme="dark"] .btn-action-secondary:hover {
  background: rgba(88, 166, 255, 0.15);
}

[data-sidebar-theme="dark"] .btn-action-danger {
  color: #f85149;
  border-color: #f85149;
}

[data-sidebar-theme="dark"] .btn-action-danger:hover {
  background: #f85149;
  color: #fff;
}

[data-sidebar-theme="dark"] .btn-action-success {
  color: #3fb950;
  border-color: #3fb950;
}

[data-sidebar-theme="dark"] .btn-action-success:hover {
  background: #3fb950;
  color: #fff;
}

/* Filter search button */
.btn-filter {
  background: #6c757d;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
}

.btn-filter:hover {
  background: #5c636a;
  color: #fff;
}

[data-sidebar-theme="dark"] .btn-filter {
  background: #30363d;
  color: #c9d1d9;
}

[data-sidebar-theme="dark"] .btn-filter:hover {
  background: #484f58;
}

/* ============================================
   1b. SPACING & OTHER VARIABLES
   ============================================ */
:root {
  /* Spacing */
  --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: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50%;

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

  /* Typography */
  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Sidebar */
  --sidebar-width: 250px;
  --header-height: 60px;
}

/* ============================================
   2. BASE RESET
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--gray-100);
  min-height: 100vh;
  line-height: 1.6;
  color: var(--gray-800);
}

/* ============================================
   3. LAYOUT - SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 996;
  transition: var(--transition-normal);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 2px 0 5px rgba(0,0,0,0.02);
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

.sidebar ul {
  list-style: none;
  padding: var(--space-sm) var(--space-md);
}

.sidebar .nav-item {
  margin-bottom: 2px;
}

.sidebar .nav-heading {
  color: var(--gray-500);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-md) var(--space-md) var(--space-xs);
  margin-top: var(--space-sm);
  font-weight: 600;
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  text-decoration: none;
  font-weight: 400;
}

.sidebar .nav-link i {
  margin-right: 10px;
  font-size: 16px;
  width: 20px;
  text-align: center;
  opacity: 0.8;
}

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

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

/* Reset any active/hover states for parent menu items with subitems */
.sidebar .nav-link[data-bs-toggle="collapse"] {
  color: var(--sidebar-text) !important;
  background: transparent !important;
}

.sidebar .nav-link[data-bs-toggle="collapse"]:hover {
  background: var(--sidebar-hover) !important;
  color: var(--sidebar-text-active) !important;
}

/* When parent is expanded (not collapsed), just make text white */
.sidebar .nav-link[data-bs-toggle="collapse"]:not(.collapsed) {
  color: var(--sidebar-text-active) !important;
  background: transparent !important;
}

/* Active state ONLY for links without data-bs-toggle (actual page links) */
.sidebar .nav-link:not([data-bs-toggle="collapse"]).active,
.sidebar .nav-link:not([data-bs-toggle="collapse"]).veer {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  font-weight: 500;
}

.sidebar .nav-link:not([data-bs-toggle="collapse"]).active i,
.sidebar .nav-link:not([data-bs-toggle="collapse"]).veer i {
  color: var(--primary);
  opacity: 1;
}

/* Submenu container */
.sidebar .nav-content {
  padding-left: 0;
  margin-left: 30px;
  border-left: 1px solid var(--sidebar-border);
  padding-top: 4px;
  padding-bottom: 4px;
}

.sidebar .nav-content .nav-link {
  font-size: 12px;
  padding: 7px 14px;
  color: var(--sidebar-text) !important;
  background: transparent !important;
  border-radius: var(--radius-sm);
}

.sidebar .nav-content .nav-link:hover {
  color: var(--sidebar-text-active) !important;
  background: var(--sidebar-hover) !important;
}

.sidebar .nav-content .nav-link.active {
  color: var(--primary) !important;
  background: var(--primary-light) !important;
  font-weight: 500;
}

/* ============================================
   4. LAYOUT - MAIN CONTENT
   ============================================ */
main {
  margin-left: var(--sidebar-width);
  background: var(--gray-100);
  min-height: 100vh;
  padding: var(--space-lg);
}

@media (max-width: 991.98px) {
  .sidebar {
    width: 100%;
    position: relative;
  }
  main {
    margin-left: 0;
  }
}

/* ============================================
   5. CARDS
   ============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: none;
  transition: var(--transition-fast);
}

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

.card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--gray-200);
  background: transparent;
  font-weight: 600;
}

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

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

/* ============================================
   6. PROGRESS STEPS / TABS
   ============================================ */
.progress-tabs {
  position: relative;
  margin-bottom: var(--space-xl);
}

.progress-tabs::after {
  content: '';
  position: absolute;
  top: 25px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gray-300);
  z-index: 1;
}

.progress-step {
  position: relative;
  z-index: 2;
  text-align: center;
}

.progress-step-btn {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-sm);
  color: var(--gray-600);
  transition: var(--transition-normal);
  cursor: pointer;
  text-decoration: none;
}

.progress-step-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.progress-step.active .progress-step-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.progress-step.completed .progress-step-btn {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
}

.progress-step-label {
  font-size: var(--font-size-sm);
  color: var(--gray-600);
  margin-top: var(--space-xs);
}

/* Stepper (Alternate Style) */
.stepper-wrapper {
  display: flex;
  justify-content: space-between;
  margin: var(--space-lg) 0;
}

.stepper-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stepper-item::before,
.stepper-item::after {
  position: absolute;
  content: "";
  border-bottom: 2px solid var(--gray-300);
  width: 100%;
  top: 20px;
  z-index: 2;
}

.stepper-item::before { left: -50%; }
.stepper-item::after { left: 50%; }
.stepper-item:first-child::before { content: none; }
.stepper-item:last-child::after { content: none; }

.step-counter {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
  color: var(--white);
  font-weight: 600;
}

.stepper-item.completed .step-counter {
  background: var(--success);
}

.stepper-item.active .step-counter {
  background: var(--primary);
}

.stepper-item.completed::after {
  border-color: var(--success);
  z-index: 3;
}

.step-name {
  font-size: var(--font-size-xs);
  margin-top: var(--space-sm);
  color: var(--gray-600);
}

/* ============================================
   7. TABLES
   ============================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  color: var(--gray-700);
}

.table th,
.table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}

.table th {
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gray-300);
}

.table-dark th {
  background: var(--gray-800);
  color: var(--white);
}

.table-light th {
  background: var(--gray-100);
  color: var(--gray-700);
}

.table-striped tbody tr:nth-of-type(odd) {
  background: var(--gray-100);
}

.table-hover tbody tr:hover {
  background: var(--primary-light);
}

.table tfoot {
  background: var(--gray-200);
  font-weight: 600;
}

/* Table ID/Ref Links - clean style instead of buttons */
.table-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
}

.table-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ============================================
   8. FORMS
   ============================================ */
.form-label {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
}

.form-control {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-md);
  color: var(--gray-800);
  transition: var(--transition-fast);
}

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

.form-control:disabled,
.form-control[readonly] {
  background: var(--gray-100);
  cursor: not-allowed;
}

.form-select {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.required-field::after {
  content: '*';
  color: var(--danger);
  margin-left: var(--space-xs);
}

/* ============================================
   9. BUTTONS
   ============================================ */
.btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-warning {
  background: var(--warning);
  color: var(--gray-800);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

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

.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--white);
}

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

.btn-outline-danger:hover {
  background: var(--danger);
  color: var(--white);
}

.btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--gray-500) !important;
  color: var(--gray-600);
}

.btn-outline-secondary:hover {
  background: var(--gray-500);
  color: var(--white);
}

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

.btn-outline-warning:hover {
  background: var(--warning);
  color: var(--gray-800);
}

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

.btn-outline-dark:hover {
  background: var(--gray-800);
  color: var(--white);
}

.btn-dark {
  background: var(--gray-800);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--gray-900);
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-lg);
}

/* ============================================
   10. BADGES
   ============================================ */
.badge {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.bg-success { background: var(--success) !important; }
.badge.bg-warning { background: var(--warning) !important; color: var(--gray-800) !important; }
.badge.bg-danger { background: var(--danger) !important; }
.badge.bg-info { background: var(--info) !important; }
.badge.bg-secondary { background: var(--gray-600) !important; }

/* ============================================
   11. ALERTS
   ============================================ */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  border: none;
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
}

.alert-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.alert-warning {
  background: var(--warning-light);
  color: var(--gray-800);
}

.alert-info {
  background: var(--info-light);
  color: var(--gray-800);
}

/* ============================================
   12. DASHBOARD COMPONENTS
   ============================================ */
.dash-header {
  background: var(--white);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
}

.dash-header h1,
.dash-header h5 {
  color: var(--gray-800);
  margin: 0;
}

/* Progress Overview Card */
.progress-overview {
  background: var(--white);
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-md);
}

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

.overview-title {
  font-size: var(--font-size-xl);
  color: var(--gray-800);
  font-weight: 600;
}

.total-quantity {
  background: var(--primary);
  color: var(--white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  font-weight: 500;
}

/* Flow Steps */
.flow-step {
  background: var(--white);
  margin: var(--space-lg) 0;
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  border-left: 4px solid var(--primary);
  transition: var(--transition-fast);
}

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

.flow-step.step-1 { border-left-color: var(--primary); }
.flow-step.step-2 { border-left-color: var(--success); }
.flow-step.step-3 { border-left-color: var(--warning); }
.flow-step.step-4 { border-left-color: #fd7e14; }
.flow-step.step-5 { border-left-color: var(--danger); }

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--gray-200);
}

.step-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: var(--font-size-lg);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.step-1 .step-number { background: var(--primary); }
.step-2 .step-number { background: var(--success); }
.step-3 .step-number { background: var(--warning); color: var(--gray-800); }
.step-4 .step-number { background: #fd7e14; }
.step-5 .step-number { background: var(--danger); }

.step-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--gray-800);
}

.step-content {
  padding-left: calc(40px + var(--space-md));
}

.action-item {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.action-item:hover {
  background: var(--gray-200);
  transform: translateX(4px);
}

/* ============================================
   13. DOCUMENT CARDS
   ============================================ */
.documents-section {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--gray-200);
}

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

.documents-title {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.document-card {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: var(--transition-fast);
  cursor: pointer;
  border: 1px solid var(--gray-200);
}

.document-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--white);
}

.document-icon {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-sm);
  color: var(--primary);
}

.document-name {
  font-weight: 500;
  color: var(--gray-800);
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-meta {
  font-size: var(--font-size-xs);
  color: var(--gray-600);
}

.document-status {
  font-size: var(--font-size-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.status-generated {
  background: var(--primary-light);
  color: var(--primary);
}

.status-uploaded {
  background: var(--success-light);
  color: var(--success);
}

/* ============================================
   14. LOADER
   ============================================ */
#loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: var(--transition-slow);
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loader-image {
  height: 100px;
  animation: pulse 1.5s ease-in-out infinite;
}

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

.loader-text {
  margin-top: var(--space-md);
  font-size: var(--font-size-md);
  color: var(--gray-700);
  font-weight: 500;
}

.dots::after {
  content: '';
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: dots 1.5s steps(4, end) infinite;
}

/* Dark theme - Loader */
[data-sidebar-theme="dark"] #loader-overlay {
  background: rgba(22, 27, 34, 1);
}

[data-sidebar-theme="dark"] .loader-text {
  color: #c9d1d9;
}

[data-sidebar-theme="dark"] .loader-image {
  filter: brightness(0) invert(1);
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: '....'; }
}

/* ============================================
   15. HEADER / NAVBAR
   ============================================ */
.header {
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  height: var(--header-height);
  border-bottom: 1px solid var(--gray-200);
}

.logo {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  width: auto !important;
  max-width: none !important;
}

.logo-text {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.logo-img {
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800, #343a40);
  white-space: nowrap;
}

.toggle-sidebar-btn {
  font-size: 24px;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition-fast);
}

.toggle-sidebar-btn:hover {
  color: var(--primary);
}

/* ============================================
   16. UTILITIES
   ============================================ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--gray-600) !important; }

.bg-primary-light { background: var(--primary-light) !important; }
.bg-success-light { background: var(--success-light) !important; }
.bg-warning-light { background: var(--warning-light) !important; }
.bg-danger-light { background: var(--danger-light) !important; }

.border-primary { border-color: var(--primary) !important; }
.border-success { border-color: var(--success) !important; }
.border-warning { border-color: var(--warning) !important; }
.border-danger { border-color: var(--danger) !important; }

.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ============================================
   17. ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.fade-in {
  animation: fadeIn var(--transition-normal);
}

.slide-in {
  animation: slideIn var(--transition-normal);
}

/* ============================================
   18. RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  :root {
    --space-lg: 1rem;
    --space-xl: 1.5rem;
  }

  .table th,
  .table td {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
  }

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

  .flow-step {
    padding: var(--space-md);
  }

  .step-content {
    padding-left: 0;
  }
}

/* ============================================
   19. HELP DESK / TICKETS
   ============================================ */
.ticket-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  overflow: hidden;
}

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

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--primary-light);
  border-bottom: 1px solid var(--gray-200);
}

.ticket-header .ticket-title {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: var(--font-size-md);
}

.ticket-body {
  padding: var(--space-lg);
}

.ticket-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.ticket-info-table {
  width: 100%;
  border-collapse: collapse;
}

.ticket-info-table th,
.ticket-info-table td {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--gray-300);
  text-align: left;
  vertical-align: middle;
}

.ticket-info-table th {
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 500;
  width: 20%;
}

.ticket-comments-table {
  width: 100%;
  margin-top: var(--space-md);
  border-collapse: collapse;
}

.ticket-comments-table th {
  padding: var(--space-sm) var(--space-md);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  border: 1px solid var(--gray-200);
  text-align: left;
}

.ticket-comments-table td {
  padding: var(--space-md);
  border: 1px solid var(--gray-200);
  vertical-align: top;
}

.ticket-comments-table ul {
  margin: 0;
  padding-left: var(--space-lg);
}

.ticket-comments-table li {
  margin-bottom: var(--space-xs);
  color: var(--gray-700);
}

/* Ticket Status Badges */
.ticket-status {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--font-size-xs);
}

.ticket-status.open { background: var(--success); color: var(--white); }
.ticket-status.on-hold { background: var(--warning); color: var(--gray-800); }
.ticket-status.escalated { background: var(--gray-600); color: var(--white); }
.ticket-status.closed { background: var(--danger); color: var(--white); }

/* Ticket Status Dropdown */
.ticket-status-select {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.ticket-status-select.status-open { background: var(--success-light); }
.ticket-status-select.status-on-hold { background: var(--warning-light); }
.ticket-status-select.status-escalated { background: var(--gray-200); }
.ticket-status-select.status-closed { background: var(--danger-light); }

/* Ticket Action Icons */
.ticket-action-btn {
  font-size: var(--font-size-xl);
  cursor: pointer;
  color: var(--primary);
  transition: var(--transition-fast);
  background: none;
  border: none;
  padding: var(--space-xs);
}

.ticket-action-btn:hover {
  color: var(--primary-dark);
  transform: scale(1.1);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
}

.empty-state i {
  font-size: 4rem;
  color: var(--gray-400);
  margin-bottom: var(--space-md);
}

.empty-state h5 {
  color: var(--gray-600);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--gray-500);
  margin-bottom: var(--space-lg);
}

/* Pagination */
.pagination {
  margin: 0;
  gap: var(--space-xs);
}

.pagination .page-link {
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  padding: var(--space-sm) var(--space-md);
  transition: var(--transition-fast);
}

.pagination .page-link:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.pagination .page-item.disabled .page-link {
  background: var(--gray-100);
  color: var(--gray-400);
}

/* Search Form */
.search-form .input-group {
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.search-form .input-group-text {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-right: none;
}

.search-form .form-control {
  border-left: none;
  border-radius: 0;
}

.search-form .form-control:focus {
  box-shadow: none;
  border-color: var(--gray-300);
}

/* ============================================
   20. PRINT STYLES
   ============================================ */
@media print {
  .sidebar,
  .header,
  #loader-overlay,
  .btn,
  .no-print {
    display: none !important;
  }

  main {
    margin-left: 0;
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid var(--gray-300);
  }
}

/* ============================================
   21. SELECT2 - BOOTSTRAP/NICEADMIN THEME
   ============================================ */

/* Base Select2 container */
.select2-container {
  width: 100% !important;
}

/* Match Bootstrap form-select styling */
.select2-container--default .select2-selection--single {
  height: 38px !important;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: #212529 !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 16px 12px !important;
  border: 1px solid #ced4da !important;
  border-radius: 0.375rem !important;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
  display: flex !important;
  align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #212529 !important;
  line-height: 1.5 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #6c757d !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  display: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
  position: absolute !important;
  right: 2rem !important;
  font-size: 1.2rem !important;
  color: #6c757d !important;
}

/* Focus state */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #86b7fe !important;
  outline: 0 !important;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Dropdown container */
.select2-dropdown {
  background-color: #fff !important;
  border: 1px solid #ced4da !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Search field in dropdown */
.select2-search--dropdown {
  padding: 0.5rem !important;
}

.select2-search--dropdown .select2-search__field {
  padding: 0.375rem 0.75rem !important;
  font-size: 1rem !important;
  border: 1px solid #ced4da !important;
  border-radius: 0.375rem !important;
  background-color: #fff !important;
  color: #212529 !important;
}

.select2-search--dropdown .select2-search__field:focus {
  border-color: #86b7fe !important;
  outline: 0 !important;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Results list - remove bullets */
.select2-results__options {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  max-height: 250px !important;
  overflow-y: auto !important;
}

.select2-results__option {
  padding: 0.5rem 0.75rem !important;
  list-style: none !important;
  cursor: pointer !important;
  background-color: #fff !important;
  color: #212529 !important;
}

.select2-results__option::before,
.select2-results__option::marker {
  content: none !important;
  display: none !important;
}

/* Highlighted option */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #0d6efd !important;
  color: #fff !important;
}

/* Selected option */
.select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #e9ecef !important;
  color: #212529 !important;
}

/* ============================================
   SELECT2 DARK MODE
   ============================================ */
[data-sidebar-theme="dark"] .select2-container--default .select2-selection--single {
  background-color: #0d1117 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c9d1d9' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #8b949e !important;
}

[data-sidebar-theme="dark"] .select2-container--default.select2-container--focus .select2-selection--single,
[data-sidebar-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single {
  border-color: #1f6feb !important;
  box-shadow: 0 0 0 0.25rem rgba(31, 111, 235, 0.25) !important;
}

[data-sidebar-theme="dark"] .select2-dropdown {
  background-color: #161b22 !important;
  border-color: #30363d !important;
}

[data-sidebar-theme="dark"] .select2-search--dropdown .select2-search__field {
  background-color: #0d1117 !important;
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .select2-search--dropdown .select2-search__field:focus {
  border-color: #1f6feb !important;
  box-shadow: 0 0 0 0.25rem rgba(31, 111, 235, 0.25) !important;
}

[data-sidebar-theme="dark"] .select2-results__option {
  background-color: #161b22 !important;
  color: #c9d1d9 !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #1f6feb !important;
  color: #fff !important;
}

[data-sidebar-theme="dark"] .select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #21262d !important;
  color: #c9d1d9 !important;
}
