/* ==========================================================================
   WEEGOSOFT MANAGER (WSM) — PREMIUM DARK MODE (Obsidian & Slate Theme)
   ========================================================================== */

body.dark-mode,
html.system-dark-mode body,
body.theme-dark {
    background-color: #0f172a !important; /* Deep Obsidian Slate */
    color: #f8fafc !important;          /* Slate 50 High Contrast Text */
}

/* NAVBAR & HEADER */
.dark-mode .navbar,
.dark-mode .header,
.dark-mode .navbar-top {
    background-color: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.dark-mode .navbar-light .navbar-brand,
.dark-mode .navbar-light .navbar-nav .nav-link {
    color: #f8fafc !important;
}

.dark-mode .navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary) !important;
}

/* CARDS & CONTAINERS */
.dark-mode .card,
.dark-mode .settings-card,
.dark-mode .card-body,
.dark-mode .card-header,
.dark-mode .card-footer,
.dark-mode .settings-section-header,
.dark-mode .modal-content,
.dark-mode .dropdown-menu {
    background-color: #1e293b !important; /* Slate 800 Surface */
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.dark-mode .card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.dark-mode .card-header,
.dark-mode .settings-section-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
    color: #f8fafc !important;
}

.dark-mode .card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
}

/* OVERRIDE GENERIC UTILITY CLASSES */
.dark-mode .bg-white,
.dark-mode .bg-light {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

.dark-mode .text-dark,
.dark-mode .text-body {
    color: #f8fafc !important;
}

.dark-mode .text-muted,
.dark-mode small.text-muted,
.dark-mode .settings-desc {
    color: #94a3b8 !important; /* Slate 400 - Clear Legibility */
}

/* FORM CONTROLS & INPUTS */
.dark-mode .form-control,
.dark-mode select.form-control,
.dark-mode textarea.form-control,
.dark-mode .custom-select,
.dark-mode .input-group-text {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}

.dark-mode .form-control:focus,
.dark-mode select.form-control:focus,
.dark-mode textarea.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent) !important;
    background-color: #0f172a !important;
    color: #ffffff !important;
}

.dark-mode .form-control::placeholder {
    color: #64748b !important;
}

/* BUTTONS */
.dark-mode .btn-light,
.theme-dark .btn-light {
    background-color: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

.dark-mode .btn-light:hover,
.theme-dark .btn-light:hover {
    background-color: #475569 !important;
    color: #ffffff !important;
    border-color: #64748b !important;
}

.dark-mode .btn-secondary,
.theme-dark .btn-secondary,
.dark-mode .btn-dark,
.theme-dark .btn-dark {
    background-color: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

.dark-mode .btn-secondary:hover,
.theme-dark .btn-secondary:hover,
.dark-mode .btn-dark:hover,
.theme-dark .btn-dark:hover {
    background-color: #475569 !important;
    color: #ffffff !important;
    border-color: #64748b !important;
}

.dark-mode .btn-outline-secondary,
.theme-dark .btn-outline-secondary {
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

.dark-mode .btn-outline-secondary:hover,
.theme-dark .btn-outline-secondary:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* LIST GROUPS */
.dark-mode .list-group,
.dark-mode .list-group-item {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.dark-mode .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

.dark-mode .list-group-item.active {
    background-color: color-mix(in srgb, var(--primary) 20%, transparent) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* TABLES */
.dark-mode .table,
.dark-mode .table td,
.dark-mode .table th {
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.dark-mode .table thead th {
    background-color: rgba(0, 0, 0, 0.2) !important;
    color: #cbd5e1 !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08) !important;
}

.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* MODALS & DROPDOWNS */
.dark-mode .modal-content,
.dark-mode .dropdown-menu,
.theme-dark .modal-content,
.theme-dark .dropdown-menu {
    background-color: #1e293b !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

.dark-mode .modal-header,
.theme-dark .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.dark-mode .modal-footer,
.theme-dark .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.dark-mode .modal-title,
.theme-dark .modal-title {
    color: #f8fafc !important;
}

.dark-mode .modal-body,
.theme-dark .modal-body {
    color: #cbd5e1 !important;
}

.dark-mode .modal-header .close,
.dark-mode .modal-content .close,
.theme-dark .modal-header .close,
.theme-dark .modal-content .close {
    color: #cbd5e1 !important;
    text-shadow: none !important;
    opacity: 0.75;
}

.dark-mode .modal-header .close:hover,
.dark-mode .modal-content .close:hover,
.theme-dark .modal-header .close:hover,
.theme-dark .modal-content .close:hover {
    color: #ffffff !important;
    opacity: 1;
}

.dark-mode .dropdown-item,
.theme-dark .dropdown-item {
    color: #f8fafc !important;
}

.dark-mode .dropdown-item:hover,
.theme-dark .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--primary) !important;
}

/* BOTTOM NAVIGATION BAR */
body.dark-mode #navbarBottom,
.theme-dark #navbarBottom {
    background-color: #0f172a !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode #navbarBottom .nav-item .nav-link,
.theme-dark #navbarBottom .nav-item .nav-link {
    color: #94a3b8 !important;
}

body.dark-mode #navbarBottom .nav-item.active .nav-link,
.theme-dark #navbarBottom .nav-item.active .nav-link,
body.dark-mode #navbarBottom .nav-item .nav-link.active,
.theme-dark #navbarBottom .nav-item .nav-link.active {
    color: var(--primary) !important;
}

/* ALERTS & BADGES */
.dark-mode .alert {
    border-radius: 10px !important;
}

.dark-mode .alert-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #34d399 !important;
}

.dark-mode .alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

.dark-mode .alert-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

.dark-mode .alert-info {
    background-color: rgba(6, 182, 212, 0.15) !important;
    border-color: rgba(6, 182, 212, 0.3) !important;
    color: #38bdf8 !important;
}

/* CUSTOM ACCENT HIGHLIGHTS */
.dark-mode .border-bottom,
.dark-mode .border-top,
.dark-mode .border-left,
.dark-mode .border-right,
.dark-mode .border {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   POS & SALES INTERFACE — DARK MODE OPTIMIZATIONS
   ========================================================================== */

/* Search Bars & Input Groups in POS */
body.dark-mode .input-group-text,
.theme-dark .input-group-text,
body.dark-mode .input-group-prepend .input-group-text,
.theme-dark .input-group-prepend .input-group-text,
body.dark-mode .input-group-append .input-group-text,
.theme-dark .input-group-append .input-group-text {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

body.dark-mode #input-place-search-local,
.theme-dark #input-place-search-local,
body.dark-mode #input-customer-search,
.theme-dark #input-customer-search,
body.dark-mode #invoice-place-search,
.theme-dark #invoice-place-search,
body.dark-mode .pos-search-input,
.theme-dark .pos-search-input {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

body.dark-mode #input-place-search-local::placeholder,
.theme-dark #input-place-search-local::placeholder,
body.dark-mode #input-customer-search::placeholder,
.theme-dark #input-customer-search::placeholder {
    color: #64748b !important;
}

/* POS Toolbar (Qty, Quick Add, View Mode, Sorter) */
body.dark-mode .pos-toolbar-btn,
.theme-dark .pos-toolbar-btn,
body.dark-mode .display-mode,
.theme-dark .display-mode {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

body.dark-mode .pos-toolbar-btn:hover,
.theme-dark .pos-toolbar-btn:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

body.dark-mode .pos-toolbar-btn.active,
.theme-dark .pos-toolbar-btn.active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

body.dark-mode .display-mode a.btn-light,
.theme-dark .display-mode a.btn-light {
    background-color: transparent !important;
    color: #94a3b8 !important;
}

body.dark-mode .display-mode a.btn-primary,
.theme-dark .display-mode a.btn-primary {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

/* Status Filters (Tables / Places) */
body.dark-mode .status-filter-btn,
.theme-dark .status-filter-btn,
body.dark-mode .btn-view-toggle,
.theme-dark .btn-view-toggle {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

body.dark-mode .status-filter-btn:hover,
.theme-dark .status-filter-btn:hover,
body.dark-mode .btn-view-toggle:hover,
.theme-dark .btn-view-toggle:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

body.dark-mode .status-filter-btn.active,
.theme-dark .status-filter-btn.active,
body.dark-mode .btn-view-toggle.active,
.theme-dark .btn-view-toggle.active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

/* Client & Server Selector Row in POS Cart */
body.dark-mode .select-customer-server-row,
.theme-dark .select-customer-server-row {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .select-customer-server-row #invoice-client-name,
.theme-dark .select-customer-server-row #invoice-client-name,
body.dark-mode .select-customer-server-row #invoice-waiter-name,
.theme-dark .select-customer-server-row #invoice-waiter-name {
    color: #cbd5e1 !important;
}

body.dark-mode .select-customer-server-row #invoice-waiter-name.text-primary,
.theme-dark .select-customer-server-row #invoice-waiter-name.text-primary {
    color: var(--primary) !important;
}

/* Sticky top bars and headers inside POS */
body.dark-mode .sticky-top.bg-light,
.theme-dark .sticky-top.bg-light,
body.dark-mode #products .bg-light,
.theme-dark #products .bg-light {
    background-color: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Table Cards in Places Grid */
body.dark-mode .table-card-rich,
.theme-dark .table-card-rich,
body.dark-mode .table-card,
.theme-dark .table-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .table-card-rich:hover,
.theme-dark .table-card-rich:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .table-card-rich.active,
.theme-dark .table-card-rich.active,
body.dark-mode .table-card.active,
.theme-dark .table-card.active {
    border-color: var(--primary) !important;
    background-color: color-mix(in srgb, var(--primary) 15%, #1e293b) !important;
}

/* Clear Cart Button */
body.dark-mode #btn-clear-cart,
.theme-dark #btn-clear-cart,
body.dark-mode .btn-vider-panier,
.theme-dark .btn-vider-panier {
    background-color: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
}

body.dark-mode #btn-clear-cart:hover,
.theme-dark #btn-clear-cart:hover {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

/* Inline bg-white overrides for POS search inputs and icons */
body.dark-mode .input-group-text.bg-white,
.theme-dark .input-group-text.bg-white,
body.dark-mode .bg-white.border-right-0,
.theme-dark .bg-white.border-right-0,
body.dark-mode #invoice-places,
.theme-dark #invoice-places {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* Category sidebar and tabs in POS */
body.dark-mode #invoice-sidebar,
.theme-dark #invoice-sidebar {
    background-color: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode #invoice-sidebar .btn-light,
.theme-dark #invoice-sidebar .btn-light {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* Delivery rows in POS Cart (Light & Dark Mode rules) */
.pos-delivery-row {
    background-color: #ffffff !important;
}

#trigger-delivery-address #delivery-address-display.text-danger {
    color: #e51c23 !important;
}

#trigger-delivery-address #delivery-address-display.text-success {
    color: #2e7d32 !important;
}

body.dark-mode .pos-delivery-row,
.theme-dark .pos-delivery-row {
    background-color: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode #trigger-delivery-address #delivery-address-display.text-danger,
.theme-dark #trigger-delivery-address #delivery-address-display.text-danger {
    color: #f87171 !important;
}

/* Global bg-white / bg-light / text-dark Dark Mode Overrides */
.dark-mode .bg-white,
.theme-dark .bg-white {
    background-color: #1e293b !important;
}

.dark-mode .bg-light,
.theme-dark .bg-light {
    background-color: #0f172a !important;
}

.dark-mode .text-dark,
.theme-dark .text-dark {
    color: #f8fafc !important;
}

/* Light Background Hover state text color enforcement */
.bg-primary-light,
.bg-primary-soft,
.bg-light-hover:hover,
.list-group-item a:hover.bg-primary-light,
.list-group-item a.bg-primary-light {
    color: #0f172a !important;
}

.bg-primary-light .text-muted,
.bg-primary-soft .text-muted,
.bg-light-hover:hover .text-muted,
.list-group-item a:hover .text-muted {
    color: #334155 !important;
}

/* Sidebar & Modal Quick Actions Hover contrast */
#pos-actions-sidebar .list-group-item a:hover .pos-action-label,
#modal-flash-actions .flash-action-card:hover .font-weight-bold {
    color: var(--primary) !important;
}


body.dark-mode #trigger-delivery-address #delivery-address-display.text-success,
.theme-dark #trigger-delivery-address #delivery-address-display.text-success {
    color: #4ade80 !important;
}

/* WSM Design System - Accent IA Dark Mode */
.dark-mode .bg-light-purple,
.theme-dark .bg-light-purple {
    background: color-mix(in srgb, #6366f1 18%, transparent) !important;
}

.dark-mode .btn-purple,
.theme-dark .btn-purple {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: #ffffff !important;
}




