/* ---------------------------------------
 * CUSTOM THEME COLORS (CSS VARIABLES)
 * ------------------------------------- */
:root {
    /* POS-aligned palette (Sales POS reference) */
    --theme-primary: #1a1a2e;
    --theme-primary-light: #16213e;
    --theme-primary-dark: #0f1220;

    --theme-accent: #4361ee;
    --theme-accent-dark: #2f4dd4;

    --theme-secondary: #E3EFFA;
    --theme-gray: #6C757D;

    --theme-form-green: #b2ca8a;
    --theme-form-green-dark: #728352;

    --theme-gold: #f6d365;
    --theme-gold-dark: #c9a84c;

    /* Status colors */
    --theme-success: #198754;
    --theme-danger: #dc3545;
    --theme-warning: #ffc107;
    --theme-info: #17a2b8;

    /* Surface & Layout */
    --theme-surface: #f0f2f5;
    --theme-border: #e9ecef;
    --theme-border-light: #dee2e6;
    --theme-text-dark: #495057;
    --theme-text-muted: #6c757d;

    /* Bootstrap overrides */
    --bs-primary: var(--theme-primary);
    --bs-primary-rgb: 26, 26, 46;
}

/* ---------------------------------------
 * BACKGROUND UTILITIES
 * ------------------------------------- */
.bg-primary-theme {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-light) 100%) !important;
}
.bg-primary-light {
    background-color: var(--theme-primary-light) !important;
}
.bg-primary-dark {
    background-color: var(--theme-primary-dark) !important;
}

.bg-accent {
    background-color: var(--theme-accent) !important;
}
.bg-accent-dark {
    background-color: var(--theme-accent-dark) !important;
}

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

.bg-form-green {
    background-color: var(--theme-form-green) !important;
}

.bg-form-green-dark {
    background-color: var(--theme-form-green-dark) !important;
}
.bg-gold {
    background-color: var(--theme-gold) !important;
}
.bg-gold-dark {
    background-color: var(--theme-gold-dark) !important;
}

/* ---------------------------------------
 * TEXT UTILITIES
 * ------------------------------------- */
.text-primary-theme {
    color: var(--theme-primary) !important;
}
.text-primary-light {
    color: var(--theme-primary-light) !important;
}
.text-primary-dark {
    color: var(--theme-primary-dark) !important;
}

.text-accent {
    color: var(--theme-accent) !important;
}
.text-accent-dark {
    color: var(--theme-accent-dark) !important;
}

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

/* ---------------------------------------
 * BORDER UTILITIES
 * ------------------------------------- */
.border-primary-theme {
    border-color: var(--theme-primary) !important;
}
.border-primary-light {
    border-color: var(--theme-primary-light) !important;
}
.border-primary-dark {
    border-color: var(--theme-primary-dark) !important;
}

.border-accent {
    border-color: var(--theme-accent) !important;
}

/* ---------------------------------------
 * BUTTON STYLES
 * ------------------------------------- */
.btn-primary {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary-dark) !important;
}
.btn-primary:hover {
    background-color: var(--theme-primary-light) !important;
    border-color: var(--theme-primary) !important;
}
.btn-accent {
    background-color: var(--theme-accent) !important;
    color: white !important;
    border-color: var(--theme-accent-dark) !important;
}
.btn-accent:hover {
    background-color: var(--theme-accent-dark) !important;
}

/* Outline buttons */
.btn-outline-primary {
    color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}
.btn-outline-primary:hover {
    background-color: var(--theme-primary) !important;
    color: white !important;
}

/* ---------------------------------------
 * STATUS UTILITIES
 * ------------------------------------- */
.text-theme-success {
    color: var(--theme-success) !important;
}
.text-theme-danger {
    color: var(--theme-danger) !important;
}
.text-theme-info {
    color: var(--theme-info) !important;
}
.text-gold {
    color: var(--theme-gold) !important;
}
.text-gold-dark {
    color: var(--theme-gold-dark) !important;
}

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

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

/* ---------------------------------------
 * BOOKING OPERATIONS DASHBOARD
 * ------------------------------------- */
.ops-card-supplier {
    border-left: 4px solid var(--theme-accent) !important;
}
.ops-card-customer {
    border-left: 4px solid var(--theme-gold) !important;
}
.ops-card-balanced {
    border-left: 4px solid var(--theme-success) !important;
}
.ops-card-long {
    border-left: 4px solid var(--theme-info) !important;
}
.ops-card-short {
    border-left: 4px solid var(--theme-danger) !important;
}

.ops-badge-supplier {
    background-color: var(--theme-accent) !important;
    color: white !important;
}
.ops-badge-customer {
    background-color: var(--theme-gold) !important;
    color: var(--theme-primary-dark) !important;
}
.ops-badge-balanced {
    background-color: var(--theme-success) !important;
    color: white !important;
}
.ops-badge-long {
    background-color: var(--theme-info) !important;
    color: white !important;
}
.ops-badge-short {
    background-color: var(--theme-danger) !important;
    color: white !important;
}

.ops-nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-primary) 100%) !important;
}

.ops-gradient-box {
    background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-primary) 100%);
    color: white;
}

.ops-stock-row {
    border-left: 3px solid;
}
.ops-stock-row.positive {
    border-left-color: var(--theme-success);
    background-color: rgba(40, 167, 69, 0.05);
}
.ops-stock-row.negative {
    border-left-color: var(--theme-danger);
    background-color: rgba(220, 53, 69, 0.05);
}
.ops-stock-row.neutral {
    border-left-color: var(--theme-gray);
}
.ops-stock-row:hover {
    background-color: rgba(20, 93, 160, 0.05);
}

.ops-form-card {
    background: var(--theme-surface);
    border-radius: 8px;
    padding: 20px;
}

.ops-metric-box {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 2px solid var(--theme-border);
}
.ops-metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--theme-text-dark);
}
.ops-metric-label {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
    margin-top: 5px;
}

.ops-activity-item {
    padding: 10px;
    border-left: 3px solid var(--theme-border-light);
    margin-bottom: 10px;
    transition: all 0.2s;
}
.ops-activity-item:hover {
    background: var(--theme-surface);
    border-left-color: var(--theme-accent);
}

.ops-live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--theme-success);
    border-radius: 50%;
    animation: ops-pulse 2s infinite;
}
@keyframes ops-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ops-quick-action-btn {
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s;
}
.ops-quick-action-btn:hover {
    transform: scale(1.05);
}

.ops-sidebar-header {
    background-color: var(--theme-primary) !important;
    color: white !important;
}
.ops-sidebar-stats {
    background-color: var(--theme-accent) !important;
    color: white !important;
}
.ops-recent-supplier {
    background-color: var(--theme-primary) !important;
    color: white !important;
}
.ops-recent-customer {
    background-color: var(--theme-gold-dark) !important;
    color: white !important;
}

/* ---------------------------------------
 * BALANCE SUMMARY PAGE
 * ------------------------------------- */
.bal-nav-pills .nav-link {
    border-radius: 0;
    padding: 10px 18px;
    font-weight: 500;
    color: var(--theme-text-dark);
    white-space: nowrap;
}
.bal-nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-primary) 100%) !important;
    color: white !important;
}
.bal-nav-pills .nav-link:hover:not(.active) {
    background-color: var(--theme-surface);
}

.bal-tab-header {
    background-color: var(--theme-primary);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

.bal-positive {
    color: var(--theme-success) !important;
    font-weight: 600;
}
.bal-negative {
    color: var(--theme-danger) !important;
    font-weight: 600;
}
.bal-neutral {
    color: var(--theme-text-muted) !important;
}

.bal-total-row {
    background-color: var(--theme-surface) !important;
    font-weight: 700;
    border-top: 2px solid var(--theme-border-light);
}

.bal-summary-card {
    border-left: 4px solid var(--theme-accent);
    background: white;
    padding: 16px;
    border-radius: 0 6px 6px 0;
}
.bal-summary-card.gold {
    border-left-color: var(--theme-gold);
}
.bal-summary-card.success {
    border-left-color: var(--theme-success);
}
.bal-summary-card.danger {
    border-left-color: var(--theme-danger);
}
.bal-summary-card.info {
    border-left-color: var(--theme-info);
}

.bal-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--theme-text-dark);
}
.bal-summary-label {
    font-size: 0.8rem;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bal-section-title {
    color: var(--theme-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--theme-accent);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.bal-maturity-warning {
    color: var(--theme-warning) !important;
    font-weight: 600;
}
.bal-maturity-danger {
    color: var(--theme-danger) !important;
    font-weight: 600;
}

/* Ledger expandable detail (Supplier / Customer balance tabs) */
.bal-ledger-detail {
    border: 1px solid var(--theme-border-light);
    border-radius: 6px;
    background-color: var(--theme-surface);
    padding: 12px 16px;
    margin: 0;
}
.bal-ledger-detail-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.bal-ledger-detail-scroll {
    max-height: 280px;
    overflow-y: auto;
}
.bal-ledger-detail-table {
    font-size: 0.875rem;
    margin-bottom: 0;
}
.bal-ledger-detail-table thead th {
    background-color: rgba(0, 0, 0, 0.06);
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 1px solid var(--theme-border-light);
}
.bal-ledger-detail-table tbody td {
    padding: 6px 10px;
    vertical-align: middle;
}
.bal-ledger-detail-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}
.bal-ledger-detail-table .text-end {
    font-variant-numeric: tabular-nums;
}
.bal-ledger-detail-empty {
    color: var(--theme-text-muted);
    font-style: italic;
    padding: 12px 0;
}
