/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #ffffff;
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --sidebar-width: 280px;
    --header-height: 70px;
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 45%, #fdf2f8 100%);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    min-height: 100vh;
    letter-spacing: -0.01em;
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

p {
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Sidebar removed - all navigation in header */

/* Main Content */
.main-content {
    margin-left: 0;
    min-height: 100vh;
    padding-top: 0;
    background: transparent;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: var(--primary-gradient);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible;
    border-bottom: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0;
    overflow: visible;
    position: relative;
}

/* Header Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 1.625rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    transition: all 0.2s ease;
    letter-spacing: -0.02em;
}

    .header-logo:hover {
        opacity: 0.9;
    }

    .header-logo i {
        font-size: 1.875rem;
        color: #fbbf24;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    }

/* Header Menu Navigation */
.header-menu {
    display: flex;
    align-items: center;
    flex: 1;
    overflow-x: auto;
    overflow-y: visible !important;
    overflow: visible !important;
    position: relative;
    z-index: 1000;
}

.header-nav {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

.header-nav-item {
    position: relative;
    z-index: 1000;
}

    .header-nav-item.dropdown.active {
        z-index: 10000;
    }

    .header-nav-item.dropdown {
        z-index: 9998;
    }

    .header-nav-item .dropdown-toggle,
    .header-nav-item .header-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.625rem 1.25rem;
        color: rgba(255, 255, 255, 0.95);
        text-decoration: none;
        border-radius: var(--radius-md);
        transition: all 0.2s ease;
        font-size: 0.875rem;
        font-weight: 500;
        white-space: nowrap;
        line-height: 1.5;
        position: relative;
    }

        .header-nav-item .dropdown-toggle::before,
        .header-nav-item .header-link::before {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 3px;
            background: #ffd700;
            transition: width 0.3s ease;
            border-radius: 2px 2px 0 0;
        }

        .header-nav-item .header-link:hover,
        .header-nav-item .header-link.active {
            background: rgba(255, 255, 255, 0.15);
            color: white;
            transform: translateY(-2px);
        }

            .header-nav-item .header-link:hover::before,
            .header-nav-item .header-link.active::before {
                width: 80%;
            }

        .header-nav-item .dropdown-toggle:hover {
            background: rgba(255, 255, 255, 0.15);
            color: white;
            transform: translateY(-2px);
        }

            .header-nav-item .dropdown-toggle:hover::before {
                width: 80%;
            }

    .header-nav-item.dropdown.active .dropdown-toggle {
        background: rgba(255, 255, 255, 0.2);
        color: white;
    }

        .header-nav-item.dropdown.active .dropdown-toggle::before {
            width: 80%;
        }

    .header-nav-item .dropdown-toggle i:last-child {
        font-size: 0.7rem;
        margin-left: 0.25rem;
        transition: transform 0.3s ease;
    }

    .header-nav-item.dropdown.active .dropdown-toggle i:last-child {
        transform: rotate(180deg);
    }

    .header-nav-item .dropdown-toggle i:first-child {
        font-size: 0.9rem;
    }

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: white;
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    border: 1px solid rgba(102, 126, 234, 0.2);
    display: block;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
}

    .dropdown-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    }

.header-nav-item.dropdown:hover .dropdown-menu,
.header-nav-item.dropdown.active .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* Force show when active - Multiple selectors for maximum compatibility */
.header-nav-item.dropdown.active .dropdown-menu,
.header-nav-item.dropdown.active > .dropdown-menu,
li.header-nav-item.dropdown.active .dropdown-menu,
li.header-nav-item.dropdown.active ul.dropdown-menu,
.header-nav .header-nav-item.dropdown.active .dropdown-menu,
.header-nav-item.dropdown.active ul.dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    max-height: 500px !important;
    position: absolute !important;
    top: calc(100% + 0.5rem) !important;
    left: 0 !important;
    z-index: 99999 !important;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

    .dropdown-menu a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        transition: width 0.3s ease;
    }

    .dropdown-menu a:hover {
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
        color: #667eea;
        padding-left: 1.75rem;
    }

        .dropdown-menu a:hover::before {
            width: 4px;
        }

    .dropdown-menu a i {
        width: 20px;
        text-align: center;
        color: #667eea;
        font-size: 0.9rem;
        transition: transform 0.2s ease;
    }

    .dropdown-menu a:hover i {
        color: #764ba2;
        transform: scale(1.1);
    }

/* Menu button removed - no sidebar */

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.header-settings-btn {
    position: relative;
    cursor: pointer;
    font-size: 1.35rem;
    color: white;
    padding: 0.75rem;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .header-settings-btn:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: scale(1.1) translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
        color: white;
    }

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

    .search-box i {
        position: absolute;
        left: 1rem;
        color: rgba(255, 255, 255, 0.7);
        z-index: 1;
    }

    .search-box input {
        padding: 0.6rem 1rem 0.6rem 2.5rem;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 2rem;
        width: 250px;
        font-size: 0.875rem;
        background: rgba(255, 255, 255, 0.15);
        color: white;
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
    }

        .search-box input::placeholder {
            color: rgba(255, 255, 255, 0.7);
        }

        .search-box input:focus {
            outline: none;
            border-color: rgba(255, 255, 255, 0.5);
            background: rgba(255, 255, 255, 0.25);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

.notifications {
    position: relative;
    cursor: pointer;
    font-size: 1.35rem;
    color: white;
    padding: 0.75rem;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .notifications:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: scale(1.1) translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .notifications .badge {
        position: absolute;
        top: 0;
        right: 0;
        background: #ff4757;
        color: white;
        font-size: 0.7rem;
        font-weight: 600;
        padding: 0.2rem 0.4rem;
        border-radius: 10px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.user-profile {
    position: relative;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

    .user-profile-trigger:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
    }

    .user-profile-trigger img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

.user-profile-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 250px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.user-profile.dropdown.active .user-profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-profile-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border-color);
}

    .user-profile-info img {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid var(--primary-color);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .user-profile-info strong {
        display: block;
        font-size: 1rem;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
    }

    .user-profile-info p {
        font-size: 0.875rem;
        color: var(--text-secondary);
        margin: 0;
    }

.user-profile-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.user-profile-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

    .user-profile-item:hover {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border-left-color: var(--danger-color);
        color: var(--danger-color);
    }

    .user-profile-item i {
        width: 20px;
        text-align: center;
        color: var(--text-secondary);
    }

    .user-profile-item:hover i {
        color: var(--danger-color);
    }

/* Content Area */
.content-area {
    width: 100%;
    padding: 2.5rem clamp(1.5rem, 4vw, 4rem);
    margin: 0;
}

@media (min-width: 1440px) {
    .content-area {
        padding-left: 5rem;
        padding-right: 5rem;
    }
}

.page-content {
    display: none;
}

    .page-content.active {
        display: block;
    }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

    .page-header h2 {
        font-size: 2rem;
        font-weight: 800;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
        letter-spacing: -0.02em;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        line-height: 1.2;
    }

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Quick Actions Section */
.quick-actions-section {
    margin-bottom: 2rem;
}

.quick-actions-header {
    user-select: none;
    transition: background-color 0.3s ease;
}

    .quick-actions-header:hover {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    }

.quick-actions-toggle {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.quick-actions-header:hover .quick-actions-toggle {
    color: var(--primary-color);
}

.quick-actions-body {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

    .quick-action-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s;
    }

    .quick-action-btn:hover::before {
        left: 100%;
    }

    .quick-action-btn:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
        border-color: transparent;
    }

.quick-action-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.quick-action-btn:hover .quick-action-icon {
    transform: scale(1.1) rotate(5deg);
}

.quick-action-content {
    flex: 1;
    min-width: 0;
}

    .quick-action-content h3 {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: var(--text-primary);
    }

    .quick-action-content p {
        font-size: 0.875rem;
        color: var(--text-secondary);
        margin: 0;
    }

.quick-action-arrow {
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.quick-action-btn:hover .quick-action-arrow {
    transform: translateX(6px);
    color: var(--primary-color);
}

/* Quick Action Button Colors */
.quick-action-btn.purchase-btn:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.quick-action-btn.purchase-btn .quick-action-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.quick-action-btn.sale-btn:hover {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
}

.quick-action-btn.sale-btn .quick-action-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.quick-action-btn.return-btn:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-color: #6366f1;
}

.quick-action-btn.return-btn .quick-action-icon {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.quick-action-btn.sale-return-btn:hover {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-color: #ec4899;
}

.quick-action-btn.sale-return-btn .quick-action-icon {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.quick-action-btn.item-btn:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-color: #3b82f6;
}

.quick-action-btn.item-btn .quick-action-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.quick-action-btn.party-btn:hover {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border-color: #8b5cf6;
}

.quick-action-btn.party-btn .quick-action-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

@media (max-width: 768px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .quick-action-btn {
        padding: 1rem;
    }

    .quick-action-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .quick-action-content h3 {
        font-size: 1rem;
    }

    .quick-action-content p {
        font-size: 0.8rem;
    }

    /* Charts responsive */
    .card-body > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    canvas {
        max-height: 250px !important;
    }
}

/* Chart Container Styling */
.card-body h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .card-body h4::before {
        content: '';
        width: 4px;
        height: 20px;
        background: var(--primary-color);
        border-radius: 2px;
    }

@media (max-width: 768px) {
    .card-body > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.3) 50%, transparent 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .stat-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }

        .stat-card:hover::before {
            opacity: 1;
        }

    .stat-card.blue-card {
        background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
        border-left: 4px solid #3b82f6;
    }

    .stat-card.purple-card {
        background: linear-gradient(135deg, #ffffff 0%, #f3e8ff 100%);
        border-left: 4px solid #8b5cf6;
    }

    .stat-card.green-card {
        background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
        border-left: 4px solid #10b981;
    }

    .stat-card.orange-card {
        background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
        border-left: 4px solid #f59e0b;
    }

    .stat-card.red-card {
        background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
        border-left: 4px solid #ef4444;
    }

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
}

.stat-icon.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
}

.stat-info {
    flex: 1;
}

    .stat-info h3 {
        font-size: 2rem;
        font-weight: 800;
        margin-bottom: 0.25rem;
        background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        line-height: 1.2;
    }

.stat-card.blue-card .stat-info h3 {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.green-card .stat-info h3 {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.orange-card .stat-info h3 {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.red-card .stat-info h3 {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
    gap: 2rem;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
}

    .card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .card:hover::before {
        opacity: 1;
    }

    .card:hover {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
        transform: translateY(-6px);
        border-color: rgba(99, 102, 241, 0.3);
    }

.card-header {
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid rgba(203, 213, 225, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
}

    .card-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    }

    .card-header h2 {
        font-size: 1.5rem;
        font-weight: 700;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin-left: 0.75rem;
        letter-spacing: -0.3px;
    }

    .card-header h3 {
        font-size: 1.25rem;
        font-weight: 700;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin-left: 0.75rem;
        letter-spacing: -0.3px;
    }

    /* Override for card-headers with gradient backgrounds - make text white */
    .card-header[style*="background"] h3,
    .card-header[style*="gradient"] h3 {
        -webkit-text-fill-color: white !important;
        color: white !important;
        background: none !important;
        -webkit-background-clip: unset !important;
        background-clip: unset !important;
    }

    .card-header[style*="color: white"] h3,
    .card-header[style*="color:white"] h3 {
        -webkit-text-fill-color: white !important;
        color: white !important;
        background: none !important;
        -webkit-background-clip: unset !important;
        background-clip: unset !important;
    }

.period-select {
    padding: 0.75rem 1.5rem;
    border: 1.5px solid rgba(79, 70, 229, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    background: white;
    color: var(--primary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

    .period-select:hover {
        border-color: var(--primary-color);
        background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

    .period-select:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    }

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

    .view-all::after {
        content: 'â†’';
        margin-left: 0.25rem;
        transition: transform 0.3s ease;
        display: inline-block;
    }

    .view-all:hover {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
        transform: translateX(2px);
    }

        .view-all:hover::after {
            transform: translateX(4px);
        }

.card-body {
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem 1.25rem;
    }
}

.chart-placeholder {
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 0.75rem;
    position: relative;
    overflow: hidden;
    padding: 1rem;
}

    .chart-placeholder canvas {
        max-height: 100%;
        max-width: 100%;
    }

/* Report Card Header Toggle */
.card-header[onclick] {
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

    .card-header[onclick]:hover {
        background: rgba(99, 102, 241, 0.05);
    }

    .card-header[onclick] i.fa-chevron-down,
    .card-header[onclick] i.fa-chevron-up {
        transition: transform 0.3s ease;
        color: var(--text-secondary);
    }

    .card-header[onclick]:hover i.fa-chevron-down,
    .card-header[onclick]:hover i.fa-chevron-up {
        color: var(--primary-color);
    }

.chart-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.03) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: white;
}

    .data-table thead {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
        position: relative;
    }

        .data-table thead::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: rgba(255, 255, 255, 0.2);
        }

    .data-table th {
        padding: 1rem 0.875rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.875rem;
        color: white;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    }

        .data-table th:first-child {
            padding-left: 1.5rem;
        }

        .data-table th:last-child {
            padding-right: 1.5rem;
        }

    .data-table td {
        padding: 1.125rem 1rem;
        border-top: 1px solid rgba(226, 232, 240, 0.6);
        font-size: 0.9375rem;
        color: var(--text-primary);
        background: white;
        font-weight: 500;
        transition: all 0.2s ease;
    }

        .data-table td:first-child {
            padding-left: 1.5rem;
        }

        .data-table td:last-child {
            padding-right: 1.5rem;
        }

    .data-table tbody tr {
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 3px solid transparent;
    }

        .data-table tbody tr:hover {
            background: linear-gradient(90deg, rgba(99, 102, 241, 0.06) 0%, rgba(118, 75, 162, 0.04) 100%);
            border-left-color: var(--primary-color);
            transform: translateX(2px);
            box-shadow: -2px 0 8px rgba(99, 102, 241, 0.15);
        }

.badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

    .badge:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    }

.badge-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.badge-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.status {
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: inline-block;
}

    .status:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    }

    .status.paid {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

    .status.pending {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: white;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

.stock-high {
    color: var(--success-color);
    font-weight: 600;
}

.stock-low {
    color: var(--danger-color);
    font-weight: 600;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

    .form-group label {
        margin-bottom: 0.625rem;
        font-weight: 600;
        font-size: 0.875rem;
        color: var(--text-primary);
        letter-spacing: 0.01em;
        display: flex;
        align-items: center;
    }

        .form-group label i {
            margin-right: 0.5rem;
            color: var(--primary-color);
            font-size: 0.875rem;
        }

.required {
    color: var(--danger-color);
    font-weight: 700;
    margin-left: 0.25rem;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.9375rem 1.375rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

    .form-control:hover {
        border-color: rgba(99, 102, 241, 0.4);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

    .form-control:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(0, 0, 0, 0.1);
        background: #ffffff;
        transform: translateY(-1px);
    }

    .form-control::placeholder {
        color: var(--text-muted);
        font-weight: 400;
        opacity: 0.7;
    }

    .form-control:disabled {
        background: #f8fafc;
        cursor: not-allowed;
        opacity: 0.6;
    }

/* Enhanced Form Elements */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    appearance: none;
    cursor: pointer;
}

    select.form-control:hover {
        border-color: rgba(99, 102, 241, 0.4);
    }

    select.form-control:focus {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234f46e5' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    }

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.6;
}

    textarea.form-control:focus {
        min-height: 120px;
    }

/* Form Labels */
label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

    label i {
        margin-right: 0.5rem;
        color: var(--primary-color);
        font-size: 0.875rem;
    }

.required {
    color: var(--danger-color);
    font-weight: 700;
    margin-left: 0.25rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

    .form-row .form-group {
        margin-bottom: 0;
    }

/* Help Text / Small Text */
.text-muted,
small.text-muted {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
    font-weight: 400;
    line-height: 1.5;
}

    .text-muted i {
        margin-right: 0.375rem;
        color: var(--info-color);
        font-size: 0.75rem;
    }

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.badge-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: white;
}

/* Status Indicators */
.status {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

    .status.paid {
        background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
        color: #065f46;
        border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .status.pending {
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
        color: #92400e;
        border: 1px solid rgba(245, 158, 11, 0.3);
    }

    .status.partial {
        background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
        color: #3730a3;
        border: 1px solid rgba(99, 102, 241, 0.3);
    }

.form-section {
    margin: 2rem 0;
}

    .form-section h3 {
        margin-bottom: 1rem;
        font-size: 1.125rem;
        color: var(--text-primary);
    }

.form-row.totals {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.total-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-left: auto;
    align-items: center;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.search-input {
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    min-width: 250px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

    .search-input:hover {
        border-color: rgba(99, 102, 241, 0.4);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

    .search-input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(0, 0, 0, 0.1);
    }

.filter-select {
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    cursor: pointer;
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

    .filter-select:hover {
        border-color: rgba(99, 102, 241, 0.4);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

    .filter-select:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(0, 0, 0, 0.1);
    }

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    border: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

    .btn-primary::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .btn-primary:hover::before {
        left: 100%;
    }

    .btn-primary:hover {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    }

    .btn-primary:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #475569 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
    border: none;
    font-weight: 600;
}

    .btn-secondary:hover {
        background: linear-gradient(135deg, #475569 0%, #334155 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(100, 116, 139, 0.4);
    }

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    border: none;
    font-weight: 600;
}

    .btn-success:hover {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    }

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    border: none;
    font-weight: 600;
}

    .btn-danger:hover {
        background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    }

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.625rem;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

    .btn-icon:hover {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
        color: var(--primary-color);
        transform: scale(1.1);
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    }

    .btn-icon:active {
        transform: scale(0.95);
    }

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
}

.btn-lg {
    padding: 1.125rem 2.25rem;
    font-size: 1.0625rem;
    border-radius: var(--radius-lg);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

    .tab-btn.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

.tab-content {
    display: none;
}

    .tab-content.active {
        display: block;
    }

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.report-card {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .report-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

.report-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1rem;
}

    .report-icon.blue {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    }

    .report-icon.green {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    }

    .report-icon.orange {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    }

    .report-icon.purple {
        background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    }

    .report-icon.red {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    }

    .report-icon.teal {
        background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    }

.report-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.report-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .modal.active {
        display: flex;
        opacity: 1;
    }

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.75rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h2 {
        font-size: 1.5rem;
        font-weight: 600;
    }

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Custom Alert/Confirm Modal */
.custom-alert-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

    .custom-alert-modal.active {
        display: flex;
    }

.custom-alert-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.custom-alert-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .custom-alert-header i {
        font-size: 1.5rem;
    }

    .custom-alert-header h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: white;
    }

.custom-alert-body {
    padding: 1.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
}

.custom-alert-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f8f9fa;
}

.custom-alert-btn {
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.custom-alert-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

    .custom-alert-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }

.custom-alert-btn-secondary {
    background: #e2e8f0;
    color: var(--text-primary);
}

    .custom-alert-btn-secondary:hover {
        background: #cbd5e1;
    }

.custom-alert-btn:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .search-box input {
        width: 200px;
    }
}

@media (max-width: 1200px) {
    .header-menu {
        margin-left: 1rem;
    }

    .header-nav-item .dropdown-toggle {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 1024px) {
    .header-menu {
        display: none;
    }

    .page-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 1rem;
    }

    .header-logo span {
        display: none;
    }

    .header-menu {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .header-nav {
        gap: 0.15rem;
    }

    .header-nav-item .dropdown-toggle,
    .header-nav-item .header-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .search-box {
        display: none;
    }

    .content-area {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-right {
        gap: 1rem;
    }

    .user-profile span {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.25rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Scrollbar Styles - removed sidebar scrollbar */

/* Additional Form Styles */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
}

/* Autocomplete Styles */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-input {
    padding-right: 40px;
}

.btn-add-new {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

    .btn-add-new:hover {
        background: var(--primary-hover);
        background: #6366f1;
    }

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 10000 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    margin-top: 2px;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

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

    .autocomplete-item:hover,
    .autocomplete-item.highlighted {
        background: #f5f5f5;
    }

    .autocomplete-item.add-new-option {
        color: var(--primary-color);
        font-weight: 500;
        background: #f0f7ff;
    }

        .autocomplete-item.add-new-option:hover {
            background: #e0efff;
        }

    .autocomplete-item i {
        margin-right: 8px;
    }

/* Compact autocomplete for purchase table */
.compact-autocomplete {
    position: relative;
}

    .compact-autocomplete .autocomplete-input {
        padding-right: 30px;
        font-size: 0.8125rem;
    }

.btn-add-new-compact {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 3px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 0.7rem;
    padding: 0;
}

    .btn-add-new-compact:hover {
        background: var(--primary-hover);
    }

.compact-dropdown {
    position: fixed !important;
    font-size: 0.75rem;
    max-height: 300px;
    min-width: 250px;
    z-index: 10001 !important;
    background: white !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    overflow-y: auto !important;
    display: none;
    pointer-events: auto !important;
    visibility: hidden;
    opacity: 0;
}

    .compact-dropdown .autocomplete-item {
        padding: 8px 12px;
        font-size: 0.75rem;
        cursor: pointer;
        border-bottom: 1px solid #f0f0f0;
    }

        .compact-dropdown .autocomplete-item:last-child {
            border-bottom: none;
        }

        .compact-dropdown .autocomplete-item:hover,
        .compact-dropdown .autocomplete-item.highlighted {
            background: #f5f5f5;
        }

/* Ensure table cells don't clip dropdowns */
.purchase-table td {
    overflow: visible !important;
    position: relative;
}

.purchase-table {
    overflow: visible !important;
}

.purchase-items-table {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
}

/* Autocomplete wrapper - ensure dropdown can escape table */
.autocomplete-wrapper {
    position: relative !important;
    z-index: 1;
}

.autocomplete-dropdown {
    position: fixed !important;
    z-index: 10001 !important;
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    display: none;
}

    .autocomplete-dropdown.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

/* Modal Updates */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

    .modal.active,
    .modal[style*="flex"] {
        display: flex !important;
    }

.modal-close {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--danger-color);
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .modal-close:hover {
        background: var(--danger-color);
        color: white;
        transform: rotate(90deg) scale(1.1);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    }

.modal-header h3 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .modal-header h3 i {
        color: var(--primary-color);
        -webkit-text-fill-color: var(--primary-color);
    }

input[type="number"].form-control {
    text-align: right;
}

input[readonly].form-control {
    background-color: var(--light-color);
    cursor: not-allowed;
}

/* Purchase Form Professional Styles */
.purchase-form-card {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: none;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 0.5rem;
}

    .purchase-form-card .card-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 0.75rem 1.25rem;
        border-bottom: none;
    }

        .purchase-form-card .card-header h3 {
            margin: 0;
            font-size: 1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

            .purchase-form-card .card-header h3 i {
                font-size: 1.1rem;
            }

.page-subtitle {
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 400;
}

.invoice-header {
    background: #f8f9fa;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    border: 1px solid #e9ecef;
}

    .invoice-header .form-group label {
        color: #495057;
        font-weight: 600;
        font-size: 0.875rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .invoice-header .form-group label i {
            color: var(--primary-color);
            font-size: 0.875rem;
        }

.purchase-items-section {
    margin: 1.5rem 0;
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border: 1px solid #e9ecef;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.875rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

    .section-header h3 {
        margin: 0;
        font-size: 1.125rem;
        font-weight: 600;
        color: #2c3e50;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

        .section-header h3 i {
            color: var(--primary-color);
        }

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.purchase-items-table {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.purchase-table {
    margin: 0;
}

    .purchase-table thead th {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        padding: 0.625rem 0.5rem;
        white-space: nowrap;
        border: none;
    }

    .purchase-table.compact-table thead th {
        padding: 0.5rem 0.375rem;
        font-size: 0.7rem;
    }

    /* Adjust column widths for number fields */
    .purchase-table.compact-table th:nth-child(6),
    .purchase-table.compact-table th:nth-child(7),
    .purchase-table.compact-table th:nth-child(8),
    .purchase-table.compact-table th:nth-child(9),
    .purchase-table.compact-table th:nth-child(10),
    .purchase-table.compact-table th:nth-child(11),
    .purchase-table.compact-table th:nth-child(12),
    .purchase-table.compact-table th:nth-child(13) {
        width: auto;
        min-width: 0;
    }

    .purchase-table tbody td {
        padding: 0.5rem;
        vertical-align: middle;
        border-bottom: 1px solid #f0f0f0;
    }

    .purchase-table.compact-table tbody td {
        padding: 0.375rem 0.25rem;
    }

    .purchase-table tbody tr:hover {
        background: #f8f9fa;
    }

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

    .purchase-table .form-control {
        border: 1px solid #dee2e6;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        transition: all 0.2s;
    }

    .purchase-table .compact-input {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
        min-width: 0;
    }

    /* Narrow width for number inputs */
    .purchase-table input[type="number"].compact-input {
        width: 70px;
        max-width: 70px;
        text-align: right;
    }

        .purchase-table input[type="number"].compact-input.qty,
        .purchase-table input[type="number"].compact-input.free-qty {
            width: 60px;
            max-width: 60px;
        }

        .purchase-table input[type="number"].compact-input.disc-per,
        .purchase-table input[type="number"].compact-input.tax-rate {
            width: 55px;
            max-width: 55px;
        }

        .purchase-table input[type="number"].compact-input.rate,
        .purchase-table input[type="number"].compact-input.mrp {
            width: 65px;
            max-width: 65px;
        }

        .purchase-table input[type="number"].compact-input.disc-amt,
        .purchase-table input[type="number"].compact-input.tax-amt {
            width: 75px;
            max-width: 75px;
        }

    .purchase-table .compact-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    }

    .purchase-table .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

.compact-amount {
    font-size: 0.8125rem !important;
    padding: 0.375rem 0.5rem;
}

.compact-btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem;
}

.compact-row {
    gap: 0.75rem;
}

.compact-field {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Optimize page header - already defined above, this is override */

.page-subtitle {
    margin-top: 0;
    font-size: 0.75rem;
    margin-bottom: 0;
}

.purchase-table .line-amount {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9375rem;
}

.purchase-table .btn-icon {
    padding: 0.375rem 0.625rem;
    background: #fee;
    color: #dc3545;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

    .purchase-table .btn-icon:hover {
        background: #fcc;
        transform: scale(1.05);
    }

.totals-section {
    margin: 1.5rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border: 1px solid #dee2e6;
}

.totals-header {
    margin-bottom: 0.875rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #dee2e6;
}

    .totals-header h3 {
        margin: 0;
        font-size: 1.125rem;
        font-weight: 600;
        color: #2c3e50;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

        .totals-header h3 i {
            color: var(--primary-color);
        }

.totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Compact number inputs in totals */
.totals-section input[type="number"] {
    width: 100%;
    max-width: 120px;
}

.totals-section .total-input {
    max-width: 150px;
}

.compact-number {
    max-width: 100px !important;
    width: 100px !important;
}

.total-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

    .total-item label {
        font-weight: 600;
        font-size: 0.8125rem;
        color: #495057;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .total-item label i {
            color: var(--primary-color);
            font-size: 0.75rem;
        }

.total-input {
    background: white;
    font-weight: 600;
    color: #495057;
    border: 2px solid #dee2e6;
}

.total-item-final {
    grid-column: span 2;
}

    .total-item-final .total-amount {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        font-size: 1.5rem;
        font-weight: 700;
        padding: 0.875rem 1rem;
        text-align: center;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

.remarks-section {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

    .remarks-section label {
        font-weight: 600;
        color: #495057;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

        .remarks-section label i {
            color: var(--primary-color);
        }

    .remarks-section textarea {
        border: 1px solid #dee2e6;
        border-radius: 6px;
        resize: vertical;
    }

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
}

/* Compact form layout */
.purchase-form-card .card-body {
    padding: 1rem 1.25rem;
}

.form-row {
    margin-bottom: 0.75rem;
}

.form-section {
    margin: 1.5rem 0;
}

    .form-section h3 {
        margin-bottom: 0.75rem;
        font-size: 1rem;
    }

/* Table horizontal scroll for better space usage */
.purchase-items-table {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
}

.purchase-table {
    width: 100%;
    table-layout: auto;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

    .btn-lg i {
        margin-right: 0.5rem;
    }

.btn-secondary i {
    margin-right: 0.5rem;
}

@media (max-width: 1200px) {
    .totals-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .total-item-final {
        grid-column: span 1;
    }

    .purchase-table {
        font-size: 0.8125rem;
    }

        .purchase-table thead th,
        .purchase-table tbody td {
            padding: 0.5rem 0.375rem;
        }
}

/* Action Buttons in Table */
.data-table .btn-icon {
    margin: 0 0.25rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-color);
    margin: 2rem 0;
}

    .empty-state i {
        font-size: 4rem;
        margin-bottom: 1rem;
        color: var(--text-muted);
        opacity: 0.5;
    }

    .empty-state h3 {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.5rem;
    }

    .empty-state p {
        font-size: 0.9375rem;
        color: var(--text-secondary);
        margin: 0;
    }

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alert Messages */
.alert {
    padding: 1.125rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
    color: #065f46;
    border-left-color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

    .alert-success i {
        color: #10b981;
    }

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
    color: #991b1b;
    border-left-color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

    .alert-error i {
        color: #ef4444;
    }

/* Validation Error Messages */
.text-danger {
    color: #dc2626 !important;
    font-size: 0.875rem;
    font-weight: 500;
    display: block;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    border-radius: 0.375rem;
    border-left: 3px solid #dc2626;
}

    .text-danger::before {
        content: "âš  ";
        font-weight: bold;
        margin-right: 0.25rem;
    }

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* Print Styles */
@media print {
    .sidebar,
    .top-header,
    .btn,
    .form-actions {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
