/* ===== RESET & VARIABLES ===== */
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #06d6a0;
    --danger: #ef476f;
    --warning: #ffd166;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===== MOBILE-FIRST LAYOUT ===== */
.app-container {
    min-height: 100vh;
    position: relative;
}

/* Mobile Header */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--light);
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.logo span {
    font-size: 12px;
    color: var(--gray);
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-actions button {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--dark);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.header-actions button:hover {
    background: var(--light);
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    border-top: 1px solid var(--border);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--gray);
    font-size: 12px;
    cursor: pointer;
    padding: 8px 0;
    transition: var(--transition);
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 500;
}

.nav-item.active i {
    color: var(--primary);
}

/* Sidebar (Desktop) */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow);
    transition: left 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 1.5em;
    margin-bottom: 4px;
}

.sidebar-header h2 span {
    font-size: 0.7em;
    color: var(--gray);
}

.sidebar-header .date {
    color: var(--gray);
    font-size: 0.9em;
    margin-top: 8px;
}

.close-sidebar {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray);
    cursor: pointer;
    display: none;
}

@media (max-width: 768px) {
    .close-sidebar {
        display: block;
    }
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section h3 {
    padding: 0 20px;
    margin-bottom: 8px;
    color: var(--gray);
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-section ul {
    list-style: none;
}

.nav-section ul li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.95em;
    gap: 12px;
    transition: var(--transition);
}

.nav-section ul li a i {
    width: 20px;
    color: var(--gray);
}

.nav-section ul li:hover a {
    background: var(--light);
}

.nav-section ul li.active a {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.nav-section ul li.active a i {
    color: white;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.user-info i {
    font-size: 24px;
    color: var(--primary);
}

.user-info span {
    font-weight: 500;
    color: var(--dark);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: none;
    border: 2px solid var(--danger);
    color: var(--danger);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}

.overlay.active {
    display: block;
}

/* Main Content */
.main-content {
    padding: 80px 16px 90px 16px;
    min-height: 100vh;
}

/* Desktop Header */
.main-header {
    position: relative;
    z-index: 100;
}

@media (min-width: 768px) {
    .main-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        background: white;
        padding: 20px 30px;
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
    }
}

.header-left h1 {
    font-size: 1.5em;
    color: var(--dark);
}

.header-right {
    position: relative;
}

.header-right p {
    color: var(--primary);
    font-weight: 600;
}

.header-right small {
    color: var(--gray);
    font-size: 0.85em;
}

/* Content Area */
.content-area {
    min-height: 400px;
}

/* Dashboard Styles */
.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.sales {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.stat-icon.transactions {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(255, 209, 102, 0.1);
    color: var(--warning);
}

.stat-icon.danger {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.stat-info h3 {
    font-size: 0.9em;
    color: var(--gray);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.stat-trend {
    font-size: 0.8em;
}

.stat-trend.positive {
    color: var(--success);
}

.stat-trend.negative {
    color: var(--danger);
}

/* Recent Transactions */
.recent-transactions {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.recent-transactions h3 {
    margin-bottom: 16px;
    color: var(--dark);
    font-size: 1.1em;
}

/* Low Stock Alert */
.low-stock-alert {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.low-stock-alert h3 {
    margin-bottom: 16px;
    color: var(--dark);
    font-size: 1.1em;
}

.alert-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) {
    .alert-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.alert-card {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 16px;
    border-left: 4px solid var(--warning);
}

.alert-card h4 {
    margin-bottom: 4px;
    font-size: 1em;
}

.alert-card p {
    color: var(--gray);
    font-size: 0.85em;
    margin-bottom: 12px;
}

.stock-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stock-indicator .current {
    font-weight: 700;
    color: var(--warning);
}

.stock-indicator .max {
    color: var(--gray);
    font-size: 0.9em;
}

/* Sales Page Styles */
/* ===== SALES PAGE IMPROVED MOBILE RESPONSIVENESS ===== */

/* Sales Page Layout */
.sales-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Sales Header - Mobile First */
.sales-header {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .sales-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
    }
}

.barcode-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.barcode-section span {
    font-size: 14px;
    font-weight: 500;
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

@media (min-width: 768px) {
    .action-buttons {
        flex-direction: row;
        width: auto;
    }
}

.customer-select,
.btn-quick,
.btn-clear {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    width: 100%;
}

@media (min-width: 768px) {
    .customer-select,
    .btn-quick,
    .btn-clear {
        width: auto;
        min-width: 120px;
    }
}

/* Sales Layout - 2 Columns on Desktop, 1 on Mobile */
.sales-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 1024px) {
    .sales-layout {
        flex-direction: row;
    }
    
    .products-section {
        flex: 1;
        min-width: 0; /* Prevents overflow */
    }
    
    .cart-panel {
        width: 380px;
        flex-shrink: 0;
    }
}

/* Products Section */
.products-section {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    overflow-x: hidden;
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 16px;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 16px;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Category Filters - Horizontal Scroll on Mobile */
.category-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.category-filters::-webkit-scrollbar {
    height: 4px;
}

.category-filters::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 2px;
}

.category-filters::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.category-filter {
    padding: 8px 16px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.category-filter.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Products Grid - Responsive */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}

@media (min-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Product Card */
.product-card {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 0; /* Prevents overflow */
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.product-info {
    flex: 1;
    min-width: 0; /* Prevents overflow */
}

.product-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-category {
    color: var(--gray);
    font-size: 11px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    flex-wrap: wrap;
}

.price {
    font-weight: 700;
    color: var(--primary);
    font-size: 13px;
}

.stock {
    color: var(--success);
    font-size: 12px;
}

.stock.low-stock {
    color: var(--danger);
}

.add-to-cart-btn {
    background: var(--primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.add-to-cart-btn i {
    font-size: 18px;
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Cart Panel - Mobile Optimized */
.cart-panel {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 80px;
    height: auto;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .cart-panel {
        width: 380px;
        position: sticky;
        top: 20px;
    }
}

.cart-panel h3 {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
}

.cart-count {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Cart Items Container */
.cart-items {
    flex: 1;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .cart-items {
        max-height: 400px;
    }
}

.empty-cart {
    text-align: center;
    color: var(--gray);
    padding: 32px 16px;
    font-size: 14px;
}

/* Cart Item */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    flex-wrap: wrap;
}

@media (min-width: 480px) {
    .cart-item {
        flex-wrap: nowrap;
    }
}

.item-details {
    flex: 1;
    min-width: 0; /* Prevents overflow */
}

.item-name {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price {
    font-size: 12px;
    color: var(--gray);
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--light);
    border-color: var(--primary);
}

.quantity {
    min-width: 30px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
}

.remove-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    color: var(--danger);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: rgba(239, 71, 111, 0.1);
}

/* Cart Summary */
.cart-summary {
    background: var(--light);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--gray);
    font-size: 14px;
}

.summary-row.total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--border);
    font-weight: 700;
    color: var(--dark);
    font-size: 16px;
}

/* Payment Methods - Responsive */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.payment-btn {
    padding: 12px;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    transition: var(--transition);
}

.payment-btn i {
    font-size: 20px;
}

.payment-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Process Button */
.btn-process {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--success), #0b5e42);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    font-size: 14px;
}

.btn-process:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-process:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* No Products Message */
.no-products {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    font-style: italic;
    grid-column: 1 / -1;
}

/* Loading State */
.products-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .product-card {
        padding: 10px;
    }
    
    .product-info h4 {
        font-size: 13px;
    }
    
    .price {
        font-size: 12px;
    }
    
    .stock {
        font-size: 11px;
    }
    
    .add-to-cart-btn {
        width: 32px;
        height: 32px;
    }
    
    .add-to-cart-btn i {
        font-size: 16px;
    }
    
    .cart-panel {
        padding: 12px;
    }
    
    .cart-item {
        padding: 10px 0;
    }
    
    .qty-btn {
        width: 26px;
        height: 26px;
    }
    
    .quantity {
        min-width: 24px;
        font-size: 13px;
    }
    
    .payment-btn {
        padding: 10px;
        font-size: 11px;
    }
    
    .payment-btn i {
        font-size: 18px;
    }
}

/* Touch-friendly adjustments for mobile */
@media (hover: none) and (pointer: coarse) {
    .product-card {
        cursor: default;
    }
    
    .add-to-cart-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .qty-btn {
        min-width: 40px;
        min-height: 40px;
    }
    
    .remove-btn {
        min-width: 40px;
        min-height: 40px;
    }
}

/* Ensure content doesn't overflow on very small screens */
@media (max-width: 360px) {
    .product-meta {
        flex-direction: column;
        gap: 2px;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-controls {
        align-self: flex-end;
        margin-top: 8px;
    }
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}


/* Product Card in Sales */
.product-card {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.product-info h4 {
    font-size: 1.1em;
    margin-bottom: 4px;
}

.product-category {
    color: var(--gray);
    font-size: 0.85em;
    margin-bottom: 8px;
}

.product-meta {
    display: flex;
    gap: 12px;
    font-size: 0.9em;
}

.price {
    font-weight: 700;
    color: var(--primary);
}

.stock {
    color: var(--success);
}

.stock.low-stock {
    color: var(--danger);
}

.add-to-cart-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
}

.add-to-cart-btn:hover {
    transform: scale(1.1);
}

/* Inventory Page */
.inventory-page {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.page-header h2 {
    font-size: 1.5em;
    color: var(--dark);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: white;
    color: var(--dark);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--light);
}

.filters-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .filters-bar {
        flex-direction: row;
        align-items: center;
    }
}

.filter-select {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 150px;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
}

.inventory-table th {
    text-align: left;
    padding: 12px 8px;
    background: var(--light);
    color: var(--gray);
    font-weight: 600;
    font-size: 0.85em;
}

.inventory-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9em;
}

.inventory-table tr:hover {
    background: var(--light);
}

.stock-badge {
    background: var(--success);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
}

.low-stock .stock-badge {
    background: var(--danger);
}

/* Expiry Classes */
.expired {
    color: var(--danger);
    font-weight: 600;
}

.expiring-soon {
    color: var(--warning);
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-edit {
    background: rgba(255, 209, 102, 0.1);
    color: var(--warning);
}

.btn-edit:hover {
    background: var(--warning);
    color: white;
}

.btn-delete {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.btn-delete:hover {
    background: var(--danger);
    color: white;
}

.btn-view {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.btn-view:hover {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.btn-success:hover {
    background: var(--success);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.page-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover {
    background: var(--light);
}

.page-info {
    color: var(--gray);
    font-size: 0.95em;
}

/* Stock Page */
.stock-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stock-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .stock-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stock-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}

.stock-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stock-card.warning {
    border-left: 4px solid var(--warning);
}

.stock-card.danger {
    border-left: 4px solid var(--danger);
}

.stock-card.expiring {
    border-left: 4px solid var(--primary);
}

.stock-card.total {
    border-left: 4px solid var(--success);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stock-card.warning .card-icon {
    background: rgba(255, 209, 102, 0.1);
    color: var(--warning);
}

.stock-card.danger .card-icon {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.stock-card.expiring .card-icon {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.stock-card.total .card-icon {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.card-info h3 {
    font-size: 0.9em;
    color: var(--gray);
    margin-bottom: 4px;
}

.card-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
}

.card-label {
    font-size: 0.75em;
    color: var(--gray);
}

/* Stock Alerts */
.stock-alerts-section {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.stock-alerts-section h3 {
    margin-bottom: 16px;
    color: var(--dark);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--light);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--warning);
}

.alert-info {
    flex: 1;
}

.alert-info h4 {
    margin-bottom: 4px;
}

.alert-info p {
    color: var(--gray);
    font-size: 0.85em;
}

.stock-level {
    width: 200px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress {
    height: 100%;
    background: var(--warning);
    border-radius: 4px;
}

.stock-count {
    font-size: 0.85em;
    color: var(--gray);
}

.alert-actions {
    display: flex;
    gap: 8px;
}

/* Expiry Section */
.expiry-section {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.expiry-section h3 {
    margin-bottom: 16px;
    color: var(--dark);
}

.expiry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.expiry-card {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 16px;
    border-left: 4px solid var(--primary);
}

.expiry-card h4 {
    margin-bottom: 8px;
}

.expiry-date {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.btn-small {
    margin-top: 12px;
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

/* Customers Page */

.customers-page {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 24px;
    width: 100%;
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1rem;
    z-index: 1;
}

.search-bar input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    transition: var(--transition);
    background: white;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Customers Grid */
.customers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
    width: 100%;
}

@media (max-width: 768px) {
    .customers-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* Customer Card - Compact Design */
.customer-card {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    min-width: 0;
}

.customer-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

/* Customer Avatar - Smaller */
.customer-avatar {
    font-size: 48px;
    color: var(--primary);
    text-align: center;
    margin-bottom: 8px;
    flex-shrink: 0;
    display: inline-block;
}

.customer-avatar i {
    background: rgba(67, 97, 238, 0.1);
    padding: 10px;
    border-radius: 50%;
    transition: var(--transition);
    display: inline-block;
}

.customer-card:hover .customer-avatar i {
    background: var(--primary);
    color: white;
    transform: scale(1.02);
}

/* Customer Name - Centered */
.customer-info {
    width: 100%;
    text-align: center;
    margin-bottom: 12px;
}

.customer-info h4 {
    font-size: 1.1em;
    margin: 0;
    color: var(--dark);
    font-weight: 600;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
    display: inline-block;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
}

.customer-card:hover .customer-info h4 {
    border-bottom-color: var(--primary);
}

/* Contact Details - Compact */
.customer-contact-list {
    width: 100%;
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.customer-contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 8px;
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.customer-contact-item:hover {
    border-color: var(--primary);
    transform: translateX(2px);
}

.customer-contact-item i {
    width: 14px;
    color: var(--primary);
    font-size: 12px;
    flex-shrink: 0;
}

.customer-contact-item span {
    flex: 1;
    color: var(--dark);
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    font-size: 0.85em;
    text-align: left;
}

/* Customer Stats - Compact */
.customer-stats {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    padding: 8px 0;
    margin: 8px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.customer-stats .stat {
    text-align: center;
    flex: 1;
    min-width: 0;
}

.customer-stats .label {
    display: block;
    font-size: 0.7em;
    color: var(--gray);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.customer-stats .value {
    font-weight: 700;
    color: var(--dark);
    font-size: 1em;
}

/* Customer Actions - Compact */
.customer-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.customer-actions .btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 14px;
    flex-shrink: 0;
}

.customer-actions .btn-edit {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.customer-actions .btn-edit:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.customer-actions .btn-delete {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.customer-actions .btn-delete:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-2px);
}

.customer-actions .btn-view {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.customer-actions .btn-view:hover {
    background: var(--success);
    color: white;
    transform: translateY(-2px);
}

/* Empty State */
.customers-grid .empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    background: var(--light);
    border-radius: var(--radius);
    font-style: italic;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .customers-grid {
        grid-template-columns: 1fr;
    }
    
    .customer-card {
        padding: 14px;
    }
    
    .customer-avatar {
        font-size: 44px;
        margin-bottom: 6px;
    }
    
    .customer-avatar i {
        padding: 8px;
    }
    
    .customer-info h4 {
        font-size: 1em;
    }
    
    .customer-contact-item {
        padding: 3px 8px;
    }
    
    .customer-contact-item span {
        font-size: 0.8em;
    }
    
    .customer-stats {
        gap: 10px;
        padding: 6px 0;
    }
    
    .customer-stats .label {
        font-size: 0.65em;
    }
    
    .customer-stats .value {
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .customers-page {
        padding: 16px;
    }
    
    .customer-card {
        padding: 12px;
    }
    
    .customer-avatar {
        font-size: 40px;
        margin-bottom: 4px;
    }
    
    .customer-avatar i {
        padding: 7px;
    }
    
    .customer-info h4 {
        font-size: 0.95em;
        margin-bottom: 8px;
    }
    
    .customer-contact-list {
        margin: 6px 0;
        gap: 4px;
    }
    
    .customer-contact-item {
        padding: 2px 8px;
    }
    
    .customer-contact-item span {
        font-size: 0.75em;
    }
    
    .customer-stats {
        gap: 8px;
        padding: 5px 0;
        margin: 6px 0;
    }
    
    .customer-stats .label {
        font-size: 0.6em;
    }
    
    .customer-stats .value {
        font-size: 0.9em;
    }
    
    .customer-actions {
        gap: 6px;
        margin-top: 2px;
    }
    
    .customer-actions .btn-icon {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* Animation for Cards */
.customer-card {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for cards */
.customer-card:nth-child(1) { animation-delay: 0.05s; }
.customer-card:nth-child(2) { animation-delay: 0.1s; }
.customer-card:nth-child(3) { animation-delay: 0.15s; }
.customer-card:nth-child(4) { animation-delay: 0.2s; }
.customer-card:nth-child(5) { animation-delay: 0.25s; }
.customer-card:nth-child(6) { animation-delay: 0.3s; }

/* Print Styles */
@media print {
    .customers-page {
        padding: 0;
        background: none;
        box-shadow: none;
    }
    
    .search-bar,
    .customer-actions {
        display: none !important;
    }
    
    .customer-card {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
        background: white;
        padding: 10px;
    }
    
    .customers-grid {
        gap: 8px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .customers-page {
        background: #0f172a;
    }
    
    .customer-card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .customer-info h4 {
        color: #f8fafc;
    }
    
    .customer-contact-item {
        background: #0f172a;
        border-color: #334155;
    }
    
    .customer-contact-item span {
        color: #e2e8f0;
    }
    
    .customer-stats {
        border-color: #334155;
    }
    
    .customer-stats .value {
        color: #f8fafc;
    }
    
    .search-bar input {
        background: #1e293b;
        border-color: #334155;
        color: #f8fafc;
    }
}

/* Waitlist Page */
.waitlist-page {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.waitlist-filters {
    margin: 20px 0;
}

.waitlist-filters select {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 200px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-fulfilled {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

/* Prescriptions Page */
.prescriptions-page {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.prescriptions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .prescriptions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.prescription-card {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border);
}

.prescription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.prescription-header h3 {
    font-size: 1.1em;
}

.prescription-body p {
    margin-bottom: 6px;
    color: var(--gray);
    font-size: 0.9em;
}

.prescription-body p strong {
    color: var(--dark);
}

.prescription-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Supplies Page */
.supplies-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.supplies-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.supplies-tabs {
    display: flex;
    gap: 8px;
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.supplies-content {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

/* Reports Page */
.reports-page {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.report-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.period-select {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 150px;
}

.reports-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
}

@media (min-width: 768px) {
    .reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .reports-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.report-card {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.report-icon {
    width: 50px;
    height: 50px;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 16px;
}

.report-card h3 {
    margin-bottom: 8px;
}

.report-card p {
    color: var(--gray);
    font-size: 0.9em;
    margin-bottom: 16px;
}

.report-preview {
    display: flex;
    justify-content: space-between;
}

.report-preview .stat {
    text-align: center;
}

.report-preview .stat span {
    display: block;
    font-size: 0.75em;
    color: var(--gray);
    margin-bottom: 4px;
}

.report-preview .stat strong {
    font-size: 1.2em;
    color: var(--dark);
}

/* History Page */
.history-page {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.history-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.history-filters input,
.history-filters select {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.history-filters input {
    flex: 1;
    min-width: 200px;
}

/* ===== HISTORY PAGE MOBILE RESPONSIVENESS ===== AND*/
/* ===== HISTORY MOBILE GRID STYLES ===== */
.history-mobile-grid {
    display: none; /* Hidden by default, shown on mobile via media query */
    gap: 16px;
    margin-bottom: 24px;
}

.history-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.history-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Ensure proper display on mobile */
@media (max-width: 768px) {
    .history-mobile-grid {
        display: grid !important;
    }
    
    .history-page .table-container-modern {
        display: none;
    }
}

@media (min-width: 769px) {
    .history-mobile-grid {
        display: none !important;
    }
    
    .history-page .table-container-modern {
        display: block;
    }
}

@media (max-width: 768px) {
    /* Hide desktop table on mobile */
    .history-page .table-container-modern {
        display: none;
    }
    
    /* Show mobile grid on mobile */
    .history-page .history-mobile-grid {
        display: grid !important;
    }
}

/* Ensure desktop table shows on desktop */
@media (min-width: 769px) {
    .history-page .history-mobile-grid {
        display: none !important;
    }
}

/* ===== WAITLIST PAGE MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    /* Hide desktop table on mobile */
    .waitlist-page .table-container-modern {
        display: none;
    }
    
    /* Show mobile grid on mobile */
    .waitlist-page .waitlist-mobile-grid {
        display: grid !important;
    }
}

@media (min-width: 769px) {
    .waitlist-page .waitlist-mobile-grid {
        display: none !important;
    }
}
/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-header h2 {
    font-size: 1.2em;
    color: var(--dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: var(--light);
}

.modal-body {
    padding: 20px;
}

/* Form Styles */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95em;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
}

/* Notifications Modal Styles */
.notifications-container {
    max-height: 500px;
    overflow-y: auto;
}

.notification-category {
    margin-bottom: 20px;
}

.notification-category h4 {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-category h4 i {
    font-size: 0.9em;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--light);
    border-left: 3px solid transparent;
}

.notification-item:hover {
    transform: translateX(4px);
    background: white;
    box-shadow: var(--shadow-sm);
}

.notification-item.warning {
    border-left-color: var(--warning);
}

.notification-item.danger {
    border-left-color: var(--danger);
}

.notification-item.info {
    border-left-color: var(--primary);
}

.notification-item i {
    font-size: 20px;
    margin-top: 2px;
}

.notification-item.warning i {
    color: var(--warning);
}

.notification-item.danger i {
    color: var(--danger);
}

.notification-item.info i {
    color: var(--primary);
}

.notification-content {
    flex: 1;
}

.notification-content p {
    margin: 0 0 4px 0;
    color: var(--dark);
}

.notification-content p strong {
    font-weight: 600;
}

.notification-content small {
    font-size: 0.75em;
    color: var(--gray);
}

.notification-time {
    font-size: 0.7em;
    color: var(--gray);
    white-space: nowrap;
    align-self: center;
}

.notification-time.urgent {
    color: var(--danger);
    font-weight: 600;
}

.notification-more {
    padding: 10px;
    text-align: center;
    color: var(--primary);
    font-size: 0.85em;
    cursor: pointer;
    border-top: 1px dashed var(--border);
    margin-top: 8px;
}

.notification-more:hover {
    background: var(--light);
}

.notification-badge {
    padding: 8px 12px;
    background: rgba(239, 71, 111, 0.1);
    border-radius: var(--radius-sm);
    margin-top: 12px;
    text-align: center;
    font-size: 0.85em;
    color: var(--danger);
}

.urgent-badge {
    background: rgba(239, 71, 111, 0.15);
    font-weight: 500;
}

.notification-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85em;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-text:hover {
    background: var(--light);
    text-decoration: underline;
}

.loading-notifications {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

.spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

.empty-notifications {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-notifications i {
    font-size: 48px;
    color: var(--border);
    margin-bottom: 16px;
}

.empty-notifications p {
    margin-bottom: 8px;
    font-size: 1.1em;
    color: var(--dark);
}

.error-notifications {
    text-align: center;
    padding: 40px;
    color: var(--danger);
}

.error-notifications i {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-notifications p {
    margin-bottom: 20px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85em;
}

/* Animation for notifications */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-item {
    animation: slideInRight 0.3s ease;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    background: var(--dark);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideUp 0.3s ease;
    max-width: 400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .toast {
        bottom: 30px;
        right: 30px;
        left: auto;
    }
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
    color: var(--dark);
}

.toast button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
}

.toast button:hover {
    opacity: 1;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.error {
    color: var(--danger);
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--border);
}

.empty-state p {
    font-size: 1.1em;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    font-style: italic;
}

.no-products,
.no-results {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    background: var(--light);
    border-radius: var(--radius-sm);
}

/* Global Search */
.global-search input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 1em;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-category {
    margin-bottom: 20px;
}

.search-category h4 {
    margin-bottom: 10px;
    color: var(--gray);
    font-size: 0.9em;
    text-transform: uppercase;
}

.search-item {
    padding: 12px;
    background: var(--light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.search-item:hover {
    background: var(--primary);
    color: white;
}

.search-item:hover span {
    color: white;
}

/* Transaction Details */
.transaction-details {
    padding: 16px;
}

.transaction-details p {
    margin-bottom: 8px;
}

.transaction-details table {
    width: 100%;
    margin-top: 16px;
}

.transaction-details th {
    background: var(--light);
    padding: 8px;
    text-align: left;
    font-size: 0.85em;
}

.transaction-details td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .mobile-header {
        display: none;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .sidebar {
        left: 0;
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
        padding: 30px;
    }
    
    .close-sidebar {
        display: none;
    }
}

@media (max-width: 767px) {
    .main-header {
        display: none !important;
    }
}

/* Print Styles */
@media print {
    .mobile-header,
    .sidebar,
    .bottom-nav,
    .btn-process,
    .action-buttons {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .cart-panel {
        box-shadow: none; 
    }
}

/* ===== LOGIN PAGE STYLES ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../assets/images/background_1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: 'Inter', sans-serif;
}

.login-box {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary);
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--gray);
    font-size: 0.95em;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.95em;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1em;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.login-form input::placeholder {
    color: var(--gray);
    opacity: 0.5;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9em;
    transition: var(--transition);
}

.login-footer a:hover {
    text-decoration: underline;
    color: var(--secondary);
}

/* Login loading state */
.login-loading {
    display: none;
    text-align: center;
    margin-top: 15px;
}

.login-loading.active {
    display: block;
}

.login-spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

.login-error {
    color: var(--danger);
    text-align: center;
    margin-top: 10px;
    font-size: 0.9em;
    padding: 10px;
    background: rgba(239, 71, 111, 0.1);
    border-radius: var(--radius-sm);
    display: none;
}

.login-error.active {
    display: block;
}

/* Demo credentials (optional) */
.login-demo {
    margin-top: 20px;
    padding: 15px;
    background: var(--light);
    border-radius: var(--radius-sm);
    text-align: center;
}

.login-demo p {
    color: var(--gray);
    font-size: 0.85em;
    margin-bottom: 5px;
}

.login-demo .demo-credentials {
    font-family: monospace;
    background: white;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* Responsive login */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 1.8em;
    }
    
    .login-header p {
        font-size: 0.9em;
    }
    
    .login-form input {
        padding: 10px 12px;
    }
    
    .btn-login {
        padding: 12px;
        font-size: 1em;
    }
}

/* Animation keyframes (if not already defined) */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== USERS MANAGEMENT ===== */
.users-page {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.users-header h2 {
    font-size: 1.4em;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.users-header h2 i {
    color: var(--primary);
}

.users-header .btn-primary {
    padding: 10px 18px;
    font-size: 0.95em;
    white-space: nowrap;
}

/* Users Stats - Fixed Grid */
.users-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .users-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .users-stats {
        grid-template-columns: 1fr;
    }
}

.user-stat-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    width: 100%;
    min-width: 0; /* Prevents flex overflow */
}

.user-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.user-stat-info {
    flex: 1;
    min-width: 0; /* Prevents text overflow */
}

.user-stat-info h4 {
    font-size: 0.8em;
    color: var(--gray);
    margin-bottom: 4px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-stat-info p {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Users Filters - Fixed */
.users-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.users-filters .search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.users-filters .search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 0.9em;
}

.users-filters .search-box input {
    width: 100%;
    padding: 10px 10px 10px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    height: 42px;
}

.users-filters select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    min-width: 130px;
    font-size: 0.95em;
    color: var(--dark);
    cursor: pointer;
    height: 42px;
}

@media (max-width: 768px) {
    .users-filters {
        flex-direction: column;
    }
    
    .users-filters .search-box {
        width: 100%;
    }
    
    .users-filters select {
        width: 100%;
    }
}

/* Users Grid - FIXED CARD GRID */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

@media (max-width: 768px) {
    .users-grid {
        grid-template-columns: 1fr;
    }
}

/* User Card - FIXED OVERFLOW ISSUES */
.user-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0; /* Critical: prevents flex overflow */
    overflow: hidden; /* Prevents content from spilling out */
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.user-card.admin {
    border-top: 4px solid var(--primary);
}

.user-card.pharmacist {
    border-top: 4px solid var(--success);
}

.user-card.cashier {
    border-top: 4px solid var(--warning);
}

/* User Avatar - Fixed */
.user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
    flex-shrink: 0;
    align-self: center; /* Center avatar */
}

.user-info {
    flex: 1;
    min-width: 0; /* Prevents text overflow */
    width: 100%;
}

.user-info h3 {
    font-size: 1.3em;
    margin-bottom: 4px;
    color: var(--dark);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .user-role {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: capitalize;
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* User Details - FIXED */
.user-details {
    margin: 16px 0;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.user-details p {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray);
    font-size: 0.95em;
    margin-bottom: 10px;
    min-width: 0; /* Prevents overflow */
    width: 100%;
}

.user-details p:last-child {
    margin-bottom: 0;
}

.user-details p i {
    width: 18px;
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
}

.user-details p strong {
    color: var(--dark);
    font-weight: 500;
    flex-shrink: 0;
}

.user-details p span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* User Status - Fixed */
.user-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px 0;
    background: var(--light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    width: 100%;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.status-indicator.active {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.2);
}

.status-indicator.inactive {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 71, 111, 0.2);
}

.user-status span {
    font-size: 0.9em;
    color: var(--dark);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User Actions - FIXED BUTTON WRAPPING */
.user-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.user-actions button {
    flex: 1 1 calc(50% - 4px); /* Two buttons per row */
    min-width: 0; /* Prevents overflow */
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85em;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.user-actions button i {
    font-size: 14px;
    flex-shrink: 0;
}

/* Specific button styles */
.btn-edit {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.btn-edit:hover {
    background: var(--primary);
    color: white;
}

.btn-reset-password {
    background: rgba(255, 209, 102, 0.1);
    color: #b85e00;
}

.btn-reset-password:hover {
    background: var(--warning);
    color: white;
}

.btn-toggle-status {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.btn-toggle-status.inactive {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.btn-toggle-status:hover {
    background: var(--success);
    color: white;
}

.btn-toggle-status.inactive:hover {
    background: var(--danger);
    color: white;
}

.btn-delete {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.btn-delete:hover {
    background: var(--danger);
    color: white;
}

/* Responsive button layouts */
@media (max-width: 480px) {
    .user-actions button {
        flex: 1 1 100%; /* Full width on mobile */
    }
    
    .user-actions {
        flex-direction: column;
    }
}

/* User Modal Specific Styles - Fixed */
.user-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .form-group.full-width {
        grid-column: span 1;
    }
}

.permissions-group {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 8px;
}

.permissions-group h4 {
    margin-bottom: 12px;
    color: var(--dark);
    font-size: 1em;
    font-weight: 600;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.permission-item:last-child {
    margin-bottom: 0;
}

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.permission-item label {
    flex: 1;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark);
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty State */
.users-grid .empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--gray);
    background: var(--light);
    border-radius: var(--radius);
    font-style: italic;
}

/* Loading State */
.users-grid .loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

/* Error State */
.users-grid .error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--danger);
    background: rgba(239, 71, 111, 0.1);
    border-radius: var(--radius);
}

/* Responsive typography */
@media (max-width: 768px) {
    .user-info h3 {
        font-size: 1.2em;
    }
    
    .user-details p {
        font-size: 0.9em;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .users-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .users-header .btn-primary {
        width: 100%;
    }
    
    .user-card {
        padding: 16px;
    }
    
    .user-details p {
        flex-wrap: wrap;
    }
    
    .user-details p strong {
        min-width: 80px;
    }
}

/* Animation */
.user-card {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    .users-filters,
    .user-actions {
        display: none !important;
    }
    
    .user-card {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ===== HEADER USER PROFILE & DROPDOWN ===== */
.user-profile-header {
    position: relative;
    width: 100%;
}

.user-info-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
    z-index: 1001;
}

.user-info-header:hover {
    background: var(--light);
}

.user-details-header {
    text-align: right;
    line-height: 1.3;
}

.user-name-header {
    display: block;
    font-weight: 700;
    color: var(--dark);
    font-size: 1rem;
}

.user-role-header {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: capitalize;
    background: var(--light);
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 2px;
}

.user-role-header.admin {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.user-role-header.pharmacist {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.user-role-header.cashier {
    background: rgba(255, 209, 102, 0.1);
    color: #b85e00;
}

.user-role-header.guest {
    background-color: #6c757d;
    color: white;
}

.user-avatar-header {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.2);
    border: 2px solid white;
    transition: var(--transition);
}

.user-avatar-header:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.3);
}

.avatar-initials {
    text-transform: uppercase;
}

/* Dropdown menu - FIXED */
.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    min-width: 240px;
    z-index: 9999;
    display: none;
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Show dropdown on hover */
.user-profile-header:hover .user-dropdown-menu {
    display: block !important;
}

/* Dropdown arrow */
.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.05));
}

.user-dropdown-menu ul {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.user-dropdown-menu ul li {
    padding: 0;
    margin: 0;
}

.user-dropdown-menu ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.user-dropdown-menu ul li a i {
    width: 20px;
    color: var(--gray);
    font-size: 1rem;
}

.user-dropdown-menu ul li a:hover {
    background: var(--light);
    color: var(--primary);
}

.user-dropdown-menu ul li a:hover i {
    color: var(--primary);
}

.user-dropdown-menu ul li.divider {
    border-top: 1px solid var(--border);
    margin: 8px 0;
    padding: 0;
}

/* Ensure header has proper positioning */
.main-header {
    position: relative;
    z-index: 1000;
    background: white;
}

.header-right {
    position: relative;
    z-index: 1001;
}

/* Make the entire header area clickable */
.user-info-header {
    cursor: pointer;
}

/* For debugging - add a background to see the dropdown area */
.user-profile-header {
    position: relative;
}

/* User Permissions */
.user-permissions {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.user-permissions strong {
    font-size: 12px;
    color: #6c757d;
    display: block;
    margin-bottom: 8px;
}

.permissions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.permission-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

.permission-badge.none {
    background: #f8f9fa;
    color: #6c757d;
}

/* Permissions Grid in Modal */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.permission-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.permission-item label {
    font-size: 13px;
    cursor: pointer;
    color: #495057;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-dropdown-menu {
        position: fixed;
        top: 70px;
        right: 10px;
        min-width: 200px;
    }
}

/* ===== DASHBOARD PRODUCTION STYLES ===== */

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    padding: 24px 30px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: var(--shadow);
}

.welcome-content h2 {
    font-size: 1.8em;
    margin-bottom: 8px;
    font-weight: 600;
}

.welcome-content p {
    opacity: 0.9;
    font-size: 1.1em;
}

.date-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.date-badge i {
    margin-right: 8px;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.kpi-card.primary::before { background: var(--primary); }
.kpi-card.success::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before { background: var(--danger); }
.kpi-card.info::before { background: #00b4d8; }
.kpi-card.purple::before { background: var(--secondary); }

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.kpi-card.primary .kpi-icon {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.kpi-card.success .kpi-icon {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.kpi-card.warning .kpi-icon {
    background: rgba(255, 209, 102, 0.1);
    color: #b85e00;
}

.kpi-card.danger .kpi-icon {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.kpi-card.info .kpi-icon {
    background: rgba(0, 180, 216, 0.1);
    color: #00b4d8;
}

.kpi-card.purple .kpi-icon {
    background: rgba(114, 9, 183, 0.1);
    color: var(--secondary);
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    display: block;
    color: var(--gray);
    font-size: 0.85em;
    margin-bottom: 4px;
}

.kpi-value {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.kpi-trend {
    font-size: 0.8em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kpi-trend.positive {
    color: var(--success);
}

.kpi-trend.negative {
    color: var(--danger);
}

.kpi-trend.neutral {
    color: var(--gray);
}

.kpi-subtext {
    font-size: 0.8em;
    color: var(--gray);
}

.kpi-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--warning);
    color: var(--dark);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: 600;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Chart Card Styles */
.chart-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.chart-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-header h3 {
    font-size: 1.3em;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header h3 i {
    color: var(--primary);
    font-size: 1.2em;
}

.chart-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chart-period {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--dark);
    font-size: 0.9em;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.chart-period:hover {
    border-color: var(--primary);
    background: var(--light);
}

.chart-period:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(180deg);
}

/* Ensure canvas renders properly */
.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Larger Chart Container */
.chart-container {
    height: 350px;
    width: 100%;
    position: relative;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .chart-container {
        height: 280px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 240px;
    }
}

/* Chart Tooltip (optional) */
.chart-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    font-family: 'Inter', monospace;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.chart-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.8);
}

/* Top Products List */
.top-products-list {
    max-height: 250px;
    overflow-y: auto;
}

.top-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.top-product-item:hover {
    background: var(--light);
}

.product-rank {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: 600;
}

.product-info-mini {
    flex: 1;
}

.product-info-mini h4 {
    font-size: 0.95em;
    margin-bottom: 2px;
}

.product-info-mini .product-category {
    font-size: 0.8em;
    color: var(--gray);
}

.product-stats {
    text-align: right;
    margin-right: 12px;
}

.product-sold {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
}

.product-revenue {
    font-size: 0.8em;
    color: var(--gray);
}

.product-progress {
    width: 60px;
}

/* Modern Transactions Table */
.transactions-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h3 {
    font-size: 1.2em;
    color: var(--dark);
}

.header-left h3 i {
    color: var(--primary);
    margin-right: 8px;
}

.transaction-count {
    background: var(--light);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    color: var(--gray);
}

.search-mini {
    position: relative;
    display: inline-block;
}

.search-mini i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 0.9em;
}

.search-mini input {
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 200px;
    font-size: 0.9em;
}

.search-mini input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Modern Table */
.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--light);
    color: var(--gray);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95em;
}

.transaction-row {
    cursor: pointer;
    transition: var(--transition);
}

.transaction-row:hover {
    background: var(--light);
}

.transaction-id {
    font-weight: 600;
    color: var(--primary);
    font-family: monospace;
}

.customer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-avatar-mini {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: 600;
}

.customer-name {
    font-weight: 500;
}

.date-time {
    display: flex;
    flex-direction: column;
}

.date-time .date {
    font-weight: 500;
    font-size: 0.95em;
}

.date-time .time {
    font-size: 0.85em;
    color: var(--gray);
}

.date-time .time.today {
    color: var(--success);
}

.date-time .time i {
    font-size: 0.7em;
    margin-right: 2px;
}

.item-count {
    background: var(--light);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
}

.amount {
    font-weight: 700;
    color: var(--dark);
}

.payment-method {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.payment-cash {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.payment-card {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.payment-mobile {
    background: rgba(114, 9, 183, 0.1);
    color: var(--secondary);
}

/* Mobile Transaction Cards */
.transactions-mobile-grid {
    display: none;
}

@media (max-width: 768px) {
    .transactions-table-container {
        display: none;
    }
    
    .transactions-mobile-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .transaction-card {
        background: var(--light);
        border-radius: var(--radius-sm);
        padding: 16px;
        cursor: pointer;
        transition: var(--transition);
    }
    
    .transaction-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }
    
    .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }
    
    .card-body {
        margin-bottom: 12px;
    }
    
    .card-body > div {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 8px;
        color: var(--gray);
        font-size: 0.9em;
    }
    
    .card-body i {
        width: 16px;
        color: var(--primary);
    }
    
    .card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }
}

/* Quick Actions Row */
.quick-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .quick-actions-row {
        grid-template-columns: 1fr;
    }
}

.quick-actions-card,
.alerts-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.quick-actions-card h3,
.alerts-card h3 {
    font-size: 1.2em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-actions-card h3 i {
    color: var(--warning);
}

.alerts-card h3 i {
    color: var(--danger);
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary);
}

.action-btn i {
    font-size: 24px;
}

.action-btn span {
    font-size: 0.85em;
    font-weight: 500;
}

/* Alerts List */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.alert-item:hover {
    transform: translateX(4px);
}

.alert-item.warning {
    background: rgba(255, 209, 102, 0.1);
    border-left: 4px solid var(--warning);
}

.alert-item.danger {
    background: rgba(239, 71, 111, 0.1);
    border-left: 4px solid var(--danger);
}

.alert-item.info {
    background: rgba(67, 97, 238, 0.1);
    border-left: 4px solid var(--primary);
}

.alert-item.success {
    background: rgba(6, 214, 160, 0.1);
    border-left: 4px solid var(--success);
}

.alert-item i {
    font-size: 24px;
}

.alert-item.warning i { color: var(--warning); }
.alert-item.danger i { color: var(--danger); }
.alert-item.info i { color: var(--primary); }
.alert-item.success i { color: var(--success); }

.alert-content {
    flex: 1;
}

.alert-content p {
    margin: 0;
    font-size: 0.95em;
}

.alert-content p:first-child {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-content small {
    color: var(--gray);
}

.alert-action {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.alert-action i {
    font-size: 12px;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.error-state i {
    font-size: 48px;
    color: var(--danger);
    margin-bottom: 16px;
}

.error-state h3 {
    margin-bottom: 8px;
    color: var(--dark);
}

.error-state p {
    color: var(--gray);
    margin-bottom: 20px;
}

/* Empty States */
.empty-state td {
    text-align: center;
    padding: 40px !important;
    color: var(--gray);
}

.empty-state i {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--border);
}

.empty-state-mobile {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    background: var(--light);
    border-radius: var(--radius-sm);
}

.empty-state-mobile i {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--border);
}

.empty-message {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-style: italic;
}

/* ===== PRODUCTION-LEVEL WAITLIST & HISTORY STYLES ===== */

/* Modern Page Header */
.modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.modern-header h2 {
    font-size: 1.5em;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modern-header h2 i {
    color: var(--primary);
    font-size: 1.3em;
}

.header-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    background: var(--light);
    color: var(--gray);
}

.stat-badge.total {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.stat-badge.pending {
    background: rgba(255, 209, 102, 0.1);
    color: #b85e00;
}

.stat-badge.urgent {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.stat-badge.time {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.stat-badge.revenue {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.stat-badge.purchase {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.stat-badge.return {
    background: rgba(255, 209, 102, 0.1);
    color: #b85e00;
}

.stat-badge i {
    font-size: 0.9em;
}

/* Modern Filters */
.waitlist-filters-modern,
.history-filters-modern {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.search-box-large {
    position: relative;
    margin-bottom: 16px;
}

.search-box-large i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1rem;
}

.search-box-large input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.search-box-large input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-select-modern {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--dark);
    font-size: 0.95em;
    cursor: pointer;
    min-width: 150px;
    transition: var(--transition);
}

.filter-select-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.filter-actions {
    display: flex;
    gap: 8px;
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.date-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

/* Modern Table Container */
.table-container-modern {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    margin-bottom: 24px;
}

/* Waitlist Table Specific Styles */
.waitlist-table th {
    white-space: nowrap;
}

.waitlist-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.waitlist-table th.sortable:hover {
    background: var(--border);
}

.waitlist-id {
    font-weight: 600;
    color: var(--primary);
    font-family: monospace;
}

.customer-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-avatar-small {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: 600;
    flex-shrink: 0;
}

.customer-info-small {
    display: flex;
    flex-direction: column;
}

.customer-info-small .customer-name {
    font-weight: 600;
    color: var(--dark);
}

.customer-info-small .customer-phone {
    font-size: 0.8em;
    color: var(--gray);
}

.product-cell {
    display: flex;
    flex-direction: column;
}

.product-cell .product-name {
    font-weight: 500;
    color: var(--dark);
}

.product-cell .product-category {
    font-size: 0.8em;
    color: var(--gray);
}

.product-details-mini {
    display: flex;
    gap: 4px;
}

.product-notes {
    cursor: help;
    opacity: 0.7;
    transition: var(--transition);
}

.product-notes:hover {
    opacity: 1;
}

.rx-badge {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 600;
}

.quantity-badge {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Priority Badges */
.priority-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: capitalize;
}

.priority-urgent {
    background: rgba(239, 71, 111, 0.15);
    color: var(--danger);
}

.priority-normal {
    background: rgba(255, 209, 102, 0.15);
    color: #b85e00;
}

.priority-low {
    background: rgba(6, 214, 160, 0.15);
    color: var(--success);
}

/* Date Cells */
.date-cell {
    display: flex;
    flex-direction: column;
}

.date-cell .date {
    font-weight: 500;
    color: var(--dark);
}

.date-cell .time {
    font-size: 0.8em;
    color: var(--gray);
}

.date-cell .days-waiting {
    font-size: 0.8em;
    margin-top: 2px;
}

.date-cell .days-waiting.long-wait {
    color: var(--danger);
    font-weight: 600;
}

.est-fulfillment {
    display: flex;
    align-items: center;
    gap: 6px;
}

.est-fulfillment .est-date {
    font-size: 0.9em;
    color: var(--gray);
}

.est-fulfillment i {
    color: var(--success);
    font-size: 0.9em;
}

/* Modern Status Badges */
.status-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge-modern i {
    font-size: 0.9em;
}

.status-badge-modern.status-pending {
    background: rgba(255, 209, 102, 0.15);
    color: #b85e00;
}

.status-badge-modern.status-fulfilled {
    background: rgba(6, 214, 160, 0.15);
    color: var(--success);
}

.status-badge-modern.status-completed {
    background: rgba(6, 214, 160, 0.15);
    color: var(--success);
}

.status-badge-modern.status-cancelled {
    background: rgba(239, 71, 111, 0.15);
    color: var(--danger);
}

/* Modern Action Buttons */
.action-buttons-modern {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    background: transparent;
}

.btn-action i {
    font-size: 1rem;
}

.btn-action.success {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.btn-action.success:hover {
    background: var(--success);
    color: white;
    transform: translateY(-2px);
}

.btn-action.info {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.btn-action.info:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-action.warning {
    background: rgba(255, 209, 102, 0.1);
    color: #b85e00;
}

.btn-action.warning:hover {
    background: var(--warning);
    color: white;
    transform: translateY(-2px);
}

.btn-action.danger {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.btn-action.danger:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-2px);
}

/* History Table Specific Styles */
.history-table .type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.type-sale {
    background: rgba(67, 97, 238, 0.15);
    color: var(--primary);
}

.type-badge.type-purchase {
    background: rgba(239, 71, 111, 0.15);
    color: var(--danger);
}

.type-badge.type-return {
    background: rgba(255, 209, 102, 0.15);
    color: #b85e00;
}

.party-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.party-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: 600;
    flex-shrink: 0;
}

.party-info {
    display: flex;
    flex-direction: column;
}

.party-info .party-name {
    font-weight: 600;
    color: var(--dark);
}

.party-info .party-contact {
    font-size: 0.8em;
    color: var(--gray);
}

.items-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.items-preview {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.item-preview {
    background: var(--light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    color: var(--gray);
}

.more-items {
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
}

.amount.positive {
    color: var(--success);
}

.amount.negative {
    color: var(--danger);
}

.payment-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-ref {
    font-size: 0.7em;
    color: var(--gray);
}

/* Waitlist Mobile Cards */
.waitlist-mobile-grid {
    display: none;
}

@media (max-width: 768px) {
    .table-container-modern {
        display: none;
    }
    
    .waitlist-mobile-grid,
    .history-mobile-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .waitlist-card,
    .history-card {
        background: white;
        border-radius: var(--radius);
        padding: 16px;
        box-shadow: var(--shadow-sm);
        transition: var(--transition);
    }
    
    .waitlist-card:hover,
    .history-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }
    
    .waitlist-card .card-header,
    .history-card .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border);
    }
    
    .card-id {
        font-weight: 600;
        color: var(--primary);
        font-family: monospace;
    }
    
    .card-id-type {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .waitlist-card .card-body,
    .history-card .card-body {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .card-customer {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .customer-avatar-medium {
        width: 48px;
        height: 48px;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1em;
        font-weight: 600;
    }
    
    .customer-details {
        display: flex;
        flex-direction: column;
    }
    
    .customer-details .customer-name {
        font-weight: 600;
        color: var(--dark);
        font-size: 1.1em;
    }
    
    .customer-details .customer-phone {
        font-size: 0.85em;
        color: var(--gray);
    }
    
    .card-product {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--light);
        padding: 12px;
        border-radius: var(--radius-sm);
    }
    
    .product-info {
        display: flex;
        flex-direction: column;
    }
    
    .product-info .product-name {
        font-weight: 600;
        color: var(--dark);
    }
    
    .product-info .product-category {
        font-size: 0.8em;
        color: var(--gray);
    }
    
    .card-meta {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        background: var(--light);
        padding: 12px;
        border-radius: var(--radius-sm);
    }
    
    .meta-item {
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--gray);
        font-size: 0.9em;
    }
    
    .meta-item i {
        width: 16px;
        color: var(--primary);
    }
    
    .card-notes {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
        background: rgba(255, 209, 102, 0.1);
        border-radius: var(--radius-sm);
        font-size: 0.9em;
        color: var(--gray);
        border-left: 3px solid var(--warning);
    }
    
    .card-notes i {
        color: var(--warning);
        margin-top: 2px;
    }
    
    .waitlist-card .card-footer,
    .history-card .card-footer {
        display: flex;
        justify-content: flex-end;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }
    
    .card-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .card-actions .btn-action {
        flex: 1;
        min-width: 80px;
    }
    
    /* History Card Specific */
    .card-party {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .party-avatar-large {
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.3em;
        font-weight: 600;
    }
    
    .party-details {
        display: flex;
        flex-direction: column;
    }
    
    .party-details .party-name {
        font-weight: 600;
        color: var(--dark);
        font-size: 1.1em;
    }
    
    .party-details .party-contact {
        font-size: 0.85em;
        color: var(--gray);
    }
    
    .card-datetime,
    .card-items,
    .card-payment {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--gray);
        font-size: 0.95em;
        background: var(--light);
        padding: 8px 12px;
        border-radius: var(--radius-sm);
    }
    
    .card-datetime i,
    .card-items i,
    .card-payment i {
        width: 16px;
        color: var(--primary);
    }
    
    .card-amount {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        background: var(--light);
        border-radius: var(--radius-sm);
    }
    
    .amount-label {
        font-weight: 500;
        color: var(--gray);
    }
    
    .card-amount .amount {
        font-size: 1.2em;
        font-weight: 700;
    }
}

/* Modern Pagination */
.pagination-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.page-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    color: var(--dark);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.page-nav:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-nav i {
    font-size: 0.9em;
}

.page-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.page-number:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
}

.page-number.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-dots {
    color: var(--gray);
    padding: 0 4px;
}

.page-info {
    color: var(--gray);
    font-size: 0.95em;
}

/* Waitlist Details Modal */
.waitlist-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.details-section {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.details-section h4 {
    margin-bottom: 12px;
    color: var(--dark);
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.details-section h4::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.details-section p {
    margin-bottom: 8px;
    color: var(--gray);
    font-size: 0.95em;
}

.details-section p strong {
    color: var(--dark);
    min-width: 100px;
    display: inline-block;
}

.details-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.details-actions button {
    flex: 1;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .filter-group {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-select-modern {
        width: 100%;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .modern-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-stats {
        width: 100%;
        flex-direction: column;
    }
    
    .stat-badge {
        width: 100%;
        justify-content: center;
    }
    
    .pagination-modern {
        flex-direction: column;
        gap: 16px;
    }
    
    .page-numbers {
        order: -1;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .btn-action {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .waitlist-filters-modern,
    .history-filters-modern,
    .action-buttons-modern,
    .pagination-modern,
    .btn-action {
        display: none !important;
    }
    
    .modern-table {
        font-size: 10pt;
    }
    
    .modern-table th {
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    .waitlist-card,
    .history-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Modern Reports Container */
.reports-page.modern-reports {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--light);
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Modern Page Header */
.modern-header {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.header-left h2 {
    font-size: 1.5em;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.header-left h2 i {
    color: var(--primary);
    font-size: 1.2em;
}

.header-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    background: var(--light);
    color: var(--gray);
    white-space: nowrap;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-select-modern {
    padding: 8px 16px;
    padding-right: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--dark);
    font-size: 0.9em;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.btn-primary, .btn-secondary {
    padding: 8px 16px;
    font-size: 0.9em;
    white-space: nowrap;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--gray);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Custom Date Range */
.custom-date-range {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input-group label {
    color: var(--gray);
    font-size: 0.85em;
}

.date-input {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

/* ===== FIXED KPI CARDS - NOW FIT PROPERLY ===== */
.reports-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
}

@media (max-width: 1200px) {
    .reports-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .reports-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card-modern {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    width: 100%;
    min-width: 0; /* Prevents flex overflow */
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
    min-width: 0; /* Prevents text overflow */
}

.kpi-label {
    display: block;
    color: var(--gray);
    font-size: 0.8em;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-trend {
    font-size: 0.75em;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

/* ===== FIXED CHARTS GRID - NOW FITS PROPERLY ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card-modern {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    min-width: 0; /* Prevents overflow */
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-header h3 {
    font-size: 1.1em;
    color: var(--dark);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-actions {
    display: flex;
    gap: 4px;
    background: var(--light);
    padding: 2px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.chart-btn {
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: var(--gray);
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.chart-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.chart-container {
    height: 250px;
    width: 100%;
    position: relative;
}

/* ===== FIXED REPORTS GRID - NOW FITS PROPERLY ===== */
.reports-grid-modern {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

@media (max-width: 1200px) {
    .reports-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .reports-grid-modern {
        grid-template-columns: 1fr;
    }
}

.report-card-modern {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    min-width: 0; /* Prevents overflow */
    display: flex;
    flex-direction: column;
}

.report-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
}

.report-card-header .report-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.report-card-header h3 {
    font-size: 1.1em;
    color: var(--dark);
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-badge {
    padding: 3px 8px;
    border-radius: 16px;
    font-size: 0.65em;
    font-weight: 600;
    background: var(--light);
    color: var(--gray);
    white-space: nowrap;
    flex-shrink: 0;
}

.report-badge.warning {
    background: rgba(255, 209, 102, 0.2);
    color: #b85e00;
}

.report-badge.success {
    background: rgba(6, 214, 160, 0.2);
    color: var(--success);
}

.report-badge.danger {
    background: rgba(239, 71, 111, 0.2);
    color: var(--danger);
}

.report-badge.info {
    background: rgba(67, 97, 238, 0.2);
    color: var(--primary);
}

.report-card-body {
    margin-bottom: 12px;
    flex: 1;
}

/* Fixed Report Stats Grid */
.report-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: var(--light);
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    min-width: 0; /* Prevents overflow */
}

.stat-row span {
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 4px;
}

.stat-row strong {
    color: var(--dark);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-row.highlight {
    background: rgba(67, 97, 238, 0.1);
}

.stat-row.highlight strong {
    color: var(--primary);
}

/* Progress Stack - Fixed */
.progress-stack {
    padding: 10px;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.progress-item {
    margin-bottom: 6px;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-item span {
    display: block;
    font-size: 0.8em;
    color: var(--gray);
    margin-bottom: 2px;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
}

/* Expiry Timeline - Fixed */
.expiry-timeline {
    padding: 10px;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.timeline-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
}

.bar-label {
    min-width: 50px;
    font-size: 0.8em;
    color: var(--gray);
    white-space: nowrap;
}

.bar-container {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: 3px;
}

.bar-danger { background: var(--danger); }
.bar-warning { background: var(--warning); }
.bar-info { background: #00b4d8; }
.bar-success { background: var(--success); }

.bar-value {
    min-width: 30px;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--dark);
    text-align: right;
    white-space: nowrap;
}

/* Report Card Footer */
.report-card-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.view-details {
    color: var(--primary);
    font-size: 0.85em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== FIXED DATA TABLES ===== */
.data-table-modern {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    overflow-x: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-header h3 {
    font-size: 1.1em;
    color: var(--dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-header h3 i {
    color: var(--primary);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Modern Table - Fixed */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Ensures table doesn't break on mobile */
}

.modern-table th {
    padding: 12px;
    text-align: left;
    background: var(--light);
    color: var(--gray);
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.modern-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--dark);
    font-size: 0.9em;
    white-space: nowrap;
}

.modern-table tbody tr:hover {
    background: var(--light);
}

/* Product Cell */
.product-cell {
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
}

.product-sku {
    font-size: 0.75em;
    color: var(--gray);
}

/* Trend Indicator */
.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.trend-indicator.positive {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.trend-indicator.negative {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

/* Payment Badge */
.payment-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.payment-badge.cash {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.payment-badge.card {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

/* Mini Chart */
.mini-chart {
    width: 100%;
    height: 40px;
    margin-top: 8px;
}

/* ===== RESPONSIVE FIXES ===== */
@media (max-width: 1024px) {
    .reports-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .modern-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-left {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-stats {
        width: 100%;
    }
    
    .stat-badge {
        width: 100%;
        justify-content: center;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .period-select-modern,
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    .btn-icon {
        width: 100%;
    }
    
    .custom-date-range {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-input-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-input {
        width: 100%;
    }
    
    .reports-kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .reports-grid-modern {
        grid-template-columns: 1fr;
    }
    
    .report-stats {
        grid-template-columns: 1fr;
    }
    
    .timeline-bar {
        flex-wrap: wrap;
    }
    
    .bar-label {
        min-width: 100%;
        margin-bottom: 2px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-actions {
        width: 100%;
    }
    
    .chart-btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .modern-header {
        padding: 16px;
    }
    
    .kpi-card-modern {
        padding: 12px;
    }
    
    .kpi-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .kpi-value {
        font-size: 1.3em;
    }
    
    .report-card-modern {
        padding: 12px;
    }
    
    .report-card-header h3 {
        font-size: 1em;
    }
    
    .stat-row {
        font-size: 0.8em;
        padding: 4px 6px;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* Print Styles */
@media print {
    .reports-page.modern-reports {
        background: white;
        padding: 20px;
    }
    
    .header-actions,
    .chart-actions,
    .btn-text,
    .report-badge {
        display: none !important;
    }
    
    .kpi-card-modern,
    .chart-card-modern,
    .report-card-modern,
    .data-table-modern {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* Category Management Styles */
.category-management {
    max-width: 800px;
    margin: 0 auto;
}

.category-actions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box-mini {
    flex: 1;
    max-width: 300px;
    position: relative;
}

.search-box-mini i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box-mini input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.categories-grid {
    display: grid;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 5px;
}

.category-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border: 1px solid #e9ecef;
}

.category-card:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.category-icon {
    width: 40px;
    height: 40px;
    background: #4361ee;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.category-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.category-desc {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.category-stats {
    margin: 0 15px;
    font-size: 12px;
    color: #666;
}

.category-stats i {
    margin-right: 5px;
}

.category-actions {
    display: flex;
    gap: 8px;
}

.category-products-list {
    max-height: 400px;
    overflow-y: auto;
}

.product-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.product-item:hover {
    background: #f5f5f5;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

.product-price {
    font-size: 12px;
    color: #666;
}

.product-stock {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.stock-low {
    background: #fee2e2;
    color: #dc2626;
}

.stock-normal {
    background: #e6f7e6;
    color: #10b981;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ccc;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
}

/* Supplies Management Styles */
.supplies-page {
    padding: 20px;
}

.supplies-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.supplies-stats .stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.supplies-stats .stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.supplies-stats .stat-card .stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.supplies-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.supplies-filters .search-box {
    flex: 1;
    min-width: 200px;
}

.supplies-filters .filter-select,
.supplies-filters .date-filter {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.supplies-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.supplies-table th,
.supplies-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.supplies-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.supplies-table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-pending {
    background: #fff3e0;
    color: #f59e0b;
}

.status-badge.status-shipped {
    background: #e0f2fe;
    color: #3b82f6;
}

.status-badge.status-received {
    background: #e0f2e9;
    color: #10b981;
}

.status-badge.status-cancelled {
    background: #fee2e2;
    color: #ef4444;
}

.supply-form .order-item-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.supply-form .order-item-row select,
.supply-form .order-item-row input {
    flex: 1;
}

.supply-details .details-section {
    margin-bottom: 20px;
}

.supply-details .details-section h4 {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #f0f0f0;
}

.supply-details .items-table {
    width: 100%;
    border-collapse: collapse;
}

.supply-details .items-table th,
.supply-details .items-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.supply-details .items-table th {
    background: #f8f9fa;
    font-weight: 500;
}

.supplier-management .suppliers-list {
    max-height: 500px;
    overflow-y: auto;
}

.supplier-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.supplier-card:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.supplier-info h4 {
    margin: 0 0 8px 0;
    color: #333;
}

.supplier-info p {
    margin: 5px 0;
    font-size: 12px;
    color: #666;
}

.supplier-info p i {
    width: 20px;
    color: #4361ee;
}

.supplier-actions {
    display: flex;
    gap: 8px;
}

.empty-cell, .loading-cell, .error-cell {
    text-align: center;
    padding: 40px !important;
    color: #666;
}

.empty-cell i, .loading-cell i, .error-cell i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

/* ===== MODERN SUPPLIER MANAGEMENT STYLES ===== */

/* Supplier Management Container */
.supplier-management-modern {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.supplier-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 350px;
}

.search-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1rem;
}

.search-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Suppliers Cards Grid */
.suppliers-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    max-height: 600px;
    overflow-y: auto;
    padding: 4px;
}

@media (max-width: 768px) {
    .suppliers-cards-container {
        grid-template-columns: 1fr;
    }
}

/* Supplier Card Modern */
.supplier-card-modern {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    border: 1px solid var(--border);
}

.supplier-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.supplier-card-header {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.supplier-avatar-modern {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

.supplier-title {
    flex: 1;
}

.supplier-title h3 {
    font-size: 1.2rem;
    margin: 0 0 6px 0;
    color: var(--dark);
    font-weight: 600;
}

.contact-person {
    font-size: 0.85rem;
    color: var(--gray);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.contact-person i {
    font-size: 0.8rem;
}

.supplier-status {
    position: absolute;
    top: 20px;
    right: 20px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(6, 214, 160, 0.15);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(239, 71, 111, 0.15);
    color: var(--danger);
}

/* Supplier Card Body */
.supplier-card-body {
    padding: 20px;
}

.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .contact-info-grid {
        grid-template-columns: 1fr;
    }
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.contact-item i {
    width: 20px;
    color: var(--primary);
    font-size: 1rem;
    margin-top: 2px;
}

.contact-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 0.7rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.contact-value {
    font-size: 0.9rem;
    color: var(--dark);
    word-break: break-word;
}

.contact-item.address .contact-value {
    line-height: 1.4;
}

/* Supplier Meta Chips */
.supplier-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.meta-chip {
    background: var(--light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
}

.meta-chip i {
    color: var(--primary);
    font-size: 0.8rem;
}

/* Supplier Notes */
.supplier-notes {
    background: #fff8e7;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: #b85e00;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-left: 3px solid var(--warning);
}

.supplier-notes i {
    color: var(--warning);
    margin-top: 2px;
}

/* Card Footer */
.supplier-card-footer {
    padding: 16px 20px;
    background: var(--light);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn-modern {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.action-btn-modern.edit-btn {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.action-btn-modern.edit-btn:hover {
    background: var(--primary);
    color: white;
}

.action-btn-modern.orders-btn {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.action-btn-modern.orders-btn:hover {
    background: var(--success);
    color: white;
}

.action-btn-modern.delete-btn {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.action-btn-modern.delete-btn:hover {
    background: var(--danger);
    color: white;
}

/* Loading & Empty States */
.loading-container {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.spinner-modern {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.error-state-modern {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.error-state-modern i {
    font-size: 48px;
    color: var(--danger);
    margin-bottom: 16px;
}

.error-state-modern h4 {
    margin-bottom: 8px;
    color: var(--dark);
}

.error-state-modern p {
    color: var(--gray);
    margin-bottom: 20px;
}

.btn-retry {
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-retry:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.empty-state-modern {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.empty-state-modern i {
    font-size: 64px;
    color: var(--border);
    margin-bottom: 16px;
}

.empty-state-modern h4 {
    margin-bottom: 8px;
    color: var(--dark);
}

.empty-state-modern p {
    color: var(--gray);
    margin-bottom: 20px;
}

/* Modern Form Styles */
.supplier-form-modern {
    max-width: 700px;
    margin: 0 auto;
}

.modal-form-modern {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: var(--light);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
}

.form-section h4 {
    margin-bottom: 20px;
    color: var(--dark);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.form-section h4 i {
    color: var(--primary);
}

.form-row-modern {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-row-modern:last-child {
    margin-bottom: 0;
}

.form-group-modern {
    display: flex;
    flex-direction: column;
}

.form-group-modern.full-width {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .form-row-modern {
        grid-template-columns: 1fr;
    }
    
    .form-group-modern.full-width {
        grid-column: span 1;
    }
}

.form-group-modern label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 6px;
}

.form-group-modern .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-group-modern input,
.form-group-modern textarea,
.form-group-modern select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group-modern input:focus,
.form-group-modern textarea:focus,
.form-group-modern select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group-modern input[type="url"] {
    font-family: monospace;
}

.form-actions-modern {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

.btn-primary-modern {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary-modern {
    background: white;
    color: var(--gray);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-secondary-modern:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Supplier Orders Modal */
.supplier-orders-list {
    max-height: 500px;
    overflow-y: auto;
}

.supplier-orders-list .order-item {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.supplier-orders-list .order-item:hover {
    background: white;
    border-left-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.order-number {
    font-weight: 600;
    color: var(--primary);
}

.order-details {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 8px;
}

.order-items {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.supplier-card-modern {
    animation: slideInUp 0.3s ease forwards;
}

.supplier-card-modern:nth-child(1) { animation-delay: 0.05s; }
.supplier-card-modern:nth-child(2) { animation-delay: 0.1s; }
.supplier-card-modern:nth-child(3) { animation-delay: 0.15s; }
.supplier-card-modern:nth-child(4) { animation-delay: 0.2s; }
.supplier-card-modern:nth-child(5) { animation-delay: 0.25s; }

/* Scrollbar Styling */
.suppliers-cards-container::-webkit-scrollbar {
    width: 8px;
}

.suppliers-cards-container::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
}

.suppliers-cards-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.suppliers-cards-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Supplier Name with Website Icon */
.supplier-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.supplier-name {
    font-weight: 500;
    color: var(--dark);
}

.supplier-website-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 50%;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.supplier-website-icon:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.supplier-website-icon i {
    font-size: 12px;
}