/**
 * Dashlink Dark Theme System Fixes
 * 
 * Provides unified, high-contrast, polished styling for:
 * 1. Global Typography & Colors (.text-dark, .text-black, .text-muted, .text-secondary)
 * 2. Card Components (headers, bodies, footers, titles, .card.bg-white, .card.bg-light, nested cards)
 * 3. Modal Components (dialog, header, title, body, footer, inputs, labels, placeholders, close button)
 * 4. Table Components (thead, table-light, tbody cells, hover, striped, borders, DataTables)
 * 5. Form Controls & Dropdown Menus
 * 6. Badges & Contextual Buttons (.btn-light-*, .badge.bg-light-*)
 * 7. Accordions, Nav Tabs, List Groups & Alerts
 */

/* ==========================================================================
   1. Typography & Global Color Overrides in Dark Mode
   ========================================================================== */
[data-pc-theme="dark"],
[data-bs-theme="dark"],
html[data-pc-theme="dark"],
html[data-bs-theme="dark"],
body[data-pc-theme="dark"],
body[data-bs-theme="dark"] {
  color-scheme: dark;
  --bs-body-bg: #131920;
  --bs-body-bg-rgb: 19, 25, 32;
  --bs-body-color: #cbd5e1;
  --bs-body-color-rgb: 203, 213, 225;
  --bs-heading-color: #f8fafc;
  --bs-border-color: #263240;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.12);
  --bs-secondary-color: #94a3b8;
  --bs-tertiary-color: #64748b;
}

/* Ensure .text-dark becomes crisp high-contrast light text on dark backgrounds */
[data-pc-theme="dark"] .text-dark,
[data-bs-theme="dark"] .text-dark,
[data-pc-theme="dark"][data-pc-direction="ltr"] .text-dark,
[data-bs-theme="dark"][data-pc-direction="ltr"] .text-dark,
body[data-pc-direction="ltr"][data-pc-theme="dark"] .text-dark,
body[data-pc-direction="ltr"][data-bs-theme="dark"] .text-dark,
html[data-pc-theme="dark"] [data-pc-direction="ltr"] .text-dark,
html[data-bs-theme="dark"] [data-pc-direction="ltr"] .text-dark {
  color: #f1f5f9 !important;
}

/* Ensure .text-black becomes pure white */
[data-pc-theme="dark"] .text-black,
[data-bs-theme="dark"] .text-black,
[data-pc-theme="dark"][data-pc-direction="ltr"] .text-black,
[data-bs-theme="dark"][data-pc-direction="ltr"] .text-black,
body[data-pc-direction="ltr"][data-pc-theme="dark"] .text-black,
body[data-pc-direction="ltr"][data-bs-theme="dark"] .text-black {
  color: #ffffff !important;
}

/* Soft muted secondary text with readable contrast */
[data-pc-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-muted,
[data-pc-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-secondary,
[data-pc-theme="dark"] .text-body-secondary,
[data-bs-theme="dark"] .text-body-secondary {
  color: #94a3b8 !important;
}

/* High-contrast headings across all views */
[data-pc-theme="dark"] h1, [data-pc-theme="dark"] h2,
[data-pc-theme="dark"] h3, [data-pc-theme="dark"] h4,
[data-pc-theme="dark"] h5, [data-pc-theme="dark"] h6,
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6,
[data-pc-theme="dark"] .h1, [data-pc-theme="dark"] .h2,
[data-pc-theme="dark"] .h3, [data-pc-theme="dark"] .h4,
[data-pc-theme="dark"] .h5, [data-pc-theme="dark"] .h6,
[data-bs-theme="dark"] .h1, [data-bs-theme="dark"] .h2,
[data-bs-theme="dark"] .h3, [data-bs-theme="dark"] .h4,
[data-bs-theme="dark"] .h5, [data-bs-theme="dark"] .h6 {
  color: #f8fafc !important;
}

/* Global border normalization */
[data-pc-theme="dark"] .border,
[data-bs-theme="dark"] .border,
[data-pc-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-top,
[data-pc-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-bottom,
[data-pc-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-start,
[data-pc-theme="dark"] .border-end,
[data-bs-theme="dark"] .border-end {
  border-color: #263240 !important;
}

/* Code and pre tags */
[data-pc-theme="dark"] pre,
[data-bs-theme="dark"] pre {
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
  border: 1px solid #1e293b !important;
}

[data-pc-theme="dark"] code,
[data-bs-theme="dark"] code {
  color: #93c5fd !important;
  background-color: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

[data-pc-theme="dark"] code.text-dark,
[data-bs-theme="dark"] code.text-dark {
  color: #93c5fd !important;
}

/* ==========================================================================
   2. Global Utility Class Re-mappings (.bg-light, .bg-light-subtle, .bg-white)
   ========================================================================== */
/* Remap .bg-light and .bg-light-subtle so they never produce glaring white boxes */
[data-pc-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-light,
[data-pc-theme="dark"] .bg-light-subtle,
[data-bs-theme="dark"] .bg-light-subtle,
[data-pc-theme="dark"][data-pc-direction="ltr"] .bg-light,
[data-bs-theme="dark"][data-pc-direction="ltr"] .bg-light,
body[data-pc-direction="ltr"][data-pc-theme="dark"] .bg-light,
body[data-pc-direction="ltr"][data-bs-theme="dark"] .bg-light,
html[data-pc-theme="dark"] [data-pc-direction="ltr"] .bg-light,
html[data-bs-theme="dark"] [data-pc-direction="ltr"] .bg-light {
  background-color: #202b36 !important;
  color: #cbd5e1 !important;
  border-color: #2e3d4d !important;
}

/* Light with opacity (e.g. .bg-light.bg-opacity-25) */
[data-pc-theme="dark"] .bg-light.bg-opacity-25,
[data-bs-theme="dark"] .bg-light.bg-opacity-25 {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: #cbd5e1 !important;
}

/* ==========================================================================
   3. Card Component Dark Theme Fixes
   ========================================================================== */
/* Base Card Style */
[data-pc-theme="dark"] .card:not(.cargo-manifest-cockpit),
[data-bs-theme="dark"] .card:not(.cargo-manifest-cockpit) {
  --bs-card-bg: #1b232d;
  --bs-card-border-color: #263240;
  --bs-card-color: #cbd5e1;
  color: #cbd5e1;
  border: 1px solid #263240 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Only set background on cards that DO NOT have intentional accent color classes */
[data-pc-theme="dark"] .card:not([class*="bg-primary"]):not([class*="bg-secondary"]):not([class*="bg-success"]):not([class*="bg-danger"]):not([class*="bg-warning"]):not([class*="bg-info"]):not([class*="bg-dark"]):not(.cargo-manifest-cockpit),
[data-bs-theme="dark"] .card:not([class*="bg-primary"]):not([class*="bg-secondary"]):not([class*="bg-success"]):not([class*="bg-danger"]):not([class*="bg-warning"]):not([class*="bg-info"]):not([class*="bg-dark"]):not(.cargo-manifest-cockpit) {
  background-color: #1b232d !important;
}

/* Cards explicitly tagged with .bg-white, .bg-light, or .bg-light-subtle */
[data-pc-theme="dark"] .card.bg-white,
[data-bs-theme="dark"] .card.bg-white,
[data-pc-theme="dark"] .card.bg-light,
[data-bs-theme="dark"] .card.bg-light,
[data-pc-theme="dark"] .card.bg-light-subtle,
[data-bs-theme="dark"] .card.bg-light-subtle,
[data-pc-theme="dark"][data-pc-direction="ltr"] .card.bg-white,
[data-bs-theme="dark"][data-pc-direction="ltr"] .card.bg-white {
  background-color: #1b232d !important;
  color: #cbd5e1 !important;
  border-color: #263240 !important;
}

/* Nested secondary cards inside main card (e.g. operations count cards, stat cards) */
[data-pc-theme="dark"] .card .card,
[data-bs-theme="dark"] .card .card,
[data-pc-theme="dark"] .card a.card,
[data-bs-theme="dark"] .card a.card,
[data-pc-theme="dark"] .card .card.bg-light-subtle,
[data-bs-theme="dark"] .card .card.bg-light-subtle,
[data-pc-theme="dark"] .card .card.bg-light,
[data-bs-theme="dark"] .card .card.bg-light,
[data-pc-theme="dark"] .card .card.bg-white,
[data-bs-theme="dark"] .card .card.bg-white {
  background-color: #202b36 !important;
  border: 1px solid #2e3d4d !important;
  color: #cbd5e1 !important;
}

[data-pc-theme="dark"] .card a.card:hover,
[data-bs-theme="dark"] .card a.card:hover {
  background-color: #263442 !important;
  border-color: #3b82f6 !important;
}

/* Card Headers & Footers */
[data-pc-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-header {
  background-color: #1e2833;
  color: #f8fafc !important;
  border-bottom: 1px solid #263240 !important;
}

[data-pc-theme="dark"] .card-header.bg-transparent,
[data-bs-theme="dark"] .card-header.bg-transparent {
  background-color: transparent !important;
  border-bottom: 1px solid #263240 !important;
}

[data-pc-theme="dark"] .card-header.bg-white,
[data-bs-theme="dark"] .card-header.bg-white,
[data-pc-theme="dark"] .card-header.bg-light,
[data-bs-theme="dark"] .card-header.bg-light,
[data-pc-theme="dark"] .card-header.bg-light-subtle,
[data-bs-theme="dark"] .card-header.bg-light-subtle {
  background-color: #1e2833 !important;
  color: #f8fafc !important;
  border-bottom: 1px solid #263240 !important;
}

[data-pc-theme="dark"] .card-footer,
[data-bs-theme="dark"] .card-footer {
  background-color: #1e2833;
  color: #cbd5e1 !important;
  border-top: 1px solid #263240 !important;
}

[data-pc-theme="dark"] .card-footer.bg-transparent,
[data-bs-theme="dark"] .card-footer.bg-transparent {
  background-color: transparent !important;
  border-top: 1px solid #263240 !important;
}

[data-pc-theme="dark"] .card-footer.bg-white,
[data-bs-theme="dark"] .card-footer.bg-white,
[data-pc-theme="dark"] .card-footer.bg-light,
[data-bs-theme="dark"] .card-footer.bg-light,
[data-pc-theme="dark"] .card-footer.bg-light-subtle,
[data-bs-theme="dark"] .card-footer.bg-light-subtle {
  background-color: #1e2833 !important;
  color: #cbd5e1 !important;
  border-top: 1px solid #263240 !important;
}

[data-pc-theme="dark"] .card-body,
[data-bs-theme="dark"] .card-body {
  color: #cbd5e1;
}

[data-pc-theme="dark"] .card-body.bg-light,
[data-bs-theme="dark"] .card-body.bg-light,
[data-pc-theme="dark"] .card-body.bg-light-subtle,
[data-bs-theme="dark"] .card-body.bg-light-subtle,
[data-pc-theme="dark"] .card-body.bg-white,
[data-bs-theme="dark"] .card-body.bg-white {
  background-color: #1b232d !important;
  color: #cbd5e1 !important;
}

/* Card titles and headings */
[data-pc-theme="dark"] .card .card-title,
[data-bs-theme="dark"] .card .card-title,
[data-pc-theme="dark"] .card h1, [data-pc-theme="dark"] .card h2,
[data-pc-theme="dark"] .card h3, [data-pc-theme="dark"] .card h4,
[data-pc-theme="dark"] .card h5, [data-pc-theme="dark"] .card h6,
[data-bs-theme="dark"] .card h1, [data-bs-theme="dark"] .card h2,
[data-bs-theme="dark"] .card h3, [data-bs-theme="dark"] .card h4,
[data-bs-theme="dark"] .card h5, [data-bs-theme="dark"] .card h6 {
  color: #f8fafc !important;
}

/* Utility boxes inside cards */
[data-pc-theme="dark"] .card .bg-light,
[data-bs-theme="dark"] .card .bg-light,
[data-pc-theme="dark"] .card .bg-light-subtle,
[data-bs-theme="dark"] .card .bg-light-subtle,
[data-pc-theme="dark"] .card .bg-white,
[data-bs-theme="dark"] .card .bg-white {
  background-color: #202b36 !important;
  color: #cbd5e1 !important;
  border-color: #2e3d4d !important;
}

/* List Groups inside cards */
[data-pc-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .list-group-item,
[data-pc-theme="dark"] .card .list-group-item,
[data-bs-theme="dark"] .card .list-group-item {
  background-color: transparent !important;
  color: #cbd5e1 !important;
  border-color: #263240 !important;
}

[data-pc-theme="dark"] .list-group-item:hover,
[data-bs-theme="dark"] .list-group-item:hover {
  background-color: rgba(255, 255, 255, 0.03) !important;
}

/* User identity card in sidebar */
[data-pc-theme="dark"] .pc-user-card,
[data-bs-theme="dark"] .pc-user-card {
  background-color: #1b232d !important;
  border-color: #263240 !important;
}

/* ==========================================================================
   4. Modal Component Dark Theme Fixes
   ========================================================================== */
[data-pc-theme="dark"] .modal-content,
[data-bs-theme="dark"] .modal-content {
  --bs-modal-bg: #1b232d;
  --bs-modal-color: #cbd5e1;
  --bs-modal-border-color: #2e3d4d;
  --bs-modal-header-border-color: #263240;
  --bs-modal-footer-border-color: #263240;
  background-color: #1b232d !important;
  color: #cbd5e1 !important;
  border: 1px solid #2e3d4d !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
}

/* Modal Headers */
[data-pc-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-header,
[data-pc-theme="dark"] .modal-header.bg-light,
[data-bs-theme="dark"] .modal-header.bg-light,
[data-pc-theme="dark"] .modal-header.bg-light-subtle,
[data-bs-theme="dark"] .modal-header.bg-light-subtle,
[data-pc-theme="dark"] .modal-header.bg-white,
[data-bs-theme="dark"] .modal-header.bg-white {
  background-color: #1e2833 !important;
  color: #f8fafc !important;
  border-bottom: 1px solid #263240 !important;
}

/* Modal contextual headers */
[data-pc-theme="dark"] .modal-header.bg-light-danger,
[data-bs-theme="dark"] .modal-header.bg-light-danger {
  background-color: rgba(220, 53, 69, 0.15) !important;
  color: #f87171 !important;
  border-bottom: 1px solid rgba(220, 53, 69, 0.25) !important;
}

[data-pc-theme="dark"] .modal-header.bg-light-primary,
[data-bs-theme="dark"] .modal-header.bg-light-primary {
  background-color: rgba(13, 110, 253, 0.15) !important;
  color: #6ea8fe !important;
  border-bottom: 1px solid rgba(13, 110, 253, 0.25) !important;
}

[data-pc-theme="dark"] .modal-header.bg-light-warning,
[data-bs-theme="dark"] .modal-header.bg-light-warning {
  background-color: rgba(255, 193, 7, 0.15) !important;
  color: #facc15 !important;
  border-bottom: 1px solid rgba(255, 193, 7, 0.25) !important;
}

[data-pc-theme="dark"] .modal-title,
[data-bs-theme="dark"] .modal-title,
[data-pc-theme="dark"] .modal-header h1,
[data-pc-theme="dark"] .modal-header h2,
[data-pc-theme="dark"] .modal-header h3,
[data-pc-theme="dark"] .modal-header h4,
[data-pc-theme="dark"] .modal-header h5,
[data-pc-theme="dark"] .modal-header h6 {
  color: #f8fafc !important;
}

/* Modal Body */
[data-pc-theme="dark"] .modal-body,
[data-bs-theme="dark"] .modal-body {
  background-color: #1b232d !important;
  color: #cbd5e1 !important;
}

/* Modal Footers */
[data-pc-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .modal-footer,
[data-pc-theme="dark"] .modal-footer.bg-light,
[data-bs-theme="dark"] .modal-footer.bg-light,
[data-pc-theme="dark"] .modal-footer.bg-light-subtle,
[data-bs-theme="dark"] .modal-footer.bg-light-subtle,
[data-pc-theme="dark"] .modal-footer.bg-white,
[data-bs-theme="dark"] .modal-footer.bg-white {
  background-color: #1e2833 !important;
  color: #cbd5e1 !important;
  border-top: 1px solid #263240 !important;
}

/* Modal Labels & Form Elements */
[data-pc-theme="dark"] .modal label,
[data-bs-theme="dark"] .modal label,
[data-pc-theme="dark"] .modal .form-label,
[data-bs-theme="dark"] .modal .form-label {
  color: #e2e8f0 !important;
}

[data-pc-theme="dark"] .modal .form-label.text-secondary,
[data-bs-theme="dark"] .modal .form-label.text-secondary {
  color: #94a3b8 !important;
}

[data-pc-theme="dark"] .modal small.text-muted,
[data-bs-theme="dark"] .modal small.text-muted {
  color: #94a3b8 !important;
}

/* Modal Form Inputs & Controls */
[data-pc-theme="dark"] .modal .form-control,
[data-bs-theme="dark"] .modal .form-control,
[data-pc-theme="dark"] .modal .form-select,
[data-bs-theme="dark"] .modal .form-select,
[data-pc-theme="dark"] .modal textarea.form-control,
[data-bs-theme="dark"] .modal textarea.form-control {
  background-color: #242f3d !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

[data-pc-theme="dark"] .modal .form-control::placeholder,
[data-bs-theme="dark"] .modal .form-control::placeholder,
[data-pc-theme="dark"] .modal textarea::placeholder,
[data-bs-theme="dark"] .modal textarea::placeholder {
  color: #64748b !important;
  opacity: 1;
}

[data-pc-theme="dark"] .modal .form-control:focus,
[data-bs-theme="dark"] .modal .form-control:focus,
[data-pc-theme="dark"] .modal .form-select:focus,
[data-bs-theme="dark"] .modal .form-select:focus,
[data-pc-theme="dark"] .modal textarea:focus,
[data-bs-theme="dark"] .modal textarea:focus {
  background-color: #242f3d !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

[data-pc-theme="dark"] .modal .form-control:disabled,
[data-bs-theme="dark"] .modal .form-control:disabled,
[data-pc-theme="dark"] .modal .form-select:disabled,
[data-bs-theme="dark"] .modal .form-select:disabled {
  background-color: #19222c !important;
  color: #64748b !important;
  border-color: #2e3d4d !important;
}

/* Modal Close Button */
[data-pc-theme="dark"] .modal .btn-close,
[data-bs-theme="dark"] .modal .btn-close,
[data-pc-theme="dark"] .offcanvas .btn-close,
[data-bs-theme="dark"] .offcanvas .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%) !important;
  opacity: 0.85;
}

[data-pc-theme="dark"] .modal .btn-close:hover,
[data-bs-theme="dark"] .modal .btn-close:hover {
  opacity: 1;
}

/* Inner preview / detail boxes inside modal (e.g. #viewRecipients, #viewText) */
[data-pc-theme="dark"] .modal .bg-light,
[data-bs-theme="dark"] .modal .bg-light,
[data-pc-theme="dark"] .modal .bg-light-subtle,
[data-bs-theme="dark"] .modal .bg-light-subtle,
[data-pc-theme="dark"] .modal .bg-white,
[data-bs-theme="dark"] .modal .bg-white {
  background-color: #202b36 !important;
  border-color: #2e3d4d !important;
  color: #cbd5e1 !important;
}

[data-pc-theme="dark"] .modal .text-dark,
[data-bs-theme="dark"] .modal .text-dark {
  color: #f1f5f9 !important;
}

/* ==========================================================================
   5. Table Component Dark Theme Fixes
   ========================================================================== */
/* Global table variables */
[data-pc-theme="dark"] .table,
[data-bs-theme="dark"] .table,
[data-pc-theme="dark"] table.dataTable,
[data-bs-theme="dark"] table.dataTable {
  --bs-table-bg: transparent;
  --bs-table-color: #cbd5e1;
  --bs-table-striped-color: #e2e8f0;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
  --bs-table-active-color: #ffffff;
  --bs-table-active-bg: rgba(255, 255, 255, 0.06);
  --bs-table-hover-color: #ffffff;
  --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
  --bs-table-border-color: #263240;
  --bs-table-accent-bg: transparent;
  color: #cbd5e1 !important;
  border-color: #263240 !important;
}

/* Crucial: Full override of Bootstrap's .table-light variables and styling */
[data-pc-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light,
[data-pc-theme="dark"] thead.table-light,
[data-bs-theme="dark"] thead.table-light,
[data-pc-theme="dark"] tr.table-light,
[data-bs-theme="dark"] tr.table-light,
[data-pc-theme="dark"] th.table-light,
[data-bs-theme="dark"] th.table-light,
[data-pc-theme="dark"] td.table-light,
[data-bs-theme="dark"] td.table-light,
[data-pc-theme="dark"] .table .table-light,
[data-bs-theme="dark"] .table .table-light {
  --bs-table-bg: #202b36 !important;
  --bs-table-color: #f1f5f9 !important;
  --bs-table-border-color: #2e3d4d !important;
  --bs-table-striped-bg: #242f3d !important;
  --bs-table-striped-color: #f1f5f9 !important;
  --bs-table-active-bg: #283544 !important;
  --bs-table-active-color: #ffffff !important;
  --bs-table-hover-bg: #283544 !important;
  --bs-table-hover-color: #ffffff !important;
  --bs-table-accent-bg: transparent !important;
  background-color: #202b36 !important;
  color: #f1f5f9 !important;
  border-color: #2e3d4d !important;
}

/* Table header cells */
[data-pc-theme="dark"] thead th,
[data-bs-theme="dark"] thead th,
[data-pc-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table thead th,
[data-pc-theme="dark"] table.dataTable thead th,
[data-bs-theme="dark"] table.dataTable thead th,
[data-pc-theme="dark"] thead.table-light th,
[data-bs-theme="dark"] thead.table-light th {
  background-color: #202b36 !important;
  color: #f1f5f9 !important;
  border-bottom: 1px solid #2e3d4d !important;
  font-weight: 600;
}

/* Table head text-secondary modifier override */
[data-pc-theme="dark"] thead.text-secondary th,
[data-bs-theme="dark"] thead.text-secondary th,
[data-pc-theme="dark"] thead.text-secondary,
[data-bs-theme="dark"] thead.text-secondary {
  color: #cbd5e1 !important;
}

/* Sticky table headers in dark mode */
[data-pc-theme="dark"] thead.sticky-top,
[data-bs-theme="dark"] thead.sticky-top,
[data-pc-theme="dark"] thead.sticky-top th,
[data-bs-theme="dark"] thead.sticky-top th {
  background-color: #202b36 !important;
  color: #f1f5f9 !important;
  z-index: 5 !important;
}

/* Table Body Cells */
[data-pc-theme="dark"] .table tbody td,
[data-bs-theme="dark"] .table tbody td,
[data-pc-theme="dark"] .table tbody th,
[data-bs-theme="dark"] .table tbody th,
[data-pc-theme="dark"] table.dataTable tbody td,
[data-bs-theme="dark"] table.dataTable tbody td {
  color: #cbd5e1 !important;
  border-color: #263240 !important;
  background-color: transparent;
}

/* Table cells with .text-dark, code, muted */
[data-pc-theme="dark"] .table td.text-dark,
[data-bs-theme="dark"] .table td.text-dark,
[data-pc-theme="dark"] .table td .text-dark,
[data-bs-theme="dark"] .table td .text-dark,
[data-pc-theme="dark"] .table th.text-dark,
[data-bs-theme="dark"] .table th.text-dark,
[data-pc-theme="dark"] .table th .text-dark,
[data-bs-theme="dark"] .table th .text-dark {
  color: #f1f5f9 !important;
}

[data-pc-theme="dark"] .table code,
[data-bs-theme="dark"] .table code {
  color: #93c5fd !important;
  background-color: rgba(255, 255, 255, 0.08);
}

[data-pc-theme="dark"] .table .text-muted,
[data-bs-theme="dark"] .table .text-muted {
  color: #94a3b8 !important;
}

[data-pc-theme="dark"] .table .text-secondary,
[data-bs-theme="dark"] .table .text-secondary {
  color: #94a3b8 !important;
}

/* Table Hover State */
[data-pc-theme="dark"] .table-hover tbody tr:hover,
[data-bs-theme="dark"] .table-hover tbody tr:hover,
[data-pc-theme="dark"] .table-hover tbody tr:hover > *,
[data-bs-theme="dark"] .table-hover tbody tr:hover > * {
  background-color: #242f3d !important;
  color: #ffffff !important;
}

/* Table Striped State */
[data-pc-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > *,
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.02) !important;
  color: #cbd5e1 !important;
}

/* Table Borders */
[data-pc-theme="dark"] .table-bordered,
[data-bs-theme="dark"] .table-bordered,
[data-pc-theme="dark"] .table-bordered > :not(caption) > *,
[data-bs-theme="dark"] .table-bordered > :not(caption) > *,
[data-pc-theme="dark"] .table-bordered th,
[data-bs-theme="dark"] .table-bordered th,
[data-pc-theme="dark"] .table-bordered td,
[data-bs-theme="dark"] .table-bordered td {
  border-color: #263240 !important;
}

/* DataTables Controls & Pagination */
[data-pc-theme="dark"] div.dt-container,
[data-bs-theme="dark"] div.dt-container {
  color: #cbd5e1;
}

[data-pc-theme="dark"] div.dt-container div.dt-search input,
[data-bs-theme="dark"] div.dt-container div.dt-search input,
[data-pc-theme="dark"] div.dt-container div.dt-length select,
[data-bs-theme="dark"] div.dt-container div.dt-length select {
  background-color: #242f3d !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

[data-pc-theme="dark"] div.dt-container .dt-info,
[data-bs-theme="dark"] div.dt-container .dt-info {
  color: #94a3b8 !important;
}

[data-pc-theme="dark"] div.dt-container .pagination .page-link,
[data-bs-theme="dark"] div.dt-container .pagination .page-link {
  background-color: #202b36;
  border-color: #263240;
  color: #cbd5e1;
}

[data-pc-theme="dark"] div.dt-container .pagination .page-item.active .page-link,
[data-bs-theme="dark"] div.dt-container .pagination .page-item.active .page-link {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
  color: #ffffff !important;
}

[data-pc-theme="dark"] div.dt-container .pagination .page-link:hover,
[data-bs-theme="dark"] div.dt-container .pagination .page-link:hover {
  background-color: #2a3747;
  color: #ffffff;
}

/* ==========================================================================
   6. Form Controls & Dropdown Menus
   ========================================================================== */
[data-pc-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-control,
[data-pc-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-select,
[data-pc-theme="dark"] textarea.form-control,
[data-bs-theme="dark"] textarea.form-control {
  background-color: #242f3d !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

[data-pc-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] .form-control::placeholder,
[data-pc-theme="dark"] textarea::placeholder,
[data-bs-theme="dark"] textarea::placeholder {
  color: #64748b !important;
  opacity: 1;
}

[data-pc-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-control:focus,
[data-pc-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-pc-theme="dark"] textarea:focus,
[data-bs-theme="dark"] textarea:focus {
  background-color: #242f3d !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

/* Select options across all browsers */
[data-pc-theme="dark"] select option,
[data-bs-theme="dark"] select option,
[data-pc-theme="dark"] .form-select option,
[data-bs-theme="dark"] .form-select option {
  background-color: #1e2833 !important;
  color: #f8fafc !important;
}

/* Checkboxes and Radios */
[data-pc-theme="dark"] .form-check-input,
[data-bs-theme="dark"] .form-check-input {
  background-color: #242f3d !important;
  border-color: #334155 !important;
}

[data-pc-theme="dark"] .form-check-input:checked,
[data-bs-theme="dark"] .form-check-input:checked {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

[data-pc-theme="dark"] .form-check-label,
[data-bs-theme="dark"] .form-check-label {
  color: #cbd5e1 !important;
}

/* Input group addon */
[data-pc-theme="dark"] .input-group-text,
[data-bs-theme="dark"] .input-group-text,
[data-pc-theme="dark"] .input-group-text.bg-white,
[data-bs-theme="dark"] .input-group-text.bg-white,
[data-pc-theme="dark"] .input-group-text.bg-light,
[data-bs-theme="dark"] .input-group-text.bg-light {
  background-color: #202b36 !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

[data-pc-theme="dark"] .input-group.bg-white,
[data-bs-theme="dark"] .input-group.bg-white {
  background-color: #242f3d !important;
  border-color: #334155 !important;
}

/* Dropdown Menus */
[data-pc-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .dropdown-menu {
  background-color: #1e2833 !important;
  border: 1px solid #2e3d4d !important;
  color: #cbd5e1 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

[data-pc-theme="dark"] .dropdown-item,
[data-bs-theme="dark"] .dropdown-item {
  color: #cbd5e1 !important;
}

[data-pc-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:hover,
[data-pc-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: #283544 !important;
  color: #ffffff !important;
}

[data-pc-theme="dark"] .dropdown-item.active,
[data-bs-theme="dark"] .dropdown-item.active {
  background-color: #0d6efd !important;
  color: #ffffff !important;
}

[data-pc-theme="dark"] .dropdown-divider,
[data-bs-theme="dark"] .dropdown-divider {
  border-color: #2e3d4d !important;
}

[data-pc-theme="dark"] .dropdown-header,
[data-bs-theme="dark"] .dropdown-header {
  color: #94a3b8 !important;
}

/* ==========================================================================
   7. Badges & Buttons in Dark Mode
   ========================================================================== */
/* Badges with light/secondary styling */
[data-pc-theme="dark"] .badge.bg-light-dark,
[data-bs-theme="dark"] .badge.bg-light-dark,
[data-pc-theme="dark"] .badge.bg-light-secondary,
[data-bs-theme="dark"] .badge.bg-light-secondary {
  background-color: #263240 !important;
  color: #f1f5f9 !important;
  border: 1px solid #334155 !important;
}

[data-pc-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.bg-light {
  background-color: #263240 !important;
  color: #cbd5e1 !important;
  border: 1px solid #334155 !important;
}

[data-pc-theme="dark"] .badge.bg-white,
[data-bs-theme="dark"] .badge.bg-white {
  background-color: #263240 !important;
  color: #6ea8fe !important;
  border: 1px solid #334155 !important;
}

/* Contextual Badges */
[data-pc-theme="dark"] .badge.bg-light-primary,
[data-bs-theme="dark"] .badge.bg-light-primary {
  background-color: rgba(13, 110, 253, 0.18) !important;
  color: #6ea8fe !important;
}

[data-pc-theme="dark"] .badge.bg-light-success,
[data-bs-theme="dark"] .badge.bg-light-success {
  background-color: rgba(25, 135, 84, 0.18) !important;
  color: #4ade80 !important;
}

[data-pc-theme="dark"] .badge.bg-light-warning,
[data-bs-theme="dark"] .badge.bg-light-warning {
  background-color: rgba(255, 193, 7, 0.18) !important;
  color: #facc15 !important;
}

[data-pc-theme="dark"] .badge.bg-light-danger,
[data-bs-theme="dark"] .badge.bg-light-danger {
  background-color: rgba(220, 53, 69, 0.18) !important;
  color: #f87171 !important;
}

[data-pc-theme="dark"] .badge.bg-light-info,
[data-bs-theme="dark"] .badge.bg-light-info {
  background-color: rgba(13, 202, 240, 0.18) !important;
  color: #38bdf8 !important;
}

/* Light Contextual Buttons */
[data-pc-theme="dark"] .btn-light-primary,
[data-bs-theme="dark"] .btn-light-primary {
  background-color: rgba(13, 110, 253, 0.15) !important;
  color: #6ea8fe !important;
  border-color: transparent !important;
}
[data-pc-theme="dark"] .btn-light-primary:hover,
[data-bs-theme="dark"] .btn-light-primary:hover {
  background-color: rgba(13, 110, 253, 0.25) !important;
  color: #ffffff !important;
}

[data-pc-theme="dark"] .btn-light-secondary,
[data-bs-theme="dark"] .btn-light-secondary {
  background-color: #263240 !important;
  color: #cbd5e1 !important;
  border-color: transparent !important;
}

[data-pc-theme="dark"] .btn-light-danger,
[data-bs-theme="dark"] .btn-light-danger {
  background-color: rgba(220, 53, 69, 0.15) !important;
  color: #f87171 !important;
  border-color: transparent !important;
}
[data-pc-theme="dark"] .btn-light-danger:hover,
[data-bs-theme="dark"] .btn-light-danger:hover {
  background-color: rgba(220, 53, 69, 0.25) !important;
  color: #ffffff !important;
}

[data-pc-theme="dark"] .btn-light-success,
[data-bs-theme="dark"] .btn-light-success {
  background-color: rgba(25, 135, 84, 0.15) !important;
  color: #4ade80 !important;
  border-color: transparent !important;
}

[data-pc-theme="dark"] .btn-light-info,
[data-bs-theme="dark"] .btn-light-info {
  background-color: rgba(13, 202, 240, 0.15) !important;
  color: #38bdf8 !important;
  border-color: transparent !important;
}

[data-pc-theme="dark"] .btn-light-warning,
[data-bs-theme="dark"] .btn-light-warning {
  background-color: rgba(255, 193, 7, 0.15) !important;
  color: #facc15 !important;
  border-color: transparent !important;
}

/* Avtar icons */
[data-pc-theme="dark"] .avtar.bg-light-primary,
[data-bs-theme="dark"] .avtar.bg-light-primary {
  background-color: rgba(13, 110, 253, 0.15) !important;
  color: #6ea8fe !important;
}
[data-pc-theme="dark"] .avtar.bg-light-success,
[data-bs-theme="dark"] .avtar.bg-light-success {
  background-color: rgba(25, 135, 84, 0.15) !important;
  color: #4ade80 !important;
}
[data-pc-theme="dark"] .avtar.bg-light-warning,
[data-bs-theme="dark"] .avtar.bg-light-warning {
  background-color: rgba(255, 193, 7, 0.15) !important;
  color: #facc15 !important;
}
[data-pc-theme="dark"] .avtar.bg-light-info,
[data-bs-theme="dark"] .avtar.bg-light-info {
  background-color: rgba(13, 202, 240, 0.15) !important;
  color: #38bdf8 !important;
}
[data-pc-theme="dark"] .avtar.bg-light-danger,
[data-bs-theme="dark"] .avtar.bg-light-danger {
  background-color: rgba(220, 53, 69, 0.15) !important;
  color: #f87171 !important;
}
[data-pc-theme="dark"] .avtar.bg-light-secondary,
[data-bs-theme="dark"] .avtar.bg-light-secondary,
[data-pc-theme="dark"] .avtar.bg-light-dark,
[data-bs-theme="dark"] .avtar.bg-light-dark {
  background-color: #263240 !important;
  color: #cbd5e1 !important;
}

/* ==========================================================================
   8. Accordions & Nav Tabs & Alerts
   ========================================================================== */
[data-pc-theme="dark"] .accordion-item,
[data-bs-theme="dark"] .accordion-item {
  background-color: #1b232d !important;
  border-color: #263240 !important;
  color: #cbd5e1 !important;
}

[data-pc-theme="dark"] .accordion-button,
[data-bs-theme="dark"] .accordion-button {
  background-color: #1e2833 !important;
  color: #f8fafc !important;
  border-color: #263240 !important;
}

[data-pc-theme="dark"] .accordion-button.bg-light,
[data-bs-theme="dark"] .accordion-button.bg-light,
[data-pc-theme="dark"] .accordion-button.bg-light-subtle,
[data-bs-theme="dark"] .accordion-button.bg-light-subtle {
  background-color: #1e2833 !important;
  color: #f8fafc !important;
  border-color: #263240 !important;
}

[data-pc-theme="dark"] .accordion-button:not(.collapsed),
[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: #242f3d !important;
  color: #6ea8fe !important;
}

[data-pc-theme="dark"] .nav-tabs,
[data-bs-theme="dark"] .nav-tabs {
  border-color: #263240 !important;
}

[data-pc-theme="dark"] .nav-tabs .nav-link,
[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: #94a3b8 !important;
}

[data-pc-theme="dark"] .nav-tabs .nav-link:hover,
[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
  color: #f1f5f9 !important;
}

[data-pc-theme="dark"] .nav-tabs .nav-link.active,
[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  color: #6ea8fe !important;
  background-color: transparent !important;
  border-color: transparent transparent #6ea8fe transparent !important;
  border-bottom: 2px solid #6ea8fe !important;
}

/* Contextual alerts in dark mode */
[data-pc-theme="dark"] .alert-light,
[data-bs-theme="dark"] .alert-light {
  background-color: #202b36 !important;
  color: #cbd5e1 !important;
  border-color: #2e3d4d !important;
}

[data-pc-theme="dark"] .alert-info,
[data-bs-theme="dark"] .alert-info {
  background-color: rgba(13, 202, 240, 0.12) !important;
  color: #7dd3fc !important;
  border-color: rgba(13, 202, 240, 0.25) !important;
}

[data-pc-theme="dark"] .alert-success,
[data-bs-theme="dark"] .alert-success {
  background-color: rgba(25, 135, 84, 0.12) !important;
  color: #86efac !important;
  border-color: rgba(25, 135, 84, 0.25) !important;
}

[data-pc-theme="dark"] .alert-warning,
[data-bs-theme="dark"] .alert-warning {
  background-color: rgba(255, 193, 7, 0.12) !important;
  color: #fde047 !important;
  border-color: rgba(255, 193, 7, 0.25) !important;
}

[data-pc-theme="dark"] .alert-danger,
[data-bs-theme="dark"] .alert-danger {
  background-color: rgba(220, 53, 69, 0.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(220, 53, 69, 0.25) !important;
}

[data-pc-theme="dark"] .alert-secondary,
[data-bs-theme="dark"] .alert-secondary {
  background-color: #202b36 !important;
  color: #cbd5e1 !important;
  border-color: #2e3d4d !important;
}

/* ========================================================================== */
/* Dashboard Operations & Pipelines Executive Cards (Light & Dark Theme)       */
/* ========================================================================== */

.ops-pipeline-card {
  border-radius: 1rem !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease !important;
  background-color: #ffffff;
  border: 1px solid #e2e8f0 !important;
}

.ops-pipeline-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
}

.ops-pipeline-card.card-cargo {
  border-top: 3px solid #2563eb !important;
}

.ops-pipeline-card.card-warehouse {
  border-top: 3px solid #06b6d4 !important;
}

.ops-pipeline-card.card-logistics {
  border-top: 3px solid #f59e0b !important;
}

/* Hero Box */
.ops-hero-box {
  position: relative;
  overflow: hidden;
  border-radius: 0.85rem;
  padding: 1.15rem 1.25rem;
  z-index: 1;
  transition: all 0.2s ease;
}

.ops-hero-box.hero-cargo {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.02) 100%);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.ops-hero-box.hero-warehouse {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(6, 182, 212, 0.02) 100%);
  border: 1px solid rgba(6, 182, 212, 0.18);
}

.ops-hero-box.hero-logistics {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.ops-watermark-icon {
  position: absolute;
  right: -10px;
  bottom: -15px;
  font-size: 5.5rem;
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

/* Pipeline Scroll Track */
.ops-scroll-track {
  max-height: 265px;
  min-height: 265px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.2) transparent;
  padding-right: 2px;
}

.ops-scroll-track::-webkit-scrollbar {
  width: 5px;
}

.ops-scroll-track::-webkit-scrollbar-track {
  background: transparent;
}

.ops-scroll-track::-webkit-scrollbar-thumb {
  background-color: rgba(100, 116, 139, 0.25);
  border-radius: 9999px;
}

.ops-scroll-track::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 116, 139, 0.45);
}

/* Pipeline Stage Tiles */
.ops-stage-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  text-decoration: none !important;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.ops-stage-tile:hover {
  transform: translateX(4px);
  background-color: #ffffff;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ops-stage-tile .tile-chevron {
  transition: transform 0.18s ease, color 0.18s ease;
  color: #94a3b8;
}

.ops-stage-tile:hover .tile-chevron {
  transform: translateX(2px);
  color: #2563eb;
}

/* Logistics 3-Step Stepper */
.ops-stepper-card {
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.ops-stepper-card:hover {
  transform: translateY(-2px);
  background: #ffffff;
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ops-step-line {
  width: 2px;
  background: #e2e8f0;
  margin: 0 auto;
}

/* Multi-segment micro bar */
.ops-stacked-track {
  display: flex;
  height: 5px;
  width: 100%;
  border-radius: 9999px;
  overflow: hidden;
  background-color: rgba(148, 163, 184, 0.2);
}

/* Dark Mode Overrides for Operations & Pipelines */
[data-pc-theme="dark"] .ops-pipeline-card,
[data-bs-theme="dark"] .ops-pipeline-card {
  background-color: #17212b !important;
  border-color: #233142 !important;
}

[data-pc-theme="dark"] .ops-pipeline-card:hover,
[data-bs-theme="dark"] .ops-pipeline-card:hover {
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.45) !important;
}

[data-pc-theme="dark"] .ops-hero-box.hero-cargo,
[data-bs-theme="dark"] .ops-hero-box.hero-cargo {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16) 0%, rgba(37, 99, 235, 0.04) 100%) !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
}

[data-pc-theme="dark"] .ops-hero-box.hero-warehouse,
[data-bs-theme="dark"] .ops-hero-box.hero-warehouse {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.16) 0%, rgba(6, 182, 212, 0.04) 100%) !important;
  border-color: rgba(6, 182, 212, 0.35) !important;
}

[data-pc-theme="dark"] .ops-hero-box.hero-logistics,
[data-bs-theme="dark"] .ops-hero-box.hero-logistics {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.04) 100%) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

[data-pc-theme="dark"] .ops-stage-tile,
[data-bs-theme="dark"] .ops-stage-tile {
  background-color: #1a2634 !important;
  border-color: #27374a !important;
  color: #f1f5f9 !important;
}

[data-pc-theme="dark"] .ops-stage-tile:hover,
[data-bs-theme="dark"] .ops-stage-tile:hover {
  background-color: #202f40 !important;
  border-color: rgba(96, 165, 250, 0.5) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-pc-theme="dark"] .ops-stepper-card,
[data-bs-theme="dark"] .ops-stepper-card {
  background-color: #1a2634 !important;
  border-color: #27374a !important;
  color: #f1f5f9 !important;
}

[data-pc-theme="dark"] .ops-stepper-card:hover,
[data-bs-theme="dark"] .ops-stepper-card:hover {
  background-color: #202f40 !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-pc-theme="dark"] .ops-stage-tile .tile-chevron,
[data-bs-theme="dark"] .ops-stage-tile .tile-chevron {
  color: #64748b !important;
}

[data-pc-theme="dark"] .ops-stage-tile:hover .tile-chevron,
[data-bs-theme="dark"] .ops-stage-tile:hover .tile-chevron {
  color: #60a5fa !important;
}

[data-pc-theme="dark"] .ops-watermark-icon,
[data-bs-theme="dark"] .ops-watermark-icon {
  opacity: 0.1 !important;
  color: #ffffff !important;
}

/* Specific text & element overrides inside ops-pipeline-card */
[data-pc-theme="dark"] .ops-pipeline-card .text-dark,
[data-bs-theme="dark"] .ops-pipeline-card .text-dark,
body[data-pc-direction="ltr"][data-pc-theme="dark"] .ops-pipeline-card .text-dark {
  color: #f1f5f9 !important;
}

[data-pc-theme="dark"] .ops-pipeline-card .text-muted,
[data-bs-theme="dark"] .ops-pipeline-card .text-muted,
body[data-pc-direction="ltr"][data-pc-theme="dark"] .ops-pipeline-card .text-muted {
  color: #94a3b8 !important;
}

[data-pc-theme="dark"] .ops-pipeline-card .card-header,
[data-bs-theme="dark"] .ops-pipeline-card .card-header {
  border-bottom-color: #233142 !important;
}

[data-pc-theme="dark"] .ops-pipeline-card .border-top,
[data-bs-theme="dark"] .ops-pipeline-card .border-top {
  border-top-color: #233142 !important;
}

[data-pc-theme="dark"] .ops-pipeline-card .bg-light-subtle,
[data-bs-theme="dark"] .ops-pipeline-card .bg-light-subtle {
  background-color: #1a2634 !important;
  color: #cbd5e1 !important;
  border-color: #2b3d52 !important;
}

/* ========================================================================== */
/* Real-time WebSocket Live Status & Avatar Pulse Styling                     */
/* ========================================================================== */

@keyframes wsPulseGlow {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes wsPulseAmber {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.ws-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  animation: wsPulseGlow 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

.ws-pulse-dot.ws-connecting {
  background-color: #f59e0b !important;
  animation: wsPulseAmber 1.2s infinite ease-in-out;
}

.ws-pulse-dot.ws-disconnected {
  background-color: #ef4444 !important;
  animation: none;
}

.ws-avatar-indicator {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  transition: all 0.25s ease;
}

.ws-avatar-indicator.ws-connecting {
  background-color: #f59e0b !important;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.ws-avatar-indicator.ws-disconnected {
  background-color: #ef4444 !important;
  box-shadow: none;
}

/* Modal and card dark mode overrides for WebSocket elements */
[data-pc-theme="dark"] #wsProfileStatusModal .modal-content,
[data-bs-theme="dark"] #wsProfileStatusModal .modal-content {
  background-color: #17212b !important;
  border-color: #233142 !important;
  color: #f1f5f9 !important;
}

[data-pc-theme="dark"] #wsProfileStatusModal .list-group-item,
[data-bs-theme="dark"] #wsProfileStatusModal .list-group-item {
  background-color: #1c2734 !important;
  border-color: #2a3848 !important;
  color: #f1f5f9 !important;
}

/* ==========================================================================
   16. Cargo Management: Fixed Table Checkbox & Floating Batch Bar Theme Styles
   ========================================================================== */
.table-checkbox-col {
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  box-sizing: border-box !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
  text-align: center !important;
  vertical-align: middle !important;
}
.table-checkbox-col .form-check-input {
  margin: 0 auto;
  float: none;
  display: inline-block;
  vertical-align: middle;
}

.cargo-floating-batch-bar {
  min-width: 320px;
  max-width: 96vw;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.18), 0 4px 12px -2px rgba(15, 23, 42, 0.08) !important;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #1e293b;
}

.cargo-floating-label {
  color: #1e293b;
}

.cargo-metric-badge {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.cargo-floating-vr {
  background-color: #cbd5e1;
  opacity: 0.6;
}

.cargo-floating-actions {
  display: flex;
  align-items: center;
  gap: 10px !important;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cargo-floating-actions::-webkit-scrollbar {
  height: 4px;
}
.cargo-floating-actions::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 4px;
}

.cargo-floating-actions .btn {
  padding: 6px 14px !important;
  font-size: 0.8125rem !important;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  white-space: nowrap !important;
  border-radius: 50rem !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.cargo-floating-actions .btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.16);
}
.cargo-floating-actions .btn:active {
  transform: translateY(0);
}

.cargo-floating-close-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  border: 1px solid #cbd5e1;
  color: #64748b;
  background-color: transparent;
  margin-left: 8px !important;
  transition: all 0.2s ease;
}
.cargo-floating-close-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
  transform: scale(1.05);
}

.cargo-substage-pills {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.cargo-substage-pills .btn {
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
[data-pc-theme="dark"] .cargo-substage-pills,
[data-bs-theme="dark"] .cargo-substage-pills {
  background: #17212b !important;
  border-color: #263240 !important;
}
[data-pc-theme="dark"] .cargo-substage-pills .btn-ghost-secondary,
[data-bs-theme="dark"] .cargo-substage-pills .btn-ghost-secondary {
  color: #cbd5e1 !important;
}

.cargo-btn-warning {
  color: #1e293b !important;
  font-weight: 600;
}

/* Dark Theme Overrides for Floating Batch Bar */
[data-pc-theme="dark"] .cargo-floating-batch-bar,
[data-bs-theme="dark"] .cargo-floating-batch-bar,
body[data-pc-theme="dark"] .cargo-floating-batch-bar,
body[data-bs-theme="dark"] .cargo-floating-batch-bar {
  background: rgba(23, 33, 43, 0.96) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(96, 165, 250, 0.3) !important;
  box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

[data-pc-theme="dark"] .cargo-floating-label,
[data-bs-theme="dark"] .cargo-floating-label {
  color: #f8fafc !important;
}

[data-pc-theme="dark"] .cargo-metric-badge,
[data-bs-theme="dark"] .cargo-metric-badge {
  background-color: #0f172a !important;
  color: #93c5fd !important;
  border: 1px solid #2a3848 !important;
}

[data-pc-theme="dark"] .cargo-floating-vr,
[data-bs-theme="dark"] .cargo-floating-vr {
  background-color: rgba(255, 255, 255, 0.2) !important;
  opacity: 0.8 !important;
}

[data-pc-theme="dark"] .cargo-floating-close-btn,
[data-bs-theme="dark"] .cargo-floating-close-btn {
  border: 1px solid #334155 !important;
  color: #cbd5e1 !important;
  background-color: rgba(255, 255, 255, 0.04) !important;
}
[data-pc-theme="dark"] .cargo-floating-close-btn:hover,
[data-bs-theme="dark"] .cargo-floating-close-btn:hover {
  background-color: #334155 !important;
  color: #ffffff !important;
  border-color: #475569 !important;
}

[data-pc-theme="dark"] .cargo-btn-warning,
[data-bs-theme="dark"] .cargo-btn-warning {
  color: #0f172a !important;
  font-weight: 600 !important;
}

/* ========================================================================== */
/* Dashlink Cargo & Manifest Operations Command Cockpit (Adaptive Light/Dark)  */
/* ========================================================================== */

/* Default / Light Theme Variables */
:root,
[data-pc-theme="light"],
[data-bs-theme="light"] {
  --cockpit-bg: radial-gradient(120% 120% at 90% 10%, rgba(14, 165, 233, 0.14) 0%, rgba(99, 102, 241, 0.07) 35%, rgba(248, 250, 252, 0.98) 75%), linear-gradient(135deg, #ffffff 0%, #f0f9ff 45%, #e2e8f0 100%);
  --cockpit-border: rgba(14, 165, 233, 0.28);
  --cockpit-shadow: 0 16px 36px -12px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(14, 165, 233, 0.12);
  --cockpit-mesh-color: rgba(15, 23, 42, 0.035);
  --cockpit-glow-orb-1: rgba(14, 165, 233, 0.08);
  --cockpit-glow-orb-2: rgba(99, 102, 241, 0.06);
  --cockpit-text-main: #0f172a;
  --cockpit-text-sub: #475569;
  --cockpit-text-muted: #64748b;
  --cockpit-heading-bg: linear-gradient(135deg, #0f172a 20%, #0369a1 70%, #0284c7 100%);
  --cockpit-heading-shadow: none;
  --cockpit-divider: rgba(203, 213, 225, 0.8);
  --cockpit-sub-divider: rgba(203, 213, 225, 0.6);

  --cockpit-live-bg: rgba(22, 163, 74, 0.1);
  --cockpit-live-border: rgba(22, 163, 74, 0.3);
  --cockpit-live-color: #15803d;

  --cockpit-station-bg: rgba(14, 165, 233, 0.1);
  --cockpit-station-border: rgba(14, 165, 233, 0.3);
  --cockpit-station-color: #0284c7;

  --cockpit-company-bg: rgba(245, 158, 11, 0.1);
  --cockpit-company-border: rgba(245, 158, 11, 0.3);
  --cockpit-company-color: #b45309;

  --cockpit-tag-bg: rgba(14, 165, 233, 0.12);
  --cockpit-tag-border: rgba(14, 165, 233, 0.3);
  --cockpit-tag-color: #0284c7;

  --cockpit-badge-bg: rgba(15, 23, 42, 0.05);
  --cockpit-badge-border: rgba(203, 213, 225, 0.8);
  --cockpit-badge-color: #475569;

  --cockpit-clock-bg: rgba(255, 255, 255, 0.9);
  --cockpit-clock-border: rgba(203, 213, 225, 0.8);

  --cockpit-pill-bg: rgba(255, 255, 255, 0.85);
  --cockpit-pill-border: rgba(203, 213, 225, 0.85);
  --cockpit-pill-color: #475569;
  --cockpit-pill-hover-bg: rgba(241, 245, 249, 1);
  --cockpit-pill-hover-color: #0f172a;
  --cockpit-pill-active-bg: rgba(14, 165, 233, 0.15);
  --cockpit-pill-active-border: #0284c7;
  --cockpit-pill-active-color: #0284c7;

  --cockpit-input-wrapper-bg: rgba(255, 255, 255, 0.95);
  --cockpit-input-wrapper-border: rgba(14, 165, 233, 0.35);
  --cockpit-input-wrapper-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
  --cockpit-input-color: #0f172a;
  --cockpit-input-placeholder: #94a3b8;

  --cockpit-quick-tag-bg: rgba(255, 255, 255, 0.85);
  --cockpit-quick-tag-border: rgba(203, 213, 225, 0.85);
  --cockpit-quick-tag-color: #334155;
  --cockpit-quick-tag-hover-bg: rgba(240, 249, 255, 1);
  --cockpit-quick-tag-hover-border: rgba(14, 165, 233, 0.5);
  --cockpit-quick-tag-hover-color: #0284c7;

  --cockpit-action-hub-bg: rgba(255, 255, 255, 0.82);
  --cockpit-action-hub-border: rgba(14, 165, 233, 0.22);
  --cockpit-action-hub-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);

  --cockpit-btn-sec-bg: rgba(255, 255, 255, 0.95);
  --cockpit-btn-sec-border: rgba(203, 213, 225, 0.9);
  --cockpit-btn-sec-color: #1e293b;
  --cockpit-btn-sec-hover-bg: rgba(240, 249, 255, 1);
  --cockpit-btn-sec-hover-border: #0284c7;
  --cockpit-btn-sec-hover-color: #0284c7;

  --cockpit-metric-card-bg: rgba(255, 255, 255, 0.82);
  --cockpit-metric-card-border: rgba(203, 213, 225, 0.75);
  --cockpit-metric-card-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  --cockpit-metric-card-hover-bg: #ffffff;
  --cockpit-metric-card-hover-border: rgba(14, 165, 233, 0.5);
  --cockpit-metric-card-hover-shadow: 0 12px 28px rgba(14, 165, 233, 0.15);

  --cockpit-cyan-color: #0284c7;
  --cockpit-emerald-color: #059669;
}

/* Dark Theme Variables */
[data-pc-theme="dark"],
[data-bs-theme="dark"] {
  --cockpit-bg: radial-gradient(120% 120% at 90% 10%, rgba(56, 189, 248, 0.22) 0%, rgba(99, 102, 241, 0.15) 35%, rgba(15, 23, 42, 0.98) 75%), linear-gradient(135deg, #09152b 0%, #0d1e3d 50%, #071124 100%);
  --cockpit-border: rgba(56, 189, 248, 0.25);
  --cockpit-shadow: 0 20px 45px -15px rgba(2, 6, 23, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --cockpit-mesh-color: rgba(255, 255, 255, 0.035);
  --cockpit-glow-orb-1: rgba(14, 165, 233, 0.16);
  --cockpit-glow-orb-2: rgba(99, 102, 241, 0.14);
  --cockpit-text-main: #ffffff;
  --cockpit-text-sub: rgba(255, 255, 255, 0.75);
  --cockpit-text-muted: rgba(255, 255, 255, 0.55);
  --cockpit-heading-bg: linear-gradient(135deg, #ffffff 40%, #bae6fd 80%, #38bdf8 100%);
  --cockpit-heading-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  --cockpit-divider: rgba(255, 255, 255, 0.12);
  --cockpit-sub-divider: rgba(255, 255, 255, 0.1);

  --cockpit-live-bg: rgba(34, 197, 94, 0.14);
  --cockpit-live-border: rgba(34, 197, 94, 0.4);
  --cockpit-live-color: #4ade80;

  --cockpit-station-bg: rgba(56, 189, 248, 0.14);
  --cockpit-station-border: rgba(56, 189, 248, 0.35);
  --cockpit-station-color: #e0f2fe;

  --cockpit-company-bg: rgba(245, 158, 11, 0.14);
  --cockpit-company-border: rgba(245, 158, 11, 0.35);
  --cockpit-company-color: #fef3c7;

  --cockpit-tag-bg: #0284c7;
  --cockpit-tag-border: rgba(56, 189, 248, 0.4);
  --cockpit-tag-color: #ffffff;

  --cockpit-badge-bg: rgba(255, 255, 255, 0.1);
  --cockpit-badge-border: rgba(255, 255, 255, 0.1);
  --cockpit-badge-color: rgba(255, 255, 255, 0.6);

  --cockpit-clock-bg: rgba(15, 23, 42, 0.65);
  --cockpit-clock-border: rgba(255, 255, 255, 0.14);

  --cockpit-pill-bg: rgba(255, 255, 255, 0.08);
  --cockpit-pill-border: rgba(255, 255, 255, 0.15);
  --cockpit-pill-color: rgba(255, 255, 255, 0.78);
  --cockpit-pill-hover-bg: rgba(255, 255, 255, 0.18);
  --cockpit-pill-hover-color: #ffffff;
  --cockpit-pill-active-bg: rgba(56, 189, 248, 0.24);
  --cockpit-pill-active-border: #38bdf8;
  --cockpit-pill-active-color: #38bdf8;

  --cockpit-input-wrapper-bg: rgba(15, 23, 42, 0.78);
  --cockpit-input-wrapper-border: rgba(255, 255, 255, 0.22);
  --cockpit-input-wrapper-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --cockpit-input-color: #ffffff;
  --cockpit-input-placeholder: rgba(255, 255, 255, 0.48);

  --cockpit-quick-tag-bg: rgba(255, 255, 255, 0.08);
  --cockpit-quick-tag-border: rgba(255, 255, 255, 0.14);
  --cockpit-quick-tag-color: rgba(255, 255, 255, 0.85);
  --cockpit-quick-tag-hover-bg: rgba(255, 255, 255, 0.2);
  --cockpit-quick-tag-hover-border: rgba(255, 255, 255, 0.35);
  --cockpit-quick-tag-hover-color: #ffffff;

  --cockpit-action-hub-bg: rgba(255, 255, 255, 0.06);
  --cockpit-action-hub-border: rgba(255, 255, 255, 0.15);
  --cockpit-action-hub-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);

  --cockpit-btn-sec-bg: rgba(255, 255, 255, 0.08);
  --cockpit-btn-sec-border: rgba(255, 255, 255, 0.16);
  --cockpit-btn-sec-color: rgba(255, 255, 255, 0.92);
  --cockpit-btn-sec-hover-bg: rgba(255, 255, 255, 0.18);
  --cockpit-btn-sec-hover-border: rgba(255, 255, 255, 0.35);
  --cockpit-btn-sec-hover-color: #ffffff;

  --cockpit-metric-card-bg: rgba(255, 255, 255, 0.05);
  --cockpit-metric-card-border: rgba(255, 255, 255, 0.12);
  --cockpit-metric-card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  --cockpit-metric-card-hover-bg: rgba(255, 255, 255, 0.1);
  --cockpit-metric-card-hover-border: rgba(56, 189, 248, 0.5);
  --cockpit-metric-card-hover-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 20px rgba(56, 189, 248, 0.25);

  --cockpit-cyan-color: #38bdf8;
  --cockpit-emerald-color: #34d399;
}

/* ========================================================================== */
/* Cockpit Structural Rules                                                   */
/* ========================================================================== */

.cargo-manifest-cockpit {
  border-radius: 1.25rem !important;
  background: var(--cockpit-bg) !important;
  border: 1px solid var(--cockpit-border) !important;
  box-shadow: var(--cockpit-shadow) !important;
  position: relative;
  overflow: hidden;
  color: var(--cockpit-text-main);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.cockpit-mesh-bg {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--cockpit-mesh-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--cockpit-mesh-color) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.cockpit-grid-overlay {
  position: absolute;
  top: 0;
  right: 0;
  width: 450px;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.cockpit-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
.cockpit-glow-orb.orb-1 {
  width: 320px;
  height: 320px;
  top: -120px;
  right: 5%;
  background: var(--cockpit-glow-orb-1);
}
.cockpit-glow-orb.orb-2 {
  width: 280px;
  height: 280px;
  bottom: -100px;
  left: 20%;
  background: var(--cockpit-glow-orb-2);
}

/* Radar Pulse */
.cockpit-radar-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: radarPulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

@keyframes radarPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 9px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Semantic Badges and Pills */
.cockpit-live-badge {
  background: var(--cockpit-live-bg) !important;
  border: 1px solid var(--cockpit-live-border) !important;
  color: var(--cockpit-live-color) !important;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.cockpit-station-pill {
  background: var(--cockpit-station-bg) !important;
  border: 1px solid var(--cockpit-station-border) !important;
  color: var(--cockpit-station-color) !important;
  font-size: 0.75rem;
}

.cockpit-company-pill {
  background: var(--cockpit-company-bg) !important;
  border: 1px solid var(--cockpit-company-border) !important;
  color: var(--cockpit-company-color) !important;
  font-size: 0.75rem;
}

.cockpit-tag-badge {
  background: var(--cockpit-tag-bg) !important;
  border: 1px solid var(--cockpit-tag-border) !important;
  color: var(--cockpit-tag-color) !important;
  border-radius: 0.35rem;
}

.cockpit-enterprise-badge {
  background: var(--cockpit-badge-bg) !important;
  border: 1px solid var(--cockpit-badge-border) !important;
  color: var(--cockpit-badge-color) !important;
  font-size: 0.72rem;
}

.cockpit-direct-badge {
  background: var(--cockpit-badge-bg) !important;
  border: 1px solid var(--cockpit-badge-border) !important;
  color: var(--cockpit-badge-color) !important;
  font-size: 0.68rem;
}

.cockpit-clock-display {
  background: var(--cockpit-clock-bg);
  border: 1px solid var(--cockpit-clock-border);
  padding: 0.28rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  backdrop-filter: blur(8px);
}

.cockpit-heading {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: var(--cockpit-heading-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: var(--cockpit-heading-shadow);
}

.cockpit-text-main {
  color: var(--cockpit-text-main) !important;
}

.cockpit-text-sub {
  color: var(--cockpit-text-sub) !important;
}

.cockpit-text-muted {
  color: var(--cockpit-text-muted) !important;
}

.cockpit-divider {
  border-color: var(--cockpit-divider) !important;
}

.cockpit-sub-divider {
  border-color: var(--cockpit-sub-divider) !important;
}

/* Omnisearch Control */
.cockpit-omnisearch {
  position: relative;
  z-index: 2;
}

.search-mode-pills .mode-pill {
  font-size: 0.73rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: var(--cockpit-pill-bg);
  border: 1px solid var(--cockpit-pill-border);
  color: var(--cockpit-pill-color);
  transition: all 0.2s ease;
}

.search-mode-pills .mode-pill:hover {
  background: var(--cockpit-pill-hover-bg);
  color: var(--cockpit-pill-hover-color);
}

.search-mode-pills .mode-pill.active {
  background: var(--cockpit-pill-active-bg);
  border-color: var(--cockpit-pill-active-border);
  color: var(--cockpit-pill-active-color);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.cockpit-input-wrapper {
  background: var(--cockpit-input-wrapper-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--cockpit-input-wrapper-border);
  border-radius: 9999px;
  padding: 5px 6px 5px 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--cockpit-input-wrapper-shadow);
}

.cockpit-input-wrapper:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35);
}

.search-icon-wrapper {
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.cockpit-input {
  background: transparent !important;
  border: none !important;
  color: var(--cockpit-input-color) !important;
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
  outline: none !important;
  box-shadow: none !important;
}

.cockpit-input::placeholder {
  color: var(--cockpit-input-placeholder) !important;
  font-size: 0.9rem;
}

.cockpit-search-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #ffffff;
  border-radius: 9999px;
  padding: 0.65rem 1.35rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.cockpit-search-btn:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.6);
}

/* Quick Tags */
.cockpit-quick-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 9999px;
  background: var(--cockpit-quick-tag-bg);
  border: 1px solid var(--cockpit-quick-tag-border);
  color: var(--cockpit-quick-tag-color) !important;
  text-decoration: none !important;
  font-size: 0.72rem;
  transition: all 0.18s ease;
}

.cockpit-quick-tag:hover {
  background: var(--cockpit-quick-tag-hover-bg);
  color: var(--cockpit-quick-tag-hover-color) !important;
  border-color: var(--cockpit-quick-tag-hover-border);
  transform: translateY(-1px);
}

.cockpit-quick-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* Action Hub */
.cockpit-action-hub {
  background: var(--cockpit-action-hub-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--cockpit-action-hub-border);
  box-shadow: var(--cockpit-action-hub-shadow);
  padding: 1.25rem 1.35rem;
  border-radius: 1rem;
  text-align: left;
}

.cockpit-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 50%, #06b6d4 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff !important;
  border-radius: 0.75rem;
  min-height: 48px;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cockpit-btn-primary:hover {
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.55);
  transform: translateY(-2px);
  color: #ffffff !important;
}

.cockpit-btn-primary .cockpit-btn-arrow {
  transition: transform 0.2s ease;
}

.cockpit-btn-primary:hover .cockpit-btn-arrow {
  transform: translateX(3px);
}

.cockpit-btn-secondary {
  background: var(--cockpit-btn-sec-bg);
  border: 1px solid var(--cockpit-btn-sec-border);
  color: var(--cockpit-btn-sec-color) !important;
  border-radius: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 42px;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cockpit-btn-secondary:hover {
  background: var(--cockpit-btn-sec-hover-bg);
  border-color: var(--cockpit-btn-sec-hover-border);
  color: var(--cockpit-btn-sec-hover-color) !important;
  transform: translateY(-1px);
}

/* 4-Quadrant Metric Cards */
.cockpit-metric-card {
  background: var(--cockpit-metric-card-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--cockpit-metric-card-border);
  border-radius: 1rem;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--cockpit-metric-card-shadow);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.cockpit-metric-card:hover {
  transform: translateY(-4px);
  background: var(--cockpit-metric-card-hover-bg);
  border-color: var(--cockpit-metric-card-hover-border);
  box-shadow: var(--cockpit-metric-card-hover-shadow);
}

.metric-badge {
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
}

.text-cyan {
  color: var(--cockpit-cyan-color) !important;
}

.text-emerald {
  color: var(--cockpit-emerald-color) !important;
}

.hover-text-cyan:hover {
  color: var(--cockpit-cyan-color) !important;
}

@media (max-width: 768px) {
  .cockpit-heading {
    font-size: 1.45rem;
  }
  .cockpit-input-wrapper {
    border-radius: 1rem;
    flex-direction: column;
    padding: 8px 10px;
    align-items: stretch !important;
  }
  .cockpit-search-btn {
    width: 100%;
    margin-top: 6px;
    justify-content: center;
  }
  .cockpit-metric-card {
    padding: 0.9rem 1rem;
  }
}

/* ========================================================================== */
/* Warehouse Cargo Distribution Layout & Non-Overlap Fixes                    */
/* ========================================================================== */
.warehouse-chart-col {
  min-width: 0 !important;
  overflow: hidden !important;
}

.warehouse-list-col {
  min-width: 0 !important;
}

.warehouse-donut-wrapper {
  width: 100% !important;
  max-width: 155px !important;
  min-height: 160px !important;
  height: 160px !important;
  margin: 0 auto !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.warehouse-donut-wrapper .apexcharts-canvas {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 auto !important;
}

.warehouse-donut-wrapper .apexcharts-canvas svg {
  max-width: 100% !important;
  width: 100% !important;
  overflow: visible !important;
}
