/**
 * Shopmaster Dark Mode Theme
 * 
 * This file provides dark theme overrides using CSS custom properties.
 * Theme is activated by adding data-theme="dark" to the <html> element.
 */

/* ========================================
   DARK THEME VARIABLE OVERRIDES
   ======================================== */

[data-theme="dark"] {
    /* Primary Brand Colors - Inverted for dark backgrounds */
    --primary-50: #0A1929;
    --primary-100: #102A43;
    --primary-200: #1A3862;
    --primary-300: #243B53;
    --primary-400: #334E68;
    --primary-500: #627D98;
    --primary-600: #9FB3C8;
    --primary-700: #BCCCDC;
    --primary-800: #D9E2EC;
    --primary-900: #F0F4F8;

    /* Accent Colors - Inverted for dark backgrounds */
    --accent-50: #5C3203;
    --accent-100: #8C4B05;
    --accent-200: #B86407;
    --accent-300: #DE7E0E;
    --accent-400: #F7941D;
    --accent-500: #F9A84D;
    --accent-600: #FBC17E;
    --accent-700: #FDD9AD;
    --accent-800: #FEECD6;
    --accent-900: #FFF8F0;

    /* Neutral Colors - Inverted for dark mode */
    --neutral-50: #0f172a;
    --neutral-100: #1e293b;
    --neutral-200: #334155;
    --neutral-300: #475569;
    --neutral-400: #64748b;
    --neutral-500: #94a3b8;
    --neutral-600: #cbd5e1;
    --neutral-700: #e2e8f0;
    --neutral-800: #f1f5f9;
    --neutral-900: #f8fafc;

    /* Success Colors - Adjusted for dark backgrounds */
    --success-50: #052e16;
    --success-100: #14532d;
    --success-500: #22c55e;
    --success-600: #4ade80;
    --success-700: #86efac;

    /* Warning Colors - Adjusted for dark backgrounds */
    --warning-50: #451a03;
    --warning-100: #78350f;
    --warning-500: #f59e0b;
    --warning-600: #fbbf24;
    --warning-700: #fcd34d;

    /* Error/Danger Colors - Adjusted for dark backgrounds */
    --error-50: #450a0a;
    --error-100: #7f1d1d;
    --error-500: #ef4444;
    --error-600: #f87171;
    --error-700: #fca5a5;

    /* Semantic Colors - Dark theme */
    --background: #0f172a;
    --surface: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border: #334155;
    --border-light: #1e293b;

    /* Enhanced Shadows for dark mode */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

    /* Dark Glassmorphism */
    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
}

/* ========================================
   SMOOTH THEME TRANSITIONS
   ======================================== */

html {
    transition: background-color 0.3s ease;
}

body,
.sidebar,
.main-content,
.modal,
.modal-content,
.metric-card,
.dashboard-section,
.table-container,
.nav-user,
.tab-content,
.form-group input,
.form-group select,
.form-group textarea,
.search-bar input,
.autocomplete-suggestions,
.info-box,
.sale-item,
.profit-card {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ========================================
   DARK MODE SPECIFIC OVERRIDES
   ======================================== */

/* ========================================
   LOGIN & REGISTER - DARK MODE
   ======================================== */
[data-theme="dark"] .login-form-section {
    background: #0f172a;
}

[data-theme="dark"] .login-form-wrapper h2 {
    color: #f1f5f9;
}

[data-theme="dark"] .login-form .form-group label {
    color: #cbd5e1;
}

[data-theme="dark"] .login-form input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .login-form input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .login-form input:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 4px rgba(26, 56, 98, 0.25);
    background: #1e293b;
}

[data-theme="dark"] .login-form .form-group small {
    color: #64748b;
}

[data-theme="dark"] .demo-credentials {
    background: #1e293b;
    border-left-color: #627D98;
}

[data-theme="dark"] .demo-credentials p {
    color: #94a3b8;
}

[data-theme="dark"] .demo-credentials strong {
    color: #f1f5f9;
}

[data-theme="dark"] .login-logo-top img {
    filter: brightness(1.1);
}

/* Error messages */
[data-theme="dark"] .error-message {
    color: #f87171;
}

/* Success message */
[data-theme="dark"] .success-message {
    color: #4ade80;
}

/* Shop number display */
[data-theme="dark"] .shop-number-display {
    background: #1e293b;
    border-color: #334155;
}

/* Sidebar in dark mode */
[data-theme="dark"] .sidebar {
    background: var(--surface);
    border-right-color: var(--border);
}

[data-theme="dark"] .nav-brand {
    border-bottom-color: var(--border);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.86) 0%, rgba(15, 23, 42, 0.98) 100%);
}

[data-theme="dark"] .sidebar-brand-app {
    background: linear-gradient(135deg, #9FB3C8 0%, #627D98 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

[data-theme="dark"] .sidebar-brand-logo-shell {
    background: #0f172a;
    border-color: #475569;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.35);
}

[data-theme="dark"] .sidebar-brand-logo-fallback {
    background: linear-gradient(135deg, rgba(26, 56, 98, 0.22) 0%, rgba(51, 78, 104, 0.14) 100%);
    color: #BCCCDC;
}

[data-theme="dark"] .nav-btn {
    color: #cbd5e1;
}

[data-theme="dark"] .nav-btn:hover {
    background-color: #1e293b;
    color: #BCCCDC;
}

[data-theme="dark"] .nav-btn.active {
    background-color: #1A3862;
    color: #F9A84D;
    border-left: 4px solid var(--accent-500);
    border-right-color: transparent;
}

[data-theme="dark"] .nav-section-label {
    color: #64748b;
}

[data-theme="dark"] .nav-user {
    background: var(--surface);
    border-top-color: var(--border);
}

[data-theme="dark"] .nav-user-name {
    color: var(--text-primary);
}

[data-theme="dark"] .nav-user-role {
    color: #94a3b8;
}

[data-theme="dark"] .nav-user-avatar {
    background: #1A3862;
    color: #BCCCDC;
    border-color: #334155;
}

/* Main Content Area */
[data-theme="dark"] .main-content {
    background: #0f172a;
}

[data-theme="dark"] .tab-content {
    background: #0f172a;
}

[data-theme="dark"] .tab-header h2 {
    color: #f8fafc;
}

/* Dashboard Cards */
[data-theme="dark"] .metric-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .metric-card:hover {
    border-color: #475569;
}

[data-theme="dark"] .metric-card h3 {
    color: #94a3b8;
}

[data-theme="dark"] .metric-value {
    background: linear-gradient(135deg, #9FB3C8 0%, #BCCCDC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .metric-card.alert .metric-value {
    background: linear-gradient(135deg, #f87171 0%, #fca5a5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .dashboard-section {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dashboard-section h3 {
    color: #f8fafc;
}

[data-theme="dark"] .restaurant-action-card {
    background: var(--accent-400);
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .restaurant-action-card:hover {
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
    background: var(--accent-500);
}

[data-theme="dark"] .restaurant-action-card:focus-visible {
    outline: 3px solid rgba(249, 168, 77, 0.32);
}

[data-theme="dark"] .restaurant-action-card strong {
    color: #f8fafc;
}

[data-theme="dark"] .restaurant-action-card span {
    color: #cbd5e1;
}

[data-theme="dark"] .restaurant-action-card::after {
    color: #e2e8f0;
    opacity: 0.72;
}

[data-theme="dark"] .restaurant-plan-banner {
    background: linear-gradient(135deg, #162033 0%, #1d293d 100%);
    border-color: #334155;
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.06);
}

[data-theme="dark"] .restaurant-plan-banner-actions .btn-secondary {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .restaurant-plan-banner-actions .btn-secondary:hover {
    background: #1e293b;
    color: #f8fafc;
}

/* Tables */
[data-theme="dark"] .table-container {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] thead {
    background: #0f172a;
}

[data-theme="dark"] th {
    color: #94a3b8;
    border-bottom-color: #334155;
}

[data-theme="dark"] th.sortable:hover {
    background: #334155;
    color: #BCCCDC;
}

[data-theme="dark"] td {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

[data-theme="dark"] tbody tr {
    background: #1e293b;
}

[data-theme="dark"] tbody tr:hover {
    background: #334155;
}

/* Forms and Inputs */
[data-theme="dark"] .form-group label {
    color: #cbd5e1;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.25);
}

[data-theme="dark"] .form-group input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .search-bar input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

/* Modals */
[data-theme="dark"] .modal {
    background: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .modal-content h2 {
    color: #f8fafc;
}

[data-theme="dark"] .menu-recipe-section {
    background: #162033;
    border-color: #334155;
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.06);
}

[data-theme="dark"] .menu-recipe-header h3 {
    color: #f8fafc;
}

[data-theme="dark"] .menu-recipe-header .section-subtitle,
[data-theme="dark"] .menu-recipe-section .empty-state p {
    color: #94a3b8;
}

[data-theme="dark"] .menu-recipe-row {
    background: #0f172a;
    border-color: #334155;
}

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

/* Buttons — Use accent colors in dark mode */
[data-theme="dark"] .btn-primary {
    background: var(--accent-400);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--accent-500);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .btn-secondary {
    background: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #475569;
    color: #f8fafc;
}

[data-theme="dark"] .currency-settings-row {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .currency-settings-field,
[data-theme="dark"] .currency-active-toggle {
    color: #cbd5e1;
}

[data-theme="dark"] .currency-settings-field input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .currency-settings-field input:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.25);
    background: #0f172a;
}

[data-theme="dark"] .currency-settings-field input[readonly] {
    background: #111827;
    color: #94a3b8;
}

[data-theme="dark"] .inventory-currency-prices-heading label {
    color: #f8fafc;
}

[data-theme="dark"] .inventory-currency-prices-heading small {
    color: #94a3b8;
}

[data-theme="dark"] .inventory-currency-price-row {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .inventory-currency-price-row input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .inventory-currency-price-row input:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.25);
    background: #0f172a;
}

[data-theme="dark"] .btn-info {
    background: #173863;
    color: #ffffff;
}

[data-theme="dark"] .btn-info:hover {
    background: #123154;
    box-shadow: 0 4px 8px rgba(79, 134, 173, 0.4);
}

[data-theme="dark"] .btn-success {
    background: #16a34a;
    color: #ffffff;
}

[data-theme="dark"] .btn-success:hover {
    background: #15803d;
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.4);
}

[data-theme="dark"] .btn-danger {
    background: #dc2626;
    color: #ffffff;
}

[data-theme="dark"] .btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.4);
}

[data-theme="dark"] .btn-warning {
    background: #d97706;
    color: #ffffff;
}

[data-theme="dark"] .btn-warning:hover {
    background: #b45309;
    box-shadow: 0 4px 8px rgba(217, 119, 6, 0.4);
}

/* Info Box and Sale Items */
[data-theme="dark"] .info-box {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .info-box p {
    color: #cbd5e1;
}

[data-theme="dark"] .sale-item {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-color: #334155;
}

[data-theme="dark"] .sale-item:hover {
    border-color: #475569;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .sale-item select,
[data-theme="dark"] .sale-item input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .sale-item .item-select:hover {
    background-color: #1e293b;
    border-color: var(--primary-400);
}

[data-theme="dark"] .sale-item .item-select:focus {
    background-color: #1e293b;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

[data-theme="dark"] .item-subtotal {
    color: #BCCCDC;
    background: rgba(26, 56, 98, 0.18);
}

/* Dark mode: Quantity stepper */
[data-theme="dark"] .sale-item .qty-stepper {
    background: #1e293b;
}

[data-theme="dark"] .sale-item .qty-btn {
    background: #334155;
    color: #BCCCDC;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .sale-item .qty-btn:hover {
    background: #475569;
    color: #D9E2EC;
}

[data-theme="dark"] .sale-item .qty-btn:active {
    background: #627D98;
    color: #ffffff;
}

[data-theme="dark"] .sale-item .item-quantity {
    color: #f8fafc;
}

/* Dark mode: Labels */
[data-theme="dark"] .sale-item .price-label,
[data-theme="dark"] .sale-item .subtotal-label {
    color: #64748b;
}

/* Dark mode: Sale item row 2 border */
[data-theme="dark"] .sale-item .sale-item-row-2 {
    border-top-color: #334155;
}

[data-theme="dark"] .sale-total {
    border-top-color: #334155;
}

[data-theme="dark"] .sale-total h3 {
    color: #BCCCDC;
}

/* Autocomplete Suggestions */
[data-theme="dark"] .autocomplete-suggestions {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .suggestion-item {
    border-bottom-color: #334155;
}

[data-theme="dark"] .suggestion-item:hover {
    background: #334155;
}

[data-theme="dark"] .suggestion-name {
    color: #f8fafc;
}

[data-theme="dark"] .suggestion-details {
    color: #94a3b8;
}

/* Alert Items */
[data-theme="dark"] .alert-item,
[data-theme="dark"] .recent-item {
    border-bottom-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .kitchen-ticket-list {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .kitchen-ticket-list-head {
    background: #111827;
    border-bottom-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .kitchen-ticket-row {
    border-bottom-color: #334155;
}

[data-theme="dark"] .kitchen-ticket-ticket strong,
[data-theme="dark"] .kitchen-ticket-items li strong {
    color: #f8fafc;
}

[data-theme="dark"] .kitchen-ticket-ticket small,
[data-theme="dark"] .kitchen-ticket-items li,
[data-theme="dark"] .kitchen-ticket-finished {
    color: #cbd5e1;
}

[data-theme="dark"] .kitchen-ticket-item-copy small,
[data-theme="dark"] .kitchen-ticket-notes {
    color: #fdba74;
}

[data-theme="dark"] .kitchen-ticket-timer span {
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
}

[data-theme="dark"] .restaurant-order-inline-action {
    background: linear-gradient(180deg, #334155 0%, #273449 100%);
    color: #e2e8f0;
    border-color: #475569;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.22);
}

[data-theme="dark"] .restaurant-order-inline-action:hover {
    border-color: #64748b;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.28);
}

[data-theme="dark"] .restaurant-order-inline-action:focus-visible {
    outline: 3px solid rgba(148, 163, 184, 0.24);
}

[data-theme="dark"] .restaurant-order-inline-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #fff7ed;
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 12px 24px rgba(234, 88, 12, 0.22);
}

[data-theme="dark"] .restaurant-order-inline-subtle {
    background: linear-gradient(180deg, #334155 0%, #293548 100%);
    color: #e2e8f0;
    border-color: #475569;
}

[data-theme="dark"] .restaurant-order-inline-danger {
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.22) 0%, rgba(69, 10, 10, 0.32) 100%);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.34);
    box-shadow: none;
}

[data-theme="dark"] .restaurant-order-settlement-main small {
    color: #cbd5e1;
}

[data-theme="dark"] .alert-item.critical {
    background: #450a0a;
    border-left-color: #ef4444;
}

/* Status Badges - Keep vibrant for visibility */
[data-theme="dark"] .status-badge.low-stock {
    background: #7f1d1d;
    color: #fca5a5;
}

[data-theme="dark"] .status-badge.in-stock {
    background: #14532d;
    color: #86efac;
}

[data-theme="dark"] .status-badge.pending {
    background: #78350f;
    color: #fcd34d;
}

[data-theme="dark"] .status-badge.approved,
[data-theme="dark"] .status-badge.completed,
[data-theme="dark"] .status-badge.settled {
    background: #14532d;
    color: #86efac;
}

[data-theme="dark"] .status-badge.partial-return {
    background: #78350f;
    color: #fcd34d;
}

[data-theme="dark"] .status-badge.returned {
    background: #7f1d1d;
    color: #fca5a5;
}

[data-theme="dark"] .status-badge.paid {
    background: #14532d;
    color: #86efac;
}

[data-theme="dark"] .status-badge.partial {
    background: #0d2745;
    color: #BCCCDC;
}

[data-theme="dark"] .status-badge.credit {
    background: #78350f;
    color: #fcd34d;
}

[data-theme="dark"] .status-badge.rejected {
    background: #7f1d1d;
    color: #fca5a5;
}

/* Sub-Navigation Tabs */
[data-theme="dark"] .sub-nav-tabs {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .sub-nav-btn {
    color: #94a3b8;
}

[data-theme="dark"] .sub-nav-btn:hover {
    color: #BCCCDC;
    background-color: #334155;
}

[data-theme="dark"] .sub-nav-btn.active {
    background: linear-gradient(135deg, #334E68 0%, #1A3862 100%);
    color: #ffffff;
}

/* Profit Cards */
[data-theme="dark"] .profit-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .profit-card h3 {
    color: #94a3b8;
}

[data-theme="dark"] .profit-value {
    color: #f8fafc;
}

[data-theme="dark"] .profit-subtitle {
    color: #64748b;
}

/* Demo credentials box */
[data-theme="dark"] .demo-credentials {
    background: #1e293b;
    border-left-color: #627D98;
}

[data-theme="dark"] .demo-credentials p {
    color: #cbd5e1;
}

[data-theme="dark"] .demo-credentials strong {
    color: #f8fafc;
}

/* Empty state */
[data-theme="dark"] .empty-state {
    color: #64748b;
}

/* Mobile Menu Button */
[data-theme="dark"] .mobile-menu-btn {
    background: #1e293b;
}

/* Scrollbar styling for dark mode */
[data-theme="dark"] .nav-menu::-webkit-scrollbar-thumb {
    background: #475569;
}

/* ========================================
   THEME TOGGLE BUTTON STYLES
   ======================================== */

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--neutral-100);
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.theme-toggle-btn:hover {
    background: var(--neutral-200);
    color: var(--text-primary);
    transform: scale(1.05);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
}

/* Show/hide sun/moon icons based on theme */
.theme-icon-sun {
    display: none;
}

.theme-icon-moon {
    display: block;
}

[data-theme="dark"] .theme-icon-sun {
    display: block;
}

[data-theme="dark"] .theme-icon-moon {
    display: none;
}

/* Theme toggle wrapper in sidebar user section */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.theme-toggle-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================
   DARK MODE DROPDOWN & SELECT STYLING
   ======================================== */

/* Base select styling in dark mode */
[data-theme="dark"] select {
    background-color: #1e293b;
    border-color: #475569;
    color: #f8fafc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%2393c5fd' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
}

[data-theme="dark"] select:hover {
    border-color: #9FB3C8;
    background-color: #334155;
}

[data-theme="dark"] select:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.25);
    background-color: #1e293b;
}

[data-theme="dark"] select option {
    background: #1e293b;
    color: #f8fafc;
}

/* Datalist input styling for dark mode */
[data-theme="dark"] input[list] {
    background-color: #1e293b;
    border-color: #475569;
    color: #f8fafc;
}

[data-theme="dark"] input[list]:hover {
    border-color: #9FB3C8;
    background-color: #334155;
}

[data-theme="dark"] input[list]:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.25);
    background-color: #1e293b;
}

[data-theme="dark"] input[list]::placeholder {
    color: #64748b;
}

/* Period select */
[data-theme="dark"] .period-select {
    background-color: #1e293b;
    border-color: #475569;
    color: #f8fafc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%2393c5fd' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .period-select:hover {
    border-color: #9FB3C8;
    background-color: #334155;
}

[data-theme="dark"] .period-select:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.25);
    background-color: #1e293b;
}

/* Return invoice searchable input */
[data-theme="dark"] #returnInvoiceInput {
    background-color: #0f172a;
    border: 1px solid #334155;
    color: #f8fafc;
    padding: 12px;
    border-radius: 6px;
    width: 100%;
    font-size: 14px;
    box-sizing: border-box;
}

[data-theme="dark"] #returnInvoiceInput:hover {
    border-color: #627D98;
}

[data-theme="dark"] #returnInvoiceInput:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.25);
    outline: none;
}

[data-theme="dark"] #returnInvoiceInput::placeholder {
    color: #64748b;
}

/* Report modal selects */
[data-theme="dark"] #reportType,
[data-theme="dark"] #dateRange,
[data-theme="dark"] #exportFormat {
    background-color: #1e293b;
    border-color: #475569;
    color: #f8fafc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%2393c5fd' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
}

[data-theme="dark"] #reportType:hover,
[data-theme="dark"] #dateRange:hover,
[data-theme="dark"] #exportFormat:hover {
    border-color: #9FB3C8;
    background-color: #334155;
}

[data-theme="dark"] #reportType:focus,
[data-theme="dark"] #dateRange:focus,
[data-theme="dark"] #exportFormat:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.25);
    background-color: #1e293b;
}

/* Purchase form selects */
[data-theme="dark"] #addPurchaseForm select,
[data-theme="dark"] #purchasePaymentMethod {
    background-color: #1e293b;
    border-color: #475569;
    color: #f8fafc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%2393c5fd' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
}

[data-theme="dark"] #addPurchaseForm select:hover,
[data-theme="dark"] #purchasePaymentMethod:hover {
    border-color: #9FB3C8;
}

[data-theme="dark"] #addPurchaseForm select:focus,
[data-theme="dark"] #purchasePaymentMethod:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.25);
}

/* User role and payment method selects */
[data-theme="dark"] #newUserRole,
[data-theme="dark"] #salePaymentMethod,
[data-theme="dark"] #expensePaymentMethod {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%2393c5fd' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
}

/* Enhanced sale item row in dark mode */
[data-theme="dark"] .sale-item {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

/* ========================================
   SUBSCRIPTION PLANS - DARK MODE
   (Main overrides are in subscription.css)
   ======================================== */



/* --- Expired Modal --- */
[data-theme="dark"] .expired-modal-icon {
    background: #450a0a;
}

[data-theme="dark"] .expired-modal-title {
    color: #f1f5f9;
}

[data-theme="dark"] .expired-modal-desc {
    color: #94a3b8;
}

[data-theme="dark"] .expired-modal-info {
    background: #0f172a;
}

[data-theme="dark"] .expired-modal-info-label {
    color: #64748b;
}

[data-theme="dark"] .expired-modal-list {
    color: #cbd5e1;
}

/* ========================================
   PURCHASE SYSTEM - DARK MODE
   ======================================== */

/* --- Purchase Table List --- */
[data-theme="dark"] #purchasesTable td[rowspan] {
    background: #1e293b;
    border-top: 2px solid #334155;
}

[data-theme="dark"] #purchasesTable .purchase-group-start td {
    border-top: 2px solid #334155;
}

/* --- Purchase Modal: Items Section --- */
[data-theme="dark"] .purchase-items-section {
    background: transparent;
    border-color: transparent;
}

[data-theme="dark"] .purchase-items-header {
    background: #1e293b;
    color: #94a3b8;
    border-bottom-color: #334155;
}

[data-theme="dark"] .purchase-item-row {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

[data-theme="dark"] .purchase-item-row:hover {
    border-color: #475569;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .purchase-item-row:focus-within {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.18);
}

[data-theme="dark"] .purchase-item-row input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .purchase-item-row input:hover {
    border-color: #475569;
}

[data-theme="dark"] .purchase-item-row input:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.2);
}

[data-theme="dark"] .purchase-item-row input::placeholder {
    color: #94a3b8;
}

/* --- Subtotal pill --- */
[data-theme="dark"] .purchase-subtotal-inline {
    background: transparent;
    border-color: #334155;
}

[data-theme="dark"] .purchase-subtotal {
    color: #6ee7b7;
}

/* --- Remove button --- */
[data-theme="dark"] .btn-remove-item {
    background: #0f172a;
    color: #64748b;
    border-color: #334155;
}

[data-theme="dark"] .btn-remove-item:hover {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

/* --- Add Item button --- */
[data-theme="dark"] .btn-add-purchase-item {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .btn-add-purchase-item:hover {
    background: #0f172a;
    border-color: #627D98;
    color: #9FB3C8;
}

/* --- Grand total --- */
[data-theme="dark"] .purchase-grand-total {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-color: #065f46;
}

[data-theme="dark"] .purchase-grand-total-label {
    color: #94a3b8;
}

[data-theme="dark"] .purchase-grand-total-amount {
    color: #6ee7b7;
}

[data-theme="dark"] #addPurchaseModal .modal-actions {
    background: #0f172a;
    border-top-color: #334155;
}

[data-theme="dark"] .purchase-field-label,
[data-theme="dark"] .purchase-item-count {
    color: #94a3b8;
}

/* --- Scrollbar --- */
[data-theme="dark"] #purchaseItems::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] #purchaseItems::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* --- Confirmation Modal --- */
[data-theme="dark"] .confirm-purchase-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .confirm-purchase-body {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .confirm-purchase-info {
    border-bottom-color: #334155;
}

[data-theme="dark"] .confirm-info-label {
    color: #64748b;
}

[data-theme="dark"] .confirm-info-value {
    color: #f1f5f9;
}

[data-theme="dark"] .confirm-items-head {
    color: #64748b;
    background: #1e293b;
}

[data-theme="dark"] .confirm-item-row {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

[data-theme="dark"] .confirm-item-name small {
    color: #64748b;
}

[data-theme="dark"] .confirm-item-total {
    color: #f1f5f9;
}

[data-theme="dark"] .confirm-purchase-total {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
}

[data-theme="dark"] .confirm-purchase-total span:first-child {
    color: #94a3b8;
}

[data-theme="dark"] .confirm-purchase-total span:last-child {
    color: #6ee7b7;
}

[data-theme="dark"] .confirm-purchase-items-table {
    border-bottom-color: #334155;
}

/* --- Read-only total input --- */
[data-theme="dark"] .item-total {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* --- Purchase Autocomplete Dropdown --- */
[data-theme="dark"] .purchase-suggestions.autocomplete-dropdown {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .purchase-suggestions .autocomplete-item:hover {
    background: #334155;
}

[data-theme="dark"] .purchase-suggestions .autocomplete-item strong {
    color: #f1f5f9;
}

[data-theme="dark"] .purchase-suggestions .autocomplete-item span {
    color: #94a3b8 !important;
}

[data-theme="dark"] .sale-item:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border-color: #475569;
}

/* Remove button in dark mode */
[data-theme="dark"] .sale-item .btn-remove {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

[data-theme="dark"] .sale-item .btn-remove:hover {
    background: #7f1d1d;
    border-color: #b91c1c;
    color: #ffffff;
}

/* Item subtotal in dark mode */
[data-theme="dark"] .item-subtotal {
    background: #1e3a5f;
    color: #BCCCDC;
}

/* Searchable Dropdown - Dark Mode */
[data-theme="dark"] .searchable-dropdown input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .searchable-dropdown input:focus {
    border-color: #627D98;
    box-shadow: 0 0 0 3px rgba(26, 56, 98, 0.25);
}

[data-theme="dark"] .searchable-dropdown input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .searchable-dropdown .dropdown-options {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .searchable-dropdown .dropdown-option {
    color: #f8fafc;
    border-bottom-color: #334155;
}

[data-theme="dark"] .searchable-dropdown .dropdown-option:hover {
    background: #334155;
}

[data-theme="dark"] .searchable-dropdown .dropdown-option.selected {
    background: #1e3a5f;
}

[data-theme="dark"] .searchable-dropdown .no-options {
    color: #64748b;
}

/* Return Items List - Dark Mode */
[data-theme="dark"] #returnItemsList {
    background: #0f172a !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .return-item-row {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .return-item-row strong {
    color: #f8fafc;
}

[data-theme="dark"] .return-item-row small {
    color: #94a3b8;
}

[data-theme="dark"] .return-item-checkbox {
    accent-color: #627D98;
}

[data-theme="dark"] .return-qty-input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .return-qty-label {
    color: #cbd5e1;
}

/* ========================================
   HOSPITALITY POS - DARK MODE
   ======================================== */
[data-theme="dark"] .hospitality-pos-modal {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .hospitality-pos-browser,
[data-theme="dark"] .hospitality-pos-summary {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .hospitality-pos-search,
[data-theme="dark"] .hospitality-pos-fields input,
[data-theme="dark"] .hospitality-pos-fields select,
[data-theme="dark"] .hospitality-pos-fields textarea,
[data-theme="dark"] .hospitality-pos-item-note {
    background: var(--neutral-50);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .hospitality-pos-search::placeholder,
[data-theme="dark"] .hospitality-pos-fields input::placeholder,
[data-theme="dark"] .hospitality-pos-fields textarea::placeholder,
[data-theme="dark"] .hospitality-pos-item-note::placeholder {
    color: var(--text-tertiary);
}

[data-theme="dark"] .hospitality-pos-category-btn {
    background: var(--neutral-50);
    border-color: var(--border);
    color: var(--text-secondary);
}

[data-theme="dark"] .hospitality-pos-category-btn:hover {
    background: var(--neutral-100);
    border-color: var(--primary-500);
    color: var(--text-primary);
}

[data-theme="dark"] .hospitality-pos-category-btn.active {
    background: var(--accent-400);
    border-color: var(--accent-400);
    color: var(--background);
}

[data-theme="dark"] .hospitality-pos-card,
[data-theme="dark"] .hospitality-pos-order-item {
    background: linear-gradient(180deg, var(--neutral-100) 0%, var(--neutral-50) 100%);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .hospitality-pos-card:hover {
    border-color: var(--primary-500);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .hospitality-pos-card:disabled {
    background: var(--neutral-100);
}

[data-theme="dark"] .hospitality-pos-card-price {
    color: var(--accent-500);
}

[data-theme="dark"] .hospitality-pos-empty {
    background: var(--neutral-50);
    border-color: var(--border);
    color: var(--text-secondary);
}

[data-theme="dark"] .hospitality-pos-receipt-card {
    background: linear-gradient(180deg, var(--success-100) 0%, var(--success-50) 100%);
    border-color: rgba(34, 197, 94, 0.38);
}

[data-theme="dark"] .hospitality-pos-receipt-title,
[data-theme="dark"] .hospitality-pos-receipt-meta {
    color: var(--success-700);
}

[data-theme="dark"] .hospitality-pos-queued-banner {
    background: linear-gradient(180deg, rgba(124, 45, 18, 0.32) 0%, rgba(67, 20, 7, 0.45) 100%);
    border-color: rgba(249, 115, 22, 0.32);
}

[data-theme="dark"] .hospitality-pos-queued-copy {
    color: #fed7aa;
}

[data-theme="dark"] .hospitality-pos-editing-banner {
    background: rgba(249, 115, 22, 0.18);
    color: #fdba74;
}

[data-theme="dark"] .hospitality-pos-qty button {
    background: var(--neutral-50);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .hospitality-pos-qty button:hover {
    background: var(--neutral-100);
    border-color: var(--primary-500);
}

[data-theme="dark"] .hospitality-pos-remove {
    color: var(--error-600);
}

[data-theme="dark"] .hospitality-pos-summary-footer {
    border-top-color: var(--border);
}

[data-theme="dark"] .hospitality-pos-saving {
    background: var(--primary-100);
    color: var(--primary-800);
}

/* ========================================
   NOTIFICATIONS - DARK MODE
   ======================================== */
[data-theme="dark"] .notification {
    background: #1e293b;
    color: #f8fafc;
    border-color: #334155;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .notification.success {
    border-left-color: #22c55e;
}

[data-theme="dark"] .notification.success::before {
    background: #14532d;
    color: #4ade80;
}

[data-theme="dark"] .notification.error {
    border-left-color: #ef4444;
}

[data-theme="dark"] .notification.error::before {
    background: #450a0a;
    color: #f87171;
}

[data-theme="dark"] .notification.info {
    border-left-color: #627D98;
}

[data-theme="dark"] .notification.info::before {
    background: #1e3a5f;
    color: #9FB3C8;
}

[data-theme="dark"] .notification.warning {
    border-left-color: #f59e0b;
}

[data-theme="dark"] .notification.warning::before {
    background: #451a03;
    color: #fbbf24;
}
