* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f7fa;
    color: #1a1a2e;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 20px;
}

.login-header .logo i {
    margin-right: 10px;
}

.login-header h2 {
    font-size: 28px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-options {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.checkbox input {
    margin-right: 8px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.error-message {
    margin-top: 16px;
    padding: 12px;
    background-color: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-footer p {
    font-size: 13px;
    color: #999;
}

.admin-layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    font-size: 20px;
    font-weight: 700;
}

.sidebar-header .logo i {
    margin-right: 10px;
    color: #667eea;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background-color: rgba(102, 126, 234, 0.2);
    color: white;
    border-left-color: #667eea;
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: rgba(220, 38, 38, 0.2);
    color: #ef4444;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(220, 38, 38, 0.3);
}

.logout-btn i {
    margin-right: 10px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: white;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.top-bar-left h1 {
    font-size: 22px;
    color: #1a1a2e;
}

.user-info {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.user-info i {
    margin-right: 8px;
    font-size: 24px;
    color: #667eea;
}

.page-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page-content.hidden {
    display: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 20px;
    color: #1a1a2e;
}

.add-btn {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.add-btn:hover {
    transform: translateY(-2px);
}

.add-btn i {
    margin-right: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 20px;
}

.stat-icon.products-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon.orders-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-icon.revenue-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon.customers-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.recent-orders {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.recent-orders h2 {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th,
.orders-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.orders-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 14px;
    color: #666;
}

.orders-table tr:hover {
    background: #f9fafb;
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status.pending {
    background: #fef3c7;
    color: #d97706;
}

.status.processing {
    background: #dbeafe;
    color: #2563eb;
}

.status.completed {
    background: #d1fae5;
    color: #059669;
}

.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-bar input,
.search-bar select {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-bar input {
    flex: 1;
    max-width: 300px;
}

.search-bar input:focus,
.search-bar select:focus {
    outline: none;
    border-color: #667eea;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.product-card-admin {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.product-card-admin:hover {
    transform: translateY(-4px);
}

.product-card-admin .product-image {
    height: 180px;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ddd;
}

.product-card-admin .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-admin .product-info {
    padding: 16px;
}

.product-card-admin .product-info h3 {
    font-size: 16px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.product-card-admin .product-info p {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
}

.product-card-admin .product-info .product-price {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
}

.product-card-admin .product-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.action-btn.view {
    background: #f0f9ff;
    color: #0ea5e9;
}

.action-btn.view:hover {
    background: #e0f2fe;
}

.action-btn.edit {
    background: #fef3c7;
    color: #d97706;
}

.action-btn.edit:hover {
    background: #fde68a;
}

.action-btn.delete {
    background: #fef2f2;
    color: #dc2626;
}

.action-btn.delete:hover {
    background: #fee2e2;
}

.empty-state {
    text-align: center;
    padding: 60px;
}

.empty-state i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
    color: #999;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.chart-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-card h3 {
    font-size: 16px;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.chart-placeholder {
    height: 200px;
    background: #f5f7fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ddd;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.settings-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.settings-card h3 {
    font-size: 16px;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.settings-card .form-group {
    margin-bottom: 16px;
}

.settings-card label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.settings-card input,
.settings-card select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.settings-card input:focus,
.settings-card select:focus {
    outline: none;
    border-color: #667eea;
}

.save-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.save-btn:hover {
    transform: translateY(-2px);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 18px;
    color: #1a1a2e;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.upload-area {
    position: relative;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: #f5f7fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #667eea;
}

.upload-area p {
    font-size: 14px;
    color: #666;
}

.image-preview {
    margin-top: 12px;
}

.image-preview img {
    max-width: 200px;
    border-radius: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #eee;
}

.cancel-btn {
    padding: 10px 24px;
    background: #f5f7fa;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cancel-btn:hover {
    background: #eee;
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
    }
    
    .nav-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom-color: #667eea;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-bar input {
        max-width: 100%;
    }
}