/* Marketting Admin Panel - Main Styles */

:root {
    --primary-color: #D2042D;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #198754;
    /* Changed from blue to green as requested */
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Prevent horizontal overflow globally */
html {
    overflow-x: hidden;
}

.main-wrapper {
    overflow-x: hidden;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
    width: auto;
    /* Changed from 80% to auto for better responsiveness */
}

@media (max-width: 991.98px) {
    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
}

.main-content {
    overflow-x: hidden;
    max-width: 100%;
}

/* Ensure containers don't overflow */
.container-fluid,
.container {
    overflow-x: hidden;
}

/* Make images responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent text overflow */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #D2042D 0%, #07050a 100%);
}

.login-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header h2 {
    margin: 0;
    font-weight: 600;
}

.login-header i {
    margin-right: 0.5rem;
}

.login-body {
    padding: 2rem;
}

.form-floating>label {
    padding-left: 2.5rem;
}

.form-floating>label i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--border-radius);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7, #0a58ca);
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Modern Sidebar Styles */
.sidebar {
    background: linear-gradient(180deg, #1a1d29 0%, #16213e 100%);
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-brand i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: var(--primary-color);
}

.sidebar-brand:hover {
    color: white;
    text-decoration: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem 0;
}

.sidebar-nav .nav {
    flex-direction: column;
    gap: 0.1rem;
    padding: 0 0.75rem;
}

.sidebar-nav .nav-item {
    margin: 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.775rem .9rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    position: relative;
    margin-bottom: 0.1rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(4px);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: white;
    border-radius: 2px;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1rem;
}

/* Navbar and dropdown fixes */
.navbar {
    z-index: 1030;
    overflow: visible !important;
    position: relative;
}

.navbar .dropdown {
    position: relative;
}

.navbar .dropdown-toggle::after {
    margin-left: 0.5rem;
}

.navbar .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    transform: none !important;
    will-change: auto;
}

/* Prevent body scroll issues */
html,
body {
    overflow-x: hidden;
}

.container-fluid {
    overflow: visible !important;
}

/* Fix for Bootstrap dropdown positioning */
.dropdown-menu[data-bs-popper] {
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    transform: none !important;
}

/* Ensure dropdown works on both mobile and desktop */
@media (max-width: 575.98px) {
    .navbar .dropdown-menu {
        position: absolute;
        right: 15px;
        left: auto;
        min-width: 250px;
        top: calc(100% + 10px);
    }

    .navbar .dropdown-menu .dropdown-item {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* User Dropdown Animation */
.navbar .dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 0.75rem;
    margin-top: 0.5rem;
    z-index: 1060 !important;
    min-width: 200px;
}

.navbar .dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
    color: var(--primary-color);
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-user-info .user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-info .user-name {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.sidebar-user-info .user-role {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.sidebar-user-info .btn-danger {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #ff6b6b;
    padding: 0.375rem 0.5rem;
    transition: all 0.3s ease;
}

.sidebar-user-info .btn-danger:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: scale(1.05);
}

.sidebar-brand-image {
    text-align: center;
    padding: 0.25rem 0;
}

.sidebar-brand-image img {
    max-width: 100px;
    height: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.sidebar-brand-image img:hover {
    opacity: 1;
}

.sidebar-brand-image .brand-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Mobile hamburger menu */
.mobile-menu-toggle {
    display: none;
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, #0b5ed7, #0a58ca);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.3);
}

.mobile-menu-toggle i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

@media (max-width: 991.98px) {
    .mobile-menu-toggle {
        display: inline-block !important;
    }
}

/* Mobile top bar */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Ensure mobile top bar items stay on same line */
.d-lg-none.sticky-top {
    background: white !important;
}

.d-lg-none .d-flex {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 1rem;
    width: 100%;
}

.d-lg-none .mobile-menu-toggle {
    flex-shrink: 0;
    white-space: nowrap;
}

.d-lg-none .dropdown {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1054;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 991.98px) {
    .sidebar-overlay {
        display: block;
    }
}

/* Mobile sidebar close button */
.sidebar-close {
    display: none;
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0;
    color: white;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-close:hover {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.sidebar-close:active {
    transform: rotate(90deg) scale(0.95);
}

.sidebar-close i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@media (max-width: 991.98px) {
    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.sidebar-close:active {
    transform: rotate(90deg) scale(0.95);
}

.sidebar-close i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@media (max-width: 991.98px) {
    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Main content adjustment */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% - var(--sidebar-width));
}

.main-content {
    padding: 2rem;
    background: #f8f9fa;
    width: 100%;
}

/* Sidebar scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background: var(--light-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Table Styles */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
    background: var(--light-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.025);
}

.table-responsive {
    overflow-x: auto;
}

.table.table-hover {
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .table.table-hover {
        white-space: normal;
    }
}

/* Button Styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.status-registered {
    background-color: var(--info-color);
}

.status-in-progress {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.status-completed {
    background-color: var(--success-color);
}

.status-cancelled {
    background-color: var(--danger-color);
}

/* Form Styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: var(--border-radius);
}

.alert i {
    margin-right: 0.5rem;
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-color);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 991.98px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        max-width: 85vw;
        z-index: 1055;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .mobile-menu-toggle {
        display: inline-block !important;
    }

    @keyframes pulse {

        0%,
        100% {
            box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        50% {
            box-shadow: 0 8px 28px rgba(13, 110, 253, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
        }
    }

    .sidebar-overlay {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
        width: 100% !important;
    }

    .main-content {
        padding: 1rem !important;
        overflow-x: hidden;
        width: 100%;
    }

    /* Responsive top bar */
    .d-lg-none.sticky-top {
        z-index: 1020;
    }

    .d-lg-none .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

.login-card {
    margin: 1rem;
}

.login-header,
.login-body {
    padding: 1.5rem;
}

/* Make tables responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* Stack cards vertically on mobile */
.row>[class*='col-'] {
    margin-bottom: 1rem;
}

/* Adjust card padding */
.card-body {
    padding: 1rem;
}

/* Make buttons smaller */
.btn-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 767.98px) {

    /* Further adjustments for smaller tablets and large phones */
    .main-content {
        padding: 0.75rem !important;
        padding-top: 4.5rem !important;
    }

    /* Make stat cards more compact */
    .card.border-start {
        margin-bottom: 0.75rem;
    }

    .card-body .h5 {
        font-size: 1.25rem;
    }

    .card-body .text-xs {
        font-size: 0.7rem;
    }

    /* Adjust table font sizes */
    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    /* Make badges smaller */
    .badge {
        font-size: 0.7rem;
        padding: 0.35em 0.5em;
    }

    /* Adjust card headers */
    .card-header h6 {
        font-size: 0.9rem;
    }
}

@media (max-width: 575.98px) {
    .sidebar-nav .nav-link {
        padding: 1rem;
        font-size: 1.1rem;
    }

    .sidebar-brand {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 0.5rem !important;
    }

    /* Stack everything vertically */
    .row {
        margin-left: 0;
        margin-right: 0;
    }

    .row>[class*='col-'] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Make page title smaller */
    h1.h2 {
        font-size: 1.25rem !important;
    }

    /* Compact stat cards */
    .card-body {
        padding: 0.75rem;
    }

    .card-body .row {
        flex-direction: column;
        text-align: center;
    }

    .card-body .col-auto {
        margin-top: 0.5rem;
    }

    /* Make tables scroll horizontally */
    .table-responsive {
        margin: 0 -0.5rem;
    }

    .table {
        font-size: 0.75rem;
        min-width: 500px;
    }

    .table th,
    .table td {
        padding: 0.4rem;
        white-space: nowrap;
    }

    /* Smaller buttons */
    .btn-sm {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Adjust pagination */
    .pagination {
        font-size: 0.8rem;
    }

    .page-link {
        padding: 0.375rem 0.5rem;
    }

    /* Make card headers more compact */
    .card-header {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    /* Adjust icon sizes */
    .fa-2x {
        font-size: 1.5em;
    }

    /* Better text wrapping */
    .text-xs,
    .small {
        font-size: 0.65rem;
    }

    /* Mobile top bar adjustments */
    .d-lg-none.sticky-top {
        padding: 0.5rem !important;
    }

    .d-lg-none .mobile-menu-toggle {
        padding: 0.375rem 0.625rem;
        font-size: 1rem;
    }

    .d-lg-none .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .d-lg-none .dropdown-menu {
        font-size: 0.875rem;
    }
}

/* Extra small devices (phones in portrait, less than 400px) */
@media (max-width: 399.98px) {
    .main-content {
        padding: 0.25rem !important;
        padding-top: 3.5rem !important;
    }

    .mobile-menu-toggle {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    h1.h2 {
        font-size: 1.1rem !important;
    }

    .card-body {
        padding: 0.5rem;
    }

    .table {
        font-size: 0.7rem;
    }

    .btn-sm {
        padding: 0.15rem 0.4rem;
        font-size: 0.7rem;
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .mobile-menu-toggle,
    .sidebar-overlay,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 
Mini Map Styles */
.mini-map-container {
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mini-map-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.mini-map-container img {
    transition: opacity 0.3s ease;
}

.mini-map-container:hover img {
    opacity: 0.9;
}

/* Location Modal Styles */
#locationModal .modal-body {
    padding: 1.5rem;
}

#fullLocationMap {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

/* Mapbox GL Controls */
.mapboxgl-ctrl-group {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mapboxgl-popup-content {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mapboxgl-marker {
    cursor: pointer;
}

/* SFS Overrides */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Change Blue (Info) to Green */
.bg-info,
.badge-info {
    background-color: #198754 !important;
}

.text-info {
    color: #198754 !important;
}

.btn-info {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: white !important;
}

/* Desktop/Mobile Responsiveness Fix */
@media (min-width: 992px) {
    .main-wrapper {
        width: calc(100% - var(--sidebar-width)) !important;
    }
}

@media (max-width: 991.98px) {
    .main-wrapper {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* ========================================
   Sale-Specific Styles
   ======================================== */

/* Sale Status Badges */
.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-success {
    background-color: #198754 !important;
    color: #fff !important;
}

/* Sale status badges with enhanced styling */
.sale-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.sale-status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.sale-status-badge.status-interested {
    background: linear-gradient(135deg, #0dcaf0, #0aa2c0);
    color: #000;
}

.sale-status-badge.status-purchased {
    background: linear-gradient(135deg, #198754, #146c43);
    color: #fff;
}

.sale-status-badge.status-advance-booking {
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #000;
}

/* Sale Form - Dynamic Item Rows */
#itemsTable {
    margin-bottom: 0;
}

#itemsTable thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    padding: 1rem 0.75rem;
}

#itemsTable tbody tr.item-row {
    transition: all 0.3s ease;
}

#itemsTable tbody tr.item-row:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: translateX(2px);
}

#itemsTable tbody tr.item-row td {
    vertical-align: middle;
    padding: 0.75rem;
}

/* Furniture select dropdown in sale form */
.furniture-select {
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.furniture-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Quantity and price inputs */
.quantity-input,
.price-input {
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
    text-align: center;
}

.quantity-input:focus,
.price-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Subtotal display */
.subtotal-display {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    font-weight: 600;
    text-align: right;
    color: var(--dark-color);
}

/* Remove item button */
.remove-item-btn {
    transition: all 0.3s ease;
}

.remove-item-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Add item button */
#addItemBtn {
    transition: all 0.3s ease;
}

#addItemBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Total amount display */
#totalAmount {
    background: linear-gradient(135deg, #198754, #146c43);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: right;
    border: none;
    padding: 0.75rem;
}

/* Sale items table footer */
#itemsTable tfoot tr {
    background-color: #f8f9fa;
    border-top: 3px solid #dee2e6;
}

#itemsTable tfoot td {
    padding: 1rem 0.75rem;
    font-size: 1.1rem;
}

/* Sale view page enhancements */
.sale-info-table {
    margin-bottom: 0;
}

.sale-info-table th {
    font-weight: 600;
    color: var(--secondary-color);
    padding: 0.75rem 0;
}

.sale-info-table td {
    padding: 0.75rem 0;
}

/* Sale summary cards */
.sale-summary-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.sale-summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Sale items table in view page */
.sale-items-table {
    margin-bottom: 0;
}

.sale-items-table thead {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.sale-items-table tbody tr {
    transition: all 0.3s ease;
}

.sale-items-table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: translateX(4px);
}

.sale-items-table tfoot {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-top: 3px solid var(--primary-color);
}

/* Sale list table enhancements */
#saleTable tbody tr {
    transition: all 0.3s ease;
}

#saleTable tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Sale action buttons */
.sale-action-btn {
    transition: all 0.3s ease;
    margin: 0 0.125rem;
}

.sale-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Sale form validation feedback */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Sale card headers with icons */
.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info {
    color: white;
    font-weight: 600;
    border-bottom: none;
}

.card-header i {
    opacity: 0.9;
}

/* Quick actions card styling */
.quick-actions-card .btn {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-actions-card .btn i {
    width: 20px;
    text-align: center;
}

/* Sale summary statistics */
.sale-stat {
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.sale-stat:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: scale(1.05);
}

.sale-stat h3 {
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.sale-stat small {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Responsive adjustments for sale forms */
@media (max-width: 991.98px) {
    #itemsTable {
        font-size: 0.875rem;
    }

    #itemsTable th,
    #itemsTable td {
        padding: 0.5rem 0.25rem;
    }

    .furniture-select,
    .quantity-input,
    .price-input,
    .subtotal-display {
        font-size: 0.875rem;
    }

    #totalAmount {
        font-size: 1rem;
    }
}

@media (max-width: 767.98px) {

    /* Stack sale form fields vertically on mobile */
    #itemsTable {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .sale-status-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .sale-stat h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    #itemsTable {
        font-size: 0.75rem;
    }

    #itemsTable th,
    #itemsTable td {
        padding: 0.375rem 0.125rem;
    }

    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    #totalAmount {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
}

/* Animation for adding/removing items */
@keyframes slideInRow {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.item-row {
    animation: slideInRow 0.3s ease-out;
}

/* Print styles for sale receipts */
@media print {

    .sale-action-btn,
    .quick-actions-card,
    #addItemBtn,
    .remove-item-btn {
        display: none !important;
    }

    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .card-header {
        background-color: #f8f9fa !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #itemsTable,
    .sale-items-table {
        page-break-inside: avoid;
    }

    .badge {
        border: 1px solid #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Loading state for dynamic operations */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.3rem solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Sale form section divider */
.sale-form-divider {
    border-top: 2px solid #dee2e6;
    margin: 2rem 0;
    position: relative;
}

.sale-form-divider::before {
    content: 'Furniture Items';
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0 1rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* Enhanced table borders for sale items */
.table-bordered.sale-items-bordered {
    border: 2px solid #dee2e6;
}

.table-bordered.sale-items-bordered th,
.table-bordered.sale-items-bordered td {
    border: 1px solid #dee2e6;
}

/* Sale notes styling */
.sale-notes {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-top: 1rem;
}

.sale-notes strong {
    color: #856404;
}

/* Empty state for sale items */
.empty-sale-items {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-color);
}

.empty-sale-items i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-sale-items p {
    font-size: 1.1rem;
    margin-bottom: 0;
}