/* Modern CSS stillari */

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

/* CSS Error Handling */
*:not(:defined) {
    display: none;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: auto; /* Gorizontal scroll ruxsat berish */
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    display: flex;
    margin: 0;
    padding: 0;
    overflow-x: auto; /* Gorizontal scroll ruxsat berish */
    min-height: 100vh;
    min-width: 320px; /* Minimal kenglik */
}

/* Kichik ekranlar uchun global optimizatsiya */
@media (max-width: 480px) {
    html, body {
        max-width: 100vw;
        overflow-x: auto; /* Horizontal scroll ruxsat berish */
    }
    
    body {
        min-width: 320px; /* Eng kichik telefon kengligi */
        width: 100%;
    }
}

/* Sidebar Navigation */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    height: calc(100vh - 70px);
    padding: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    left: 0;
    top: 70px;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.sidebar-menu {
    list-style: none;
    padding: 10px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin: 2px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

/* Yuqoridan chiziq animatsiyasi */
.sidebar-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pastdan chiziq animatsiyasi */
.sidebar-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2ecc71, #3498db);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu a:hover {
    background: rgba(52, 73, 94, 0.8);
    color: #ffffff;
    border-left-color: #3498db;
    transform: translateX(5px);
}

.sidebar-menu a:hover::before {
    transform: translateX(0);
}

.sidebar-menu a:hover::after {
    transform: translateX(0);
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3), rgba(255, 255, 255, 0.15));
    color: #ffffff;
    border-left-color: #ffffff;
    font-weight: 600;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Aktiv elementda chiziqlar doimiy ko'rinadi */
.sidebar-menu a.active::before {
    transform: translateX(0);
    background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0.5));
}

.sidebar-menu a.active::after {
    transform: translateX(0);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), #ffffff);
}

/* Aktiv icon animatsiya */
.sidebar-menu a.active .icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(1.25);
    }
}

.sidebar-menu .icon {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Top Header Bar */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, #3498db, #667eea);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-left h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.currency-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.currency-display:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.currency-rate {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: color 0.3s ease;
}

.edit-rate-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.edit-rate-btn:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: background 0.3s ease;
}

.user-info:hover {
    background: rgba(255,255,255,0.15);
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 0.5rem;
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(135, 206, 250, 0.6);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(135, 206, 250, 0.2);
}

.logout-btn:hover {
    background: rgba(135, 206, 250, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(135, 206, 250, 0.3);
}

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

.logout-icon {
    font-size: 1rem;
}

.logout-text {
    font-size: 0.9rem;
}

/* Main Content - Desktop */
.main-content {
    margin-left: 250px;
    margin-top: 70px;
    flex: 1;
    padding: 20px;
    width: calc(100vw - 250px);
    max-width: calc(100vw - 250px);
    min-height: calc(100vh - 70px);
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Desktop uchun minimal kenglik - olib tashlandi layout muammosi tufayli */
@media (min-width: 769px) {
    .main-content {
        /* min-width olib tashlandi - flex layout ishlatadi */
    }
}

/* Header va Navigation (eski navbar o'rniga) */
.content-header {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.content-header h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 5px;
}

.breadcrumb {
    color: #7f8c8d;
    font-size: 14px;
}

/* Container */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Grid */
.product-grid, .store-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.product-card, .store-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.product-card:hover, .store-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #27ae60;
}

.product-price::before {
    content: '$';
    color: #2ecc71;
}

.product-description {
    color: #7f8c8d;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.product-stock {
    background: #ecf0f1;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #2c3e50;
    display: inline-block;
}

/* Formalar */
.form-container {
    max-width: 600px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Tugmalar */
.btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.btn-success:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* Decimal ma'lumotlari */
.decimal-info {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2);
}

.decimal-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.pros, .cons {
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.pros h4, .cons h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.pros ul, .cons ul {
    list-style: none;
    padding: 0;
}

.pros li, .cons li {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.pros li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #2ecc71;
    font-weight: bold;
}

.cons li:before {
    content: "✗";
    position: absolute;
    left: 0;
    color: #e74c3c;
    font-weight: bold;
}

/* USD Currency Styling */
.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #27ae60;
}

.product-price::before {
    content: '$';
    color: #2ecc71;
}

/* Price inputs with USD symbol */
input[name="price"] {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="%23666"><text x="2" y="16" font-family="Arial" font-size="16" fill="%23666">$</text></svg>') no-repeat 10px center;
    padding-left: 35px;
}

/* Currency display classes */
.currency-usd::before {
    content: '$';
    color: #27ae60;
    font-weight: bold;
    margin-right: 2px;
}

.price-display {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.1em;
}

/* Tips grid for add product page */
.tips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.tip-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.tip-item h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.tip-item ul {
    list-style: none;
    padding: 0;
}

.tip-item li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.tip-item li::before {
    content: '•';
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Info grid - 3 columns layout */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3498db;
}

.info-card h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.info-card p {
    margin-bottom: 0.5rem;
    color: #34495e;
}

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .top-header {
        padding: 0 1rem;
    }
    
    .header-right {
        gap: 1rem;
    }
    
    .currency-display {
        padding: 0.4rem 0.8rem;
    }
    
    .currency-rate {
        font-size: 0.9rem;
    }
    
    .main-content {
        margin-left: 200px;
        width: calc(100vw - 200px);
        max-width: calc(100vw - 200px);
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .decimal-pros-cons {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        flex-direction: column;
        overflow-x: auto; /* Gorizontal scroll ta'minlash */
        min-width: 320px; /* Kichikroq minimal kenglik */
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        max-height: 40vh;
        overflow-y: auto;
        overflow-x: auto; /* Sidebar ham scroll qila olsin */
        min-width: 100%; /* Sidebar to'liq kenglik */
    }
    
    .main-content {
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
        min-width: 320px; /* Minimal kenglik telefon uchun */
        overflow-x: auto !important; /* Content scroll qila olsin - kuchliroq */
        -webkit-overflow-scrolling: touch !important; /* iOS uchun smooth scroll */
        padding: 10px; /* Kichik padding */
        box-sizing: border-box;
    }
    
    /* Tablelar uchun gorizontal scroll - cart table uchun emas */
    .table-responsive:not(.cart-table-container) {
        overflow-x: auto;
        width: 100%;
        max-width: 100%;
    }
    
    /* Cart table container uchun alohida qoida - mobile da horizontal scroll */
    .cart-table-container {
        overflow-x: auto !important; /* Horizontal scroll qo'shish */
        overflow-y: visible !important; /* Vertical scroll yo'q */
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    table:not(.cart-table) {
        width: 100%; /* Faqat boshqa jadvallar uchun */
        max-width: 100%;
    }
}

.nav-menu a:hover {
    background-color: #34495e;
}

/* Main content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

/* Products grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.product-card h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 1rem;
}

.description {
    color: #7f8c8d;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.stock {
    color: #e67e22;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    margin-right: 0.5rem;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-warning {
    background: #f39c12;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Info cards */
.decimal-info, .decimal-tips {
    margin-top: 3rem;
}

.info-card, .tips-card {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.info-card h3, .tips-card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-content h4 {
    color: #34495e;
    margin-bottom: 1rem;
}

.info-content ul {
    list-style: none;
}

.info-content li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

/* Total display */
.total-display {
    background-color: #2ecc71;
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 2rem;
    animation: slideIn 0.5s ease-in-out;
}

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

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        text-align: center;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .info-content {
        grid-template-columns: 1fr;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Store specific styles only */
.store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.store-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.store-info {
    margin: 1rem 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

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

.info-label {
    font-weight: 500;
    color: #7f8c8d;
}

.info-value {
    color: #2c3e50;
    font-weight: 600;
}

.store-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-view {
    background-color: #3498db;
    color: white;
}

.btn-view:hover {
    background-color: #2980b9;
}

.btn-edit {
    background-color: #f39c12;
    color: white;
}

.btn-edit:hover {
    background-color: #e67e22;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* CACHE KILLER FOR WAREHOUSE ISSUE - v3.0 FINAL FIX */
/* Warehouse styles are now completely in template CSS */
/* Updated: 2025-09-10 21:31 */

/* Form Action Buttons */
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.submit-btn, .btn-cancel {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    font-weight: 500;
}

.submit-btn {
    background: #27ae60;
    color: white;
    flex: 2; /* ikki barobar kengroq */
}

.submit-btn:hover {
    background: #229954;
    transform: translateY(-2px);
}

.btn-cancel {
    background: #95a5a6;
    color: white;
}

.btn-cancel:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

/* Responsive form actions */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .submit-btn, .btn-cancel {
        width: 100%;
    }
}

/* Ikkinchi qatorlar uchun alohida CSS (faqat 5 ta TD bor) */
.sales-table tr.sale-group-item td:nth-child(1) { min-width: 120px; text-align: center; }  /* Joylashuv */
.sales-table tr.sale-group-item td:nth-child(2) { min-width: 250px; text-align: left; font-size: 14px; font-weight: 500; }    /* Mahsulot */
.sales-table tr.sale-group-item td:nth-child(3) { min-width: 70px; text-align: center; font-weight: 600; }   /* Miqdor */
.sales-table tr.sale-group-item td:nth-child(4) { min-width: 80px; text-align: right; font-weight: 600; }   /* Narx */
.sales-table tr.sale-group-item td:nth-child(5) { min-width: 90px; text-align: right; font-weight: 600; }   /* Yig'indi */

/* ==============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================== */

/* GPU acceleration uchun transform3d ishlatish */
.sidebar,
.mobile-nav-toggle,
.mobile-header,
.sidebar-overlay {
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Smooth scrolling optimization */
.sidebar {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Mobile animation optimizations */
@media (max-width: 768px) {
    .sidebar {
        transition: left 0.25s ease-out;
        will-change: transform;
    }
    
    .mobile-nav-toggle:hover,
    .btn:hover {
        transition: transform 0.2s ease;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==============================================
   MOBILE RESPONSIVE DESIGN
   ============================================== */

/* Desktop da mobile elementlarni yashirish */
@media (min-width: 769px) {
    .mobile-nav-toggle {
        display: none;
    }
    
    .mobile-header {
        display: none;
    }
    
    .sidebar-overlay {
        display: none;
    }
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: none; /* Desktop da yashirish */
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1200;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    width: 60px;
    height: 60px;
    align-items: center;
    justify-content: center;
}

.mobile-nav-toggle:hover {
    background: #34495e;
    transform: scale(1.05);
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.mobile-header h1 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1150;
}
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
}

/* Mobile Styles */
@media (max-width: 768px) {
    
    /* Show mobile navigation elements */
    .mobile-nav-toggle {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1200;
        background: #2c3e50;
        color: white;
        border: none;
        width: 50px;
        height: 50px;
        border-radius: 8px;
        font-size: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        transition: all 0.3s ease;
    }
    
    .mobile-nav-toggle:hover {
        background: #34495e;
        transform: scale(1.05);
    }
    
    .mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        z-index: 1100;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
    
    .mobile-header h1 {
        font-size: 1.6rem;
        margin: 0;
        font-weight: 600;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    }
    
    /* Hide desktop header */
    .header {
        display: none;
    }
    
    /* Adjust body layout for mobile */
    body {
        flex-direction: column;
        padding-top: 70px;
        overflow-x: auto;
    }
    
    /* Mobile sidebar - Compact va user-friendly */
    .sidebar {
        position: fixed;
        left: -260px;
        top: 70px;
        height: calc(100vh - 70px);
        width: 260px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1160;
        background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
    }
    
    .sidebar.active {
        left: 0;
        box-shadow: 4px 0 30px rgba(0,0,0,0.4);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1150;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Mobile sidebar menu - Compact va toza */
    .sidebar-menu {
        padding: 10px 0;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .sidebar-menu li a {
        padding: 15px 20px;
        font-size: 1rem;
        font-weight: 500;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        display: flex;
        align-items: center;
        min-height: 50px;
        transition: all 0.3s ease;
        color: #bdc3c7;
    }
    
    .sidebar-menu li a:hover {
        background: rgba(255,255,255,0.1);
        color: #ecf0f1;
        padding-left: 25px;
    }
    
    .sidebar-menu li a.active {
        background: rgba(52, 152, 219, 0.3);
        color: #fff;
        border-left: 4px solid #3498db;
    }
    
    .sidebar-menu li a i {
        margin-right: 15px;
        font-size: 1.2rem;
        width: 25px;
        text-align: center;
        color: inherit;
    }
    
    /* Main content adjustments */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 10px 5px;
        min-height: calc(100vh - 70px);
        background: #f8f9fa;
    }
    
    /* Dashboard responsive - Mobile optimized */
    .dashboard-container {
        padding: 5px;
    }
    
    .stats-cards {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .card {
        background: white;
        border-radius: 12px;
        padding: 15px 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: 1px solid #e9ecef;
        transition: transform 0.2s ease;
    }
    
    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    }
    
    .card h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
        color: #495057;
        font-weight: 600;
    }
    
    .card .value {
        font-size: 1.8rem;
        font-weight: bold;
        color: #2c3e50;
        margin-bottom: 5px;
    }
    
    .card .label {
        font-size: 0.9rem;
        color: #6c757d;
    }
    
    /* Tables responsive - Card formatga o'tkazish */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        width: 100%;
        max-width: 100%;
        /* Container o'lchami to'liq bo'lsin */
        min-height: 300px;
        background: white;
    }
    
    .sales-table {
        width: 100%;
        max-width: 100%;
        font-size: 1rem;
    }
    
    .sales-table th {
        padding: 15px 10px;
        font-size: 1.1rem;
        font-weight: 600;
        background: #34495e;
        color: white;
    }
    
    .sales-table td {
        padding: 15px 10px;
        font-size: 1rem;
        border-bottom: 2px solid #ecf0f1;
    }
    
    /* Sale items uchun card style */
    .sales-table tr.sale-group-header {
        background: #3498db;
        color: white;
    }
    
    .sales-table tr.sale-group-header td {
        font-weight: bold;
        font-size: 1.1rem;
        padding: 18px 10px;
    }
    
    .sales-table tr.sale-group-item:nth-child(even) {
        background: #f8f9fa;
    }
    
    /* Forms responsive - Katta va oson */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 8px;
        display: block;
        color: #2c3e50;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 18px;
        padding: 15px;
        border-radius: 8px;
        border: 2px solid #ddd;
        min-height: 50px;
        transition: all 0.3s ease;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: #3498db;
        box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
        outline: none;
    }
    
    /* Buttons responsive - Katta va aniq */
    .btn, .submit-btn, .btn-cancel {
        padding: 18px 25px;
        font-size: 1.2rem;
        font-weight: 600;
        min-height: 55px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    .btn:hover, .submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
        margin-top: 30px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Modal responsive - Katta va aniq */
    .modal {
        padding: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 3rem auto;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 15px;
        padding: 25px;
    }
    
    .modal h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
        text-align: center;
        color: #2c3e50;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Mobile Styles - Juda sodda va aniq */
@media (max-width: 480px) {
    /* Global scroll settings */
    * {
        overflow-x: auto !important;
    }
    
    .mobile-header h1 {
        font-size: 1.5rem;
        white-space: nowrap; /* Matnni qirqib tashlashni oldini olish */
    }
    
    .mobile-nav-toggle {
        padding: 12px;
        font-size: 20px;
        width: 50px;
        height: 50px;
        top: 15px;
        left: 15px;
    }
    
    .main-content {
        padding: 15px 10px;
        overflow-x: auto;
        min-width: 480px;
    }
    
    .card {
        padding: 20px 15px;
        margin-bottom: 15px;
        min-width: 300px; /* Card minimal kengligi */
        overflow-x: auto;
    }
    
    .card h3 {
        font-size: 1.2rem;
        white-space: nowrap;
    }
    
    .card .value {
        font-size: 1.8rem;
    }
    
    /* Tablelarni mobile da gorizontal scroll bilan ko'rsatish */
    .sales-table {
        display: table;
        overflow-x: auto;
        white-space: normal;
        width: 100%;
        max-width: 100%;
    }
    
    .sales-table table {
        width: 100%;
        max-width: 100%;
    }
    
    /* Mobile card layout for sales - shu yerda ham scroll */
    .mobile-sales-cards {
        display: block;
        overflow-x: auto;
    }
    
    .mobile-sale-card {
        background: white;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        border-left: 5px solid #3498db;
        min-width: 350px; /* Card minimal kengligi */
        white-space: nowrap;
    }
    
    .mobile-sale-card h4 {
        font-size: 1.1rem;
        color: #2c3e50;
        margin-bottom: 10px;
        font-weight: 600;
    }
    
    .mobile-sale-card .sale-info {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
        font-size: 1rem;
    }
    
    .mobile-sale-card .sale-info .label {
        font-weight: 600;
        color: #7f8c8d;
    }
    
    .mobile-sale-card .sale-info .value {
        font-weight: 500;
        color: #2c3e50;
    }
    
    .mobile-sale-card .total {
        font-size: 1.2rem;
        font-weight: bold;
        color: #27ae60;
        text-align: right;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 2px solid #ecf0f1;
    }
    
    /* Form elementlarini yanada kattalashtirish */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 20px;
        padding: 18px;
        min-height: 55px;
    }
    
    .btn {
        padding: 20px 25px;
        font-size: 1.1rem;
        min-height: 60px;
    }
    
    /* Sidebar menuni yanada kattalashtirish */
    .sidebar-menu li a {
        padding: 25px 30px;
        font-size: 1.3rem;
        min-height: 70px;
    }
    
    .sidebar-menu li a .icon {
        font-size: 1.6rem;
        margin-right: 25px;
    }
}

/* ================================================
   GLOBAL RESPONSIVE TABLE AND HORIZONTAL SCROLL
   Kichik ekranlar uchun gorizontal scroll
   ================================================ */

/* Barcha table-lar uchun gorizontal scroll */
.table-responsive, .table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
}

table:not(.cart-table) {
    min-width: 800px; /* Faqat boshqa jadvallar uchun */
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

/* 480px dan kichik ekranlar uchun global scroll */
@media (max-width: 480px) {
    /* Viewport metani tekshirish uchun */
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Barcha container va wrapper lar uchun */
    .container, .main-content, .content {
        overflow-x: auto;
        min-width: 100%; /* To'liq kenglik */
        width: 100%;
    }
    
    /* Form wrapper */
    .form-container {
        overflow-x: auto;
        min-width: 100%; /* To'liq kenglik */
        width: 100%;
    }
    
    /* Table wrapper - automatic scrolling */
    .table-responsive {
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Button containers */
    .form-actions, .btn-group {
        overflow-x: auto;
        white-space: nowrap;
        min-width: 300px;
    }
}

/* Viewport meta tag uchun CSS hint */
/* HTML head da quyidagicha bo'lishi kerak: */
/* <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> */

/* ================================================
   SPECIFIC PAGES TABLE RESPONSIVE STYLES
   Maxsus sahifalar uchun table responsive stillari
   ================================================ */

/* Sales History, Pending Sales, Products, Customers, Users sahifalari uchun */
.sales-table, .products-table, .customers-table, .users-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* Ustunlar avtomatik o'lchansin */
}

/* Desktop uchun minimal kenglik */
@media (min-width: 769px) {
    .sales-table, .products-table, .customers-table, .users-table {
        min-width: 800px; /* Maqbul desktop minimal kenglik */
    }
}

/* Mobil uchun jadval responsive */
@media (max-width: 768px) {
    .sales-table, .products-table, .customers-table, .users-table {
        min-width: 600px; /* Mobil uchun kichikroq minimal kenglik */
        font-size: 14px; /* Kichikroq font */
    }
    
    .sales-table th, .sales-table td,
    .products-table th, .products-table td,
    .customers-table th, .customers-table td,
    .users-table th, .users-table td {
        padding: 6px 8px; /* Kichikroq padding */
    }
}

/* Desktop da kichik ekranlar uchun maxsus qoidalar */
@media (min-width: 769px) and (max-width: 1600px) {
    .table-responsive .table-container,
    .products-table-container,
    .customers-table-container,
    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .sales-table,
    .customers-table,
    .users-table {
        min-width: 900px; /* Desktop uchun maqbul kenglik */
    }
    
    /* Horizontal scroll hint - o'chirilgan */
    .table-responsive .table-container::before,
    .products-table-container::before,
    .customers-table-container::before,
    .users-table-container::before {
        display: none;
    }
    
    @keyframes scrollHint {
        0%, 100% { opacity: 0.7; }
        50% { opacity: 1; }
    }
}

.sales-table th, .sales-table td,
.products-table th, .products-table td,
.customers-table th, .customers-table td,
.users-table th, .users-table td {
    white-space: nowrap; /* Matnni qirqmaslik */
    padding: 8px 12px;
    border: 1px solid #dee2e6;
}

/* Table container'lar uchun scroll */
.table-container, .products-table-container, .customers-table-container, .users-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

/* 768px dan kichik ekranlar uchun */
@media (max-width: 768px) {
    .sales-table, .products-table, .customers-table, .users-table {
        min-width: 600px; /* Mobile da kichikroq minimal kenglik */
        font-size: 14px; /* Kichikroq shrift */
    }
    
    .sales-table th, .sales-table td,
    .products-table th, .products-table td,
    .customers-table th, .customers-table td,
    .users-table th, .users-table td {
        padding: 6px 8px;
    }
}

/* 480px dan kichik ekranlar uchun */
@media (max-width: 480px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -3px; /* Container padding'ni hisobga olish */
        width: calc(100% + 6px); /* To'liq kenglik */
    }
    
    .sales-table, .products-table, .customers-table, .users-table {
        min-width: 600px; /* Kichik ekranda kichikroq kenglik */
        font-size: 13px;
    }
    
    /* Table header'lar uchun */
    .sales-table th, .products-table th, .customers-table th, .users-table th {
        background-color: #f8f9fa;
        position: sticky;
        top: 0;
        z-index: 10;
        font-weight: 600;
    }
    
    /* Scroll hint - foydalanuvchiga scroll qilish mumkinligini ko'rsatish */
    .table-responsive::after {
        content: "← → Scroll qiling";
        display: block;
        text-align: center;
        font-size: 12px;
        color: #6c757d;
        padding: 5px;
        background: #f8f9fa;
        border-top: 1px solid #dee2e6;
    }
    
    /* Mobile specific optimizations */
    body {
        font-size: 14px;
        line-height: 1.5;
        margin: 0;
        padding: 0;
    }
    
    /* Container va wrapper lar uchun maximal kenglik */
    .container,
    .dashboard-container,
    .products-container,
    .sales-history-page {
        padding-left: 3px;
        padding-right: 3px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .main-content {
        padding: 8px 3px;
        font-size: 14px;
    }
    
    /* Cards ultra compact */
    .card {
        padding: 10px 8px;
        margin-bottom: 6px;
        border-radius: 8px;
    }
    
    .card h3 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    .card .value {
        font-size: 1.4rem;
    }
    
    .card .label {
        font-size: 0.8rem;
    }
    
    /* Mobile sidebar ultra compact */
    .sidebar {
        width: 220px;
        left: -220px;
    }
    
    .sidebar-menu li a {
        padding: 12px 15px;
        font-size: 0.95rem;
        min-height: 45px;
    }
    
    .sidebar-menu li a i {
        margin-right: 12px;
        font-size: 1.1rem;
        width: 20px;
    }
}

/* ================================================
   MOBILE NAVIGATION ANIMATIONS & PERFORMANCE
   ================================================ */

/* CSS Smooth Animations */
@keyframes slideInRight {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.sidebar.active {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.active {
    animation: fadeIn 0.3s ease;
}

/* Performance optimizations */
.sidebar,
.sidebar-overlay,
.mobile-nav-toggle {
    will-change: transform, opacity;
    backface-visibility: hidden;
}
