/* =====================================================================
   style.css
   ---------------------------------------------------------------------
   Custom styles layered on top of Bootstrap 5.
   This file starts with the Login page; more sections are appended
   as later modules (dashboard, sidebar, tables) are built.
   ===================================================================== */

:root {
    --brand-primary: #4361ee;
    --brand-primary-dark: #3247c9;
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #f4f6fb;
}

/* ---------------------------------------------------------------
   Login Page
   --------------------------------------------------------------- */
.login-page {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #3a0ca3 100%);
    min-height: 100vh;
}

.login-wrapper {
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
}

.login-logo {
    width: 64px;
    height: 64px;
    line-height: 64px;
    border-radius: 50%;
    background: rgba(67, 97, 238, 0.1);
    color: var(--brand-primary);
    font-size: 28px;
    margin: 0 auto;
}

.login-card .btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    border-radius: 8px;
}

.login-card .btn-primary:hover {
    background-color: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
}

.login-card .form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.15);
}

.toggle-password {
    cursor: pointer;
}

/* ---------------------------------------------------------------
   App Shell Layout (Sidebar + Topbar + Main Content)
   --------------------------------------------------------------- */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: #1e2144;
    color: #cfd2f0;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease, width .25s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand i {
    color: var(--brand-primary);
    font-size: 1.3rem;
}

.sidebar-user {
    padding: 18px 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-nav {
    padding: 10px 0;
    flex: 1;
}

.sidebar-nav .nav-link {
    color: #cfd2f0;
    padding: 11px 20px;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(67, 97, 238, 0.18);
    border-left-color: var(--brand-primary);
    color: #fff;
    font-weight: 600;
}

/* Collapsed sidebar state (toggled via JS + localStorage) */
body.sidebar-collapsed .sidebar {
    width: 74px;
    min-width: 74px;
}
body.sidebar-collapsed .sidebar .brand-text,
body.sidebar-collapsed .sidebar .sidebar-user,
body.sidebar-collapsed .sidebar-nav .nav-link span {
    display: none;
}
body.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 12px 0;
}

/* --- Main content + Topbar --- */
.main-content {
    flex: 1;
    min-width: 0;
    background: #f4f6fb;
}

.topbar {
    background: #fff;
    height: 64px;
}

.page-heading {
    font-weight: 700;
    color: #23264a;
}

/* --- Avatars --- */
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.3rem;
    display: flex;
}

/* --- Notification dropdown --- */
.notif-dropdown {
    width: 320px;
    max-height: 420px;
    overflow: hidden;
}

.notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    cursor: pointer;
    transition: background .15s ease;
}

.notif-item:hover {
    background: #f8f9fc;
}

.notif-item.unread {
    background: rgba(67, 97, 238, 0.06);
    border-left: 3px solid var(--brand-primary);
}

.notif-badge {
    font-size: .6rem;
    padding: 3px 5px;
}

/* --- Dashboard stat cards (used in dashboard module) --- */
.stat-card {
    border: none;
    border-radius: 14px;
    color: #fff;
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.stat-card i.stat-icon {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 2.4rem;
    opacity: .25;
}

.stat-card h3 {
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-card span {
    font-size: .85rem;
    opacity: .9;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 1050;
        box-shadow: 0 0 20px rgba(0,0,0,.2);
    }
    body.sidebar-collapsed .sidebar {
        left: 0;
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
    }
    body.sidebar-collapsed .sidebar .brand-text,
    body.sidebar-collapsed .sidebar .sidebar-user,
    body.sidebar-collapsed .sidebar-nav .nav-link span {
        display: inline;
    }
    body.sidebar-collapsed .sidebar-nav .nav-link {
        justify-content: flex-start;
        padding: 11px 20px;
    }
}
