/* --------------------------------------------------
   BASE FONT
-------------------------------------------------- */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* --------------------------------------------------
   LAYOUT / FOOTER / SHELL
-------------------------------------------------- */
body {
    margin-bottom: 0 !important;
}

    body.app-shell {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

main {
    flex: 1 0 auto;
}

footer.footer {
    flex-shrink: 0;
    margin-top: 30px;
}

.container,
.container-fluid {
    padding-bottom: 0 !important;
}

/* --------------------------------------------------
   QUICK LINKS SIDEBAR
-------------------------------------------------- */
.quick-sidebar {
    width: 260px;
    min-height: calc(100vh - 112px);
    position: sticky;
    top: 112px;
    overflow-y: auto;
    background-color: #ffffff;
    transition: width .2s ease;
    flex-shrink: 0;
}

    .quick-sidebar hr {
        margin: 10px 0;
    }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #e1e5eb;
    font-weight: 600;
}

.sidebar-title {
    font-size: 0.95rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
}

.sidebar-nav {
    list-style: none;
    padding: 8px;
    margin: 0;
}

    .sidebar-nav li {
        margin-bottom: 4px;
    }

    .sidebar-nav a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 6px;
        color: #333;
        text-decoration: none;
        font-size: 0.95rem; /* MATCH MAIN MENU */
        font-weight: 500; /* MATCH MAIN MENU */
        line-height: 1.4;
    }

        .sidebar-nav a:hover {
            background: #eef5ff;
            color: #0a2d57;
        }

    .sidebar-nav .divider {
        height: 1px;
        background: #e1e5eb;
        margin: 10px 0;
    }

/* COLLAPSED SIDEBAR */
body.sidebar-collapsed .quick-sidebar {
    width: 60px;
}

body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .sidebar-nav span {
    display: none;
}

/* DARK MODE SIDEBAR */
body.theme-dark .quick-sidebar {
    background-color: #2a2d3a;
    border-color: #3c3f51;
}

body.theme-dark .sidebar-nav a {
    color: #e6e6e6;
}

    body.theme-dark .sidebar-nav a:hover {
        background: #313545;
    }

/* --------------------------------------------------
   TOP + MODULE NAVBAR (BLUE)
-------------------------------------------------- */
.navbar.navbar-dark,
.main-navbar,
.module-navbar {
    background-color: #0a2d57 !important;
    transition: background-color .2s ease, color .2s ease;
}

    .navbar.navbar-dark .navbar-brand {
        color: #ffffff !important;
        font-weight: 600;
    }

    .navbar.navbar-dark .nav-link {
        color: #ffffff !important;
        font-size: 0.95rem;
        font-weight: 500;
    }

        .navbar.navbar-dark .nav-link:hover {
            color: #1fb6ff !important;
        }

.navbar-brand img {
    vertical-align: middle;
}

/* --------------------------------------------------
   MEGA DROPDOWN
-------------------------------------------------- */
.mega-dropdown .dropdown-menu {
    width: 900px;
    border-radius: 6px;
    background-color: #ffffff !important;
}

.mega-panel .dropdown-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0a2d57;
}

.mega-panel .dropdown-item {
    padding: 4px 10px;
    font-size: 0.85rem;
}

/* --------------------------------------------------
   DASHBOARD BACKGROUND (LIGHT)
-------------------------------------------------- */
body:not(.theme-dark).app-shell {
    background-color: #f3f4f6 !important;
}

/* --------------------------------------------------
   CARDS (LIGHT MODE)
-------------------------------------------------- */
.card {
    background-color: #ffffff !important;
    border: 1px solid #e1e5eb !important;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

    .card:hover {
        box-shadow: 0 3px 8px rgba(0, 0, 0, .13);
    }

/* --------------------------------------------------
   DARK MODE BASE
-------------------------------------------------- */
body.theme-dark {
    background-color: #1e1e2f !important;
    color: #e6e6e6 !important;
}

    /* DARK NAVBAR */
    body.theme-dark .navbar.navbar-dark {
        background-color: #111a2b !important;
    }

    /* DARK CARD */
    body.theme-dark .card {
        background-color: #2a2d3a !important;
        border-color: #3c3f51 !important;
        box-shadow: none !important;
    }

        /* DARK CARD TEXT */
        body.theme-dark .card h1,
        body.theme-dark .card h2,
        body.theme-dark .card h3,
        body.theme-dark .card h4,
        body.theme-dark .card h5,
        body.theme-dark .card h6,
        body.theme-dark .card p,
        body.theme-dark .card span {
            color: #e6e6e6 !important;
        }

    /* DARK MODE text-muted fix */
    body.theme-dark .text-muted,
    body.theme-dark small.text-muted {
        color: #cfcfcf !important;
    }

/* --------------------------------------------------
   INPUTS + FLOAT LABEL (LOGIN)
-------------------------------------------------- */
.input-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: #0a2d57 !important;
    z-index: 5;
    pointer-events: none;
}

.form-floating > label {
    padding-left: 32px !important;
}

/* --------------------------------------------------
   DASHBOARD STATS
-------------------------------------------------- */
.dashboard-card {
    border-left: 4px solid #0a2d57;
    transition: box-shadow .15s ease;
}

    .dashboard-card:hover {
        box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
    }

.icon-lg {
    font-size: 2rem;
    opacity: .65;
}

/* DARK */
body.theme-dark .dashboard-card {
    background-color: #2a2d3a !important;
    border-left-color: #1fb6ff;
}

    body.theme-dark .dashboard-card .text-muted {
        color: #b5b5b5 !important;
    }

    body.theme-dark .dashboard-card .icon-lg {
        opacity: .85;
    }

/* --------------------------------------------------
   QUICK ACTION TILES (PACKED MODE)
-------------------------------------------------- */
.quick-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.quick-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 150px;
    height: 95px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e1e5eb;
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all .18s ease;
    text-decoration: none !important;
    color: inherit !important;
}

    .quick-tile:hover {
        background: #e8f2ff;
        border-color: #0a2d57;
        color: #0a2d57 !important;
    }

.quick-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
    color: #0a2d57;
}

/* MOBILE PACKED */
@media (max-width: 576px) {
    .quick-tile {
        width: 100%;
        height: 72px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
    }
}

/* DARK MODE TILES */
body.theme-dark .quick-tile {
    background: #2a2d3a;
    border-color: #3c3f51;
    color: #e6e6e6 !important;
}

body.theme-dark .quick-icon {
    color: #e6e6e6 !important;
}

body.theme-dark .quick-tile:hover {
    background: #313545;
    border-color: #4a4e61;
    color: #fff !important;
}

/* --------------------------------------------------
   MOBILE LOGIN FIX
-------------------------------------------------- */
@media (max-width: 768px) {
    .login-card {
        width: 90% !important;
        padding: 22px !important;
    }
}

/* --------------------------------------------------
   FORCE MEGA MENU WIDTHS (Bootstrap override)
-------------------------------------------------- */
.navbar .mega-dropdown > .dropdown-menu {
    min-width: unset !important;
    width: auto;
}

.navbar .mega-dropdown > .dropdown-menu.mega-sm {
    width: 420px !important;
}

.navbar .mega-dropdown > .dropdown-menu.mega-lg {
    width: 720px !important;
}

.navbar .mega-dropdown > .dropdown-menu.mega-xl {
    width: 900px !important;
}
