/*
 * DentalPro Maroc — Design System V2 Stylesheet
 * Includes: Dark Mode, Command Palette (Ctrl+K), Floating Toasts, 
 * Mobile Bottom Nav, Skeleton Loaders & Touch Target Optimizations.
 * Built with full rollback isolation (scoped via body.dp-v2 & body.dp-dark-theme).
 */

/* === DESIGN TOKENS V2 === */
body.dp-v2 {
  --dp-v2-radius: 14px;
  --dp-v2-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --dp-v2-shadow-lg: 0 20px 45px -10px rgba(15, 23, 42, 0.12);
  --dp-v2-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === DARK MODE TOKENS & COMPREHENSIVE GLOBAL COVERAGE === */
html.dp-dark-theme,
body.dp-dark-theme,
[data-bs-theme="dark"] {
  color-scheme: dark;
  --dp-bg: #0b1120 !important;
  --dp-card-bg: #131c31 !important;
  --dp-card-elevated: #1a2642 !important;
  --dp-text: #f1f5f9 !important;
  --dp-text-muted: #94a3b8 !important;
  --dp-text-light: #64748b !important;
  --dp-border-color: #233252 !important;
  --dp-primary-light: rgba(14, 165, 233, 0.16) !important;
  --dp-accent-light: rgba(16, 185, 129, 0.16) !important;
  --dp-sidebar-bg: #070c18 !important;
  --dp-topbar-bg: rgba(7, 12, 24, 0.96) !important;
  --dp-card-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.45), 0 4px 12px -2px rgba(0, 0, 0, 0.35) !important;

  /* Bootstrap 5.3 Native Variables */
  --bs-body-bg: #0b1120 !important;
  --bs-body-color: #f1f5f9 !important;
  --bs-emphasis-color: #ffffff !important;
  --bs-secondary-color: #94a3b8 !important;
  --bs-secondary-bg: #18233c !important;
  --bs-tertiary-color: #64748b !important;
  --bs-tertiary-bg: #131c31 !important;
  --bs-border-color: #233252 !important;
  --bs-card-bg: #131c31 !important;
  --bs-card-cap-bg: #18233c !important;
  --bs-card-border-color: #233252 !important;
  --bs-table-bg: transparent !important;
  --bs-table-color: #f1f5f9 !important;
  --bs-table-border-color: #233252 !important;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.025) !important;
  --bs-table-striped-color: #f1f5f9 !important;
  --bs-table-hover-bg: rgba(14, 165, 233, 0.08) !important;
  --bs-table-hover-color: #ffffff !important;
}

/* Base Layout & Page Backgrounds */
html.dp-dark-theme,
body.dp-dark-theme,
body.dp-dark-theme.dp-body,
body.dp-dark-theme .dp-layout,
body.dp-dark-theme .dp-main,
body.dp-dark-theme .dp-content {
  background-color: var(--dp-bg) !important;
  color: var(--dp-text) !important;
}

/* Topbar & Sidebar in Dark Mode */
body.dp-dark-theme .dp-topbar,
body.dp-dark-theme #topbar {
  background: var(--dp-topbar-bg) !important;
  border-bottom: 1px solid var(--dp-border-color) !important;
}

body.dp-dark-theme .dp-sidebar,
body.dp-dark-theme .sidebar {
  background: var(--dp-sidebar-bg) !important;
  border-right: 1px solid var(--dp-border-color) !important;
}

/* Topbar Search Bar & Autocomplete Results in Dark Mode */
body.dp-dark-theme .dp-topbar-search-group {
  background: #152039 !important;
  border: 1px solid #2b3d63 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}
body.dp-dark-theme .dp-topbar-search-group:focus-within {
  background: #192644 !important;
  border-color: var(--dp-primary) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}
body.dp-dark-theme #topbarSearchInput {
  background: transparent !important;
  color: #f1f5f9 !important;
}
body.dp-dark-theme #topbarSearchInput::placeholder {
  color: #94a3b8 !important;
}
body.dp-dark-theme .dp-topbar-search-kbd {
  background: #0f172a !important;
  color: #94a3b8 !important;
  border-color: #2b3d63 !important;
}
body.dp-dark-theme #topbarSearchResults {
  background: #131c31 !important;
  border-color: var(--dp-border-color) !important;
}
body.dp-dark-theme #topbarSearchResults .list-group-item {
  background: #131c31 !important;
  color: var(--dp-text) !important;
  border-color: var(--dp-border-color) !important;
}
body.dp-dark-theme #topbarSearchResults .list-group-item:hover {
  background: #1d2b4a !important;
}

/* Cards, Modals, Dropdowns, List Groups, Offcanvas, Accordions */
body.dp-dark-theme .dp-card,
body.dp-dark-theme .dp-table-card,
body.dp-dark-theme .dp-chart-card,
body.dp-dark-theme .dp-odontogram,
body.dp-dark-theme .dp-agenda-container,
body.dp-dark-theme .card,
body.dp-dark-theme .modal-content,
body.dp-dark-theme .offcanvas,
body.dp-dark-theme .dropdown-menu,
body.dp-dark-theme .list-group-item,
body.dp-dark-theme .accordion-item,
body.dp-dark-theme .accordion-body {
  background-color: var(--dp-card-bg) !important;
  background-image: none !important;
  color: var(--dp-text) !important;
  border-color: var(--dp-border-color) !important;
}

body.dp-dark-theme .dp-card,
body.dp-dark-theme .card,
body.dp-dark-theme .modal-content,
body.dp-dark-theme .dropdown-menu {
  box-shadow: var(--dp-card-shadow) !important;
}

/* Dark mode KPI cards */
body.dp-dark-theme .dp-kpi-card {
  background-color: var(--dp-card-bg) !important;
  color: var(--dp-text) !important;
  border-color: var(--dp-border-color) !important;
}

/* Card / Modal / Table Headers & Footers */
body.dp-dark-theme .dp-card-header,
body.dp-dark-theme .card-header,
body.dp-dark-theme .card-footer,
body.dp-dark-theme .modal-header,
body.dp-dark-theme .modal-footer,
body.dp-dark-theme .accordion-button {
  background: #18233c !important;
  background-color: #18233c !important;
  color: #f1f5f9 !important;
  border-color: var(--dp-border-color) !important;
}
body.dp-dark-theme .accordion-button:not(.collapsed) {
  background: #1e2d4d !important;
  color: #38bdf8 !important;
  box-shadow: inset 0 -1px 0 var(--dp-border-color) !important;
}
body.dp-dark-theme .accordion-button::after {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dropdown Items & Dividers */
body.dp-dark-theme .dropdown-item {
  color: #e2e8f0 !important;
}
body.dp-dark-theme .dropdown-item:hover,
body.dp-dark-theme .dropdown-item:focus {
  background-color: #1e2d4d !important;
  color: #38bdf8 !important;
}
body.dp-dark-theme .dropdown-header {
  color: #94a3b8 !important;
  border-color: var(--dp-border-color) !important;
}
body.dp-dark-theme .dropdown-divider {
  border-top-color: var(--dp-border-color) !important;
  opacity: 1;
}

/* Tables & DataTables */
body.dp-dark-theme .table,
body.dp-dark-theme .dp-table,
body.dp-dark-theme .table > :not(caption) > * > *,
body.dp-dark-theme .table td,
body.dp-dark-theme .table th,
body.dp-dark-theme .dp-table tbody td {
  background-color: transparent !important;
  color: var(--dp-text) !important;
  border-color: var(--dp-border-color) !important;
}

body.dp-dark-theme .table-light,
body.dp-dark-theme .table-light > th,
body.dp-dark-theme .table-light > td,
body.dp-dark-theme thead th,
body.dp-dark-theme .dp-table thead th,
body.dp-dark-theme .table thead th {
  background-color: #18233c !important;
  background: #18233c !important;
  color: #cbd5e1 !important;
  border-color: var(--dp-border-color) !important;
}

body.dp-dark-theme .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.025) !important;
  color: var(--dp-text) !important;
}

body.dp-dark-theme .table tbody tr:hover,
body.dp-dark-theme .dp-table tbody tr:hover,
body.dp-dark-theme .table-hover > tbody > tr:hover > * {
  background-color: rgba(14, 165, 233, 0.08) !important;
  color: #ffffff !important;
}

/* Contextual Table Rows in Dark Mode */
body.dp-dark-theme tr.table-warning,
body.dp-dark-theme tr.table-warning > td,
body.dp-dark-theme tr.table-warning > th,
body.dp-dark-theme .table-warning {
  background-color: rgba(245, 158, 11, 0.14) !important;
  color: #fde68a !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}
body.dp-dark-theme tr.table-danger,
body.dp-dark-theme tr.table-danger > td,
body.dp-dark-theme tr.table-danger > th,
body.dp-dark-theme .table-danger {
  background-color: rgba(239, 68, 68, 0.14) !important;
  color: #fecaca !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
body.dp-dark-theme tr.table-success,
body.dp-dark-theme tr.table-success > td,
body.dp-dark-theme tr.table-success > th,
body.dp-dark-theme .table-success {
  background-color: rgba(16, 185, 129, 0.14) !important;
  color: #a7f3d0 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}
body.dp-dark-theme tr.table-info,
body.dp-dark-theme tr.table-info > td,
body.dp-dark-theme tr.table-info > th,
body.dp-dark-theme .table-info {
  background-color: rgba(14, 165, 233, 0.14) !important;
  color: #bae6fd !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
}
body.dp-dark-theme tr.table-secondary,
body.dp-dark-theme tr.table-secondary > td,
body.dp-dark-theme .table-secondary {
  background-color: rgba(148, 163, 184, 0.12) !important;
  color: #cbd5e1 !important;
}

/* DataTables Controls & Pagination */
body.dp-dark-theme .dataTables_wrapper,
body.dp-dark-theme .dataTables_info,
body.dp-dark-theme .dataTables_length label,
body.dp-dark-theme .dataTables_filter label {
  color: var(--dp-text-muted) !important;
}
body.dp-dark-theme .dataTables_wrapper .dataTables_filter input,
body.dp-dark-theme .dataTables_wrapper .dataTables_length select {
  background-color: #18233c !important;
  color: #f1f5f9 !important;
  border-color: #2b3d63 !important;
}
body.dp-dark-theme .page-link,
body.dp-dark-theme .paginate_button {
  background-color: #18233c !important;
  border-color: #2b3d63 !important;
  color: #cbd5e1 !important;
}
body.dp-dark-theme .page-link:hover,
body.dp-dark-theme .paginate_button:hover {
  background-color: #233252 !important;
  color: #38bdf8 !important;
  border-color: var(--dp-primary) !important;
}
body.dp-dark-theme .page-item.active .page-link,
body.dp-dark-theme .paginate_button.current {
  background-color: var(--dp-primary) !important;
  border-color: var(--dp-primary) !important;
  color: #ffffff !important;
}
body.dp-dark-theme .page-item.disabled .page-link {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
  color: #475569 !important;
}

/* Forms, Inputs, Selects, Textareas, Input Groups, Checkboxes */
body.dp-dark-theme .form-control,
body.dp-dark-theme .form-select,
body.dp-dark-theme input[type="text"]:not(#topbarSearchInput):not(.dp-cmd-input),
body.dp-dark-theme input[type="number"],
body.dp-dark-theme input[type="date"],
body.dp-dark-theme input[type="time"],
body.dp-dark-theme input[type="datetime-local"],
body.dp-dark-theme input[type="month"],
body.dp-dark-theme input[type="email"],
body.dp-dark-theme input[type="tel"],
body.dp-dark-theme input[type="password"],
body.dp-dark-theme input[type="search"],
body.dp-dark-theme input[type="url"],
body.dp-dark-theme select,
body.dp-dark-theme textarea {
  background-color: #18233c !important;
  color: #f1f5f9 !important;
  border-color: #2b3d63 !important;
}

body.dp-dark-theme .form-control:focus,
body.dp-dark-theme .form-select:focus,
body.dp-dark-theme textarea:focus {
  background-color: #1d2b4a !important;
  border-color: var(--dp-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.22) !important;
}

body.dp-dark-theme .form-control:disabled,
body.dp-dark-theme .form-control[readonly],
body.dp-dark-theme .form-select:disabled {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  border-color: #1e293b !important;
}

body.dp-dark-theme .form-control::placeholder,
body.dp-dark-theme textarea::placeholder {
  color: #64748b !important;
  opacity: 1;
}

body.dp-dark-theme .input-group-text {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #2b3d63 !important;
}

body.dp-dark-theme .form-check-input {
  background-color: #18233c !important;
  border-color: #475569 !important;
}
body.dp-dark-theme .form-check-input:checked {
  background-color: var(--dp-primary) !important;
  border-color: var(--dp-primary) !important;
}

body.dp-dark-theme .form-label,
body.dp-dark-theme .form-check-label,
body.dp-dark-theme label {
  color: #e2e8f0;
}
body.dp-dark-theme .form-text {
  color: #94a3b8 !important;
}
body.dp-dark-theme .form-section-title {
  color: #38bdf8 !important;
  border-bottom-color: #233252 !important;
}

/* Navigation Tabs & Pills */
body.dp-dark-theme .nav-tabs {
  border-bottom-color: var(--dp-border-color) !important;
}
body.dp-dark-theme .nav-tabs .nav-link,
body.dp-dark-theme .nav-pills .nav-link {
  color: #94a3b8 !important;
  background-color: transparent;
  border-color: transparent !important;
}
body.dp-dark-theme .nav-tabs .nav-link:hover:not(.active),
body.dp-dark-theme .nav-pills .nav-link:hover:not(.active) {
  color: #f1f5f9 !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--dp-border-color) !important;
}
body.dp-dark-theme .nav-tabs .nav-link.active,
body.dp-dark-theme .nav-pills .nav-link.active {
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(14, 165, 233, 0.28) !important;
}

/* Typography & Utility Classes in Dark Mode */
body.dp-dark-theme .text-dark,
body.dp-dark-theme .text-black,
body.dp-dark-theme .text-body,
body.dp-dark-theme .dp-page-title,
body.dp-dark-theme .dp-card-title,
body.dp-dark-theme .dp-chart-title,
body.dp-dark-theme h1, body.dp-dark-theme h2,
body.dp-dark-theme h3, body.dp-dark-theme h4,
body.dp-dark-theme h5, body.dp-dark-theme h6 {
  color: #f8fafc !important;
}

body.dp-dark-theme .text-muted,
body.dp-dark-theme .text-secondary,
body.dp-dark-theme .dp-breadcrumb {
  color: #94a3b8 !important;
}

body.dp-dark-theme .bg-white,
body.dp-dark-theme .bg-light,
body.dp-dark-theme .bg-body,
body.dp-dark-theme .bg-body-tertiary,
body.dp-dark-theme .bg-body-secondary {
  background-color: #18233c !important;
  color: var(--dp-text) !important;
}

body.dp-dark-theme .border,
body.dp-dark-theme .border-top,
body.dp-dark-theme .border-bottom,
body.dp-dark-theme .border-start,
body.dp-dark-theme .border-end,
body.dp-dark-theme .border-light,
body.dp-dark-theme .border-secondary-subtle,
body.dp-dark-theme hr {
  border-color: var(--dp-border-color) !important;
}

/* Buttons, Action Buttons & Close Button in Dark Mode */
body.dp-dark-theme .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%) !important;
}
body.dp-dark-theme .btn-light,
body.dp-dark-theme .btn-white {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}
body.dp-dark-theme .btn-light:hover,
body.dp-dark-theme .btn-white:hover {
  background-color: #283548 !important;
  color: #ffffff !important;
}
body.dp-dark-theme .btn-outline-secondary,
body.dp-dark-theme .btn-outline-dark {
  color: #cbd5e1 !important;
  border-color: #475569 !important;
}
body.dp-dark-theme .btn-outline-secondary:hover,
body.dp-dark-theme .btn-outline-dark:hover {
  background-color: #334155 !important;
  color: #ffffff !important;
  border-color: #64748b !important;
}

body.dp-dark-theme .btn-action {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
}
body.dp-dark-theme .btn-action-view {
  background-color: rgba(14, 165, 233, 0.18) !important;
  color: #38bdf8 !important;
}
body.dp-dark-theme .btn-action-edit {
  background-color: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
}
body.dp-dark-theme .btn-action-delete {
  background-color: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
}

/* Subtle Badges & Status Badges in Dark Mode */
body.dp-dark-theme .badge.bg-light,
body.dp-dark-theme .badge.bg-white,
body.dp-dark-theme .badge.bg-secondary-subtle {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}
body.dp-dark-theme .badge.bg-primary-subtle {
  background-color: rgba(14, 165, 233, 0.18) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(14, 165, 233, 0.35) !important;
}
body.dp-dark-theme .badge.bg-success-subtle,
body.dp-dark-theme .badge-status-confirme,
body.dp-dark-theme .badge-status-termine,
body.dp-dark-theme .badge-status-payee,
body.dp-dark-theme .dp-appt-confirme,
body.dp-dark-theme .dp-appt-termine {
  background-color: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
body.dp-dark-theme .badge.bg-warning-subtle,
body.dp-dark-theme .badge-status-en_attente,
body.dp-dark-theme .badge-status-partiellement_payee,
body.dp-dark-theme .dp-appt-en_attente {
  background-color: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
body.dp-dark-theme .badge.bg-danger-subtle,
body.dp-dark-theme .badge-status-absent,
body.dp-dark-theme .badge-status-annulee,
body.dp-dark-theme .dp-appt-absent {
  background-color: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
body.dp-dark-theme .badge.bg-info-subtle,
body.dp-dark-theme .badge-status-en_salle,
body.dp-dark-theme .badge-status-emise {
  background-color: rgba(56, 189, 248, 0.18) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}
body.dp-dark-theme .badge-status-annule,
body.dp-dark-theme .badge-status-brouillon {
  background-color: rgba(148, 163, 184, 0.18) !important;
  color: #cbd5e1 !important;
}

/* Alerts & Medical Alert Banners in Dark Mode */
body.dp-dark-theme .alert-light,
body.dp-dark-theme .alert-secondary {
  background-color: #18233c !important;
  color: #e2e8f0 !important;
  border-color: #2b3d63 !important;
}
body.dp-dark-theme .alert-info {
  background-color: rgba(14, 165, 233, 0.14) !important;
  color: #bae6fd !important;
  border-color: rgba(14, 165, 233, 0.35) !important;
}
body.dp-dark-theme .alert-warning {
  background-color: rgba(245, 158, 11, 0.14) !important;
  color: #fde68a !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
body.dp-dark-theme .alert-success {
  background-color: rgba(16, 185, 129, 0.14) !important;
  color: #a7f3d0 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
body.dp-dark-theme .alert-danger,
body.dp-dark-theme .dp-medical-alert {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #fecaca !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}
body.dp-dark-theme .dp-medical-alert-item {
  color: #fecaca !important;
}

/* Module-Specific Components: Odontogram, Agenda, Reconciliation, Orthodontics, Mobile */
body.dp-dark-theme .dp-tooth {
  background-color: #18233c !important;
  border-color: #2b3d63 !important;
  color: #e2e8f0 !important;
}
body.dp-dark-theme .dp-tooth:hover {
  border-color: var(--dp-primary) !important;
  background-color: #1e2d4d !important;
}
body.dp-dark-theme .dp-agenda-slot {
  background-color: transparent !important;
}
body.dp-dark-theme .dp-agenda-slot:hover {
  background-color: rgba(14, 165, 233, 0.08) !important;
}
body.dp-dark-theme .dp-agenda-hour {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  border-right-color: var(--dp-border-color) !important;
}
body.dp-dark-theme .dp-recon-accordion .accordion-item,
body.dp-dark-theme .dp-recon-header-btn,
body.dp-dark-theme .dp-anomaly-card {
  background: var(--dp-card-bg) !important;
  color: var(--dp-text) !important;
  border-color: var(--dp-border-color) !important;
}
body.dp-dark-theme .dp-recon-header-btn:hover,
body.dp-dark-theme .dp-recon-header-btn[aria-expanded="true"] {
  background: #18233c !important;
  border-bottom-color: var(--dp-border-color) !important;
}
body.dp-dark-theme .dp-recon-chevron {
  background: #1e293b !important;
  color: #cbd5e1 !important;
}
body.dp-dark-theme .dp-summary-mini-card {
  background: #18233c !important;
  border-color: var(--dp-border-color) !important;
  color: var(--dp-text) !important;
}
body.dp-dark-theme .dp-summary-mini-card.dp-changed {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
body.dp-dark-theme .dp-mobile-bottom-nav {
  background-color: rgba(15, 23, 42, 0.96) !important;
  border-top-color: var(--dp-border-color) !important;
}
body.dp-dark-theme pre,
body.dp-dark-theme code {
  color: #e2e8f0;
}
body.dp-dark-theme pre {
  background-color: #0f172a !important;
  border-color: var(--dp-border-color) !important;
}

/* Override Hardcoded Light Inline Styles Across Module Views (Screen Only) */
@media screen {
  body.dp-dark-theme [style*="background:#fff"],
  body.dp-dark-theme [style*="background: #fff"],
  body.dp-dark-theme [style*="background:#ffffff"],
  body.dp-dark-theme [style*="background: #ffffff"],
  body.dp-dark-theme [style*="background-color:#fff"],
  body.dp-dark-theme [style*="background-color: #fff"],
  body.dp-dark-theme [style*="background-color:#ffffff"],
  body.dp-dark-theme [style*="background-color: #ffffff"],
  body.dp-dark-theme [style*="background: white"],
  body.dp-dark-theme [style*="background:white"] {
    background-color: var(--dp-card-bg) !important;
    background-image: none !important;
    color: var(--dp-text) !important;
  }

  body.dp-dark-theme [style*="background:#f8fafc"],
  body.dp-dark-theme [style*="background: #f8fafc"],
  body.dp-dark-theme [style*="background-color:#f8fafc"],
  body.dp-dark-theme [style*="background-color: #f8fafc"],
  body.dp-dark-theme [style*="background:#fafafa"],
  body.dp-dark-theme [style*="background: #fafafa"],
  body.dp-dark-theme [style*="background:#f1f5f9"],
  body.dp-dark-theme [style*="background: #f1f5f9"],
  body.dp-dark-theme [style*="background-color:#f1f5f9"],
  body.dp-dark-theme [style*="background-color: #f1f5f9"],
  body.dp-dark-theme [style*="background:linear-gradient(135deg,#f8fafc"],
  body.dp-dark-theme [style*="background: linear-gradient(135deg, #f8fafc"] {
    background: #18233c !important;
    background-color: #18233c !important;
    color: var(--dp-text) !important;
  }

  body.dp-dark-theme [style*="background:#f0f9ff"],
  body.dp-dark-theme [style*="background: #f0f9ff"],
  body.dp-dark-theme [style*="background:#eff6ff"],
  body.dp-dark-theme [style*="background:#eef2ff"] {
    background: rgba(14, 165, 233, 0.14) !important;
    background-color: rgba(14, 165, 233, 0.14) !important;
  }

  body.dp-dark-theme [style*="background:#fffbeb"],
  body.dp-dark-theme [style*="background: #fffbeb"],
  body.dp-dark-theme [style*="background-color:#fffbeb"],
  body.dp-dark-theme [style*="background:#fef9ec"] {
    background: rgba(245, 158, 11, 0.14) !important;
    background-color: rgba(245, 158, 11, 0.14) !important;
  }

  body.dp-dark-theme [style*="background:#f0fdf4"],
  body.dp-dark-theme [style*="background: #f0fdf4"],
  body.dp-dark-theme [style*="background:#e8f5e9"] {
    background: rgba(16, 185, 129, 0.14) !important;
    background-color: rgba(16, 185, 129, 0.14) !important;
  }

  body.dp-dark-theme [style*="background:#fef2f2"],
  body.dp-dark-theme [style*="background: #fef2f2"] {
    background: rgba(239, 68, 68, 0.14) !important;
    background-color: rgba(239, 68, 68, 0.14) !important;
  }

  body.dp-dark-theme [style*="color:#0f172a"],
  body.dp-dark-theme [style*="color: #0f172a"],
  body.dp-dark-theme [style*="color:#1e293b"],
  body.dp-dark-theme [style*="color: #1e293b"],
  body.dp-dark-theme [style*="color:#334155"],
  body.dp-dark-theme [style*="color: #334155"] {
    color: #f1f5f9 !important;
  }

  body.dp-dark-theme [style*="color:#475569"],
  body.dp-dark-theme [style*="color: #475569"],
  body.dp-dark-theme [style*="color:#64748b"],
  body.dp-dark-theme [style*="color: #64748b"] {
    color: #94a3b8 !important;
  }

  body.dp-dark-theme [style*="color:#1e40af"],
  body.dp-dark-theme [style*="color: #1e40af"] {
    color: #38bdf8 !important;
  }

  body.dp-dark-theme [style*="border: 1px solid #e2e8f0"],
  body.dp-dark-theme [style*="border:1px solid #e2e8f0"],
  body.dp-dark-theme [style*="border: 1px solid #cbd5e1"],
  body.dp-dark-theme [style*="border-color:#e2e8f0"] {
    border-color: var(--dp-border-color) !important;
  }

  /* Scrollbars in Dark Mode */
  body.dp-dark-theme ::-webkit-scrollbar-track {
    background: #0b1120;
  }
  body.dp-dark-theme ::-webkit-scrollbar-thumb {
    background: #334155;
  }
  body.dp-dark-theme ::-webkit-scrollbar-thumb:hover {
    background: var(--dp-primary);
  }
}

/* === FLOATING TOAST CONTAINER V2 === */
#dpToastContainer {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
  width: calc(100vw - 3rem);
  pointer-events: none;
}

.dp-toast {
  pointer-events: auto;
  background: #ffffff;
  color: #0f172a;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.18), 0 5px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid rgba(14, 165, 233, 0.25);
  animation: dpToastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

body.dp-dark-theme .dp-toast {
  background: #1e293b;
  color: #f8fafc;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.dp-toast-success { border-color: rgba(16, 185, 129, 0.35); }
.dp-toast-danger  { border-color: rgba(239, 68, 68, 0.35); }
.dp-toast-warning { border-color: rgba(245, 158, 11, 0.35); }
.dp-toast-info    { border-color: rgba(14, 165, 233, 0.35); }

.dp-toast-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}
.dp-toast-success .dp-toast-icon { color: #10b981; }
.dp-toast-danger  .dp-toast-icon { color: #ef4444; }
.dp-toast-warning .dp-toast-icon { color: #f59e0b; }
.dp-toast-info    .dp-toast-icon { color: #0ea5e9; }

.dp-toast-content {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
}

.dp-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.dp-toast-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}
body.dp-dark-theme .dp-toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

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

@keyframes dpToastFadeOut {
  to {
    opacity: 0;
    transform: translateX(40px) scale(0.9);
  }
}

/* === COMMAND PALETTE (CTRL+K) V2 === */
.dp-cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1080;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.dp-cmd-dialog {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.35);
  width: 100%;
  max-width: 620px;
  overflow: hidden;
  transform: translateY(-15px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

body.dp-dark-theme .dp-cmd-dialog {
  background: #151f38;
  border-color: #243252;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.dp-cmd-backdrop.active .dp-cmd-dialog {
  transform: translateY(0) scale(1);
}

.dp-cmd-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}
body.dp-dark-theme .dp-cmd-header {
  border-bottom-color: #243252;
}

.dp-cmd-input {
  border: none !important;
  box-shadow: none !important;
  font-size: 1.05rem;
  font-weight: 500;
  background: transparent !important;
  color: inherit;
  width: 100%;
  outline: none;
}

.dp-cmd-shortcut-badge {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}
body.dp-dark-theme .dp-cmd-shortcut-badge {
  background: #1e2c50;
  color: #94a3b8;
  border-color: #334155;
}

.dp-cmd-body {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.dp-cmd-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 700;
  padding: 0.6rem 0.8rem 0.3rem 0.8rem;
}

.dp-cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: #1e293b;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
body.dp-dark-theme .dp-cmd-item {
  color: #e2e8f0;
}

.dp-cmd-item:hover, .dp-cmd-item.selected {
  background: #f0f9ff;
  color: #0ea5e9;
}
body.dp-dark-theme .dp-cmd-item:hover, 
body.dp-dark-theme .dp-cmd-item.selected {
  background: #1e2e4a;
  color: #38bdf8;
}

.dp-cmd-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
body.dp-dark-theme .dp-cmd-item-icon {
  background: #1e3a5f;
  color: #38bdf8;
}

/* === MOBILE BOTTOM NAVIGATION BAR V2 === */
.dp-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  display: none;
  justify-content: space-around;
  align-items: center;
  z-index: 1040;
  box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.05);
  padding: 0 0.5rem;
}

body.dp-dark-theme .dp-bottom-nav {
  background: rgba(15, 23, 42, 0.94);
  border-top-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
  body.dp-v2 .dp-bottom-nav {
    display: flex !important;
  }
  body.dp-v2 .dp-main {
    padding-bottom: 75px !important;
  }
}

.dp-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #64748b;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  flex: 1;
  height: 100%;
  transition: color 0.15s ease;
}
body.dp-dark-theme .dp-bottom-nav-item {
  color: #94a3b8;
}

.dp-bottom-nav-item i {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.dp-bottom-nav-item:hover,
.dp-bottom-nav-item.active {
  color: #0ea5e9;
}
.dp-bottom-nav-item.active i {
  transform: translateY(-2px) scale(1.1);
}

/* === SHIMMER SKELETON LOADERS === */
.dp-skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: dpSkeletonShimmer 1.4s ease infinite;
  border-radius: 8px;
}
body.dp-dark-theme .dp-skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 37%, #1e293b 63%);
  background-size: 400% 100%;
}

@keyframes dpSkeletonShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* === CHAIRSIDE TOUCH TARGET OPTIMIZATIONS === */
@media (max-width: 992px) {
  body.dp-v2 .btn:not(.btn-sm):not(.btn-xs),
  body.dp-v2 .form-control:not(.form-control-sm),
  body.dp-v2 .form-select:not(.form-select-sm) {
    min-height: 42px;
  }
  body.dp-v2 .btn,
  body.dp-v2 .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
