/* Custom CSS for BrightPathSoft */

:root {
    --primary-color: #1B365D;
    --secondary-color: #132848;
    --accent-color: #60C1E5;
    --success-color: #2f9e6b;
    --danger-color: #c23b3b;
    --warning-color: #60C1E5;
    --info-color: #3FA8D0;
    --dark-color: #1B365D;
    --light-color: #F5F0E6;
    --font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
    --bp-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bp-font-display: "Playfair Display", Georgia, "Times New Roman", serif;
    --bp-primary: #1B365D;
    --bp-primary-dark: #132848;
    --bp-accent: #60C1E5;
    --bp-body-bg: #F5F0E6;
    --bp-fg: #1B365D;
    --bp-surface: #FFFFFF;
    --bp-muted: #5A6B7D;
}

body {
    font-family: var(--bp-font-family, var(--font-family, "Inter", system-ui, sans-serif));
    background-color: var(--bp-body-bg, #FFFFFF);
    color: var(--bp-fg, #111111);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.navbar-brand,
.modal-title,
.card-title,
.bp-display-font {
    font-family: var(--bp-font-display, var(--font-display, "Playfair Display", Georgia, serif));
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #cbd3da;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main content area */
main {
    margin-left: 0;
    padding-top: 56px;
}

@media (min-width: 768px) {
    main {
        margin-left: 16.666667%;
    }
}

/* Dashboard Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    border-radius: 10px 10px 0 0 !important;
}

.border-left-primary {
    border-left: 0.25rem solid var(--primary-color, #1B365D) !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.text-xs {
    font-size: 0.7rem;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #5a5c69;
    background-color: #f8f9fc;
}

.table td {
    vertical-align: middle;
}

/* Buttons */
.btn {
    border-radius: 0.35rem;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color, #0A3A24);
    border-color: var(--secondary-color, #0A3A24);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: #212529;
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
}

/* Forms */
.form-control {
    border-radius: 0.35rem;
    border: 1px solid #d1d3e2;
}

.form-control:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.form-label {
    font-weight: 600;
    color: #5a5c69;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.35rem;
}

/* Badges */
.badge {
    font-size: 0.75em;
    font-weight: 600;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: #5a5c69;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--secondary-color, #0A3A24) !important;
    border-color: var(--secondary-color, #0A3A24) !important;
    color: white !important;
}

/* Status indicators */
.status-pending {
    color: var(--warning-color);
}

.status-completed {
    color: var(--success-color);
}

.status-cancelled {
    color: var(--danger-color);
}

/* Stock levels */
.stock-low {
    color: var(--danger-color);
    font-weight: bold;
}

.stock-medium {
    color: var(--warning-color);
    font-weight: bold;
}

.stock-high {
    color: var(--success-color);
    font-weight: bold;
}

/* Expiry warnings */
.expiry-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.25rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.expiry-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 0.25rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Invoice styles */
.invoice-header {
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 2rem;
}

.invoice-details {
    background-color: #f8f9fc;
    padding: 1rem;
    border-radius: 0.35rem;
}

.invoice-table th {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.invoice-totals {
    background-color: #f8f9fc;
    padding: 1rem;
    border-radius: 0.35rem;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .sidebar {
        top: 56px;
    }
    
    main {
        margin-left: 0;
    }
    
    .card-body {
        padding: 0.9rem 0.75rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
        -webkit-overflow-scrolling: touch;
    }

    .btn-group-sm > .btn,
    .btn-sm {
        padding: 0.35rem 0.55rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body {
        padding: 0.85rem 0.9rem;
    }

    .form-label {
        margin-bottom: 0.3rem;
    }

    .row.g-3,
    .row.gy-3 {
        --bs-gutter-y: 0.75rem;
    }
}

/* In-app bill/view tables: keep rows compact (no stretched gaps) */
.invoice-table tbody td,
.table.bill-lines tbody td,
.card .table-striped tbody td {
    height: auto;
    vertical-align: top;
}
.invoice-table tbody tr,
.table.bill-lines tbody tr {
    height: auto;
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }

    .invoice-table tbody td,
    .table tbody td {
        height: auto !important;
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
        vertical-align: top !important;
    }
}

