/* ==================== ROOT VARIABLES ==================== */
:root {
    /* Light Mode Colors */
    --primary: #0088CC;
    --primary-dark: #006BA1;
    --primary-light: #33A3D9;
    
    --success: #10B981;
    --success-light: #D1FAE5;
    
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    
    --info: #3B82F6;
    --info-light: #DBEAFE;
    
    --purple: #8B5CF6;
    --purple-light: #EDE9FE;
    
    --orange: #F97316;
    --orange-light: #FFEDD5;
    
    --teal: #14B8A6;
    --teal-light: #CCFBF1;
    
    --indigo: #6366F1;
    --indigo-light: #E0E7FF;
    
    /* Background */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    
    /* Text */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    
    /* Border */
    --border-color: #E5E7EB;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Font */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary: #0088CC;
    --primary-dark: #33A3D9;
    --primary-light: #006BA1;
    
    --success: #10B981;
    --success-light: #064E3B;
    
    --danger: #EF4444;
    --danger-light: #7F1D1D;
    
    --warning: #F59E0B;
    --warning-light: #78350F;
    
    --info: #3B82F6;
    --info-light: #1E3A8A;
    
    --purple: #8B5CF6;
    --purple-light: #4C1D95;
    
    --orange: #F97316;
    --orange-light: #7C2D12;
    
    --teal: #14B8A6;
    --teal-light: #134E4A;
    
    --indigo: #6366F1;
    --indigo-light: #312E81;
    
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    
    --border-color: #374151;
}

/* ==================== GENERAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    font-family: var(--font-family);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

#app {
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-primary);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Desktop uchun faqat */
@media (min-width: 601px) {
    #app {
        border-radius: 0;
    }
}

/* ==================== LOADING SCREEN ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-screen p {
    margin-top: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== HEADER ==================== */
.header {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    background: var(--bg-primary);
}

.header-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-lg);
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== HEADER BAR ==================== */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-back {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--border-color);
    transform: translateX(-2px);
}

.header-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.header-info svg {
    color: var(--primary);
}

.btn-theme {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-theme:hover {
    background: var(--border-color);
    transform: rotate(15deg);
}

/* ==================== SEARCH BOX ==================== */
.search-box {
    margin: var(--spacing-md);
    position: relative;
}

.search-box svg {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

/* ==================== SHOPS LIST ==================== */
.shops-list {
    padding: 0 var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.shop-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.shop-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.shop-info {
    flex: 1;
}

.shop-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.shop-info p {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.shop-info p svg {
    width: 14px;
    height: 14px;
}

.shop-details {
    flex: 1;
}

.shop-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.shop-address,
.shop-manager {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 2px 0;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-add {
    margin: var(--spacing-md);
    width: calc(100% - 32px);
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    padding: var(--spacing-md);
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-green .stat-icon {
    background: var(--success-light);
    color: var(--success);
}

.stat-blue .stat-icon {
    background: var(--info-light);
    color: var(--info);
}

.stat-red .stat-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-purple .stat-icon {
    background: var(--purple-light);
    color: var(--purple);
}

.stat-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
    white-space: nowrap;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* ==================== SECTIONS ==================== */
.quick-actions,
.modules-section {
    padding: var(--spacing-md);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.action-btn {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.action-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.action-primary:hover {
    background: var(--primary);
    color: white;
}

.action-danger {
    border-color: var(--danger);
    color: var(--danger);
}

.action-danger:hover {
    background: var(--danger);
    color: white;
}

.action-success {
    border-color: var(--success);
    color: var(--success);
}

.action-success:hover {
    background: var(--success);
    color: white;
}

.action-warning {
    border-color: var(--orange);
    color: var(--orange);
}

.action-warning:hover {
    background: var(--orange);
    color: white;
}

.action-btn span {
    font-size: 14px;
    font-weight: 600;
}

/* ==================== MODULES GRID ==================== */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.module-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.module-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.module-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-icon-blue {
    background: var(--info-light);
    color: var(--info);
}

.module-icon-purple {
    background: var(--purple-light);
    color: var(--purple);
}

.module-icon-green {
    background: var(--success-light);
    color: var(--success);
}

.module-icon-orange {
    background: var(--orange-light);
    color: var(--orange);
}

.module-icon-teal {
    background: var(--teal-light);
    color: var(--teal);
}

.module-icon-indigo {
    background: var(--indigo-light);
    color: var(--indigo);
}

.module-icon-gray {
    background: #E5E7EB;
    color: #6B7280;
}

.module-info {
    text-align: center;
}

.module-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.module-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== RESPONSIVE ==================== */
/* 360 × 800px Mobile Screen Optimization */
@media (max-width: 360px) and (max-height: 820px) {
    /* Body and main container */
    body {
        font-size: 13px;
    }

    #app {
        max-width: 360px;
        min-height: 100vh;
    }

    /* Header layout */
    .header {
        padding: 10px;
    }

    .header h1 {
        font-size: 18px;
    }

    .header p {
        font-size: 12px;
    }

    .header svg {
        width: 32px;
        height: 32px;
    }

    /* Navigation and menu */
    .nav-menu,
    .navbar {
        height: auto;
    }

    /* Buttons */
    .btn-small {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Grid layouts */
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }

    /* Module and shop cards */
    .module-card,
    .shop-card {
        min-height: auto;
    }

    /* Stats display */
    .stats-grid {
        gap: 8px;
        padding: 8px;
    }

    .stat-card {
        padding: 10px;
        gap: 8px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: 12px;
    }

    /* Modules grid */
    .modules-grid {
        gap: 8px;
    }

    .module-card {
        padding: 12px;
    }

    .module-icon {
        width: 44px;
        height: 44px;
    }

    .module-info h4 {
        font-size: 13px;
    }

    .module-info p {
        font-size: 11px;
    }

    /* List views */
    .list-item {
        padding: 10px;
        gap: 8px;
    }

    .list-item-title {
        font-size: 13px;
    }

    .list-item-subtitle {
        font-size: 11px;
    }

    /* Tables */
    table {
        font-size: 11px;
    }

    th, td {
        padding: 6px;
    }

    /* Scroll improvements */
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }

    /* Flexibility for content */
    .flex-container {
        flex-wrap: wrap;
    }

    /* Badge and tags */
    .badge,
    .tag {
        padding: 2px 6px;
        font-size: 10px;
    }

    /* Bottom spacing for action buttons */
    .action-buttons {
        gap: 6px;
    }

    .action-buttons .btn {
        flex: 1;
    }
}

@media (max-width: 400px) {
    .stats-grid {
        gap: 8px;
        padding: 8px;
    }

    .stat-card {
        padding: 10px;
        gap: 8px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: 12px;
    }

    .modules-grid {
        gap: 8px;
    }

    .module-card {
        padding: 12px;
    }

    .module-icon {
        width: 44px;
        height: 44px;
    }

    .module-info h4 {
        font-size: 13px;
    }

    .module-info p {
        font-size: 11px;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen {
    animation: fadeIn 0.3s ease;
}

/* ==================== UTILITIES ==================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}


