/* ============================================
   SRC SOFTWARE - Professional Billing System
   Version: 2.0 | Fully Responsive | Optimized
   Color Scheme: Dark Blue (#1e3a8a) + Teal (#0d9488)
   ============================================ */

:root {
    /* Colors */
    --primary-dark: #1e3a8a;
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --secondary: #0d9488;
    --secondary-light: #14b8a6;
    --accent: #f59e0b;
    --danger: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light-gray: #f1f5f9;
    --white: #ffffff;
    --black: #000000;
    /* Spacing - All heights unified */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 60px;
    --footer-height: 50px;
    --sidebar-footer-height: 60px;
    --mobile-header: 56px;
    --mobile-footer: 45px;
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--light-gray);
    color: var(--dark);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   SIDEBAR OVERLAY
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-base);
}

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

/* ============================================
   WRAPPER & LAYOUT
   ============================================ */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, #0a1a3a 100%);
    color: var(--white);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base), width var(--transition-base);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-xl);
}

    .sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: var(--radius-full);
    }

/* Mobile Sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.show {
            transform: translateX(0);
        }
}

/* Desktop Sidebar */
@media (min-width: 992px) {
    .sidebar.collapsed {
        width: var(--sidebar-collapsed);
    }

        .sidebar.collapsed .brand-text,
        .sidebar.collapsed .nav-text,
        .sidebar.collapsed .sidebar-footer span {
            display: none;
        }

        .sidebar.collapsed .nav-link {
            justify-content: center;
            padding: 0.75rem;
        }

            .sidebar.collapsed .nav-link i {
                margin: 0;
                font-size: 1.25rem;
            }

        .sidebar.collapsed .sidebar-header {
            padding: 1.25rem;
            justify-content: center;
        }

        .sidebar.collapsed .brand-logo {
            justify-content: center;
        }

            .sidebar.collapsed .brand-logo i {
                margin: 0;
            }

        .sidebar.collapsed .sidebar-close {
            display: none;
        }
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

    .brand-logo i {
        font-size: 1.75rem;
        color: var(--secondary-light);
    }

.brand-text {
    background: linear-gradient(135deg, #fff, var(--secondary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-soft {
    font-weight: 500;
    -webkit-text-fill-color: var(--secondary-light);
}

.sidebar-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

    .sidebar-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }

@media (min-width: 992px) {
    .sidebar-close {
        display: none;
    }
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 1rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

    .nav-item.active {
        background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
        box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
    }

    .nav-item:hover:not(.active) {
        background: rgba(255, 255, 255, 0.08);
    }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--white);
    text-decoration: none;
    transition: all var(--transition-fast);
}

    .nav-link i {
        width: 1.5rem;
        font-size: 1.125rem;
        text-align: center;
    }

.nav-text {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-badge {
    background: var(--accent);
    color: var(--dark);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
}

/* Sidebar Footer - Only Logout Button */
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    height: var(--sidebar-footer-height);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem;
    background: rgba(220, 38, 38, 0.15);
    border-radius: var(--radius-md);
    color: #fca5a5;
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    font-weight: 500;
}

    .sidebar-logout-btn:hover {
        background: rgba(220, 38, 38, 0.3);
        color: #fff;
    }

    .sidebar-logout-btn i {
        font-size: 1rem;
    }

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

@media (min-width: 992px) {
    .main-content.expanded {
        margin-left: var(--sidebar-collapsed);
        width: calc(100% - var(--sidebar-collapsed));
    }
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* ============================================
   TOP NAVBAR - Fixed Height
   ============================================ */
.top-navbar {
    background: var(--white);
    height: var(--header-height);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 999;
}

@media (max-width: 767.98px) {
    .top-navbar {
        height: var(--mobile-header);
    }
}

.top-navbar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.5rem;
}

@media (max-width: 767.98px) {
    .top-navbar .container-fluid {
        padding: 0 1rem;
    }
}

/* Navbar Left */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--dark);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .sidebar-toggle:hover {
        background: var(--light-gray);
    }

@media (max-width: 767.98px) {
    .sidebar-toggle {
        font-size: 1.125rem;
        padding: 0.375rem;
    }
}

.page-title h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
}

@media (max-width: 767.98px) {
    .page-title h4 {
        font-size: 1rem;
    }
}

/* Navbar Right */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

@media (max-width: 767.98px) {
    .navbar-right {
        gap: 0.75rem;
    }
}

/* Notification Icon */
.notification-icon {
    position: relative;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

    .notification-icon:hover {
        background: var(--light-gray);
    }

    .notification-icon i {
        font-size: 1.125rem;
        color: var(--gray);
        transition: color var(--transition-fast);
    }

    .notification-icon:hover i {
        color: var(--primary);
    }

    .notification-icon .badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background: var(--danger);
        color: white;
        font-size: 0.625rem;
        font-weight: 600;
        padding: 0.125rem 0.375rem;
        border-radius: var(--radius-full);
        min-width: 1rem;
        text-align: center;
    }

/* Date Time */
.date-time {
    font-size: 0.8125rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-md);
    background: var(--light-gray);
}

    .date-time i {
        font-size: 0.75rem;
    }

@media (max-width: 640px) {
    .date-time span {
        display: none;
    }

    .date-time {
        padding: 0.375rem;
        background: transparent;
    }

        .date-time i {
            font-size: 0.875rem;
        }
}

/* ============================================
   USER PROFILE DROPDOWN - FIXED
   ============================================ */

.user-profile {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: none;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: auto;
}

    .user-dropdown-toggle:hover {
        background: var(--light-gray);
    }

    .user-dropdown-toggle:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
    }

    .user-dropdown-toggle.active {
        background: var(--light-gray);
    }

        .user-dropdown-toggle.active .dropdown-icon {
            transform: rotate(180deg);
        }

/* User Avatar */
.user-avatar-nav i {
    font-size: 2rem;
    color: var(--secondary);
    transition: color var(--transition-fast);
}

.user-dropdown-toggle:hover .user-avatar-nav i {
    color: var(--primary);
}

/* User Info Text */
.user-info-nav {
    text-align: left;
    line-height: 1.3;
}

.user-name-nav {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
}

.user-role-nav {
    font-size: 0.6875rem;
    color: var(--gray);
}

/* Dropdown Icon */
.dropdown-icon {
    font-size: 0.75rem;
    color: var(--gray);
    transition: transform var(--transition-fast);
}

/* Dropdown Menu */
.user-profile .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    z-index: 1050;
    min-width: 260px;
    padding: 0.5rem;
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--dark);
    text-align: left;
    background-color: var(--white);
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
}

    .user-profile .dropdown-menu.show {
        display: block;
    }

/* Dropdown Items */
.user-profile .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    color: var(--dark);
    text-decoration: none;
}

    .user-profile .dropdown-item:hover {
        background: var(--light-gray);
        transform: translateX(2px);
    }

    .user-profile .dropdown-item i {
        width: 1.25rem;
        font-size: 1rem;
        color: var(--gray);
        transition: color var(--transition-fast);
    }

    .user-profile .dropdown-item:hover i {
        color: var(--primary);
    }

    /* Badge in Dropdown */
    .user-profile .dropdown-item .badge {
        margin-left: auto;
        background: var(--danger);
        color: white;
        font-size: 0.6875rem;
        padding: 0.1875rem 0.5rem;
        border-radius: var(--radius-full);
    }

    /* Danger Item (Logout) */
    .user-profile .dropdown-item.text-danger {
        color: var(--danger);
    }

        .user-profile .dropdown-item.text-danger i {
            color: var(--danger);
        }

        .user-profile .dropdown-item.text-danger:hover {
            background: rgba(220, 38, 38, 0.1);
        }

            .user-profile .dropdown-item.text-danger:hover i {
                color: var(--danger);
            }

/* Dropdown Divider */
.user-profile .dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid var(--light-gray);
    height: 0;
}

/* Remove default Bootstrap dropdown arrow */
.dropdown-toggle::after {
    display: none !important;
}

/* Tablet View */
@media (max-width: 991.98px) {
    .user-info-nav {
        display: flex;
        flex-direction: column;
    }

    .user-name-nav {
        font-size: 0.8125rem;
    }

    .user-role-nav {
        font-size: 0.625rem;
    }
}

/* Mobile View */
@media (max-width: 767.98px) {
    .user-info-nav {
        display: none;
    }

    .dropdown-icon {
        display: none;
    }

    .user-avatar-nav i {
        font-size: 1.75rem;
    }

    .user-dropdown-toggle {
        padding: 0.375rem;
    }

    .user-profile .dropdown-menu {
        min-width: 220px;
        right: 0;
        left: auto;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .user-avatar-nav i {
        font-size: 1.5rem;
    }

    .user-profile .dropdown-menu {
        min-width: 200px;
    }

    .user-profile .dropdown-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* ============================================
   MOBILE MENU FAB
   ============================================ */
.mobile-menu-fab {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

    .mobile-menu-fab:hover {
        transform: scale(1.1);
        box-shadow: var(--shadow-xl);
    }

@media (max-width: 991.98px) {
    .mobile-menu-fab {
        display: flex;
    }
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
    padding: 1.5rem;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

@media (max-width: 1024px) {
    .content-wrapper {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
        min-height: calc(100vh - var(--mobile-header) - var(--mobile-footer));
    }
}

/* ============================================
   FIXED FOOTER - Same height as sidebar footer
   ============================================ */
.main-footer {
    background: var(--white);
    border-top: 1px solid var(--light-gray);
    padding: 0.75rem 1.5rem;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
    transition: box-shadow var(--transition-fast);
    height: var(--footer-height);
}

    .main-footer.scrolled {
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    }

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    height: 100%;
}

.footer-left p {
    font-size: 0.75rem;
    color: var(--gray);
    margin: 0;
}

.footer-left strong {
    color: var(--primary);
    font-weight: 600;
}

.footer-center .footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: var(--light-gray);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    color: var(--gray);
    font-weight: 500;
}

    .footer-center .footer-badge i {
        font-size: 0.625rem;
        color: var(--secondary);
    }

.footer-right .footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--gray);
    text-decoration: none;
    transition: color var(--transition-fast);
}

    .footer-link:hover {
        color: var(--primary);
    }

    .footer-link i {
        font-size: 0.6875rem;
    }

@media (max-width: 768px) {
    .main-footer {
        padding: 0.625rem 1rem;
        height: var(--mobile-footer);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }

    .footer-left p {
        font-size: 0.6875rem;
    }

    .footer-right .footer-links {
        justify-content: center;
        gap: 0.75rem;
    }

    .footer-link {
        font-size: 0.6875rem;
    }
}

@media (max-width: 576px) {
    .footer-center .footer-badge {
        padding: 0.1875rem 0.625rem;
        font-size: 0.625rem;
    }

    .footer-link {
        font-size: 0.625rem;
    }
}

/* ============================================
   CARD STYLES
   ============================================ */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
    margin-bottom: 1.25rem;
}

    .card:hover {
        box-shadow: var(--shadow-md);
    }

.card-header {
    background: var(--white);
    border-bottom: 1px solid var(--light-gray);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    font-weight: 600;
}

    .card-header.bg-primary {
        background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
        color: white;
    }

    .card-header.bg-success {
        background: linear-gradient(135deg, var(--success), var(--secondary)) !important;
        color: white;
    }

    .card-header.bg-warning {
        background: linear-gradient(135deg, var(--warning), #d97706) !important;
        color: white;
    }

.card-body {
    padding: 1.25rem;
}

@media (max-width: 768px) {
    .card-header {
        padding: 0.75rem 1rem;
    }

        .card-header h5,
        .card-header h4 {
            font-size: 1rem;
        }

    .card-body {
        padding: 1rem;
    }
}

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-grid {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

    .product-grid::-webkit-scrollbar {
        width: 4px;
    }

    .product-grid::-webkit-scrollbar-track {
        background: var(--light-gray);
        border-radius: var(--radius-full);
    }

    .product-grid::-webkit-scrollbar-thumb {
        background: var(--secondary);
        border-radius: var(--radius-full);
    }

@media (max-width: 768px) {
    .product-grid {
        max-height: 50vh;
    }
}

.product-card {
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 100%;
}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
        border-color: var(--secondary-light);
    }
}

    .product-card .card-body {
        padding: 0.75rem;
    }

    .product-card .card-title {
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0.5rem 0;
}

@media (max-width: 576px) {
    .product-card .card-body {
        padding: 0.625rem;
    }

    .product-card .card-title {
        font-size: 0.8125rem;
    }

    .product-price {
        font-size: 0.9375rem;
        margin: 0.375rem 0;
    }
}

/* ============================================
   TABLE STYLES
   ============================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cart-table {
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 600px;
}

    .cart-table thead th {
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        color: darkblue;
        font-weight: 600;
        border: none;
        padding: 0.75rem;
        font-size: 0.8125rem;
    }

    .cart-table tbody td {
        padding: 0.75rem;
        vertical-align: middle;
    }

    .cart-table tbody tr:hover {
        background: var(--light-gray);
    }

.table {
    margin-bottom: 0;
}

    .table thead th {
        background: var(--light-gray);
        border-bottom: 2px solid var(--gray-light);
        font-weight: 600;
        padding: 0.75rem;
        font-size: 0.8125rem;
    }

    .table tbody td {
        padding: 0.75rem;
        vertical-align: middle;
    }

@media (max-width: 768px) {
    .cart-table thead th,
    .cart-table tbody td,
    .table thead th,
    .table tbody td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}

@media (max-width: 768px) {
    .btn {
        padding: 0.625rem 1rem;
        min-height: 2.5rem;
        font-size: 0.8125rem;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--secondary));
    color: white;
}

    .btn-success:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: white;
}

    .btn-danger:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

    .btn-outline-primary:hover {
        background: var(--primary);
        color: white;
        transform: translateY(-2px);
    }

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

    .btn-outline-danger:hover {
        background: var(--danger);
        color: white;
        transform: translateY(-2px);
    }

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .btn-sm {
        padding: 0.375rem 0.625rem;
        min-height: 2rem;
    }
}

/* ============================================
   FORM CONTROLS
   ============================================ */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

@media (max-width: 768px) {
    .form-control,
    .form-select {
        padding: 0.625rem 0.75rem;
        font-size: 1rem;
        min-height: 2.75rem;
    }
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
}

@media (max-width: 768px) {
    .form-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
}

.quantity-input,
.discount-input {
    width: 4rem;
    text-align: center;
}

@media (max-width: 768px) {
    .quantity-input,
    .discount-input {
        width: 3.5rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   CATEGORY PILLS
   ============================================ */
.category-pill {
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0.375rem 1rem !important;
    border-radius: var(--radius-full) !important;
    font-weight: 500;
    font-size: 0.75rem;
    background: var(--gray);
    color: white;
    display: inline-block;
    margin: 0.125rem;
}

    .category-pill:hover {
        transform: scale(1.05);
    }

    .category-pill.active {
        background: linear-gradient(135deg, var(--secondary), var(--secondary-light)) !important;
    }

@media (max-width: 768px) {
    .category-pill {
        padding: 0.3125rem 0.75rem !important;
        font-size: 0.6875rem;
    }
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
    position: relative;
    width: 100%;
}

    .search-box i {
        position: absolute;
        left: 0.875rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray);
        font-size: 0.875rem;
        pointer-events: none;
    }

    .search-box input {
        padding-left: 2.5rem;
        border-radius: var(--radius-full);
        height: 2.625rem;
        width: 100%;
    }

        .search-box input:focus {
            border-color: var(--secondary);
            box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
            outline: none;
        }

@media (max-width: 768px) {
    .search-box input {
        height: 2.75rem;
        font-size: 1rem;
    }

    .search-box i {
        left: 0.75rem;
    }
}

/* ============================================
   PAYMENT MODAL
   ============================================ */
.payment-option {
    cursor: pointer;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
}

    .payment-option:hover {
        border-color: var(--secondary);
        background: var(--light-gray);
    }

    .payment-option.selected {
        border-color: var(--success);
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(13, 148, 136, 0.05));
    }

    .payment-option i {
        font-size: 1.75rem;
        color: var(--secondary);
        margin-bottom: 0.5rem;
    }

    .payment-option div {
        font-size: 0.8125rem;
        font-weight: 500;
    }

@media (max-width: 576px) {
    .payment-option {
        padding: 0.625rem;
    }

        .payment-option i {
            font-size: 1.25rem;
        }

        .payment-option div {
            font-size: 0.6875rem;
        }
}

/* ============================================
   MODAL
   ============================================ */
.modal-dialog {
    margin: 1.75rem auto;
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: var(--radius-lg);
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
    }
}

/* ============================================
   DASHBOARD STAT CARDS
   ============================================ */
.stat-card {
    transition: transform var(--transition-fast);
}

    .stat-card:hover {
        transform: translateY(-4px);
    }

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bg-primary-light {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.bg-success-light {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.bg-warning-light {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.bg-info-light {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

@media (max-width: 768px) {
    .stat-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .stat-card h3 {
        font-size: 1.125rem;
    }
}

/* ============================================
   TRANSACTION ITEMS
   ============================================ */
.transaction-item {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background var(--transition-fast);
}

    .transaction-item:last-child {
        border-bottom: none;
    }

    .transaction-item:hover {
        background: var(--light-gray);
    }

@media (max-width: 768px) {
    .transaction-item {
        padding: 0.75rem 1rem;
    }

        .transaction-item h6 {
            font-size: 0.9rem;
        }

        .transaction-item small {
            font-size: 0.7rem;
        }
}

/* ============================================
   SUPPLIER CARDS
   ============================================ */
.supplier-card {
    transition: all var(--transition-fast);
    height: 100%;
}

    .supplier-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

.supplier-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.supplier-info {
    font-size: 0.8125rem;
    margin-top: 0.75rem;
}

    .supplier-info div {
        margin-bottom: 0.375rem;
    }

@media (max-width: 768px) {
    .supplier-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .supplier-card .card-title {
        font-size: 1rem;
    }

    .supplier-info {
        font-size: 0.75rem;
    }
}

/* ============================================
   SETTINGS LIST GROUP
   ============================================ */
.list-group-item {
    border: none;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-fast);
}

    .list-group-item.active {
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        color: white;
    }

    .list-group-item:not(.active):hover {
        background: var(--light-gray);
    }

    .list-group-item i {
        width: 1.5rem;
        margin-right: 0.75rem;
    }

@media (max-width: 768px) {
    .list-group-item {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0;
}

    .pagination .page-item.active .page-link {
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        border-color: var(--primary);
        color: white;
    }

    .pagination .page-link {
        color: var(--primary);
        border-radius: var(--radius-md);
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

        .pagination .page-link:hover {
            color: var(--primary-dark);
            background: var(--light-gray);
        }

@media (max-width: 576px) {
    .pagination .page-link {
        padding: 0.375rem 0.625rem;
        font-size: 0.6875rem;
    }
}

/* ============================================
   INVOICE STYLES
   ============================================ */
.invoice-container {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.invoice-header {
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .invoice-container {
        padding: 1rem;
        border-radius: var(--radius-lg);
    }

    .invoice-header {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

        .invoice-header h3 {
            font-size: 1.2rem;
        }

        .invoice-header p {
            font-size: 0.8rem;
        }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-notification {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1100;
    min-width: 280px;
    max-width: 400px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight var(--transition-base);
}

    .toast-notification.success {
        border-left: 4px solid var(--success);
    }

    .toast-notification.error {
        border-left: 4px solid var(--danger);
    }

    .toast-notification.warning {
        border-left: 4px solid var(--warning);
    }

    .toast-notification.info {
        border-left: 4px solid var(--info);
    }

    .toast-notification i {
        font-size: 1.25rem;
    }

    .toast-notification.success i {
        color: var(--success);
    }

    .toast-notification.error i {
        color: var(--danger);
    }

    .toast-notification.warning i {
        color: var(--warning);
    }

    .toast-notification.info i {
        color: var(--info);
    }

    .toast-notification .message {
        flex: 1;
        font-size: 0.8125rem;
        color: var(--dark);
    }

    .toast-notification .close-btn {
        background: none;
        border: none;
        cursor: pointer;
        color: var(--gray);
        font-size: 0.875rem;
    }

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 576px) {
    .toast-notification {
        left: 1rem;
        right: 1rem;
        min-width: auto;
    }
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

    .spinner-overlay.show {
        opacity: 1;
        visibility: visible;
    }

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   WELCOME SECTION
   ============================================ */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.bg-opacity-10 {
    background: rgba(255, 255, 255, 0.1);
}

.bg-opacity-15 {
    background: rgba(255, 255, 255, 0.15);
}

.bg-opacity-20 {
    background: rgba(255, 255, 255, 0.2);
}

.bg-opacity-25 {
    background: rgba(255, 255, 255, 0.25);
}

.bg-opacity-30 {
    background: rgba(255, 255, 255, 0.3);
}

.bg-opacity-40 {
    background: rgba(255, 255, 255, 0.4);
}

.bg-opacity-50 {
    background: rgba(255, 255, 255, 0.5);
}

.bg-opacity-60 {
    background: rgba(255, 255, 255, 0.6);
}

.bg-opacity-70 {
    background: rgba(255, 255, 255, 0.7);
}

.bg-opacity-80 {
    background: rgba(255, 255, 255, 0.8);
}

.bg-opacity-90 {
    background: rgba(255, 255, 255, 0.9);
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.5);
}

.text-white-60 {
    color: rgba(255, 255, 255, 0.6);
}

.text-white-70 {
    color: rgba(255, 255, 255, 0.7);
}

.text-white-80 {
    color: rgba(255, 255, 255, 0.8);
}

.text-white-90 {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background: linear-gradient(135deg, #1e3a8a, #2563eb, #0d9488);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.cursor-pointer {
    cursor: pointer;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shadow-hover {
    transition: box-shadow var(--transition-fast);
}

    .shadow-hover:hover {
        box-shadow: var(--shadow-lg);
    }

.touch-active {
    transform: scale(0.98);
    transition: transform var(--transition-fast);
}

/* Responsive Grid */
@media (max-width: 768px) {
    .g-4 {
        --bs-gutter-y: 0.75rem;
        --bs-gutter-x: 0.75rem;
    }

    .row > [class*="col-"] {
        margin-bottom: 0.75rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    h5 {
        font-size: 1rem;
    }

    h6 {
        font-size: 0.9rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .top-navbar,
    .mobile-menu-fab,
    .main-footer,
    .no-print,
    .btn,
    .action-buttons,
    .sidebar-toggle,
    .sidebar-overlay,
    .notification-icon,
    .user-profile {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .content-wrapper {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .invoice-container {
        box-shadow: none;
        padding: 0;
    }

    body {
        background: white;
    }
}

/* ============================================
   POS RECEIPT PRINT FORMAT (58mm/80mm thermal-style)
   Toggled by adding .print-receipt to <body> before window.print()
   ============================================ */
@media print {
    body.print-receipt {
        width: 80mm;
    }

    body.print-receipt .invoice-print-area {
        width: 100%;
        font-size: 11px;
        line-height: 1.35;
    }

    body.print-receipt .invoice-print-area h3,
    body.print-receipt .invoice-print-area h4,
    body.print-receipt .invoice-print-area h5 {
        font-size: 13px;
    }

    body.print-receipt .invoice-print-area .row {
        display: block;
    }

    body.print-receipt .invoice-print-area .col-md-6,
    body.print-receipt .invoice-print-area .col-md-5,
    body.print-receipt .invoice-print-area .text-md-end {
        width: 100%;
        text-align: left !important;
    }

    body.print-receipt .invoice-print-area table {
        font-size: 10px;
        width: 100%;
    }

    body.print-receipt .invoice-print-area .table-bordered th,
    body.print-receipt .invoice-print-area .table-bordered td {
        border: none !important;
        border-bottom: 1px dashed #999 !important;
        padding: 3px 2px;
    }

    body.print-receipt .invoice-print-area .badge {
        border: 1px solid #333 !important;
        color: #000 !important;
        background: none !important;
    }

    /* Supermarket/D-Mart style: bold centered shop name, monospace-ish item columns, dashed dividers */
    body.print-receipt .receipt-header h4 {
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-size: 15px;
        margin-bottom: 2px;
    }

    body.print-receipt .receipt-divider {
        border: none;
        border-top: 1px dashed #000 !important;
        margin: 6px 0;
    }

    body.print-receipt .invoice-print-area table,
    body.print-receipt .invoice-print-area td,
    body.print-receipt .invoice-print-area th {
        font-family: 'Courier New', Courier, monospace;
    }

    body.print-receipt .receipt-footer {
        font-style: italic;
        margin-top: 4px;
    }

    @page {
        size: 80mm auto;
        margin: 2mm;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
}

    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, var(--primary-dark), var(--secondary-light));
    }

/* ============================================
   DASHBOARD SPECIFIC STYLES
   ============================================ */

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    position: relative;
    overflow: hidden;
}

    .welcome-card::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
        pointer-events: none;
    }

.welcome-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.stat-badge {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    backdrop-filter: blur(10px);
}

.welcome-stats-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(10px);
    display: inline-block;
}

.text-success-light {
    color: #34d399;
}

/* Transaction Item */
.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .transaction-icon i {
        font-size: 1.125rem;
    }

/* Low Stock Table */
.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .welcome-stats-card {
        padding: 0.75rem 1rem;
    }

        .welcome-stats-card .fs-1 {
            font-size: 1.5rem !important;
        }

    .stat-badge {
        padding: 0.375rem 0.75rem;
    }

        .stat-badge .fs-5 {
            font-size: 1rem !important;
        }

    .transaction-icon {
        width: 32px;
        height: 32px;
    }

        .transaction-icon i {
            font-size: 0.875rem;
        }
}

@media (max-width: 576px) {
    .welcome-card .display-4 {
        font-size: 1.5rem;
    }

    .stat-card h3 {
        font-size: 1.25rem;
    }

    .stat-icon {
        width: 2rem;
        height: 2rem;
    }
}
