:root {
    --primary-color: #4F46E5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    --bg-body: #F3F4F6;
    /* Gray 100 */
    --bg-sidebar: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-main: #111827;
    /* Gray 900 */
    --text-muted: #6B7280;
    /* Gray 500 */
    --border-color: #E5E7EB;
    /* Gray 200 */

    --sidebar-width: 260px;
    --header-height: 64px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 50;
    transition: transform 0.3s ease-in-out;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: #F9FAFB;
    /* Gray 50 */
    color: var(--text-main);
}

.nav-item.active {
    background-color: #EEF2FF;
    /* Indigo 50 */
    color: var(--primary-color);
}

.nav-item i {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    /* Offset for fixed sidebar */
    display: flex;
    flex-direction: column;
    padding-bottom: 2rem;
}

.page-header {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

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

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.content-wrapper {
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

/* --- Components --- */
.card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card h3 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    color: var(--text-muted);
}

ul.activity-list {
    list-style: none;
    padding-left: 0;
}

ul.activity-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

ul.activity-list li:last-child {
    border-bottom: none;
}

/* --- Mobile-only Elements --- */
.mobile-header {
    display: none;
    /* Hidden on desktop */
}

.sidebar-overlay {
    display: none;
}

/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        /* Hide sidebar by default */
        box-shadow: var(--shadow-md);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        /* Remove offset */
        margin-top: var(--header-height);
        /* Make room for mobile header */
    }

    .mobile-header {
        display: flex;
        align-items: center;
        height: var(--header-height);
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        padding: 0 1.5rem;
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 60;
        justify-content: space-between;
    }

    .mobile-header .logo {
        font-weight: 700;
        color: var(--primary-color);
        font-size: 1.25rem;
    }

    #menu-toggle {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--text-main);
        display: flex;
        align-items: center;
    }

    .page-header {
        display: none;
        /* Simplify header for mobile, or adjust */
    }

    .content-wrapper {
        padding: 1.5rem;
    }

    /* Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 45;
    }

}


/* --- Authentication Layout --- */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-body);
    padding: 1rem;
}

.auth-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    text-align: center;
}

.brand-logo {
    max-width: 180px;
    margin-bottom: 2rem;
    height: auto;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.auth-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Auth Forms */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-family: var(--font-family);
    transition: all 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1.5rem;
    text-decoration: none;
    display: inline-block;
}

.btn-link:hover {
    text-decoration: underline;
}

.alert-error {
    background-color: #FEF2F2;
    /* Red 50 */
    border: 1px solid #FECACA;
    /* Red 200 */
    color: #991B1B;
    /* Red 800 */
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    text-align: left;
}

/* Password Validation (Choose Password) */
.validation-table {
    width: 100%;
    background: #F9FAFB;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.validation-table td {
    padding: 4px;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.validation-table i {
    font-size: 1rem;
    vertical-align: middle;
}

.validation-table .ph-check-circle {
    color: #10B981;
    /* Green 500 */
}

.validation-table .ph-x-circle {
    color: #EF4444;
    /* Red 500 */
}