/* Admin Dashboard Styles */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --primary: #0F172A;
    --secondary: #C0A062;
    --bg-body: #F1F5F9;
    --bg-white: #FFFFFF;
    --text-main: #334155;
    --text-light: #64748B;
    --border: #E2E8F0;
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary);
    color: var(--bg-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
    /* Enable scrolling for sidebar if needed */
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    color: var(--bg-white);
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--secondary);
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-menu li a {
    text-decoration: none;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--bg-white);
}

.sidebar-menu li a.active {
    border-right: 3px solid var(--secondary);
}

.badge {
    margin-right: auto;
    background: var(--secondary);
    color: var(--bg-white);
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
}

.logout:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    transition: var(--transition);
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-toggle {
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-light);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.header-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Dashboard Content */
.dashboard-container {
    padding: 2rem;
}

.page-title {
    margin-bottom: 2rem;
    color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-card h3 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-size: 1.1rem;
}

/* Tables */
.recent-section {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.recent-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    background: #e2e8f0;
    border: none;
    border-radius: 0.3rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-sm:hover {
    background: var(--secondary);
    color: var(--bg-white);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-active {
    background: #dcfce7;
    color: #16a34a;
}

.status-sold {
    background: #fee2e2;
    color: #ef4444;
}

.status-pending {
    background: #fef9c3;
    color: #ca8a04;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        right: -260px;
        /* Hide RTL */
    }

    .sidebar.active {
        right: 0;
    }

    .main-content {
        margin-right: 0;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-group-row {
        flex-direction: column;
        gap: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-container {
        padding: 1rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
}

.form-group-row {
    display: flex;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(192, 160, 98, 0.1);
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}