/* ==========================================================================
   AuraGold Wholesale ERP - World-Class Luxury Design System
   Architecture: High-End Bullion Depository & Haute Joaillerie Enterprise
   Typography: Cinzel (Luxury Roman Serif) + Plus Jakarta Sans + JetBrains Mono
   Color Scheme: Obsidian Onyx, Metallic Champagne & Imperial Gold Gradients
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Theme Variables
   -------------------------------------------------------------------------- */
:root, [data-theme="dark"] {
    /* Color Palette - Mild Slate & Charcoal Luxury Theme (Comfortable & Soft) */
    --bg-canvas: #131722;
    --bg-main: #171c28;
    --bg-surface: #1e2433;
    --bg-card: #222938;
    --bg-card-hover: #293144;
    --bg-elevated: #283042;
    --bg-input: #19202e;

    /* Subtle Glass Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(229, 185, 90, 0.6);

    /* Metallic Gold Palette */
    --gold-primary: #e5b95a;
    --gold-light: #fef0c7;
    --gold-dark: #b88a2a;
    --gold-hover: #f3c86a;
    --gold-glow: rgba(229, 185, 90, 0.25);
    --gold-subtle: rgba(229, 185, 90, 0.12);
    --gold-border: rgba(229, 185, 90, 0.32);

    /* Multi-stop Luxury Gold Gradients */
    --gold-gradient: linear-gradient(135deg, #e8c47e 0%, #fcedbb 25%, #dfb552 50%, #fef3c7 75%, #b38226 100%);
    --gold-gradient-satin: linear-gradient(135deg, #dfb552 0%, #f0d886 50%, #b38e2d 100%);
    --gold-gradient-dark: linear-gradient(135deg, #352e1d 0%, #201b12 100%);
    --gold-gradient-subtle: linear-gradient(135deg, rgba(229, 185, 90, 0.16) 0%, rgba(229, 185, 90, 0.04) 100%);

    /* Semantic Status Accents */
    --status-success: #10b981;
    --status-success-bg: rgba(16, 185, 129, 0.14);
    --status-success-border: rgba(16, 185, 129, 0.32);

    --status-warning: #f59e0b;
    --status-warning-bg: rgba(245, 158, 11, 0.14);
    --status-warning-border: rgba(245, 158, 11, 0.32);

    --status-danger: #ef4444;
    --status-danger-bg: rgba(239, 68, 68, 0.14);
    --status-danger-border: rgba(239, 68, 68, 0.32);

    --status-info: #38bdf8;
    --status-info-bg: rgba(56, 189, 248, 0.14);
    --status-info-border: rgba(56, 189, 248, 0.32);

    /* Text Colors - High Legibility Mild Contrast */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Typography */
    --font-serif: 'Cinzel', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, Menlo, monospace;

    /* Dimensions */
    --sidebar-width: 270px;
    --sidebar-collapsed-width: 76px;
    --topbar-height: 68px;

    /* Elevation Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 6px 20px -2px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.35);
    --shadow-gold: 0 0 20px -2px var(--gold-glow);

    /* Bootstrap 5 Theme Overrides to completely prevent dark-mode black text */
    --bs-body-color: var(--text-primary);
    --bs-body-color-rgb: 248, 250, 252;
    --bs-body-bg: var(--bg-canvas);
    --bs-body-bg-rgb: 19, 23, 34;
    --bs-card-color: var(--text-primary);
    --bs-card-bg: var(--bg-card);
    --bs-modal-color: var(--text-primary);
    --bs-table-color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-subtle);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
    --bs-table-hover-bg: rgba(229, 185, 90, 0.08);
    --bs-table-hover-color: var(--text-primary);
    --bs-list-group-color: var(--text-primary);
    --bs-list-group-bg: var(--bg-card);
    --bs-list-group-border-color: var(--border-subtle);
    --bs-dropdown-color: var(--text-primary);
    --bs-dropdown-bg: var(--bg-surface);
    --bs-dropdown-border-color: var(--border-card);
    --bs-heading-color: var(--text-primary);
    --bs-modal-bg: var(--bg-surface);
    --bs-secondary-color: var(--text-secondary);
    --bs-tertiary-color: var(--text-muted);
    --bs-emphasis-color: var(--text-primary);
}

/* Light Theme - Imperial Alabaster & Warm Champagne */
[data-theme="light"] {
    --bg-canvas: #f8f9fa;
    --bg-main: #f1f3f6;
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-input: #ffffff;

    --border-subtle: #e2e8f0;
    --border-card: #e2e8f0;
    --border-focus: rgba(184, 134, 11, 0.55);

    --gold-primary: #b8860b;
    --gold-light: #784c0c;
    --gold-dark: #784c0c;
    --gold-hover: #996515;
    --gold-glow: rgba(184, 134, 11, 0.2);
    --gold-subtle: rgba(184, 134, 11, 0.08);
    --gold-border: rgba(184, 134, 11, 0.28);

    --gold-gradient: linear-gradient(135deg, #b8860b 0%, #e6ca65 35%, #996515 70%, #d4af37 100%);
    --gold-gradient-satin: linear-gradient(135deg, #b8860b 0%, #cfab3a 50%, #784c0c 100%);
    --gold-gradient-dark: linear-gradient(135deg, #fef8eb 0%, #faedd0 100%);
    --gold-gradient-subtle: linear-gradient(135deg, rgba(184, 134, 11, 0.1) 0%, rgba(184, 134, 11, 0.02) 100%);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 18px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.12);
    --shadow-gold: 0 0 20px -2px rgba(184, 134, 11, 0.18);

    /* Bootstrap 5 Theme Overrides for Daylight Mode */
    --bs-body-color: var(--text-primary);
    --bs-body-color-rgb: 15, 23, 42;
    --bs-body-bg: var(--bg-canvas);
    --bs-body-bg-rgb: 248, 249, 250;
    --bs-card-color: var(--text-primary);
    --bs-card-bg: var(--bg-card);
    --bs-modal-color: var(--text-primary);
    --bs-table-color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-subtle);
    --bs-table-striped-bg: rgba(0, 0, 0, 0.02);
    --bs-table-hover-bg: rgba(184, 134, 11, 0.06);
    --bs-table-hover-color: var(--text-primary);
    --bs-list-group-color: var(--text-primary);
    --bs-list-group-bg: var(--bg-card);
    --bs-list-group-border-color: var(--border-subtle);
    --bs-dropdown-color: var(--text-primary);
    --bs-dropdown-bg: #ffffff;
    --bs-dropdown-border-color: var(--border-subtle);
    --bs-heading-color: var(--text-primary);
    --bs-modal-bg: #ffffff;
    --bs-secondary-color: var(--text-secondary);
    --bs-tertiary-color: var(--text-muted);
    --bs-emphasis-color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   2. Global Typography & Core Resets
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-size: 0.935rem;
    line-height: 1.55;
    min-height: 100vh;
}

/* Serif Brand Font Utility */
.font-serif, .brand-font {
    font-family: var(--font-serif);
    letter-spacing: 0.03em;
}

/* Tabular Monospace Data Utility */
.font-mono, .metric-value, .calc-val, .weight-display, .currency-display {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Gold Text Shimmer */
.text-gold-gradient {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.text-gold {
    color: var(--gold-primary) !important;
}

/* Luxury Custom Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* --------------------------------------------------------------------------
   3. CRITICAL: Dark Theme Black Text Elimination
   -------------------------------------------------------------------------- */
/* Any element with .text-dark in dark theme MUST use light text, unless on a gold button/badge */
[data-theme="dark"] .text-dark:not(.btn-gold, .btn-gold *, .badge-gold.bg-gold, .nav-pills .nav-link.active, .nav-pills .nav-link.active *) {
    color: var(--text-primary) !important;
}

/* Fix Bootstrap .bg-light and .table-light in dark mode */
[data-theme="dark"] .bg-light:not(.print-invoice-paper, .print-invoice-paper *) {
    background-color: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

[data-theme="dark"] .table-light,
[data-theme="dark"] thead.table-light,
[data-theme="dark"] thead.table-light th,
[data-theme="dark"] tr.table-light,
[data-theme="dark"] tr.table-light td {
    background-color: var(--bg-surface) !important;
    color: var(--gold-light) !important;
    border-color: var(--border-subtle) !important;
}

/* General Bootstrap Table Dark Color Enforcement */
[data-theme="dark"] .table {
    --bs-table-color: var(--text-primary) !important;
    --bs-table-bg: transparent !important;
    --bs-table-border-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

[data-theme="dark"] .table-bordered {
    border-color: var(--border-subtle) !important;
}

[data-theme="dark"] .border-dark {
    border-color: var(--border-subtle) !important;
}

[data-theme="dark"] .text-black {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-body,
[data-theme="dark"] .text-body-secondary,
[data-theme="dark"] .text-body-tertiary {
    color: var(--text-secondary) !important;
}

/* Modals in Dark Mode */
[data-theme="dark"] .modal-content {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-card) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65) !important;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-subtle) !important;
}

[data-theme="dark"] .modal-title {
    color: var(--gold-light) !important;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) brightness(1.75);
}

/* Translucent Luxury Badges - No Black Text */
[data-theme="dark"] .badge.bg-warning,
[data-theme="dark"] .badge.bg-warning.text-dark {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

[data-theme="dark"] .badge.bg-info,
[data-theme="dark"] .badge.bg-info.text-dark {
    background: rgba(56, 189, 248, 0.18) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

[data-theme="dark"] .badge.bg-secondary {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

[data-theme="dark"] .badge.bg-success {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] .badge.bg-danger {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

/* Luxury Glowing Alerts in Dark Mode */
[data-theme="dark"] .alert {
    border-radius: 10px;
    border-width: 1px;
    font-size: 0.88rem;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.14) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(16, 185, 129, 0.14) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.14) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fde68a !important;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(56, 189, 248, 0.14) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    color: #7dd3fc !important;
}

/* Dropdown Menus in Dark Mode */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-card) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--bg-card-hover) !important;
    color: var(--gold-light) !important;
}

[data-theme="dark"] .dropdown-divider {
    border-color: var(--border-subtle) !important;
}

/* --------------------------------------------------------------------------
   3.1 CRITICAL: Daylight Theme White/Light Text Elimination
   -------------------------------------------------------------------------- */
/* Any element with .text-light or .text-white in daylight theme MUST use dark primary text,
   UNLESS explicitly located on a solid-colored button/badge or the dark auth canvas */
[data-theme="light"] .text-light:not(
    .btn-primary, .btn-primary *,
    .btn-danger, .btn-danger *,
    .btn-success, .btn-success *,
    .btn-info, .btn-info *,
    .btn-dark, .btn-dark *,
    .btn-warning:not(.text-dark), .btn-warning:not(.text-dark) *,
    .badge.bg-primary, .badge.bg-primary *,
    .badge.bg-danger, .badge.bg-danger *,
    .badge.bg-success, .badge.bg-success *,
    .badge.bg-info, .badge.bg-info *,
    .auth-canvas, .auth-canvas *
),
[data-theme="light"] .text-white:not(
    .btn-primary, .btn-primary *,
    .btn-danger, .btn-danger *,
    .btn-success, .btn-success *,
    .btn-info, .btn-info *,
    .btn-dark, .btn-dark *,
    .btn-warning:not(.text-dark), .btn-warning:not(.text-dark) *,
    .badge.bg-primary, .badge.bg-primary *,
    .badge.bg-danger, .badge.bg-danger *,
    .badge.bg-success, .badge.bg-success *,
    .badge.bg-info, .badge.bg-info *,
    .auth-canvas, .auth-canvas *
) {
    color: var(--text-primary) !important;
}

[data-theme="light"] .text-white-50:not(
    .btn-primary, .btn-primary *,
    .btn-danger, .btn-danger *,
    .btn-success, .btn-success *,
    .btn-info, .btn-info *,
    .btn-dark, .btn-dark *,
    .badge.bg-primary, .badge.bg-primary *,
    .badge.bg-danger, .badge.bg-danger *,
    .badge.bg-success, .badge.bg-success *,
    .badge.bg-info, .badge.bg-info *,
    .auth-canvas, .auth-canvas *
) {
    color: var(--text-muted) !important;
}

/* Breadcrumbs in Daylight Mode */
[data-theme="light"] .breadcrumb-item.active,
[data-theme="light"] .breadcrumb-item.active.text-light {
    color: var(--text-primary) !important;
}

/* Form Check / Switch Labels in Daylight Mode */
[data-theme="light"] .form-check-label,
[data-theme="light"] .form-check-label.text-light {
    color: var(--text-primary) !important;
}

/* Dark Badges become high-contrast soft slate badges in Light Mode */
[data-theme="light"] .badge.bg-dark {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

/* Dark surface wrappers in Light Mode */
[data-theme="light"] .bg-surface-dark,
[data-theme="light"] .bg-dark.bg-opacity-25,
[data-theme="light"] .bg-dark.bg-opacity-10 {
    background-color: #f1f5f9 !important;
    color: var(--text-primary) !important;
}

/* Modals in Daylight Mode */
[data-theme="light"] .modal-content {
    background-color: #ffffff !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .modal-header,
[data-theme="light"] .modal-footer {
    border-color: var(--border-subtle) !important;
}

[data-theme="light"] .modal-title {
    color: var(--text-primary) !important;
}

/* Dropdowns in Daylight Mode */
[data-theme="light"] .dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .dropdown-item {
    color: var(--text-secondary) !important;
}

[data-theme="light"] .dropdown-item:hover,
[data-theme="light"] .dropdown-item:focus {
    background-color: var(--bg-card-hover) !important;
    color: var(--gold-dark) !important;
}

[data-theme="light"] .dropdown-divider {
    border-color: var(--border-subtle) !important;
}

/* Tables in Daylight Mode */
[data-theme="light"] .table {
    --bs-table-color: var(--text-primary) !important;
    --bs-table-bg: transparent !important;
    --bs-table-border-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

[data-theme="light"] .table th,
[data-theme="light"] .table td {
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

[data-theme="light"] .table-light,
[data-theme="light"] thead.table-light,
[data-theme="light"] thead.table-light th,
[data-theme="light"] tr.table-light,
[data-theme="light"] tr.table-light td {
    background-color: #f8fafc !important;
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

/* Nav Pills & Tabs in Daylight Mode */
[data-theme="light"] .nav-pills .nav-link:not(.active) {
    color: var(--text-secondary) !important;
    background-color: #ffffff !important;
    border-color: var(--border-subtle) !important;
}

[data-theme="light"] .nav-pills .nav-link:hover:not(.active) {
    background-color: var(--bg-card-hover) !important;
    color: var(--gold-dark) !important;
    border-color: var(--gold-border) !important;
}

/* Sidebar Links in Daylight Mode */
[data-theme="light"] .sidebar-link {
    color: var(--text-secondary);
}

[data-theme="light"] .sidebar-link:hover {
    background-color: var(--bg-card-hover);
    color: var(--gold-dark) !important;
}

[data-theme="light"] .sidebar-link:hover i {
    color: var(--gold-dark) !important;
}

[data-theme="light"] .sidebar-link.active {
    background: rgba(184, 134, 11, 0.1) !important;
    color: var(--gold-dark) !important;
    border-color: var(--gold-primary) !important;
}

[data-theme="light"] .sidebar-link.active i {
    color: var(--gold-dark) !important;
}

/* Card Header in Daylight Mode */
[data-theme="light"] .card-erp-header {
    background: rgba(0, 0, 0, 0.02) !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-subtle) !important;
}

/* Outline Gold Button Hover in Daylight Mode */
[data-theme="light"] .btn-outline-gold:hover {
    background: rgba(184, 134, 11, 0.1) !important;
    color: var(--gold-dark) !important;
    border-color: var(--gold-hover) !important;
}

/* Rate Ticker in Daylight Mode */
[data-theme="light"] .rate-ticker-pill {
    background-color: #ffffff !important;
    color: var(--text-primary) !important;
    border-color: rgba(184, 134, 11, 0.3) !important;
}

/* List group items in Daylight Mode */
[data-theme="light"] .list-group-item {
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

/* Border secondary subtle in light mode */
[data-theme="light"] .border-secondary {
    border-color: var(--border-subtle) !important;
}

/* Defined .bg-gold class */
.bg-gold {
    background: var(--gold-gradient) !important;
    color: #0b0d11 !important;
}

/* Solid high-contrast text on jewel-tone buttons */
.btn-info {
    background-color: #0284c7 !important;
    border-color: #0369a1 !important;
    color: #ffffff !important;
}
.btn-info:hover {
    background-color: #0369a1 !important;
    color: #ffffff !important;
}

.btn-success {
    background-color: #059669 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}
.btn-success:hover {
    background-color: #047857 !important;
    color: #ffffff !important;
}

.btn-warning {
    background-color: #d97706 !important;
    border-color: #b45309 !important;
    color: #ffffff !important;
}

/* Nav Pills Styling */
.nav-pills {
    gap: 0.35rem;
}

.nav-pills .nav-link {
    color: var(--text-secondary) !important;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.55rem 1.15rem;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-pills .nav-link:hover:not(.active) {
    background: var(--bg-card-hover) !important;
    color: var(--gold-light) !important;
    border-color: var(--gold-border);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: var(--gold-gradient) !important;
    color: #0b0d11 !important;
    font-weight: 700 !important;
    border-color: var(--gold-dark) !important;
    box-shadow: 0 4px 14px var(--gold-glow) !important;
}

.nav-pills .nav-link.active i {
    color: #0b0d11 !important;
}

/* Form Controls & Select Options */
select option {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
}

.form-control:disabled, .form-control[readonly],
.form-select:disabled {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-subtle) !important;
}

::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.8;
}

/* DataTables Light Text in Dark Mode */
[data-theme="dark"] .dataTables_wrapper,
[data-theme="dark"] .dataTables_info,
[data-theme="dark"] .dataTables_length,
[data-theme="dark"] .dataTables_filter,
[data-theme="dark"] .dataTables_paginate {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-card) !important;
}

[data-theme="dark"] .page-link {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .page-item.active .page-link {
    background-color: var(--gold-primary) !important;
    border-color: var(--gold-dark) !important;
    color: #000000 !important;
}

/* --------------------------------------------------------------------------
   4. Master Responsive App Layout
   -------------------------------------------------------------------------- */
#app-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-canvas);
    position: relative;
}

/* Sidebar Styling */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Desktop Collapsed Sidebar */
@media (min-width: 992px) {
    #sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }
    #sidebar.collapsed .sidebar-text,
    #sidebar.collapsed .sidebar-badge,
    #sidebar.collapsed .sidebar-brand-name,
    #sidebar.collapsed .nav-section-title,
    #sidebar.collapsed .sidebar-header-sub {
        display: none !important;
    }
    #sidebar.collapsed .sidebar-link {
        justify-content: center;
        padding: 0.75rem 0;
        margin: 0.2rem 0.5rem;
        border-radius: 8px;
    }
    #sidebar.collapsed .sidebar-link i {
        font-size: 1.35rem;
        margin: 0;
    }
    #main-content {
        margin-left: var(--sidebar-width);
        transition: margin-left 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }
    #main-content.expanded {
        margin-left: var(--sidebar-collapsed-width);
    }
}

/* Mobile & Tablet Drawer Behavior (< 992px) */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
        width: 285px;
        box-shadow: none;
        z-index: 1060;
    }
    #sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 14px 0 45px rgba(0, 0, 0, 0.75);
    }
    #main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Frosted Backdrop Overlay on Mobile */
#sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 5, 7, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1055;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

#sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Sidebar Header & Brand */
.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.35rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.brand-gold {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gold-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b0d11;
    font-size: 1.15rem;
    box-shadow: 0 4px 14px var(--gold-glow);
    flex-shrink: 0;
}

.sidebar-brand-name {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-header-sub {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 0.85rem 0.85rem 0.35rem;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-link i {
    font-size: 1.18rem;
    width: 24px;
    text-align: center;
    color: inherit;
    transition: transform 0.18s ease;
}

.sidebar-link:hover {
    background-color: var(--bg-card-hover);
    color: var(--gold-light);
    transform: translateX(2px);
}

.sidebar-link:hover i {
    transform: scale(1.1);
    color: var(--gold-primary);
}

.sidebar-link.active {
    background: var(--gold-gradient-subtle);
    color: var(--gold-primary);
    border: 1px solid var(--gold-border);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-link.active i {
    color: var(--gold-primary);
}

/* Main Content Area */
#main-content {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--bg-canvas);
}

/* --------------------------------------------------------------------------
   5. Topbar & Live Bullion Ticker
   -------------------------------------------------------------------------- */
#topbar {
    height: var(--topbar-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

@media (max-width: 576px) {
    #topbar {
        padding: 0 0.85rem;
    }
}

.rate-ticker-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: 9999px;
    padding: 0.35rem 0.95rem;
    font-size: 0.82rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

.live-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: livePulseAnim 2s infinite;
}

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

.rate-badge {
    color: var(--gold-primary);
    font-weight: 700;
    font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   6. Cards, Bento Grids & Luxury Surfaces
   -------------------------------------------------------------------------- */
.card-erp {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.35rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.card-erp:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.card-erp-header {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.02);
}

.card-erp-body {
    padding: 1.35rem;
}

/* High-Impact Luxury Metric Cards (KPI) */
.metric-card-luxury {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s;
    height: 100%;
}

.metric-card-luxury:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-gold);
    border-color: var(--gold-border);
}

.metric-card-luxury::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--gold-gradient));
}

.metric-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: var(--gold-subtle);
    color: var(--gold-primary);
    border: 1px solid var(--gold-border);
    margin-bottom: 1rem;
}

.metric-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.metric-value {
    font-size: 1.68rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.metric-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   7. 3 Core Wholesale Models Showcase Panel
   -------------------------------------------------------------------------- */
.wholesale-model-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 1.35rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.wholesale-model-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.wholesale-model-card.model-bullion {
    border-color: rgba(212, 175, 55, 0.35);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, var(--bg-card) 60%);
}
.wholesale-model-card.model-bullion:hover {
    border-color: var(--gold-primary);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}

.wholesale-model-card.model-custom {
    border-color: rgba(56, 189, 248, 0.35);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, var(--bg-card) 60%);
}
.wholesale-model-card.model-custom:hover {
    border-color: var(--status-info);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.2);
}

.wholesale-model-card.model-ready {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-card) 60%);
}
.wholesale-model-card.model-ready:hover {
    border-color: var(--status-success);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

/* --------------------------------------------------------------------------
   8. Tables & DataTables (Responsive & Monospace Weights)
   -------------------------------------------------------------------------- */
.table-luxury-wrapper {
    position: relative;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-erp {
    width: 100%;
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    vertical-align: middle;
    margin-bottom: 0;
}

.table-erp th {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    border-top: none;
    white-space: nowrap;
}

.table-erp td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
    transition: background 0.15s ease;
    color: var(--text-primary);
}

.table-erp tbody tr:hover td {
    background-color: var(--bg-card-hover);
}

/* Numeric alignment in tables */
.table-erp td.text-end,
.table-erp th.text-end {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   9. Luxury Badges & Status Chips
   -------------------------------------------------------------------------- */
.badge-gold {
    background: var(--gold-subtle);
    color: var(--gold-primary);
    border: 1px solid var(--gold-border);
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.badge-posted {
    background: var(--status-success-bg);
    color: var(--status-success);
    border: 1px solid var(--status-success-border);
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-draft {
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border: 1px solid var(--status-warning-border);
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-cancelled {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border: 1px solid var(--status-danger-border);
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   10. Form Controls, Inputs & Touch Optimization
   -------------------------------------------------------------------------- */
.form-control, .form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    border-radius: 8px;
    padding: 0.58rem 0.9rem;
    min-height: 42px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-surface);
    border-color: var(--gold-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
    outline: none;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.input-group-text {
    background-color: var(--bg-surface);
    border-color: var(--border-card);
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   11. Master Gold Buttons & CTAs
   -------------------------------------------------------------------------- */
.btn-gold {
    background: var(--gold-gradient);
    border: 1px solid var(--gold-dark);
    color: #0b0d11 !important;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 10px var(--gold-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-gold:hover {
    background: var(--gold-hover);
    color: #000000 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.45);
}

.btn-gold:active {
    transform: translateY(0);
}

.btn-outline-gold {
    background: transparent;
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary) !important;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-outline-gold:hover {
    background: var(--gold-subtle);
    color: var(--gold-light) !important;
    border-color: var(--gold-hover);
    box-shadow: 0 4px 14px var(--gold-glow);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   12. Luxury Auth Pages (Admin & Client Portal)
   -------------------------------------------------------------------------- */
.auth-canvas {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    gap: 0.75rem;
    background: radial-gradient(ellipse at 50% 10%, #252e40 0%, #131722 80%);
    position: relative;
    overflow: hidden;
}

.auth-canvas::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 650px;
    height: 450px;
    background: radial-gradient(circle, rgba(229, 185, 90, 0.16) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
}

.auth-card-luxury {
    width: 100%;
    max-width: 460px;
    background: rgba(30, 37, 52, 0.94);
    border: 1px solid var(--gold-border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 35px rgba(229, 185, 90, 0.15);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 2.5rem 2.25rem;
    position: relative;
    z-index: 10;
}

.auth-brand-emblem {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gold-gradient-dark);
    border: 2px solid var(--gold-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-primary);
    font-size: 2.2rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 0 25px var(--gold-glow);
}

.demo-chip {
    cursor: pointer;
    font-size: 0.74rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    background: var(--gold-subtle);
    color: var(--gold-light);
    border: 1px solid var(--gold-border);
    display: inline-block;
    margin: 3px;
    transition: all 0.15s ease;
}

.demo-chip:hover {
    background: var(--gold-primary);
    color: #000;
    box-shadow: 0 2px 8px var(--gold-glow);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   13. Official Luxury Invoice Document (Screen & Print)
   -------------------------------------------------------------------------- */
/* On Screen: Luxury Depository Certificate */
.print-invoice {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--gold-border) !important;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), var(--shadow-gold) !important;
}

.print-invoice h4, .print-invoice h5, .print-invoice strong, .print-invoice .fs-6 {
    color: var(--text-primary) !important;
}

.print-invoice .text-dark {
    color: var(--text-primary) !important;
}

.print-invoice .bg-white {
    background-color: var(--bg-surface) !important;
}

.print-invoice .bg-light {
    background-color: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

.print-invoice .table-light,
.print-invoice thead.table-light tr,
.print-invoice thead.table-light th {
    background-color: var(--bg-elevated) !important;
    color: var(--gold-light) !important;
    border-color: var(--border-subtle) !important;
}

.print-invoice table,
.print-invoice th,
.print-invoice td {
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

.print-invoice .border-dark {
    border-color: var(--gold-border) !important;
}

.print-invoice .badge.border-dark {
    border-color: var(--gold-border) !important;
    color: var(--gold-primary) !important;
    background: var(--gold-subtle) !important;
}

/* ==========================================================================
   14. Print Mode Media Query - Pure White Paper Output for Reports & Invoices
   ========================================================================== */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm 10mm 12mm 10mm;
    }

    /* 1. Hide All Web Interactive Chrome */
    #sidebar, 
    #topbar, 
    #sidebar-backdrop, 
    footer, 
    .no-print, 
    .btn, 
    button, 
    .rate-ticker-pill, 
    .nav-pills, 
    .alert, 
    .modal-backdrop,
    .action-col, 
    th.action-col, 
    td.action-col,
    .dropdown,
    .dataTables_filter,
    .dataTables_length,
    .dataTables_paginate,
    .dataTables_info {
        display: none !important;
    }

    /* 2. Global Print Resets */
    html, body {
        background: #ffffff !important;
        color: #0b0f19 !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
        font-size: 8.5pt !important;
        line-height: 1.35 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #app-wrapper, 
    #main-content, 
    main {
        display: block !important;
        margin-left: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        width: 100% !important;
        min-height: auto !important;
    }

    /* 3. Report Card Transformation into Clean Document */
    .card-erp {
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 4px !important;
        box-shadow: none !important;
        margin: 0 0 12px 0 !important;
        padding: 0 !important;
        page-break-inside: auto;
    }

    .card-erp-header {
        background: #f8fafc !important;
        color: #0f172a !important;
        border-bottom: 1px solid #cbd5e1 !important;
        padding: 6px 10px !important;
        font-size: 9pt !important;
        font-weight: 700 !important;
    }

    .card-erp-body {
        padding: 0 !important;
        background: #ffffff !important;
    }

    /* 4. Table Print Layout */
    .table-luxury-wrapper, 
    .table-responsive {
        overflow: visible !important;
        width: 100% !important;
    }

    .table-erp, 
    .table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 8pt !important;
        color: #0f172a !important;
        margin-bottom: 0 !important;
    }

    .table-erp th, 
    .table th {
        background-color: #f1f5f9 !important;
        color: #0f172a !important;
        font-weight: 700 !important;
        text-align: left;
        padding: 5px 7px !important;
        border: 1px solid #cbd5e1 !important;
        font-size: 7.5pt !important;
        text-transform: uppercase !important;
        letter-spacing: 0.04em !important;
    }

    .table-erp td, 
    .table td {
        padding: 4px 7px !important;
        border: 1px solid #e2e8f0 !important;
        color: #0f172a !important;
        background: #ffffff !important;
        vertical-align: middle !important;
        page-break-inside: avoid !important;
    }

    .table-erp tfoot tr, 
    .table-erp tfoot td,
    .table tfoot tr,
    .table tfoot td {
        background-color: #f8fafc !important;
        font-weight: 700 !important;
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
    }

    tr {
        page-break-inside: avoid !important;
    }

    /* 5. Typography and High Contrast Text in Print */
    .text-light, 
    .text-white, 
    .text-muted, 
    .text-secondary,
    .text-dim {
        color: #1e293b !important;
    }

    .text-gold, 
    .text-gold-gradient {
        color: #0f172a !important;
        background: none !important;
        -webkit-text-fill-color: initial !important;
        font-weight: 600 !important;
    }

    .text-success {
        color: #065f46 !important;
    }

    .text-danger {
        color: #991b1b !important;
    }

    .text-info {
        color: #075985 !important;
    }

    .font-mono, 
    .font-monospace {
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    }

    .badge {
        border: 1px solid #64748b !important;
        color: #0f172a !important;
        background: transparent !important;
        font-size: 6.8pt !important;
        padding: 1px 4px !important;
    }

    /* 6. Invoice Document Output */
    .print-invoice {
        background: #ffffff !important;
        color: #000000 !important;
        border: 2px solid #000000 !important;
        padding: 18px !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .print-invoice * {
        color: #000000 !important;
        background: transparent !important;
        border-color: #333333 !important;
    }

    #gold-page-loader {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   7. Master Luxury Gold Page Preloader
   Features: 3D Gold Bullion Ingot, Orbital Halos, Specular Shimmer & Molten Fill
   Software Partner: Infossel Soft Solutions
   -------------------------------------------------------------------------- */
#gold-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1b2130 0%, #131722 65%, #0c0f17 100%);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
                visibility 0.45s ease, 
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform, visibility;
    user-select: none;
    -webkit-user-select: none;
}

[data-theme="light"] #gold-page-loader {
    background: radial-gradient(circle at center, #ffffff 0%, #f4f5f8 65%, #eaeef3 100%);
}

#gold-page-loader.loaded {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: scale(1.03) !important;
}

.gold-loader-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 360px;
    max-width: 90vw;
    text-align: center;
    perspective: 1000px;
}

/* Orbital Luxury Halos */
.gold-halo-system {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 250px;
    pointer-events: none;
}

.gold-halo-ring {
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.gold-halo-outer {
    width: 240px;
    height: 240px;
    border: 1px dashed rgba(229, 185, 90, 0.35);
    box-shadow: 0 0 25px rgba(229, 185, 90, 0.15);
    animation: goldHaloSpin 16s linear infinite;
}

.gold-halo-inner {
    width: 195px;
    height: 195px;
    border: 1.5px solid rgba(229, 185, 90, 0.2);
    border-top-color: #ffd700;
    border-bottom-color: #ffd700;
    animation: goldHaloSpinReverse 9s linear infinite;
}

.gold-halo-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff0a5;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700;
    pointer-events: none;
}

.gold-halo-particle.p1 {
    top: 15px;
    left: 50%;
    animation: goldParticlePulse 2s ease-in-out infinite;
}

.gold-halo-particle.p2 {
    bottom: 20px;
    left: 30%;
    animation: goldParticlePulse 2.4s ease-in-out infinite 0.5s;
}

.gold-halo-particle.p3 {
    top: 50%;
    right: 15px;
    animation: goldParticlePulse 2.2s ease-in-out infinite 1s;
}

.gold-halo-particle.p4 {
    top: 40%;
    left: 12px;
    animation: goldParticlePulse 1.9s ease-in-out infinite 1.5s;
}

/* 3D Fine Gold Bullion Ingot */
.gold-ingot-wrapper {
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
    animation: goldIngotLevitate 3s ease-in-out infinite;
    transform-style: preserve-3d;
}

.gold-ingot {
    position: relative;
    width: 172px;
    height: 94px;
    border-radius: 8px;
    background: linear-gradient(135deg, #b8860b 0%, #ffd700 18%, #fff3a8 36%, #e5b95a 55%, #a4711b 80%, #fce289 100%);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 
                0 0 32px rgba(229, 185, 90, 0.4), 
                inset 0 2px 4px rgba(255, 255, 255, 0.8), 
                inset 0 -3px 6px rgba(110, 75, 10, 0.7);
    border: 1px solid rgba(255, 240, 165, 0.7);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotateX(8deg) rotateY(-4deg);
    transition: transform 0.3s ease;
}

.gold-ingot-sheen {
    position: absolute;
    top: -50%;
    left: -80%;
    width: 60%;
    height: 200%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.75) 50%, transparent 100%);
    transform: rotate(26deg);
    animation: goldSheenSweep 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
    z-index: 3;
}

.gold-ingot-top-bevel {
    position: absolute;
    inset: 4px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%, rgba(0, 0, 0, 0.12) 100%);
    pointer-events: none;
}

.gold-ingot-hallmark {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #63430a;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.65), 0 -1px 1px rgba(0, 0, 0, 0.5);
    font-family: var(--font-serif);
    line-height: 1;
}

.gold-hallmark-symbol {
    font-size: 1.15rem;
    color: #63430a;
    margin-bottom: 2px;
}

.gold-hallmark-purity {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: #573a08;
}

.gold-hallmark-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    color: #63430a;
    margin-top: 2px;
}

.gold-hallmark-meta {
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #785310;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.gold-hallmark-dot {
    font-size: 0.65rem;
}

.gold-ingot-shadow {
    width: 140px;
    height: 14px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55) 0%, transparent 70%);
    margin: 14px auto 0 auto;
    border-radius: 50%;
    animation: goldShadowPulse 3s ease-in-out infinite;
}

[data-theme="light"] .gold-ingot-shadow {
    background: radial-gradient(ellipse at center, rgba(133, 94, 20, 0.35) 0%, transparent 70%);
}

/* Loader Meta & Progress Bar */
.gold-loader-meta {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gold-loader-brand {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--gold-primary);
    text-transform: uppercase;
    margin-bottom: 6px;
    text-shadow: 0 0 16px var(--gold-glow);
}

.gold-loader-tagline {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.gold-status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffd700;
    box-shadow: 0 0 8px #ffd700;
    animation: goldDotPulse 1.4s ease-in-out infinite;
}

.gold-progress-track {
    width: 210px;
    height: 4px;
    background: rgba(229, 185, 90, 0.16);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid rgba(229, 185, 90, 0.3);
}

.gold-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #b8860b, #ffd700, #fff0a5, #d4af37, #b8860b);
    background-size: 250% 100%;
    animation: goldMoltenFlow 1.6s ease-in-out infinite;
}

.gold-loader-credit {
    font-size: 0.74rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gold-loader-credit strong {
    color: var(--gold-primary);
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Preloader Keyframes */
@keyframes goldHaloSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes goldHaloSpinReverse {
    from { transform: translate(-50%, -50%) rotate(360deg); }
    to { transform: translate(-50%, -50%) rotate(0deg); }
}

@keyframes goldParticlePulse {
    0%, 100% { transform: scale(0.8); opacity: 0.4; }
    50% { transform: scale(1.3); opacity: 1; filter: drop-shadow(0 0 6px #ffd700); }
}

@keyframes goldIngotLevitate {
    0%, 100% { transform: translateY(0) rotateX(8deg) rotateY(-4deg); }
    50% { transform: translateY(-7px) rotateX(6deg) rotateY(-2deg); }
}

@keyframes goldShadowPulse {
    0%, 100% { transform: scale(1); opacity: 0.55; }
    50% { transform: scale(0.85); opacity: 0.32; }
}

@keyframes goldSheenSweep {
    0% { left: -80%; }
    40%, 100% { left: 160%; }
}

@keyframes goldDotPulse {
    0%, 100% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.4); opacity: 1; }
}

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


