/* GravityBooks Main Stylesheet */

:root {
    --primary-color: var(--color-charcoal);
    --success-color: var(--color-charcoal);
    /* Success is signaled by lock/gold, not green buttons */
    --danger-color: var(--color-crimson);
    --warning-color: var(--color-warning);
    --info-color: var(--color-gold);

    /* Viljoen Legacy Aliases */
    --v-charcoal: var(--color-charcoal);
    --v-gold: var(--color-gold);
    --v-gold-light: rgba(212, 175, 55, 0.1);
    --v-crimson: var(--color-crimson);
    --v-off-white: var(--color-off-white);
    --v-banker-green: #1B4D3E;
    --v-border: #e0e0e0;
    --v-text: var(--color-text-dark);
    --v-text-grey: var(--color-text-grey);
    --v-shadow: 0 15px 35px -5px rgba(44, 53, 57, 0.1);

    --color-banker-green: #1B4D3E;
    --color-platinum: #DEE2E6;
    --color-platinum-hover: #d1d9e0;

    /* Interaction States */
    --color-gold-hover: #c29d2b;
    --color-charcoal-hover: #1a2023;
    --color-pure-white: #FFFFFF;

    /* Transition System */
    --v-transition-fast: all 0.15s ease;
    --v-transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* --- Viljoen Legacy Palette --- */
    --color-charcoal: #2C3539;
    /* Deep Canvas */
    --color-gold: #D4B068;
    /* Viljoen Gold */
    --color-crimson: #A62C2B;
    /* Muted Crimson (Negatives) */
    --color-off-white: #FFFFFF;
    /* Proper White Surface */
    --color-text-dark: #1A1A1A;
    /* Quill Ink */
    --color-text-grey: #6C757D;
    /* Secondary Text */

    /* UI States (Heritage Inspired) */
    --color-success: var(--color-charcoal);
    --color-info: var(--color-gold);
    --color-warning: #F59E0B;
    /* Amber / Caution */
    --color-warning-dark: #D97706;

    /* Systematic Greyscale */
    --color-grey-50: #FFFFFF;
    --color-grey-100: #F8F9FA;
    /* Distinct from --color-off-white (#FFFFFF) — secondary/muted surface (zebra stripes, hover states) */
    --color-grey-200: #F1F3F5;
    /* --color-zebra-stripe alias */
    --color-grey-300: #E9ECEF;
    --color-grey-400: #DEE2E6;
    /* --color-border alias */
    --color-grey-500: #ADB5BD;
    --color-grey-600: #6C757D;
    /* --color-text-grey alias */
    --color-grey-700: #495057;
    --color-grey-800: #343A40;
    --color-grey-900: #212529;

    /* Semantic Aliases */
    --color-paper: var(--color-off-white);
    --color-zebra-stripe: rgba(0, 0, 0, 0.05);
    --color-border: var(--color-grey-400);
    --color-gold-faint: rgba(212, 175, 55, 0.1);

    /* --- Typography --- */
    --font-header: 'Merriweather', serif;
    --font-ui: 'Inter', sans-serif;
    --font-data: 'Roboto Mono', monospace;

    /* --- Effects --- */
    --shadow-luxury: 0 15px 35px -5px rgba(44, 53, 57, 0.15);
    --border-radius-card: 12px;
}

@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-BoldItalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
}

body {
    font-family: var(--font-ui), 'Open Sans', sans-serif;
    background-color: var(--color-off-white);
    color: var(--color-text-dark);
}

.font-serif {
    font-family: var(--font-header);
}

.font-mono {
    font-family: var(--font-data);
}

/* Luxury Card System */
.luxury-card {
    background: white;
    padding: clamp(1rem, 3vw, 2.5rem);
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-luxury);
    border: none;
    margin-bottom: 2rem;
}

.luxury-card-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--color-gold);
    display: inline-block;
    padding-bottom: 5px;
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    padding: 0;
    box-shadow: none;
    background-color: var(--color-charcoal) !important;
    transition: var(--v-transition-smooth);
    height: 100vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125em;
    cursor: pointer;
    border: 1.5px solid var(--color-border);
    transition: var(--v-transition-fast);
}

.form-check-input:checked {
    background-color: var(--color-gold) !important;
    border-color: var(--color-gold) !important;
    transition: var(--v-transition-fast);
    transform: scale(1.05);
    /* Slight growth on check */
}

/* --- Phase 10: Legacy Alert Shims (Messaging Remediation) --- */
.alert {
    background: var(--color-grey-100) !important;
    border-left: 5px solid var(--color-charcoal) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    color: var(--color-text-dark) !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    padding: 1rem 1.25rem !important;
    font-family: var(--font-ui) !important;
}

.alert-success {
    border-left-color: var(--color-gold) !important;
}

.alert-danger,
.alert-error {
    border-left-color: var(--color-crimson) !important;
}

.alert-warning {
    border-left-color: var(--color-warning) !important;
}

.alert-info {
    border-left-color: var(--color-charcoal) !important;
}

.alert strong {
    color: inherit;
    font-weight: 700;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25) !important;
    border-color: var(--color-gold) !important;
}

.form-check-label {
    padding-left: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    padding-top: 2px;
}

.form-control,
.form-select {
    transition: var(--v-transition-smooth);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-gold) !important;
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.1) !important;
}

/* Dropdown Slide-Out Transitions (Robust Animation Pattern) */
@keyframes v-dropdown-slide-in {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    10% {
        opacity: 0;
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show,
.ts-wrapper.dropdown-active .ts-dropdown,
.ts-dropdown.v-show {
    animation: v-dropdown-slide-in 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

/* Base states to ensure no snap-in */
.dropdown-menu,
.ts-dropdown {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

/* Ensure TomSelect dropdown is properly handled even at body level */
.ts-dropdown.v-smart-select,
.ts-wrapper.v-smart-select .ts-dropdown,
.ts-dropdown {
    /* Default for body-level */
    margin-top: 5px;
    border-radius: 8px;
    box-shadow: var(--shadow-luxury);
    border: 1px solid var(--color-border);
    background-color: var(--color-off-white) !important;
    color: var(--color-charcoal) !important;
    z-index: 10000 !important;
    /* Higher than table and modals */
    overflow: visible !important;
}

.v-smart-select.ts-dropdown .option,
.ts-wrapper.v-smart-select .ts-dropdown .option {
    padding: 10px 15px;
    transition: var(--v-transition-fast);
    border-left: 3px solid transparent;
}

.v-smart-select.ts-dropdown .option.active,
.ts-wrapper.v-smart-select .ts-dropdown .option.active {
    background-color: var(--color-gold-faint) !important;
    color: var(--color-charcoal) !important;
    border-left: 3px solid var(--color-gold) !important;
}

/* Smart Select Search Input - Executive Minimalist */
.v-smart-select.ts-dropdown .dropdown-input,
.ts-wrapper.v-smart-select .ts-dropdown .dropdown-input {
    color: var(--color-charcoal) !important;
    background-color: var(--color-pure-white) !important;
    border: none !important;
    border-bottom: 2px solid var(--color-gold-faint) !important;
    border-radius: 0 !important;
    padding: 12px 15px !important;
    margin-bottom: 5px !important;
    font-family: inherit !important;
    font-size: 0.9rem !important;
    box-shadow: none !important;
    transition: var(--v-transition-fast);
}

.v-smart-select.ts-dropdown .dropdown-input:focus,
.ts-wrapper.v-smart-select .ts-dropdown .dropdown-input:focus {
    border-bottom-color: var(--color-gold) !important;
    outline: none !important;
    background-color: var(--color-off-white) !important;
}

.v-smart-select.ts-dropdown .dropdown-input::placeholder,
.ts-wrapper.v-smart-select .ts-dropdown .dropdown-input::placeholder {
    color: rgba(0, 0, 0, 0.3);
    font-style: italic;
    font-size: 0.85rem;
}

/* Optgroup headers for grouped accounts */
.v-smart-select.ts-dropdown .optgroup-header,
.ts-wrapper.v-smart-select .ts-dropdown .optgroup-header {
    color: var(--color-gold) !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    background-color: rgba(0, 0, 0, 0.03) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding: 8px 15px;
}

/* Control (The Select Box itself) */
.ts-wrapper.v-smart-select .ts-control {
    background-color: var(--color-platinum) !important;
    color: var(--color-charcoal) !important;
    border-color: var(--color-border) !important;
    border-radius: 6px;
    padding: 8px 12px;
}

.ts-wrapper.v-smart-select.focus .ts-control {
    border-color: var(--color-gold) !important;
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.1) !important;
}

.ts-wrapper.v-smart-select .ts-control .item {
    color: var(--color-charcoal) !important;
}

/* --- Phase 10: Single-Line Executive (Smart Select Fix) --- */
.ts-wrapper.v-smart-select:not(.multi) .ts-control {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
    padding-right: 2.5rem !important;
    /* Space for chevron */
    white-space: nowrap !important;
}

.ts-wrapper.v-smart-select:not(.multi) .ts-control>div {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: calc(100% - 20px) !important;
    flex-shrink: 1 !important;
}

/* [FIX] Prevent item from disappearing on focus, which caused "blank field" look */
.ts-wrapper.v-smart-select.focus:not(.multi) .ts-control .item {
    display: inline-block !important;
    opacity: 0.5 !important;
    /* Mute slightly to show search is active */
}

.ts-wrapper.v-smart-select .ts-control>input {
    display: inline-block !important;
    opacity: 1 !important;
    width: auto !important;
    flex: 1 !important;
    min-width: 4px !important;
}

.btn-viljoen-gold {
    background-color: var(--color-gold);
    color: var(--color-charcoal);
    border: 1px solid var(--color-gold);
    font-weight: 600;
    transition: var(--v-transition-smooth);
}

.btn-viljoen-gold:hover {
    background-color: var(--color-gold-hover);
    /* Slightly darker gold */
    color: var(--color-charcoal);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-viljoen-gold:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-viljoen-charcoal {
    background-color: var(--color-charcoal);
    color: var(--color-gold);
    border: 1px solid var(--color-charcoal);
    font-weight: 600;
    transition: var(--v-transition-smooth);
}

.btn-viljoen-charcoal:hover {
    background-color: var(--color-charcoal-hover);
    /* Slightly darker charcoal */
    color: var(--color-pure-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-viljoen-charcoal:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-platinum {
    background-color: var(--color-platinum);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
    transition: var(--v-transition-smooth);
}

.btn-platinum:hover {
    background-color: var(--color-platinum-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-platinum:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --- Phase 8: Two-Stage Button States & Transitions --- */
@keyframes v-pulse-weight {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.015);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }

    100% {
        transform: scale(1);
    }
}

.v-btn-confirming {
    background-color: var(--color-warning) !important;
    color: var(--color-text-dark) !important;
    border-color: var(--color-warning-dark) !important;
    font-weight: 700 !important;
    animation: v-pulse-weight 1s infinite ease-in-out;
}

.v-btn-confirming-danger {
    background-color: #A62C2B !important;
    color: #fff !important;
    border-color: #8a2424 !important;
    font-weight: 700 !important;
    animation: v-pulse-weight 1s infinite ease-in-out;
}

.sidebar-sticky {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    /* Keep vertical scroll only */
    padding-top: 1rem;
    min-height: 0;
    /* Important for flex-shrink/scroll */

    /* Ghost Scrollbar (Option 1) */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.sidebar-sticky::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Webkit */
}

.sidebar .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.85rem 1.5rem;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.sidebar .nav-link.active {
    color: var(--color-gold) !important;
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--color-gold);
    font-weight: 600;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

/* Sidebar Watermark Branding (Converted to Header) */
.sidebar-watermark {
    position: relative;
    width: 100%;
    padding: 2rem 1rem 1rem 1rem;
    z-index: 2;
    background-color: var(--color-charcoal);
    text-align: center;
}

.sidebar-watermark img {
    width: 100%;
    max-width: 180px;
    /* Constrain slightly so it doesn't look huge */
    height: auto;
    display: inline-block;
}

/* Layering for interactive elements */
.sidebar-brand,
.sidebar-sticky,
.sidebar-footer {
    position: relative;
    z-index: 2;
    background: transparent !important;
}

/* Ensure nav items are readable */
.sidebar .nav-link {
    position: relative;
    z-index: 3;
}

/* Sidebar Submenu Reflection */
.sidebar .nav-link .active-child-label {
    display: block;
    font-size: 0.7rem;
    color: var(--color-gold);
    margin-left: 28px;
    margin-top: -2px;
    opacity: 0.8;
    font-weight: 400;
}

.sidebar .nav-item {
    position: relative;
}

.sidebar .v-submenu {
    position: fixed;
    /* Escape sidebar scroll clipping */
    left: -9999px;
    /* Initial position off-screen */
    top: 0;
    min-width: 220px;
    background-color: var(--color-charcoal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: none;
    padding: 0.5rem 0;
    list-style: none;
    border-radius: 0 8px 8px 0;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .nav-item:hover>.v-submenu,
.sidebar .nav-item.submenu-open>.v-submenu {
    display: block;
    animation: sidebarSlideIn 0.2s ease-out;
}

@keyframes sidebarSlideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar .v-submenu .nav-link {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    border-left: none;
}

.sidebar .v-submenu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.sidebar .v-has-submenu {
    position: relative;
    padding-right: 30px;
}

.sidebar .v-has-submenu::after {
    content: "\F285";
    /* bi-chevron-right */
    font-family: "bootstrap-icons";
    font-size: 0.7rem;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

/* Submenu Section Headers - Heritage Style */
.sidebar .v-submenu .nav-header,
.sidebar .collapse .nav-header {
    font-family: 'Merriweather', serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-gold) !important;
    padding: 12px 1.5rem 6px 1.5rem;
    margin-top: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    opacity: 1 !important;
}

.sidebar .v-submenu .nav-header:first-child,
.sidebar .collapse .nav-header:first-child {
    margin-top: 0;
}

/* Sidebar Branding & Footer */
.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    background-color: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    color: var(--color-off-white);
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.user-profile i {
    font-size: 1.25rem;
    color: var(--color-gold);
}

.company-switcher {
    font-size: 0.8rem;
}

.company-switcher .dropdown-toggle {
    color: rgba(255, 255, 255, 0.6) !important;
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
}

.company-switcher .dropdown-toggle:hover {
    color: var(--color-gold) !important;
}

/* Main Content Adjustment */
main[role="main"],
.col-md-10.ms-sm-auto {
    margin-top: 0 !important;
    padding-top: 2rem;
}

main {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Content */
main {
    padding-top: 1rem;
}

/* Cards */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Forms */
input[readonly] {
    background-color: var(--color-grey-100);
    cursor: not-allowed;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Tables */
.table-sm td,
.table-sm th {
    padding: 0.25rem;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -100%;
        transition: left 0.3s;
        z-index: 1000;
        background-color: var(--color-grey-50);
    }

    .sidebar.show {
        left: 0;
    }

    .table-responsive {
        overflow-x: auto;
    }
}

/* Utility Classes */
.text-success {
    color: var(--success-color) !important;
}

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

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

/* Date Filter Component */
.date-range-btn {
    min-width: 280px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.date-range-picker-container .dropdown-menu {
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    padding: 0.75rem 0;
}

.date-range-picker-container .dropdown-header {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--color-grey-600);
    margin-top: 0.5rem;
}

.date-range-picker-container .dropdown-item {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.date-range-picker-container .dropdown-item:hover {
    background-color: var(--color-grey-100);
    color: var(--primary-color);
    padding-left: 1.5rem;
}

/* Litepicker Customizations */
.litepicker {
    font-family: 'Open Sans', sans-serif !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

/* Print Utilities */
@media print {

    .no-print,
    .btn-toolbar,
    .breadcrumb,
    .navbar,
    .sidebar {
        display: none !important;
    }

    main {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* Luxury Dropdown Standard (Viljoen Legacy) */
.v-picker {
    position: relative;
    display: inline-block;
}

.v-picker-btn {
    background-color: var(--color-charcoal);
    color: var(--color-gold);
    border: 1px solid var(--color-charcoal);
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.v-picker-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    color: var(--color-gold);
    /* Lighter gold */
}

.v-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    right: auto;
    width: 280px;
    background: var(--color-off-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-luxury);
    z-index: 1100;
    padding: 8px 0;
    list-style: none;
    /* Ensure no bullets */
    display: none;
    /* Controlled by JS or Bootstrap toggle if we use it */
}

.v-dropdown.dropdown-menu-end {
    right: 0;
    left: auto;
}

.v-dropdown.show {
    display: block;
}

.v-dropdown-header {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--color-grey-500);
    padding: 16px 20px 8px 20px;
    text-transform: uppercase;
}

.v-option {
    display: block;
    padding: 10px 20px;
    color: var(--color-charcoal);
    text-decoration: none !important;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.v-option:hover,
.v-option.active {
    background-color: var(--color-gold-faint);
    border-left: 3px solid var(--color-gold);
    color: var(--color-charcoal) !important;
}

/* Cascading Sub-menus */
.v-option {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.v-has-submenu::after {
    content: "\F285";
    /* Bootstrap Icons bi-chevron-right */
    font-family: "bootstrap-icons";
    font-size: 0.8rem;
    color: var(--color-gold);
    margin-left: 10px;
    opacity: 0.6;
    transition: transform 0.2s;
}

.v-option:hover.v-has-submenu::after {
    transform: translateX(3px);
    opacity: 1;
}

.v-submenu-container {
    position: relative;
}

.v-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 220px;
    background: var(--color-off-white);
    border: 1px solid var(--color-border);
    border-radius: 4px 8px 8px 8px;
    /* Refined for overlap */
    box-shadow: var(--shadow-luxury);
    z-index: 1200;
    display: none;
    padding: 8px 0;
    margin-left: -2px;
    /* Slight overlap to prevent hover gap jitter */
    list-style: none;
    /* Ensure no bullets */
}

.v-submenu-container:hover>.v-submenu {
    display: block;
    animation: slideInRight 0.2s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.v-option i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: var(--color-gold);
}

.v-divider {
    height: 1px;
    background-color: var(--color-grey-300);
    margin: 8px 0;
}

.custom-range-link {
    color: var(--color-gold) !important;
    font-weight: 600;
}

/* --- Luxury Filter Function Styles --- */
.v-card-body {
    padding: 30px;
}

.v-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-text-grey);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.v-form-select,
.v-form-control {
    border: 1px solid var(--color-border);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* --- DATE INPUTS: HIDE NATIVE CALENDAR GLYPH, KEEP THE PICKER --- */
/* The WebKit calendar glyph eats horizontal space and overlaps the value on
   narrow viewports. Instead of display:none (which kills click-to-open), the
   indicator is made invisible and stretched across the whole field, so tapping
   anywhere on the input still opens the native picker. */
input[type="date"],
input[type="datetime-local"],
input[type="month"] {
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    opacity: 0;
    background: transparent;
    color: transparent;
    cursor: pointer;
}

/* --- THE SEGMENTED CONTROL --- */
.v-segmented-control {
    background-color: var(--color-off-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 4px;
    display: inline-flex;
    gap: 4px;
    width: 100%;
}

.v-segmented-control input[type="radio"],
.v-segmented-control input[type="checkbox"] {
    display: none;
}

.v-segment-label {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-grey);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin: 0;
    user-select: none;
    white-space: nowrap;
}

.v-segment-label:hover {
    color: var(--color-charcoal);
    background-color: rgba(0, 0, 0, 0.02);
}

.v-segmented-control input:checked+label {
    background-color: var(--color-grey-50);
    color: var(--color-charcoal);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(44, 53, 57, 0.1);
    border-bottom: 2px solid var(--color-gold);
}

.v-btn-generate {
    background-color: var(--color-charcoal);
    color: var(--color-gold);
    border: none;
    font-weight: 600;
    padding: 10px;
    transition: all 0.2s ease;
}

.v-btn-generate:hover {
    background-color: var(--color-charcoal);
    color: var(--color-gold);
    transform: translateY(-1px);
}

/* --- Viljoen Button System --- */
/* Primary Charcoal/Gold Button */
.btn-viljoen {
    background-color: var(--color-charcoal);
    color: var(--color-gold);
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-viljoen:hover {
    transform: translateY(-1px);
    color: var(--color-grey-50);
    background-color: var(--color-charcoal);
}

/* Gold Action Button */
.btn-gold {
    background-color: var(--color-gold);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    background-color: var(--color-gold);
    color: white;
}

/* Muted Crimson Button (for destructive actions) */
.btn-crimson-outline {
    border: 1px solid var(--color-crimson);
    color: var(--color-crimson);
    background: transparent;
}

.btn-crimson-outline:hover {
    background-color: var(--color-crimson);
    color: white;
}

/* --- Viljoen Badge System --- */
/* Active Status Badge - Gold tint instead of Bootstrap green */
.v-badge-active {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: var(--color-gold-faint);
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Inactive Status Badge - Muted grey */
.v-badge-inactive {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: var(--color-grey-300);
    color: var(--color-text-grey);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Security Seal Badge (for system/locked states) */
.v-badge-secure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--color-gold-faint);
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    user-select: none;
}

/* Paid Status Badge - Vibrant Success Green */
.v-badge-paid {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(25, 135, 84, 0.15);
    color: var(--color-success);
    border: 1px solid var(--color-success);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Reversal Status Badge (Credit/Debit Notes, Refunds) - Muted Crimson */
.v-badge-reversal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(166, 44, 43, 0.15);
    color: var(--color-crimson);
    border: 1px solid var(--color-crimson);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Sent/Partial Status Badge - Calming Cerulean Blue */
.v-badge-sent,
.v-badge-partial {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(13, 110, 253, 0.15);
    color: var(--color-info);
    border: 1px solid var(--color-info);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

/* --- Viljoen Luxury Table --- */
.v-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.v-table thead th {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-text-grey);
    letter-spacing: 0.5px;
    padding: 12px 15px;
    border-bottom: 2px solid var(--color-gold);
    background-color: transparent;
}

.v-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.v-table tbody tr:hover {
    background-color: var(--color-gold-faint);
}

/* Zebra striping */
.v-table tbody tr:nth-child(even) {
    background-color: var(--color-zebra-stripe);
}

.v-table tbody tr:nth-child(even):hover {
    background-color: var(--color-gold-faint);
}

/* Data columns (monospace for numbers) */
.v-table .data-col {
    font-family: var(--font-data);
    font-weight: 500;
}

/* Sortable headers for v-table */
.v-table th.sortable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.v-table th.sortable:hover {
    background-color: var(--color-gold-faint);
}

/* --- Dual Price Field UI --- */
.price-readonly {
    background-color: var(--color-zebra-stripe) !important;
    color: var(--color-text-grey) !important;
    cursor: not-allowed;
    font-style: italic;
}

.price-editable {
    background-color: var(--color-off-white);
    border-color: var(--color-gold) !important;
}

.price-editable:focus {
    border-color: var(--color-gold) !important;
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25) !important;
}

.price-exc-cell {
    font-weight: 600;
}

.price-inc-cell {
    font-style: italic;
}

/* --- Total Money Card (Luxury) --- */
.card-money {
    background-color: var(--color-charcoal);
    color: white;
    border: 1px solid var(--color-charcoal);
}

.card-money .card-money-label {
    font-family: var(--font-ui);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
}

.card-money .amount-large {
    font-family: var(--font-data);
    font-size: 2.5rem;
    font-weight: 700;
}

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

.card-money .divider {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* --- VILJOEN LUXURY OVERRIDES (Legacy Aliases) --- */

/* --- THE MONEY CARD --- */
.card-money {
    background-color: var(--v-charcoal) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(44, 53, 57, 0.25);
    overflow: hidden;
    position: relative;
}

.card-money .card-body {
    padding: 30px;
}

.card-money .amount-large {
    color: var(--v-gold) !important;
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    font-size: 2.8rem;
    margin: 15px 0;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
    white-space: nowrap;
}

/* PRJ-006: prevent "R" wrapping onto its own line on narrow mobile screens */
@media (max-width: 767.98px) {
    .card-money .amount-large {
        font-size: 1.9rem;
    }
}

.card-money .divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    padding-top: 15px;
}

.card-money-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
}


/* --- LITEPICKER OVERRIDES (Banishing the Blue) --- */
:root {
    --litepicker-month-header-color: var(--v-charcoal);
    --litepicker-button-prev-month-color-hover: var(--v-gold);
    --litepicker-button-next-month-color-hover: var(--v-gold);
    --litepicker-day-color-hover: var(--v-gold);
    --litepicker-is-today-color: var(--v-gold);
    --litepicker-is-start-color: #D4AF37;
    --litepicker-is-start-color-bg: var(--v-charcoal);
    --litepicker-is-end-color: #D4AF37;
    --litepicker-is-end-color-bg: var(--v-charcoal);
    --litepicker-button-apply-color: var(--v-gold);
    --litepicker-button-apply-color-bg: var(--v-charcoal);
}

/* --- THE PLATINUM SEAL (Status) --- */
.status-pill-draft, .v-badge-draft-glass {
    background: rgba(142, 149, 156, 0.05);
    color: #8E959C;
    border: 1px solid rgba(142, 149, 156, 0.1);
    padding: 4px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
}

.v-badge-posted-glass {
    background: rgba(217, 197, 178, 0.1);
    color: #A68E74;
    border: 1px solid rgba(217, 197, 178, 0.2);
    padding: 4px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
}

.v-badge-paid-glass {
    background: rgba(125, 140, 123, 0.1);
    color: #7D8C7B;
    border: 1px solid rgba(125, 140, 123, 0.2);
    padding: 4px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
}

/* --- BUTTONS --- */
/* The 'Safe Commit' Button (British Racing Green) */
.btn-emerald {
    background-color: var(--v-emerald);
    color: white;
    border: none;
    font-weight: 600;
    padding: 10px 24px;
    box-shadow: 0 4px 10px rgba(4, 57, 39, 0.2);
}

.btn-emerald:hover {
    background-color: var(--color-success);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

/* Platinum Actions (Secondary) */
.btn-platinum {
    background-color: white;
    border: 1px solid var(--v-platinum);
    color: var(--v-charcoal);
    font-weight: 500;
}

.btn-platinum:hover {
    border-color: var(--v-platinum-dark);
    background-color: var(--color-grey-100);
}

/* --- TABLE STYLES --- */
.table-viljoen th {
    font-family: 'Merriweather', serif;
    font-size: 0.8rem;
    color: var(--v-text);
    border-bottom: 2px solid var(--v-charcoal);
    padding-bottom: 12px;
}

/* --- DASHBOARD: EXECUTIVE BRIEFING --- */
.greeting h1 {
    font-family: var(--font-header);
    font-size: 2rem;
    color: var(--v-charcoal);
    margin-bottom: 5px;
}

.greeting p {
    color: var(--color-text-grey);
    font-size: 0.95rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.metric-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-luxury);
    transition: transform 0.2s;
    border-top: 4px solid transparent;
}

.metric-card:hover {
    transform: translateY(-3px);
}

.metric-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-grey);
    margin-bottom: 15px;
    font-weight: 600;
}

.metric-value {
    font-family: var(--font-data);
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--v-charcoal);
    margin-bottom: 5px;
}

.metric-trend {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.trend-up {
    color: var(--color-success);
}

.trend-neutral {
    color: var(--color-text-grey);
}

.card-profit {
    border-top-color: var(--v-gold);
}

.card-profit .metric-value {
    color: var(--v-gold);
    font-weight: 700;
}

.dashboard-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-luxury);
    padding: 30px;
    min-height: 350px;
}

.card-header-v {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--color-grey-300);
    padding-bottom: 15px;
}

.card-header-v h3 {
    font-family: var(--font-header);
    font-size: 1.1rem;
    color: var(--v-charcoal);
    margin-bottom: 0;
}

.card-action-link {
    color: var(--v-gold);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.graph-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-bottom: 2px solid var(--v-gold);
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 0 20px;
}

.graph-bar {
    width: 40px;
    background: var(--v-charcoal);
    opacity: 0.15;
    border-radius: 4px 4px 0 0;
    transition: 0.3s;
}

.graph-bar:hover {
    opacity: 0.8;
    background: var(--v-gold);
}

.action-list {
    list-style: none;
    padding-left: 0;
}

.action-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--color-grey-200);
}

.action-item:last-child {
    border-bottom: none;
}

.action-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--v-off-white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--v-charcoal);
}

.action-details {
    flex: 1;
}

.action-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--v-text);
}

.action-meta {
    font-size: 0.8rem;
    color: var(--color-text-grey);
}

.btn-approve {
    padding: 6px 12px;
    background: var(--v-charcoal);
    color: var(--v-gold);
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-approve:hover {
    background-color: var(--color-charcoal);
    color: var(--color-grey-50);
}

.urgent .action-icon {
    background: rgba(166, 44, 43, 0.1);
    color: var(--v-crimson);
}

/* --- Strategic Deletion Patterns --- */
.v-delete-typical-wrapper {
    position: relative;
    z-index: 11;
}

.btn-delete-typical {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--v-crimson);
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-delete-typical:hover {
    background: var(--v-crimson);
    color: white;
    border-color: var(--v-crimson);
}

.v-delete-slide-confirm {
    position: absolute;
    right: -300px;
    top: 0;
    bottom: 0;
    width: 250px;
    background: var(--v-charcoal);
    color: var(--v-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    padding: 0 15px;
    z-index: 5;
    border-left: 2px solid var(--v-gold);
    white-space: nowrap;
}

.v-delete-slide-confirm.active {
    right: 0;
    opacity: 1;
    pointer-events: auto;
}

.btn-confirm-final {
    background: var(--v-crimson);
    color: white;
    border: none;
    padding: 4px 10px;
    margin-left: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 3px;
}

/* Executive Modal Styles */
.v-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.v-modal-box {
    background: #f4f1ea;
    /* Parchment */
    padding: 40px;
    border: 1px solid var(--v-gold);
    text-align: center;
    max-width: 450px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.v-modal-insignia {
    font-size: 2.5rem;
    color: var(--v-gold);
    margin-bottom: 15px;
}

.v-modal-title {
    color: var(--v-crimson);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.v-modal-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.v-audit-warning {
    display: block;
    margin-top: 15px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--v-charcoal);
    opacity: 0.7;
    font-style: italic;
}

.v-modal-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.v-btn-gold-outline {
    background: transparent;
    border: 1px solid var(--v-gold);
    color: var(--v-charcoal);
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.2s;
}

.v-btn-garnet {
    background: var(--v-crimson);
    color: white;
    border: none;
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.2s;
}

.v-btn-garnet:hover {
    background: #5a0c0e;
    transform: translateY(-1px);
}

/* Ensure actions column stays clickable but distinct */
.clickable-row .btn,
.clickable-row a:not(.stretched-link),
.clickable-row input,
.clickable-row select {
    position: relative;
    z-index: 2;
    /* Ensure controls sit above the row click area */
    pointer-events: auto;
    /* Explicitly allow pointer events */
}

/* --- Sticky Footer Sidebar Adjustment --- */
@media (min-width: 768px) {
    .v-sticky-footer {
        left: 16.666667% !important;
        /* Matches col-md-2 */
        width: 83.333333% !important;
        /* Matches col-md-10 */
        right: 0 !important;
        transition: left 0.3s ease, width 0.3s ease;
    }
}

@media (min-width: 769px) {
    body.sidebar-rail .v-sticky-footer {
        left: 60px !important;
        width: calc(100% - 60px) !important;
    }
}

/* --- Viljoen Legacy Components --- */

/* 1. Primary Button (Charcoal & Gold) */
.btn-viljoen {
    background-color: var(--color-charcoal);
    color: var(--color-gold);
    border: 1px solid var(--color-charcoal);
    font-weight: 600;
    font-family: var(--font-ui);
    transition: var(--v-transition-smooth);
}

.btn-viljoen:hover {
    transform: translateY(-1px);
    color: var(--color-grey-50);
    background-color: var(--color-charcoal-hover);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-viljoen:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 2. Segmented Control (Toggle) */
.v-segmented-control {
    background-color: var(--color-grey-50);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 3px;
    display: inline-flex;
    width: 100%;
}

.v-segmented-control .btn {
    flex: 1;
    border: none;
    border-radius: 6px;
    color: var(--color-text-grey);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 4px 10px;
}

.v-segmented-control .btn.active {
    background-color: var(--color-charcoal);
    color: var(--color-gold);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 3. Icons & Accents */
.icon-gold {
    color: var(--color-gold);
}

.icon-charcoal {
    color: var(--color-charcoal);
}

.icon-crimson {
    color: var(--color-crimson);
}

/* 4. Cashbook Ledger & Heritage Styles */
.ledger-card {
    background: var(--color-paper);
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-luxury);
    border: 1px solid rgba(44, 53, 57, 0.05);
    overflow: hidden;
    margin-bottom: 2rem;
}

.ledger-table {
    background-color: transparent !important;
}

.ledger-table thead th {
    font-family: var(--font-header) !important;
    background-color: rgba(44, 53, 57, 0.03) !important;
    color: var(--color-charcoal);
    border-bottom: 2px solid var(--color-gold) !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 12px 8px !important;
}

.ledger-table td {
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 8px !important;
}

.ledger-table tbody tr:hover {
    background-color: rgba(212, 175, 55, 0.05) !important;
}

/* Financial precision typography */
.font-money {
    font-family: var(--font-data) !important;
    font-weight: 500;
}

.amount-negative {
    color: var(--color-crimson) !important;
}

/* Luxury Selectors (Bank/View Mode) */
.luxury-select-group {
    background: var(--color-charcoal);
    border: 1px solid var(--color-charcoal);
    border-radius: 8px;
    padding: 2px;
}

.luxury-select-group label {
    color: rgba(212, 175, 55, 0.7);
    /* Increased opacity for readability */
    font-size: 10px;
    text-transform: uppercase;
    margin-left: 8px;
    margin-top: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Improve segmented control buttons inside luxury group */
.luxury-select-group .v-segmented-control .btn {
    color: rgba(212, 175, 55, 0.5);
    /* Soft Gold for unselected visibility */
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.15);
    margin: 0 2px;
    transition: all 0.2s ease;
}

.luxury-select-group .v-segmented-control .btn:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(212, 175, 55, 0.5);
}

.luxury-select-group .v-segmented-control .btn.active {
    background-color: var(--color-gold) !important;
    color: var(--color-charcoal) !important;
    border-color: var(--color-gold) !important;
    font-weight: 700;
}

.luxury-select {
    background-color: var(--color-charcoal) !important;
    color: var(--color-gold) !important;
    border: none !important;
    font-family: var(--font-header) !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    /* Slightly larger for Serif impact */
    box-shadow: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23D4AF37' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-size: 12px 12px;
}

.luxury-select:focus {
    color: var(--color-gold) !important;
}

/* Action Icons */
.btn-action-reconcile {
    color: var(--color-crimson) !important;
    transition: all 0.2s;
}

.btn-action-reconcile:hover {
    transform: scale(1.1);
    color: var(--color-crimson) !important;
}

.icon-status-locked {
    color: var(--color-gold) !important;
}

/* --- Rolodex Pattern (Luxurious List Views) --- */
.v-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 2rem;
}

.v-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 25px;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 4px solid transparent;
    text-decoration: none !important;
    box-shadow: 0 4px 6px rgba(44, 53, 57, 0.02);
}

.v-item-card:hover {
    transform: translateY(-2px) scale(1.005);
    box-shadow: var(--v-shadow);
    border-left-color: var(--v-gold) !important;
    z-index: 2;
}

.v-item-card.v-inactive-card {
    background: transparent;
    border: 1px dashed var(--v-border);
    opacity: 0.7;
    box-shadow: none;
}

.v-item-card.v-inactive-card:hover {
    background: white;
    opacity: 1;
    border: 1px solid var(--v-border);
    border-left: 4px solid var(--v-gold) !important;
}

.luxury-card-subtle {
    background: #fdfdfd;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.border-bottom-gold {
    border-bottom: 2px solid var(--v-gold) !important;
}

.v-item-actions .btn-link,
.v-btn-action {
    color: var(--v-text-grey) !important;
    opacity: 0.5;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.v-item-actions .btn-link:hover,
.v-btn-action:hover {
    color: var(--v-crimson) !important;
    opacity: 1;
    transform: scale(1.1);
}

.v-form-control-sm {
    border-radius: 6px;
    border: 1px solid var(--v-border);
    padding: 8px 12px;
    font-family: var(--font-ui);
}

.v-form-control-sm:focus {
    border-color: var(--v-gold);
    box-shadow: 0 0 0 2px var(--v-gold-light);
    outline: none;
}

/* User Suggested Filter Drawer Styles */
.btn-apply-filter {
    background-color: var(--v-charcoal);
    color: var(--v-gold) !important;
    border: 1px solid var(--v-charcoal);
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-apply-filter:hover {
    background-color: #1a2023;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: var(--v-gold) !important;
}

.btn-clear-filter {
    background: transparent;
    border: none;
    color: var(--v-text-grey) !important;
    text-decoration: underline;
    font-size: 0.9rem;
    padding: 8px 12px;
}

.btn-clear-filter:hover {
    color: var(--v-crimson) !important;
}

.input-luxury-line {
    border: none !important;
    border-bottom: 1px solid #ddd !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding-left: 0 !important;
    transition: border-color 0.3s !important;
    width: 100%;
}

.input-luxury-line:focus {
    border-bottom: 2px solid var(--v-gold) !important;
    outline: none !important;
    box-shadow: none !important;
}



.v-item-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.v-item-name {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--v-charcoal);
}

.v-item-meta {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--v-text-grey);
    display: flex;
    gap: 12px;
    align-items: center;
}

.v-item-meta span:not(:last-child)::after {
    content: "•";
    margin-left: 12px;
    opacity: 0.5;
}

.v-item-financials {
    text-align: right;
}

.v-item-balance {
    font-family: var(--font-data);
    font-size: 1.25rem;
    color: var(--v-charcoal);
    font-weight: 500;
}

.v-item-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--v-text-grey);
    letter-spacing: 0.1em;
    display: block;
    margin-top: 6px;
}

.v-omni-search {
    position: relative;
    margin-bottom: 30px;
}

.v-omni-input {
    width: 100%;
    padding: 22px 30px;
    font-size: 1.2rem;
    border: none;
    border-radius: 12px;
    background: white;
    box-shadow: var(--v-shadow);
    font-family: var(--font-ui);
    color: var(--v-charcoal);
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.v-omni-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--v-gold), var(--v-shadow);
}

/* --- Heritage Pagination (Viljoen Legacy) --- */
.v-pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 8px;
    gap: 8px;
    justify-content: center;
}

.v-pagination .page-item .page-link {
    background-color: white;
    border: 1px solid var(--color-border);
    color: var(--v-charcoal);
    font-family: var(--font-ui);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--v-transition-smooth);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(44, 53, 57, 0.05);
}

.v-pagination .page-item.active .page-link {
    background-color: var(--v-charcoal);
    border-color: var(--v-charcoal);
    color: var(--color-gold) !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(44, 53, 57, 0.15);
}

.v-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    background-color: var(--color-gold-faint);
    border-color: var(--color-gold);
    color: var(--v-charcoal);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.1);
}

.v-pagination .page-item.disabled .page-link {
    color: var(--color-text-grey);
    opacity: 0.5;
    pointer-events: none;
    background-color: var(--color-grey-100);
    border-color: var(--color-border);
}

.v-pagination .page-item i {
    font-size: 1rem;
    margin-top: 1px;
}

/* --- Tom Select Heritage Overrides --- */
.ts-dropdown {
    z-index: 2000 !important;
    border-radius: 8px !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: var(--shadow-luxury) !important;
    background: white !important;
}

.ts-dropdown .active {
    background-color: var(--color-gold-faint) !important;
    color: var(--v-charcoal) !important;
}

.ts-dropdown .option:hover {
    background-color: var(--color-gold-faint) !important;
}

.ts-dropdown-content {
    max-height: 300px !important;
}


/* --- Extra Utilities --- */
.bg-gold-subtle {
    background-color: var(--v-gold-light) !important;
}

.text-gold-dark {
    color: #856404 !important;
    /* Dark gold for badge text */
}

.border-gold-subtle {
    border-color: rgba(212, 175, 55, 0.3) !important;
}

/* --- Viljoen Legacy Tooltips --- */
.tooltip {
    --bs-tooltip-bg: var(--color-charcoal);
    --bs-tooltip-color: var(--color-gold);
    --bs-tooltip-opacity: 1;
    --bs-tooltip-border-radius: 6px;
    z-index: 10000;
}

.tooltip-inner {
    border: 1px solid var(--color-gold) !important;
    font-family: var(--font-ui) !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3) !important;
    text-align: center !important;
}

.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--color-gold) !important;
}

.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--color-gold) !important;
}

.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: var(--color-gold) !important;
}

.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: var(--color-gold) !important;
}

/* ─────────────────────────────────────────────────────────────────
   BRIEFING ROOM DASHBOARD (Option A)
   ───────────────────────────────────────────────────────────────── */

/* KPI card alert state */
.metric-card.card-alert {
    border-color: rgba(166, 44, 43, 0.25);
    background-color: rgba(166, 44, 43, 0.03);
}

/* Layer divider */
.briefing-divider {
    border: none;
    border-top: 1px solid var(--color-grey-300);
    margin: 2.5rem 0 0;
}

/* ─── Takealot Banner (Viljoen Charcoal/Gold) ─────────────────── */
.takealot-banner {
    position: relative;
    background: var(--v-charcoal);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: var(--color-off-white);
    box-shadow: 0 6px 20px rgba(44, 53, 57, 0.2);
}

.takealot-icon {
    font-size: 1.4rem;
    color: var(--v-gold);
    opacity: 0.9;
}

.takealot-label {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 700;
    display: block;
    line-height: 1.2;
    color: var(--color-off-white);
}

.takealot-meta {
    font-size: 0.7rem;
    opacity: 0.55;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.takealot-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.takealot-value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--v-gold);
}

.takealot-unit {
    font-size: 0.65rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-off-white);
}

/* Takealot hover popup */
.takealot-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(44, 53, 57, 0.18);
    border: 1px solid var(--color-grey-300);
    padding: 1rem;
    z-index: 1000;
    animation: drawerSlideIn 0.2s ease-out forwards;
}

.takealot-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.6rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-grey-300);
}

.takealot-popup-total {
    font-family: var(--font-data);
    font-size: 0.85rem;
    color: var(--v-charcoal);
    font-weight: 600;
}

.takealot-popup-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-grey-200);
}


.action-item.action-alert {
    border-left: 3px solid var(--color-crimson);
    background-color: rgba(166, 44, 43, 0.03);
}

.action-item.action-warn {
    border-left: 3px solid var(--color-warning);
    background-color: rgba(245, 158, 11, 0.04);
}

/* ─── Dashboard Drawer ────────────────────────────────────────── */
.dashboard-drawer {
    padding: 0.75rem 0.5rem 0.25rem;
    border-top: 1px solid var(--color-grey-300);
    animation: drawerSlideIn 0.2s ease-out forwards;
}

@keyframes drawerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-drawer-row {
    padding: 0 1rem 0.5rem;
    background-color: var(--color-grey-100);
    border-radius: 0 0 8px 8px;
}

.drawer-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.drawer-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--color-grey-200);
    vertical-align: middle;
}

.drawer-table tr:last-child td {
    border-bottom: none;
}

.drawer-link {
    color: var(--color-charcoal);
    font-weight: 500;
    text-decoration: none;
}

.drawer-link:hover {
    color: var(--color-gold);
    text-decoration: underline;
}

.drawer-footer-link {
    display: block;
    font-size: 0.78rem;
    color: var(--color-text-grey);
    text-align: right;
    padding-top: 0.4rem;
    text-decoration: none;
}

.drawer-footer-link:hover {
    color: var(--color-charcoal);
}

/* Days overdue badges */
.days-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.days-warn {
    background-color: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.days-danger {
    background-color: rgba(166, 44, 43, 0.12);
    color: var(--color-crimson);
}

/* ─── Setup Checklist Concertina ────────────────────────────── */
.setup-checklist-wrapper {
    background: var(--color-off-white);
    border: 1px solid var(--color-grey-300);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.setup-toggle-bar {
    cursor: pointer;
    user-select: none;
}

.setup-bar-label {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--v-charcoal);
}

.setup-bar-percentage {
    font-family: var(--font-data);
    font-weight: 700;
    color: var(--v-gold);
    margin-left: 0.5rem;
}

.setup-mini-progress {
    overflow: hidden;
    border-radius: 10px;
}

.setup-content-drawer {
    border-top: 1px solid var(--color-grey-200);
    padding-top: 1rem;
    animation: drawerSlideIn 0.3s ease-out forwards;
}

.transition-icon {
    transition: transform 0.3s ease;
}

.setup-checklist-wrapper.expanded .transition-icon {
    transform: rotate(180deg);
}