/* Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    min-height: 100vh;
    color: #1e293b;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: relative;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

/* Burger Menu - Always Visible */
.burger {
    display: flex;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    z-index: 1001;
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 0;
    margin-top: -4px;
}

.burger:hover {
    transform: scale(1.1);
}

.burger:active {
    transform: scale(0.95);
}

/* Nav Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 150;
}

.nav-links.active ~ .nav-overlay {
    opacity: 1;
    visibility: visible;
}

.burger div {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Nav Links - Side Drawer */
.nav-links {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 50%, #1d4ed8 100%);
    flex-direction: column;
    width: 280px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    padding-top: 5rem;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    display: flex;
}

.nav-links.active {
    transform: translateX(0%);
}

/* Nav Links Animation */
.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    margin: 8px 16px;
    padding: 14px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    width: calc(100% - 32px);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-links::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa, #f472b6);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Auth Pages */
.auth-wrapper {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #8b5cf6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

.auth-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.auth-header p {
    color: #64748b;
    font-size: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
    text-align: center;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    margin-top: 0.75rem;
    box-shadow: none;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

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

/* Messages */
.error-msg {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.success-msg {
    background: #f0fdf4;
    color: #16a34a;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

/* Switch Link */
.switch-link {
    text-align: center;
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

.switch-link a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.switch-link a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Dashboard Specifics */
.dashboard {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.dashboard h1 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.dashboard-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    color: #1e3a8a;
    font-weight: 700;
}

.dashboard-header p {
    color: #64748b;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Stat Cards */
.stat-card {
    background: white;
    padding: 1.75rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #3b82f6;
    border-radius: 4px 0 0 4px;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.stat-card:nth-child(1)::before { background: linear-gradient(180deg, #10b981, #059669); }
.stat-card:nth-child(2)::before { background: linear-gradient(180deg, #3b82f6, #2563eb); }
.stat-card:nth-child(3)::before { background: linear-gradient(180deg, #8b5cf6, #7c3aed); }
.stat-card:nth-child(4)::before { background: linear-gradient(180deg, #f59e0b, #d97706); }

.stat-card:nth-child(1):hover { border-color: #10b981; }
.stat-card:nth-child(2):hover { border-color: #3b82f6; }
.stat-card:nth-child(3):hover { border-color: #8b5cf6; }
.stat-card:nth-child(4):hover { border-color: #f59e0b; }

.stat-card h3 {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.card {
    background: white;
    padding: 1.75rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.card h3 {
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.card p {
    color: #64748b;
    margin-bottom: 1rem;
}

/* Products Grid */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.page-header h1 {
    color: #1e3a8a;
    font-weight: 700;
    font-size: 1.75rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.product-image {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    margin-bottom: 1rem;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.product-card h3 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.product-card .price {
    color: #059669;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-card .stock {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

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

.orders-table {
    width: 100%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-collapse: collapse;
}

.orders-table th,
.orders-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.orders-table th {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.orders-table tr {
    transition: background 0.2s ease;
}

.orders-table tbody tr:hover {
    background: linear-gradient(90deg, #f0f9ff 0%, #e0f2fe 100%);
}

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

.status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status.paid,
.status.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.status.pending {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.status.partial {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.view {
    animation: fadeIn 0.3s ease;
}

.view.hidden {
    display: none !important;
}

/* View container wrapper */
#app-section > .container > .view:not(#view-dashboard) {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Logo Upload */
.logo-upload {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    border: 2px dashed #bae6fd;
}

.logo-box {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Messages */
.error-msg {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
    border-left: 4px solid #ef4444;
}

.success-msg {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #16a34a;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
    border-left: 4px solid #22c55e;
}

.logo-box {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
    border: 1px solid #ddd;
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h2 {
    color: #1e3a8a;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.close {
    float: right;
    font-size: 1.75rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
    line-height: 1;
}

.close:hover {
    color: #ef4444;
}

/* ==================== MOBILE RESPONSIVE STYLES ==================== */

/* Billing Section */
.billing-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.billing-col {
    flex: 1;
    min-width: 300px;
}

#bill-common-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

#bill-common-products .bill-product-card {
    padding: 0.75rem;
    cursor: pointer;
    min-height: auto;
    text-align: center;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

#bill-common-products .bill-product-card:hover {
    transform: translateY(-2px);
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

#bill-common-products .bill-product-card h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #1e293b;
}

#bill-common-products .bill-product-card span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #059669;
}

/* Responsive Billing Table */
.billing-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.billing-table th, .billing-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.billing-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
}

/* Mobile Optimizations for Billing */
@media screen and (max-width: 768px) {
    .billing-col {
        min-width: 100%;
    }
    
    #bill-common-products {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .billing-table th, .billing-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }

    /* Navbar adjustments */
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .nav-brand {
        font-size: 1.2rem;
    }
    
    .nav-logo {
        height: 32px;
        width: 32px;
    }
    
    /* Container padding */
    .container {
        padding: 1rem;
    }
    
    /* Page header mobile */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        text-align: center;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    /* Hide all tables on mobile */
    .table-responsive {
        display: none !important;
    }
    
    /* Orders cards for mobile */
    .orders-cards {
        display: flex !important;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .order-card {
        background: white;
        border-radius: 16px;
        padding: 1.25rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        border: 1px solid #e2e8f0;
        transition: all 0.3s ease;
    }
    
    .order-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        border-color: #3b82f6;
    }
    
    .order-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid #f1f5f9;
    }
    
    .order-card-id {
        font-weight: 700;
        font-size: 1.1rem;
        color: #1e3a8a;
        background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        padding: 4px 12px;
        border-radius: 8px;
    }
    
    .order-card-body {
        font-size: 0.9rem;
        color: #4b5563;
    }
    
    .order-card-row {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .order-card-label {
        font-weight: 600;
        color: #6b7280;
    }
    
    .order-card-value {
        font-weight: 700;
    }
    
    .order-card-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .order-card-actions button {
        flex: 1;
        padding: 0.75rem;
        font-size: 0.85rem;
        font-weight: 600;
        border-radius: 8px;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 0.5rem 0.75rem;
    }
    
    .orders-table th {
        font-size: 0.75rem;
    }
    
    /* Customer cards for mobile view */
    .customer-cards {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem;
        width: 100%;
        padding: 0 0.5rem;
    }
    
    .customer-card {
        background: white;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border: 1px solid #e5e7eb;
        margin-bottom: 0.5rem;
    }
    
    .customer-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
        border-bottom: 2px solid #f3f4f6;
        padding-bottom: 0.5rem;
    }
    
    .customer-card-name {
        font-weight: 700;
        font-size: 1.1rem;
        color: #1e293b;
    }
    
    .customer-card-body {
        font-size: 0.95rem;
        color: #4b5563;
        line-height: 1.5;
    }
    
    .customer-card-body p {
        margin: 0.5rem 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .customer-card-actions {
        display: flex;
        gap: 0.75rem;
        margin-top: 1rem;
        padding-top: 0.75rem;
        border-top: 1px solid #f3f4f6;
    }
    
    .customer-card-actions button {
        flex: 1;
        padding: 0.75rem;
        font-size: 0.9rem;
        font-weight: 600;
        border-radius: 8px;
    }
    
    /* Expense cards for mobile view */
    .expenses-cards {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem;
        width: 100%;
        padding: 0 0.5rem;
    }
    
    .expense-card {
        background: white;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border: 1px solid #e5e7eb;
        margin-bottom: 0.5rem;
    }
    
    .expense-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
        border-bottom: 2px solid #f3f4f6;
        padding-bottom: 0.5rem;
    }
    
    .expense-card-category {
        font-weight: 700;
        font-size: 1rem;
        color: #1e293b;
    }
    
    .expense-card-amount {
        font-weight: 700;
        font-size: 1.1rem;
        color: #dc2626;
    }
    
    .expense-card-body {
        font-size: 0.95rem;
        color: #4b5563;
    }
    
    .expense-card-row {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .expense-card-label {
        font-weight: 600;
        color: #6b7280;
    }
    
    .expense-card-value {
        font-weight: 500;
        text-align: right;
    }
    
    .expense-card-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 0.75rem;
        border-top: 1px solid #f3f4f6;
    }
    
    .expense-card-actions button {
        flex: 1;
        padding: 0.75rem;
        font-size: 0.9rem;
        font-weight: 600;
        border-radius: 8px;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 1.25rem;
    }
    
    /* Form adjustments */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.625rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Dashboard cards mobile */
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 0.85rem;
    }
    
    .stat-card .value {
        font-size: 1.5rem;
    }
    
    /* Auth section mobile */
    .auth-box {
        padding: 1.5rem;
        width: 95%;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .logo-upload {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    /* Side drawer */
    .nav-links {
        width: 80%;
        max-width: 280px;
    }
    
    /* Toast notification */
    #toast {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
        text-align: center;
    }
}

/* Extra small devices */
@media screen and (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .orders-table {
        min-width: 500px;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .customer-card {
        padding: 0.875rem;
    }
}

/* Hide horizontal scrollbar but keep functionality */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: linear-gradient(90deg, #f0f9ff, #e0f2fe);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

/* Desktop/Mobile visibility classes */
.desktop-only {
    display: block !important;
}

.mobile-only {
    display: none !important;
}

@media screen and (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
        flex-direction: column;
    }
    
    /* Force hide table on mobile */
    .table-responsive.desktop-only {
        display: none !important;
        visibility: hidden;
    }
}