/* ================================================= */
/* 1. Reset & Base Variables (Unified Color Palette) */
/* ================================================= */
:root {
    --primary-bg: #f8fafc;
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-hover: #334155;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent-blue: #0284c7;
    --success-bg: #d1fae5;
    --success-text: #065f46;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    direction: ltr; /* أو rtl حسب رغبتك */
}

/* ================================================= */
/* 2. Desktop Layout Structure                      */
/* ================================================= */
.sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    background-color: var(--sidebar-bg);
    color: #fff;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar .logo {
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #334155;
    color: #fff;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.sidebar ul li a {
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.sidebar ul li a:hover, 
.sidebar ul li.active a {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
    transition: margin 0.3s ease;
}

/* ================================================= */
/* 3. Component Styling (Cards, Grids, Tables)      */
/* ================================================= */
.welcome-card, .actions-box, .stat-card, .section-box {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.welcome-card {
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 20px;
}

.stat-card .title {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.section-box {
    overflow: hidden;
}

.section-header {
    padding: 18px 25px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: bold;
    color: var(--text-main);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr td {
    padding: 16px 25px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.info-table tr:last-child td {
    border-bottom: none;
}

.info-table td:first-child {
    color: var(--text-muted);
    width: 30%;
    font-weight: 500;
}

.info-table td:last-child {
    color: var(--text-main);
    font-weight: 500;
}

.actions-box {
    padding: 25px;
}

.btn-blue {
    background-color: var(--accent-blue);
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    display: inline-block;
    transition: background 0.2s;
}

.btn-blue:hover {
    background-color: #026aa7;
}

/* ================================================= */
/* 4. Mobile Responsive Queries (< 768px)           */
/* ================================================= */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .welcome-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    /* تحويل الجداول لبطاقات منفصلة على الموبايل لسهولة القراءة */
    .info-table, .info-table tbody, .info-table tr, .info-table td {
        display: block;
        width: 100% !important;
    }

    .info-table tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: #fff;
        padding: 5px 0;
    }

    .info-table tr td {
        padding: 10px 15px;
        border-bottom: 1px solid #f8fafc !important;
        text-align: left;
    }

    .info-table td:first-child {
        font-size: 12px;
        color: var(--text-muted);
        padding-bottom: 2px;
    }

    .info-table td:last-child {
        font-size: 14px;
        padding-top: 2px;
    }
}