:root {
    --primary-color: #3DA1D2;
    --secondary-color: #4D4D4D;
    --accent-color: #89C4E1;
    --bg-light: #F4F7F6;
    --white: #FFFFFF;
    --text-dark: #333333;
    --text-muted: #777777;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --sidebar-width: 250px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Arial';
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    direction: rtl;
    text-align: right;
}

/* Login Page Styles */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
}

.login-box h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-box p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
    font-size: 1rem;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background-color: #2c8ab8;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.alert {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    text-align: center;
}

.sidebar-header h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.nav-menu {
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #cbd5e0;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item a:hover, .nav-item.active a {
    background-color: rgba(255,255,255,0.1);
    color: var(--white);
    border-right: 4px solid var(--primary-color);
}

.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    padding: 2rem;
    width: calc(100% - var(--sidebar-width));
}

header.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile span {
    font-weight: 600;
}

/* Cards & Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.stat-card .title {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #edf2f7;
}

th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* 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: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 50%;
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        display: none;
    }
    .main-content {
        margin-right: 0;
        width: 100%;
    }
}
