/* ===================================================================
   TRIVONE ERP - DARK THEME SYSTEM OVERRIDES
   Activates when [data-theme="dark"] or body.dark-theme is present
   =================================================================== */

:root[data-theme="dark"],
body.dark-theme {
    --dark-bg-main: #0b1329;
    --dark-bg-card: #131d35;
    --dark-bg-surface: #182442;
    --dark-bg-header: #0f172a;
    --dark-bg-sidebar: #0a0f1d;
    --dark-border: rgba(255, 255, 255, 0.08);
    --dark-border-subtle: #22304e;
    --dark-text-primary: #f8fafc;
    --dark-text-secondary: #94a3b8;
    --dark-text-muted: #64748b;
    --dark-accent: #38bdf8;
    --dark-accent-hover: #0ea5e9;
    --dark-accent-bg: rgba(56, 189, 248, 0.12);
}

/* 1. Global Shell & Layout Containers */
body.dark-theme {
    background-color: var(--dark-bg-main) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .app-container {
    background-color: var(--dark-bg-main) !important;
}

body.dark-theme .app-main,
body.dark-theme .app-main__outer,
body.dark-theme .app-main__inner {
    background-color: var(--dark-bg-main) !important;
}

/* 2. Top Header Navigation */
body.dark-theme .app-header {
    background-color: var(--dark-bg-header) !important;
    border-bottom: 1px solid var(--dark-border-subtle) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

body.dark-theme .app-header__logo {
    background-color: var(--dark-bg-header) !important;
    border-bottom: 1px solid var(--dark-border-subtle) !important;
    border-right: 1px solid var(--dark-border-subtle) !important;
}

body.dark-theme .app-header-title__text {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .app-header-title {
    border-right: 1px solid var(--dark-border-subtle) !important;
}

body.dark-theme .hamburger-inner,
body.dark-theme .hamburger-inner::before,
body.dark-theme .hamburger-inner::after {
    background-color: #cbd5e1 !important;
}

/* 3. Sidebar Navigation */
body.dark-theme .app-sidebar {
    background-color: var(--dark-bg-sidebar) !important;
    border-right: 1px solid var(--dark-border-subtle) !important;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .app-sidebar__heading {
    color: var(--dark-accent) !important;
    opacity: 0.9;
    font-size: 11px;
    letter-spacing: 0.8px;
    font-weight: 700;
}

/* Sidebar Menu Title Badge in Dark Theme (replaces white badge) */
body.dark-theme .menu-title,
body.dark-theme .app-sidebar__heading.menu-title {
    background-color: #131d35 !important;
    border: 1px solid #1e2c4f !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    margin: 8px 10px 4px 10px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.2s ease !important;
}

body.dark-theme .menu-title:hover,
body.dark-theme .app-sidebar__heading.menu-title:hover {
    background-color: #1a2747 !important;
    border-color: #38bdf8 !important;
}

body.dark-theme .menu-title span,
body.dark-theme .app-sidebar__heading.menu-title span {
    color: #38bdf8 !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
}

body.dark-theme .menu-title i,
body.dark-theme .app-sidebar__heading.menu-title i {
    color: #94a3b8 !important;
}

body.dark-theme .menu-title:hover span,
body.dark-theme .app-sidebar__heading.menu-title:hover span {
    color: #7dd3fc !important;
}

body.dark-theme .menu-title:hover i,
body.dark-theme .app-sidebar__heading.menu-title:hover i {
    color: #38bdf8 !important;
}

body.dark-theme .vertical-nav-menu li a {
    color: #cbd5e1 !important;
    transition: all 0.2s ease;
}

body.dark-theme .vertical-nav-menu li a i.metismenu-icon {
    color: #94a3b8 !important;
    transition: color 0.2s ease;
}

body.dark-theme .vertical-nav-menu li a:hover {
    background-color: var(--dark-accent-bg) !important;
    color: var(--dark-accent) !important;
}

body.dark-theme .vertical-nav-menu li a:hover i.metismenu-icon {
    color: var(--dark-accent) !important;
}

body.dark-theme .vertical-nav-menu li a.mm-active {
    background-color: var(--dark-accent-bg) !important;
    color: var(--dark-accent) !important;
    font-weight: 600;
}

body.dark-theme .vertical-nav-menu li a.mm-active i.metismenu-icon {
    color: var(--dark-accent) !important;
}

body.dark-theme .vertical-nav-menu ul {
    background: transparent !important;
}

body.dark-theme .vertical-nav-menu ul::before {
    background: #22304e !important;
}

body.dark-theme .vertical-nav-menu ul>li>a {
    color: #94a3b8 !important;
}

body.dark-theme .vertical-nav-menu ul>li>a:hover,
body.dark-theme .vertical-nav-menu ul>li>a.mm-active {
    color: var(--dark-accent) !important;
    background: rgba(56, 189, 248, 0.08) !important;
}

/* 4. Cards & Content Panes */
body.dark-theme .main-card,
body.dark-theme .card {
    background-color: var(--dark-bg-card) !important;
    border: 1px solid var(--dark-border-subtle) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .card-header {
    background-color: var(--dark-bg-surface) !important;
    border-bottom: 1px solid var(--dark-border-subtle) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .card-title,
body.dark-theme .card-header-title {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .card-footer {
    background-color: var(--dark-bg-surface) !important;
    border-top: 1px solid var(--dark-border-subtle) !important;
}

/* 5. Tables */
body.dark-theme .table {
    color: var(--dark-text-primary) !important;
    background-color: transparent !important;
}

body.dark-theme .table th {
    background-color: var(--dark-bg-surface) !important;
    color: #cbd5e1 !important;
    border-color: var(--dark-border-subtle) !important;
    font-weight: 600;
}

body.dark-theme .table td {
    border-color: var(--dark-border-subtle) !important;
    color: #ffffff !important;
    background-color: transparent !important;
}

body.dark-theme .table td span {
    color: inherit;
}

body.dark-theme .role-name-text,
body.dark-theme .user-name-text,
body.dark-theme .permission-name-text {
    color: #ffffff !important;
}

body.dark-theme .permission-description-text {
    color: #cbd5e1 !important;
}

body.dark-theme .table td .font-weight-bold,
body.dark-theme .table td .font-weight-medium,
body.dark-theme .table td strong {
    color: #ffffff !important;
}

body.dark-theme .table td [style*="color: #1e293b"],
body.dark-theme .table td [style*="color: #213368"],
body.dark-theme .table td [style*="color:#1e293b"],
body.dark-theme .table td [style*="color:#213368"] {
    color: #f8fafc !important;
}

body.dark-theme .table td [style*="color: #475569"],
body.dark-theme .table td [style*="color:#475569"] {
    color: #cbd5e1 !important;
}

body.dark-theme .table td .text-muted,
body.dark-theme .table td .text-muted.font-italic {
    color: #94a3b8 !important;
}

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

body.dark-theme .table-hover tbody tr:hover {
    background-color: rgba(56, 189, 248, 0.06) !important;
}

/* 6. Form Controls & Inputs */
body.dark-theme .form-control,
body.dark-theme .form-select,
body.dark-theme input[type="text"],
body.dark-theme input[type="password"],
body.dark-theme input[type="email"],
body.dark-theme input[type="number"],
body.dark-theme input[type="date"],
body.dark-theme textarea,
body.dark-theme select {
    background-color: #0d1527 !important;
    border: 1px solid var(--dark-border-subtle) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .form-control:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
    background-color: #101a30 !important;
    border-color: var(--dark-accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.2) !important;
    color: #ffffff !important;
}

body.dark-theme .form-control::placeholder {
    color: var(--dark-text-muted) !important;
}

body.dark-theme label {
    color: #cbd5e1 !important;
}

body.dark-theme .input-group-text {
    background-color: var(--dark-bg-surface) !important;
    border-color: var(--dark-border-subtle) !important;
    color: #cbd5e1 !important;
}

/* 7. Dropdown Menus */
body.dark-theme .dropdown-menu {
    background-color: var(--dark-bg-card) !important;
    border: 1px solid var(--dark-border-subtle) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .dropdown-item {
    color: #cbd5e1 !important;
}

body.dark-theme .dropdown-item:hover,
body.dark-theme .dropdown-item:focus {
    background-color: var(--dark-bg-surface) !important;
    color: #ffffff !important;
}

body.dark-theme .dropdown-divider {
    border-top: 1px solid var(--dark-border-subtle) !important;
}

body.dark-theme .notifications-header {
    background: var(--dark-bg-surface) !important;
    border-bottom: 1px solid var(--dark-border-subtle) !important;
}

body.dark-theme .notifications-header h6 {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .notifications-body {
    background: var(--dark-bg-card) !important;
    color: var(--dark-text-secondary) !important;
}

body.dark-theme .notification-item {
    border-bottom: 1px solid var(--dark-border-subtle) !important;
}

body.dark-theme .notification-item:hover {
    background: var(--dark-bg-surface) !important;
}

body.dark-theme .notification-title {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .notification-text {
    color: var(--dark-text-secondary) !important;
}

body.dark-theme .notifications-footer {
    background: var(--dark-bg-surface) !important;
    border-top: 1px solid var(--dark-border-subtle) !important;
}

/* 8. App Footer */
body.dark-theme .app-wrapper-footer {
    background-color: var(--dark-bg-main) !important;
}

body.dark-theme .app-footer__inner {
    background-color: var(--dark-bg-header) !important;
    border-top: 1px solid var(--dark-border-subtle) !important;
    color: var(--dark-text-muted) !important;
}

body.dark-theme .app-footer .nav-link {
    color: var(--dark-text-secondary) !important;
}

body.dark-theme .app-footer .nav-link:hover {
    color: var(--dark-accent) !important;
}

/* 9. Page Title & Breadcrumb */
body.dark-theme .app-page-title {
    background: var(--dark-bg-card) !important;
    border: 1px solid var(--dark-border-subtle) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
}

body.dark-theme .page-title-heading {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .app-page-title .text-primary {
    color: #38bdf8 !important;
}

body.dark-theme .app-page-title .page-title-heading > div > div:first-child {
    color: #f8fafc !important;
}

body.dark-theme .page-title-subheading,
body.dark-theme .app-page-title .page-title-subheading {
    color: #94a3b8 !important;
}

body.dark-theme .page-title-icon {
    background: var(--dark-bg-surface) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .page-title-icon i {
    color: var(--dark-accent) !important;
}

/* 10. Badges, Buttons, Widgets */
body.dark-theme .badge-light {
    background-color: var(--dark-bg-surface) !important;
    color: #cbd5e1 !important;
    border: 1px solid var(--dark-border-subtle) !important;
}

body.dark-theme .badge-secondary {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .btn-light,
body.dark-theme .btn-secondary {
    background-color: #1e293b !important;
    border-color: var(--dark-border-subtle) !important;
    color: #cbd5e1 !important;
}

body.dark-theme .btn-light:hover,
body.dark-theme .btn-secondary:hover {
    background-color: #27354f !important;
    color: #ffffff !important;
}

body.dark-theme .btn-outline-secondary {
    border-color: var(--dark-border-subtle) !important;
    color: #cbd5e1 !important;
}

body.dark-theme .btn-outline-secondary:hover {
    background-color: var(--dark-bg-surface) !important;
    color: #ffffff !important;
}

body.dark-theme .widget-chart {
    background-color: var(--dark-bg-card) !important;
    border-color: var(--dark-border-subtle) !important;
}

body.dark-theme .widget-numbers {
    color: var(--dark-text-primary) !important;
}

body.dark-theme .widget-subheading {
    color: var(--dark-text-muted) !important;
}

/* 11. Modal Windows */
body.dark-theme .modal-dialog {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}

body.dark-theme .modal-dialog-centered::before {
    display: none !important;
    height: 0 !important;
    content: none !important;
}

body.dark-theme .modal-content {
    background-color: var(--dark-bg-card) !important;
    border: 1px solid var(--dark-border-subtle) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
    color: var(--dark-text-primary) !important;
}

body.dark-theme .modal-header {
    border-bottom: 1px solid var(--dark-border-subtle) !important;
}

body.dark-theme .modal-footer {
    border-top: 1px solid var(--dark-border-subtle) !important;
}

body.dark-theme .close {
    color: #cbd5e1 !important;
    text-shadow: none !important;
}

/* 12. Theme Switcher Toggle Button in Top Navbar */
.theme-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    color: #eab308; /* Sun yellow in light mode */
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    padding: 0;
}

.theme-switch-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

body.dark-theme .theme-switch-btn {
    background: #182442;
    border: 1px solid var(--dark-border-subtle);
    color: #38bdf8; /* Moon blue in dark mode */
}

body.dark-theme .theme-switch-btn:hover {
    background: #1e2f56;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.theme-switch-btn i {
    font-size: 17px;
    transition: transform 0.4s ease;
}

.theme-switch-btn:hover i {
    transform: rotate(20deg);
}

/* Password Changing Page */
body.dark-theme .password-requirements-box {
    background-color: var(--dark-bg-surface) !important;
    border-color: var(--dark-border-subtle) !important;
}

body.dark-theme .password-requirements-title {
    color: #38bdf8 !important;
}

/* Trash Action Outline Button & Red Icon */
.trash-action-btn,
button.trash-action-btn {
    width: 34px !important;
    height: 31px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.08) !important;
    border-radius: 4px !important;
    padding: 0 !important;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.trash-action-btn:disabled,
button.trash-action-btn:disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    border-color: rgba(220, 53, 69, 0.4) !important;
}

.trash-action-btn:hover:not(:disabled),
button.trash-action-btn:hover:not(:disabled) {
    background-color: #dc3545 !important;
}

.trash-action-btn i,
.trash-action-btn .fa-trash,
.trash-action-icon,
button.trash-action-btn i,
button.trash-action-btn .fa-trash,
button.trash-action-btn .trash-action-icon {
    color: #dc3545 !important;
    font-size: 14px !important;
}

.trash-action-btn:hover:not(:disabled) i,
.trash-action-btn:hover:not(:disabled) .fa-trash,
.trash-action-btn:hover:not(:disabled) .trash-action-icon {
    color: #ffffff !important;
}

body.dark-theme .trash-action-btn,
body.dark-theme button.trash-action-btn {
    background-color: rgba(220, 53, 69, 0.12) !important;
    border: 1px solid #dc3545 !important;
}

body.dark-theme .trash-action-btn i,
body.dark-theme .trash-action-btn .fa-trash,
body.dark-theme .trash-action-icon,
body.dark-theme button.trash-action-btn i,
body.dark-theme button.trash-action-btn .fa-trash {
    color: #dc3545 !important;
}

body.dark-theme .trash-action-btn:hover:not(:disabled),
body.dark-theme button.trash-action-btn:hover:not(:disabled) {
    background-color: #dc3545 !important;
}

body.dark-theme .trash-action-btn:hover:not(:disabled) i,
body.dark-theme .trash-action-btn:hover:not(:disabled) .fa-trash {
    color: #ffffff !important;
}

/* ===================================================================
   SWEETALERT2 & MODALS - DARK THEME OVERRIDES
   =================================================================== */

body.dark-theme .swal2-popup,
body.dark-theme .swal2-container .swal2-popup,
[data-theme="dark"] .swal2-popup,
[data-theme="dark"] .swal2-container .swal2-popup,
html[data-theme="dark"] .swal2-popup,
.dark-theme .swal2-popup {
    background: var(--dark-bg-card, #131d35) !important;
    background-color: var(--dark-bg-card, #131d35) !important;
    color: var(--dark-text-primary, #f8fafc) !important;
    border: 1px solid var(--dark-border-subtle, #22304e) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
}

body.dark-theme .swal2-title,
[data-theme="dark"] .swal2-title {
    color: var(--dark-text-primary, #f8fafc) !important;
}

body.dark-theme .swal2-html-container,
[data-theme="dark"] .swal2-html-container {
    color: var(--dark-text-secondary, #94a3b8) !important;
}

body.dark-theme .swal2-input,
body.dark-theme .swal2-select,
body.dark-theme .swal2-textarea,
[data-theme="dark"] .swal2-input,
[data-theme="dark"] .swal2-select,
[data-theme="dark"] .swal2-textarea {
    background: var(--dark-bg-surface, #182442) !important;
    background-color: var(--dark-bg-surface, #182442) !important;
    border: 1px solid var(--dark-border-subtle, #22304e) !important;
    color: var(--dark-text-primary, #f8fafc) !important;
}

body.dark-theme .swal2-input:focus,
body.dark-theme .swal2-select:focus,
body.dark-theme .swal2-textarea:focus,
[data-theme="dark"] .swal2-input:focus,
[data-theme="dark"] .swal2-select:focus,
[data-theme="dark"] .swal2-textarea:focus {
    border-color: var(--dark-accent, #38bdf8) !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

body.dark-theme .swal2-input::placeholder,
body.dark-theme .swal2-textarea::placeholder,
[data-theme="dark"] .swal2-input::placeholder,
[data-theme="dark"] .swal2-textarea::placeholder {
    color: var(--dark-text-muted, #64748b) !important;
}

body.dark-theme .swal2-validation-message,
[data-theme="dark"] .swal2-validation-message {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

body.dark-theme .swal2-close,
[data-theme="dark"] .swal2-close {
    color: var(--dark-text-muted, #64748b) !important;
}

body.dark-theme .swal2-close:hover,
[data-theme="dark"] .swal2-close:hover {
    color: var(--dark-text-primary, #f8fafc) !important;
}

/* Ensure labels, headings, paragraphs, and custom boxes inside swal are visible in dark mode */
body.dark-theme .swal2-popup label,
body.dark-theme .swal-custom-label,
[data-theme="dark"] .swal2-popup label,
[data-theme="dark"] .swal-custom-label {
    color: var(--dark-text-primary, #f8fafc) !important;
}

body.dark-theme .swal2-popup p,
body.dark-theme .swal-custom-subtext,
[data-theme="dark"] .swal2-popup p,
[data-theme="dark"] .swal-custom-subtext {
    color: var(--dark-text-secondary, #94a3b8) !important;
}

body.dark-theme .swal-custom-box,
body.dark-theme .swal2-popup div[style*="background: #f8fafc"],
body.dark-theme .swal2-popup div[style*="background: #ffffff"],
body.dark-theme .swal2-popup div[style*="background: #eef2ff"],
body.dark-theme .swal2-popup div[style*="background: #fdf2f8"],
body.dark-theme .swal2-popup div[style*="background:#f8fafc"],
body.dark-theme .swal2-popup div[style*="background:#ffffff"],
body.dark-theme .swal2-popup div[style*="background:#eef2ff"],
body.dark-theme .swal2-popup div[style*="background:#fdf2f8"],
[data-theme="dark"] .swal-custom-box,
[data-theme="dark"] .swal2-popup div[style*="background: #f8fafc"],
[data-theme="dark"] .swal2-popup div[style*="background: #ffffff"],
[data-theme="dark"] .swal2-popup div[style*="background: #eef2ff"],
[data-theme="dark"] .swal2-popup div[style*="background: #fdf2f8"] {
    background: var(--dark-bg-surface, #182442) !important;
    background-color: var(--dark-bg-surface, #182442) !important;
    border-color: var(--dark-border-subtle, #22304e) !important;
    color: var(--dark-text-primary, #f8fafc) !important;
}

/* Custom In-Page Modals (e.g. Proforma Tier Modal & Quantity Modal) */
.pos-modal-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.pos-modal-title {
    color: #213368;
    font-weight: 700;
}

.pos-tier-item-btn {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    color: #213368;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}
.pos-tier-item-btn:hover {
    border-color: #213368;
    background-color: #f8f9fa;
}

.pos-qty-input {
    background-color: #ffffff;
    border: 2px solid #3498db;
    color: #1e293b;
}

body.dark-theme .pos-modal-card,
[data-theme="dark"] .pos-modal-card {
    background: var(--dark-bg-card, #131d35) !important;
    background-color: var(--dark-bg-card, #131d35) !important;
    border-color: var(--dark-border-subtle, #22304e) !important;
    color: var(--dark-text-primary, #f8fafc) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
}

body.dark-theme .pos-modal-title,
[data-theme="dark"] .pos-modal-title {
    color: var(--dark-text-primary, #f8fafc) !important;
}

body.dark-theme .pos-tier-item-btn,
[data-theme="dark"] .pos-tier-item-btn {
    background: var(--dark-bg-surface, #182442) !important;
    background-color: var(--dark-bg-surface, #182442) !important;
    border-color: var(--dark-border-subtle, #22304e) !important;
    color: var(--dark-text-primary, #f8fafc) !important;
}

body.dark-theme .pos-tier-item-btn:hover,
[data-theme="dark"] .pos-tier-item-btn:hover {
    background: rgba(56, 189, 248, 0.12) !important;
    background-color: rgba(56, 189, 248, 0.12) !important;
    border-color: var(--dark-accent, #38bdf8) !important;
}

body.dark-theme .pos-tier-item-btn strong,
body.dark-theme .pos-tier-item-btn i,
[data-theme="dark"] .pos-tier-item-btn strong,
[data-theme="dark"] .pos-tier-item-btn i {
    color: var(--dark-text-primary, #f8fafc) !important;
}

body.dark-theme .pos-qty-input,
[data-theme="dark"] .pos-qty-input {
    background: var(--dark-bg-surface, #182442) !important;
    background-color: var(--dark-bg-surface, #182442) !important;
    border-color: var(--dark-accent, #38bdf8) !important;
    color: var(--dark-text-primary, #f8fafc) !important;
}

body.dark-theme .pos-tier-item-btn strong,
body.dark-theme .pos-tier-item-btn i,
[data-theme="dark"] .pos-tier-item-btn strong,
[data-theme="dark"] .pos-tier-item-btn i {
    color: var(--dark-text-primary, #f8fafc) !important;
}

body.dark-theme .pos-qty-input,
[data-theme="dark"] .pos-qty-input {
    background-color: var(--dark-bg-surface, #182442) !important;
    border-color: var(--dark-accent, #38bdf8) !important;
    color: var(--dark-text-primary, #f8fafc) !important;
}



/* SweetAlert Cancel Button Dark Theme */
body.dark-theme .swal2-popup .swal2-styled.swal2-cancel,
[data-theme="dark"] .swal2-popup .swal2-styled.swal2-cancel,
body.dark-theme .pos-btn-cancel,
[data-theme="dark"] .pos-btn-cancel {
    background: #dc3545 !important;
    background-color: #dc3545 !important;
    color: #ffffff !important;
    border: 1px solid rgba(220, 53, 69, 0.5) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

body.dark-theme .swal2-popup .swal2-styled.swal2-cancel:hover,
[data-theme="dark"] .swal2-popup .swal2-styled.swal2-cancel:hover,
body.dark-theme .pos-btn-cancel:hover,
[data-theme="dark"] .pos-btn-cancel:hover {
    background: #bb2d3b !important;
    background-color: #bb2d3b !important;
    color: #ffffff !important;
}

/* ==========================================================================
   POS Sales Create Terminal Dark Theme Overrides
   ========================================================================== */
body.dark-theme .pos-transaction-container,
[data-theme="dark"] .pos-transaction-container {
    background-color: transparent !important;
}

body.dark-theme .pos-left-section,
[data-theme="dark"] .pos-left-section,
body.dark-theme .pos-right-content,
[data-theme="dark"] .pos-right-content {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    color: #f8fafc !important;
}

body.dark-theme .scan-search-box,
[data-theme="dark"] .scan-search-box {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .scan-search-box input,
[data-theme="dark"] .scan-search-box input {
    background: transparent !important;
    color: #f8fafc !important;
}

body.dark-theme .scan-search-box input::placeholder,
[data-theme="dark"] .scan-search-box input::placeholder {
    color: #94a3b8 !important;
}

body.dark-theme .search-results-dropdown,
[data-theme="dark"] .search-results-dropdown {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .search-result-item,
[data-theme="dark"] .search-result-item {
    border-bottom: 1px solid #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .search-result-item:hover,
[data-theme="dark"] .search-result-item:hover,
body.dark-theme .search-result-item.highlighted,
[data-theme="dark"] .search-result-item.highlighted {
    background: #2563eb !important;
    color: #ffffff !important;
}

body.dark-theme .search-result-item .item-code,
body.dark-theme .search-result-item .item-stock,
[data-theme="dark"] .search-result-item .item-code,
[data-theme="dark"] .search-result-item .item-stock {
    color: #94a3b8 !important;
}

body.dark-theme .items-table-container,
[data-theme="dark"] .items-table-container {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-theme table.items-table,
[data-theme="dark"] table.items-table {
    background: #0f172a !important;
    color: #f8fafc !important;
}

body.dark-theme table.items-table thead,
[data-theme="dark"] table.items-table thead {
    background: #1e293b !important;
}

body.dark-theme table.items-table thead th,
[data-theme="dark"] table.items-table thead th {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border-bottom: 2px solid #334155 !important;
}

body.dark-theme table.items-table tbody tr,
[data-theme="dark"] table.items-table tbody tr {
    background: #0f172a !important;
    border-bottom: 1px solid #1e293b !important;
    color: #f8fafc !important;
}

body.dark-theme table.items-table tbody tr:hover,
[data-theme="dark"] table.items-table tbody tr:hover {
    background: #1e293b !important;
}

body.dark-theme table.items-table tbody tr.selected,
[data-theme="dark"] table.items-table tbody tr.selected {
    background: #1e3a8a !important;
    color: #ffffff !important;
}

body.dark-theme table.items-table td,
[data-theme="dark"] table.items-table td {
    border-bottom: 1px solid #1e293b !important;
    color: #f8fafc !important;
}

body.dark-theme .tender-section,
[data-theme="dark"] .tender-section {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

body.dark-theme .tender-col,
[data-theme="dark"] .tender-col {
    color: #f8fafc !important;
}

body.dark-theme .tender-label,
[data-theme="dark"] .tender-label {
    color: #94a3b8 !important;
}

body.dark-theme .customer-panel,
[data-theme="dark"] .customer-panel,
body.dark-theme .customer-panel-body,
[data-theme="dark"] .customer-panel-body {
    background: #1e293b !important;
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-theme .customer-panel-header,
[data-theme="dark"] .customer-panel-header {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-bottom: 1px solid #334155 !important;
}

body.dark-theme .customer-field label,
[data-theme="dark"] .customer-field label {
    color: #cbd5e1 !important;
}

body.dark-theme .customer-input,
body.dark-theme .phone-input,
[data-theme="dark"] .customer-input,
[data-theme="dark"] .phone-input {
    background: #0f172a !important;
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .customer-input:focus,
body.dark-theme .phone-input:focus,
[data-theme="dark"] .customer-input:focus,
[data-theme="dark"] .phone-input:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

body.dark-theme .customer-search-container .btn-light,
[data-theme="dark"] .customer-search-container .btn-light {
    background: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

body.dark-theme .payment-type-btn:not(.active),
[data-theme="dark"] .payment-type-btn:not(.active) {
    background: #0f172a !important;
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #94a3b8 !important;
}

body.dark-theme .payment-type-btn:not(.active):hover,
[data-theme="dark"] .payment-type-btn:not(.active):hover {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

body.dark-theme .payment-type-btn.active,
[data-theme="dark"] .payment-type-btn.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .customer-search-results,
[data-theme="dark"] .customer-search-results,
body.dark-theme .customer-suggestions,
[data-theme="dark"] .customer-suggestions {
    background: #0f172a !important;
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    color: #f8fafc !important;
}

body.dark-theme .customer-search-results > div,
[data-theme="dark"] .customer-search-results > div,
body.dark-theme .customer-suggestion-item,
[data-theme="dark"] .customer-suggestion-item {
    border-bottom: 1px solid #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .customer-search-results > div:hover,
[data-theme="dark"] .customer-search-results > div:hover,
body.dark-theme .customer-suggestion-item:hover,
[data-theme="dark"] .customer-suggestion-item:hover {
    background: #1e293b !important;
    color: #ffffff !important;
}

body.dark-theme .toggle-btn:not(.active),
[data-theme="dark"] .toggle-btn:not(.active) {
    background: #334155 !important;
    color: #94a3b8 !important;
    border: 1px solid #475569 !important;
}

body.dark-theme .keypad-btn,
[data-theme="dark"] .keypad-btn {
    background: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}

body.dark-theme .keypad-btn:hover,
[data-theme="dark"] .keypad-btn:hover {
    background: #334155 !important;
}

body.dark-theme .keypad-btn:active,
[data-theme="dark"] .keypad-btn:active {
    background: #2563eb !important;
    color: #ffffff !important;
}

body.dark-theme .keypad-btn.action-btn,
[data-theme="dark"] .keypad-btn.action-btn {
    background: #475569 !important;
    color: #ffffff !important;
}

body.dark-theme .summary-box,
[data-theme="dark"] .summary-box {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

body.dark-theme .summary-col .summary-label,
[data-theme="dark"] .summary-col .summary-label {
    color: #94a3b8 !important;
}

body.dark-theme .summary-col .summary-value,
[data-theme="dark"] .summary-col .summary-value {
    color: #f8fafc !important;
}

body.dark-theme .pos-modal-overlay,
[data-theme="dark"] .pos-modal-overlay {
    background: rgba(0, 0, 0, 0.75) !important;
}

body.dark-theme .pos-modal-content,
[data-theme="dark"] .pos-modal-content {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .pos-modal-header,
[data-theme="dark"] .pos-modal-header {
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .pos-modal-footer,
[data-theme="dark"] .pos-modal-footer {
    background: #1e293b !important;
    border-top: 1px solid #334155 !important;
}

body.dark-theme .pos-modal-content input,
body.dark-theme .pos-modal-content select,
body.dark-theme .pos-modal-content textarea,
[data-theme="dark"] .pos-modal-content input,
[data-theme="dark"] .pos-modal-content select,
[data-theme="dark"] .pos-modal-content textarea {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .tier-card,
[data-theme="dark"] .tier-card {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .tier-card:hover,
[data-theme="dark"] .tier-card:hover {
    border-color: #38bdf8 !important;
    background: #1e3a8a !important;
}

/* ==========================================================================
   Petty Cash Modal Theme Styles (matching live Trivone ERP)
   ========================================================================== */
body.dark-theme .petty-cash-modal-card,
[data-theme="dark"] .petty-cash-modal-card {
    background: #131d35 !important;
    background-color: #131d35 !important;
    border: 1px solid #22304e !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
    color: #f8fafc !important;
}

body.dark-theme .petty-cash-modal-card h2,
[data-theme="dark"] .petty-cash-modal-card h2 {
    color: #f8fafc !important;
}

body.dark-theme .petty-cash-info-box,
[data-theme="dark"] .petty-cash-info-box {
    background: #182442 !important;
    background-color: #182442 !important;
    border-color: #22304e !important;
}

body.dark-theme .petty-cash-info-box span,
[data-theme="dark"] .petty-cash-info-box span {
    color: #f8fafc !important;
}

body.dark-theme .petty-cash-info-box .avail-cash-val,
[data-theme="dark"] .petty-cash-info-box .avail-cash-val {
    color: #38bdf8 !important;
}

body.dark-theme .petty-cash-info-box .avail-cash-sub,
[data-theme="dark"] .petty-cash-info-box .avail-cash-sub {
    color: #94a3b8 !important;
}

body.dark-theme .petty-cash-modal-card label,
[data-theme="dark"] .petty-cash-modal-card label {
    color: #cbd5e1 !important;
}

body.dark-theme .petty-cash-modal-card input,
body.dark-theme .petty-cash-modal-card select,
body.dark-theme .petty-cash-modal-card textarea,
[data-theme="dark"] .petty-cash-modal-card input,
[data-theme="dark"] .petty-cash-modal-card select,
[data-theme="dark"] .petty-cash-modal-card textarea {
    background: #182442 !important;
    background-color: #182442 !important;
    border-color: #22304e !important;
    color: #f8fafc !important;
}

body.dark-theme .petty-cash-modal-card input:focus,
body.dark-theme .petty-cash-modal-card select:focus,
body.dark-theme .petty-cash-modal-card textarea:focus,
[data-theme="dark"] .petty-cash-modal-card input:focus,
[data-theme="dark"] .petty-cash-modal-card select:focus,
[data-theme="dark"] .petty-cash-modal-card textarea:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

/* Till Cash Status Modal Dark Theme */
body.dark-theme .till-cash-status-box,
[data-theme="dark"] .till-cash-status-box {
    background: #182442 !important;
    background-color: #182442 !important;
    border-color: #22304e !important;
    color: #f8fafc !important;
}

body.dark-theme .till-cash-status-box span,
body.dark-theme .till-cash-status-box div,
[data-theme="dark"] .till-cash-status-box span,
[data-theme="dark"] .till-cash-status-box div {
    color: #cbd5e1 !important;
}

body.dark-theme .till-cash-status-box strong,
[data-theme="dark"] .till-cash-status-box strong {
    color: #f8fafc !important;
}

body.dark-theme .current-cash-in-till-box,
[data-theme="dark"] .current-cash-in-till-box {
    background: #1e3a8a !important;
    background-color: #1e3a8a !important;
    border-color: #3b82f6 !important;
}

body.dark-theme .current-cash-in-till-box span,
[data-theme="dark"] .current-cash-in-till-box span {
    color: #ffffff !important;
}





/* ==========================================================================
   Dark Theme - Payment Modal
   ========================================================================== */
body.dark-theme .payment-modal-content,
[data-theme="dark"] .payment-modal-content {
    background: #1e293b !important;
    color: #f8fafc !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .payment-modal-header,
[data-theme="dark"] .payment-modal-header {
    border-bottom: 2px solid #334155 !important;
}

body.dark-theme .payment-modal-header h3,
[data-theme="dark"] .payment-modal-header h3 {
    color: #f8fafc !important;
}

body.dark-theme .payment-modal-close,
[data-theme="dark"] .payment-modal-close {
    color: #94a3b8 !important;
}

body.dark-theme .payment-modal-close:hover,
[data-theme="dark"] .payment-modal-close:hover {
    color: #f87171 !important;
}

body.dark-theme .payment-total-section,
[data-theme="dark"] .payment-total-section {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
}

body.dark-theme .payment-total-label,
[data-theme="dark"] .payment-total-label {
    color: #94a3b8 !important;
}

body.dark-theme .payment-total-value,
[data-theme="dark"] .payment-total-value {
    color: #38bdf8 !important;
}

body.dark-theme .payment-method-item,
[data-theme="dark"] .payment-method-item {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
}

body.dark-theme .payment-method-select,
[data-theme="dark"] .payment-method-select {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #38bdf8 !important;
}

body.dark-theme .payment-method-select option,
[data-theme="dark"] .payment-method-select option {
    background: #1e293b !important;
    color: #f8fafc !important;
}

body.dark-theme .payment-option-select,
[data-theme="dark"] .payment-option-select {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #64748b !important;
}

body.dark-theme .payment-option-select option,
[data-theme="dark"] .payment-option-select option {
    background: #1e293b !important;
    color: #f8fafc !important;
}

body.dark-theme .payment-amount-input,
[data-theme="dark"] .payment-amount-input {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #38bdf8 !important;
}

body.dark-theme .payment-amount-input::placeholder,
[data-theme="dark"] .payment-amount-input::placeholder {
    color: #64748b !important;
}

body.dark-theme .payment-summary-section,
[data-theme="dark"] .payment-summary-section {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .payment-summary-row,
[data-theme="dark"] .payment-summary-row {
    color: #f8fafc !important;
}

body.dark-theme .payment-add-method-btn,
[data-theme="dark"] .payment-add-method-btn {
    background: #0284c7 !important;
    color: #ffffff !important;
}

body.dark-theme .payment-add-method-btn:hover,
[data-theme="dark"] .payment-add-method-btn:hover {
    background: #0369a1 !important;
}

body.dark-theme .payment-modal-btn.cancel,
[data-theme="dark"] .payment-modal-btn.cancel {
    background: #475569 !important;
    color: #ffffff !important;
}

body.dark-theme .payment-modal-btn.cancel:hover,
[data-theme="dark"] .payment-modal-btn.cancel:hover {
    background: #334155 !important;
}

body.dark-theme .payment-modal-btn.confirm,
[data-theme="dark"] .payment-modal-btn.confirm {
    background: #16a34a !important;
    color: #ffffff !important;
}

body.dark-theme .payment-modal-btn.confirm:hover,
[data-theme="dark"] .payment-modal-btn.confirm:hover {
    background: #15803d !important;
}

body.dark-theme .payment-modal-btn.confirm:disabled,
[data-theme="dark"] .payment-modal-btn.confirm:disabled {
    background: #334155 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
}
