/* Admin CSS for Fatima Estate Advisor */
:root {
    --primary: #4f46e5;
    --secondary: #3730a3;
    --accent: #1e293b;
    --light: #f1f5f9;
    --white: #ffffff;
    --dark: #0f172a;
    --sidebar-width: 260px;
    --header-height: 70px;
    --shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #f8fafc;
    color: #0f172a;
}



/* Login Page Styling */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 100%);
}

.login-card {
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 400px;
    text-align: center;
}

.login-card .logo {
    width: 120px;
    margin-bottom: 2rem;
}

.login-card h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(194, 157, 89, 0.2);
}

.admin-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.admin-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* Layout Container */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f1f5f9;
}

/* Modern Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 12px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    padding: 1.5rem 1rem;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 12px;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    transform: translateX(4px);
}

.nav-item.logout {
    margin-top: auto;
    color: #ef4444;
}

.nav-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 1rem 0;
}

.user-info-mini {
    padding: 0 16px;
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    /* Push content */
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

/* Top Header in Main Content */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0.25rem 0 0 0;
}

.header-date {
    font-weight: 600;
    color: var(--primary);
    background: #e0e7ff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.menu-toggle {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
    padding: 0.5rem;
}

/* Backdrop */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.admin-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
    border: 1px solid #f1f5f9;
}

/* Stats Overview Cards */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-info h4 {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--light);
    color: #64748b;
    font-weight: 600;
    font-size: 0.875rem;
}

.admin-table td {
    padding: 16px;
    border-bottom: 1px solid var(--light);
    font-size: 0.9rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

/* ========================================
   RESPONSIVE DESIGN (ADMIN)
   ======================================== */

@media (max-width: 992px) {

    /* Dashboard Grid Stacking */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* Mobile Sidebar Logic */
    .sidebar {
        transform: translateX(-100%);
        /* Hide off-screen */
        width: 260px;
        /* Ensure width is set */
    }

    .sidebar.show {
        transform: translateX(0);
        /* Slide in */
    }

    .main-content {
        margin-left: 0;
        /* Full width */
        padding: 1rem;
    }

    .menu-toggle {
        display: block;
        /* Show hamburger */
    }

    .top-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-title {
        order: 2;
        width: 100%;
        text-align: center;
    }

    .menu-toggle {
        order: 1;
    }

    .header-date {
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Login adjustments */
    .login-card {
        width: 90%;
        padding: 2rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px;
        font-size: 0.8rem;
    }
}