* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    direction: rtl;
    text-align: right;
}

.admin-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 250px;
    overflow-y: auto;
}

.sidebar h2 {
    margin-bottom: 30px;
    font-size: 20px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 4px;
    cursor: pointer;
    text-align: right;
    transition: background 0.3s;
    font-size: 16px;
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
}

.main-content {
    margin-right: 250px;
    padding: 30px;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    text-align: center;
    border-top: 4px solid #667eea;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-card h3 {
    color: #666;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.stat-value {
    font-size: 42px;
    font-weight: bold;
    color: #667eea;
    margin: 0;
}

.recent-activity {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.recent-activity h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 22px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.activity-log {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px 15px;
    background: #f9f9f9;
    border-right: 4px solid #667eea;
    border-radius: 6px;
    font-size: 14px;
    color: #555;
    transition: background 0.2s;
}

.activity-item:hover {
    background: #f0f0f0;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

/* Tables */
.products-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.products-table thead {
    background: #667eea;
    color: white;
}

.products-table th,
.products-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.products-table tbody tr:hover {
    background: #f9f9f9;
}

.products-table td:last-child {
    border-bottom: 1px solid #eee;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #ddd;
    color: #333;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #ccc;
}

.btn-edit {
    background: #f39c12;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.btn-delete {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
}

.close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-start;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
}

/* Orders */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-right: 4px solid #667eea;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.order-id {
    font-weight: bold;
    color: #333;
}

.order-status {
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
}

.order-customer {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.order-items {
    font-size: 13px;
    color: #999;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.order-item {
    padding: 5px 0;
}

/* Reviews */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-right: 4px solid #f39c12;
}

.review-product {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.review-author {
    color: #666;
}

.review-rating {
    color: #f39c12;
    font-weight: bold;
}

.review-text {
    color: #666;
    line-height: 1.5;
    margin: 10px 0;
}

.review-date {
    color: #999;
    font-size: 12px;
}

/* Settings */
.settings-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.settings-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.settings-group h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.setting-item {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-right: 3px solid #667eea;
}

.setting-item label {
    font-weight: 600;
    color: #333;
}

.setting-item input,
.setting-item textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

.setting-item input:focus,
.setting-item textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.setting-item input[type="color"] {
    width: 80px;
    height: 45px;
    cursor: pointer;
}

.setting-item button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    transition: background 0.2s;
}

.setting-item button:hover {
    background: #764ba2;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .main-content {
        margin-right: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .products-table {
        font-size: 12px;
    }

    .products-table th,
    .products-table td {
        padding: 10px 5px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}
