﻿html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding-top: 65px; /* Desktop spacing below navbar */
    background-color: #d9efe3;
    overflow-x: hidden;
}

.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    margin: 0 8px;
    overflow: visible !important;
}

.notification-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
}

    .notification-link:hover {
        background: rgba(255,255,255,.15);
    }

    .notification-link i {
        font-size: 22px;
        color: #ffc107;
    }

.notification-count {
    position: absolute;
    top: -4px;
    right: -2px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dc3545;
    color: #fff;
    border-radius: 11px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    z-index: 9999;
}

/* Fixed Navbar */
.navbar-fixed-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 576px) {
    body {
        padding-top: 50px;
    }
    #tempGraphCard,
    #rainGraphCard {
        display: none !important;
    }
}

/* Main content wrapper */
main {
    flex: 1; 
    display: flex;
    flex-direction: column;
}

/* Navbar styling */
.navbar-custom {
    background: linear-gradient(135deg, #2E6E1E 0%,#60944A 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    margin-top: auto;
    flex-shrink: 0;
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 0.25rem;
}

    .navbar-custom .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.15);
        color: white !important;
    }

    .navbar-custom .nav-link.active {
        background-color: rgba(255, 255, 255, 0.2);
        color: white !important;
    }

.btn-login {
    /*    background-color: #2563EB;
    color: #2563EB;*/
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

    .btn-login:hover {
        background-color: #f59e0b;
        color: white;
        transform: translateY(-2px);
        text-decoration: none;
    }

.btn-logout {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    border: 2px solid white;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

    .btn-logout:hover {
        background-color: white;
        color: #2563eb;
        text-decoration: none;
    }

/* Footer styling */
.footer-custom {
    background: linear-gradient(135deg, #4b6220 100%);
    color: white;
    padding: 2rem 0 0 0;
    /*margin-top: 2rem;*/
    margin-top: auto;
    width: 100%;
}

    .footer-custom a {
        color: #0ea5e9;
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .footer-custom a:hover {
            color: #f59e0b;
            text-decoration: none;
        }

.footer-section h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

    .footer-section ul li {
        margin-bottom: 0.5rem;
    }

        .footer-section ul li a {
            color: #0ea5e9;
            text-decoration: none;
            transition: color 0.3s ease;
        }

            .footer-section ul li a:hover {
                color: #f59e0b;
            }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    /*    margin-top: 2rem;
*/ text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   FOOTER BRAND COMPACT
======================================== */



    /* Smaller footer icon */

    .footer-brand .icon-circle {
        width: 42px;
        height: 42px;
    }

        .footer-brand .icon-circle i {
            font-size: 1.15rem;
        }

    /* Reduce icon spacing */

    .footer-brand .brand-icon {
        margin-right: -2px;
    }

    /* Compact text block */

    .footer-brand .brand-text {
        line-height: 1;
    }

    /* Footer title */

    .footer-brand .brand-title {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    /* Subtitle */

    .footer-brand .brand-subtitle {
        font-size: 0.72rem;
        margin-top: 0;
    }

    /* Department */

    .footer-brand .brand-dept {
        font-size: 0.58rem;
        margin-top: 1px;
    }

/* Footer description */

.footer-description {
    color: rgba(255,255,255,0.82);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-top: 0.75rem;
}

/* ========================================
   FINAL FOOTER LOGO FIX
======================================== */



/* Remove extra icon spacing */


/* Compact text */

.footer-brand .brand-text {
    line-height: 0.95;
}

/* Reduce subtitle spacing */

.footer-brand .brand-subtitle {
    margin-top: 0 !important;
}

/* Reduce department spacing */

.footer-brand .brand-dept {
    margin-top: 0 !important;
}

/* Mobile footer */

@media (max-width: 576px) {

    .footer-brand .icon-circle {
        margin-right: -2px;
    }

        .footer-brand .icon-circle i {
            font-size: 1.15rem;
        }

    .footer-brand .brand-title {
        font-size: 0.95rem;
    }

    .footer-brand .brand-subtitle {
        font-size: 0.68rem;
    }

    .footer-brand .brand-dept {
        font-size: 0.55rem;
    }

    .footer-description {
        font-size: 0.82rem;
    }

}

/* Page content padding */
.page-content {
    padding: 2rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-custom .nav-link {
        padding: 0.5rem 0.75rem !important;
    }

    .footer-custom {
        padding: 2rem 0 1rem 0;
    }

    .footer-section {
        margin-bottom: 1.5rem;
    }
}
/* FIX NAVBAR WRAPPING */
.navbar-nav {
    flex-wrap: nowrap !important;
    overflow-x: auto;
}

    .navbar-nav::-webkit-scrollbar {
        display: none;
    }

.navbar-custom .nav-link {
    white-space: nowrap;
    padding: 0.4rem 0.6rem !important;
    margin: 0 0.15rem;
}

/* Responsive tightening */
@media (max-width: 1200px) {
    .navbar-custom .nav-link {
        font-size: 14px;
        padding: 0.35rem 0.5rem !important;
    }
}

@media (max-width: 992px) {
    body {
        padding-top: 54px;
    }
    .navbar-custom .nav-link {
        font-size: 13px;
        padding: 0.3rem 0.4rem !important;
    }
}
/* ========================================
   ECOSENSE GOVERNMENT BRAND HEADER
======================================== */

.ecosense-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    color: white !important;
    padding: 2px 0;
}

/* ========================================
   CLEAN FOOTER BRAND
======================================== */

.footer-brand {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 0.8rem;
}

    .footer-brand .brand-icon {
        margin-right: 0 !important;
    }

    .footer-brand .icon-circle {
        width: 52px;
        height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .footer-brand .icon-circle i {
            font-size: 1.45rem;
        }

    .footer-brand .brand-text {
        line-height: 1;
    }

    .footer-brand .brand-title {
        font-size: 1rem;
    }

    .footer-brand .brand-subtitle {
        font-size: .72rem;
        margin-top: 0;
    }

    .footer-brand .brand-dept {
        font-size: .58rem;
        margin-top: 1px;
    }

/* Mobile */

@media (max-width:576px) {

    /* Reduce overall footer height */
    .footer-custom {
        padding: .8rem 0 .2rem 0 !important;
        margin-top: 1rem;
    }

    /* Reduce column spacing */
    .footer-section {
        margin-bottom: .5rem !important;
    }

    .col-md-6,
    .col-lg-4,
    .col-lg-3,
    .col-lg-2 {
        margin-bottom: .5rem !important;
    }

    /* Compact footer logo */
    .footer-brand {
        gap: 3px !important;
        margin-bottom: .2rem !important;
    }

        .footer-brand .icon-circle {
            width: 28px;
            height: 28px;
        }

            .footer-brand .icon-circle i {
                font-size: .75rem;
            }

        .footer-brand .brand-title {
            font-size: .72rem !important;
            margin-bottom: 0;
        }

        .footer-brand .brand-subtitle {
            font-size: .45rem !important;
        }

        .footer-brand .brand-dept {
            font-size: .40rem !important;
        }

    .footer-description {
        font-size: .68rem;
        line-height: 1.2;
        margin-top: .2rem;
        margin-bottom: .3rem;
    }

    /* Links smaller */
    .footer-section h5 {
        font-size: .82rem;
        margin-bottom: .3rem;
    }

    .footer-section ul li {
        margin-bottom: .15rem;
    }

        .footer-section ul li a {
            font-size: .72rem;
        }

    /* Social icons smaller */
    .social-links a {
        font-size: .9rem !important;
        margin-right: .4rem !important;
    }

    .footer-bottom {
        padding-top: .3rem;
        font-size: .65rem;
    }
}

/* ICON */
.brand-icon {
    font-size: 2.2rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

/* TEXT WRAPPER */
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.08;
}

/* MAIN TITLE */
.brand-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.2px;
}

/* SUBTITLE */
.brand-subtitle {
    font-size: 1.05rem;
    font-weight: 500;
    color: #f1f8e9;
    margin-top: 2px;
}

/* DEPARTMENT */
.brand-dept {
    font-size: 0.82rem;
    font-weight: 400;
    color: #dcedc8;
    margin-top: 3px;
}

/* ========================================
   NAVBAR STYLE
======================================== */

.navbar-custom {
    background: linear-gradient(135deg, #2E6E1E 0%, #60944A 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding-top: 6px;
    padding-bottom: 6px;
}

/* ========================================
   MOBILE RESPONSIVE
======================================== */

@media (max-width: 992px) {

    .ecosense-brand {
        gap: 10px;
    }

    .brand-title {
        font-size: 1.05rem;
    }

    .brand-subtitle {
        font-size: 0.82rem;
    }

    .brand-dept {
        font-size: 0.65rem;
    }

    .brand-icon {
        font-size: 1.7rem;
    }
}

@media (max-width: 576px) {

    .ecosense-brand {
        gap: 8px;
    }

    .brand-title {
        font-size: 0.92rem;
    }

    .brand-subtitle {
        font-size: 0.72rem;
    }

    .brand-dept {
        font-size: 0.58rem;
    }

    .brand-icon {
        font-size: 1.4rem;
    }
}



.layout-wrapper {
    display: flex;
}

.sidebar.collapsed {
    width: 75px;
}

.sidebar {
    width: 260px;
    background: #A0BC86;
    color: #2d4a2d;
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
    overflow-x: visible;
    padding: 10px 0;
    transition: all .35s ease;
    z-index: 100;
}

    /* Menu Link */
    .sidebar .nav-link {
        display: flex;
        align-items: center;
        color: #355E3B;
        padding: 10px 12px;
        border-radius: 10px;
        transition: .3s;
        white-space: nowrap;
        font-weight: 500;
        font-size: 14px;
    }

        .sidebar .nav-link:hover {
            background: #BFDDB8;
            color: #1F3A1F;
        }

        .sidebar .nav-link i:first-child {
            width: 28px;
            min-width: 28px;
            text-align: center;
            font-size: 14px;
        }

        .sidebar .nav-link span {
            margin-left: 12px;
            transition: .3s;
        }

        .sidebar .nav-link .fa-angle-down {
            margin-left: auto;
        }

    .sidebar.collapsed .nav-link span,
    .sidebar.collapsed .nav-link .fa-angle-down {
        display: none;
    }

    /* Active Menu */
    .sidebar .nav-link.active {
        background: #2e7d32;
        color: #fff !important;
        border-radius: 8px;
        font-weight: 600;
    }

        .sidebar .nav-link.active i {
            color: #fff !important;
        }

        .sidebar .nav-link.active::before {
            content: "";
            position: absolute;
            left: 0;
            top: 8px;
            bottom: 8px;
            width: 4px;
            /*background: #ffc107;*/
            border-radius: 4px;
        }


    .sidebar.collapsed .nav-item {
        position: relative;
    }

    .sidebar.collapsed .nav-link {
        justify-content: center;
        position: relative;
    }

        .sidebar.collapsed .nav-link::after {
            content: attr(data-title);
            position: fixed;
            left: 82px;
            top: var(--tooltip-top, 50%);
            transform: translateY(-50%);
            background: #2E7D32;
            color: #fff;
            padding: 8px 14px;
            border-radius: 8px;
            white-space: nowrap;
            font-size: 14px;
            font-weight: 500;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            z-index: 999999;
        }

        .sidebar.collapsed .nav-link::before {
            content: "";
            position: fixed;
            left: 77px;
            top: var(--tooltip-top, 50%);
            transform: translateY(-50%) rotate(45deg);
            width: 10px;
            height: 10px;
            background: #2E7D32;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            z-index: 999998;
        }

    .sidebar.collapsed .nav-item:hover > .nav-link::after,
    .sidebar.collapsed .nav-item:hover > .nav-link::before {
        opacity: 1;
        visibility: visible;
    }

    .sidebar.collapsed .collapse {
        display: none !important;
    }

    .sidebar.collapsed .nav-item {
        position: relative;
    }

        .sidebar.collapsed .nav-item:hover > .collapse {
            opacity: 1;
            visibility: visible;
        }


    .sidebar.collapsed {
        width: 75px;
    }

    .sidebar i {
        width: 25px;
    }

    /* Sub Menu */
    .sidebar .sub-menu {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 12px 6px 40px !important;
        font-size: 12px !important;
        font-weight: 500;
        color: #355E3B !important;
        line-height: 1.2;
    }

        .sidebar .sub-menu::before {
            content: "↳";
            font-size: 13px;
            width: 16px;
            text-align: center;
            flex-shrink: 0;
            margin-right: 0;
        }

    /* Sub-Sub Menu */
    .sidebar .sub-sub-menu {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 5px 12px 5px 65px !important;
        font-size: 11px !important;
        font-weight: 500;
        color: #355E3B !important;
        line-height: 1.2;
    }

        .sidebar .sub-sub-menu::before {
            content: "▸";
            font-size: 10px;
            width: 16px;
            text-align: center;
            flex-shrink: 0;
            margin-right: 0;
        }

        .sidebar .sub-menu span,
        .sidebar .sub-sub-menu span {
            margin: 0;
            padding: 0;
            flex: 1;
        }

.main-content {
    flex: 1;
    min-width: 0;
    transition: all .3s ease;
    position: relative;
    z-index: 1;
}

.main-content-no-sidebar {
    flex: 1;
    margin-left: 0;
    padding: 5px;
}


@media (max-width:991px) {

    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 15px;
    }

    .layout-wrapper {
        display: block;
    }
}

/* Mobile Sidebar */
.sidebar-mobile {
    top: 65px !important;
    height: calc(100vh - 65px);
    background: #F3F8F2;
}

    /* Sidebar Header */
    .sidebar-mobile .offcanvas-header {
        background: #2E7D32;
        color: #ffffff;
    }

    /* Sidebar Body */
    .sidebar-mobile .offcanvas-body {
        background: #F3F8F2;
        padding: 0;
    }

    /* Menu Links */
    .sidebar-mobile .nav-link {
        color: #355E3B;
        font-weight: 500;
        padding: 14px 20px;
    }

        .sidebar-mobile .nav-link i {
            color: #2E7D32;
            width: 24px;
        }

        /* Hover */
        .sidebar-mobile .nav-link:hover {
            background: #DCEED7;
            color: #1B5E20;
        }

        /* Active */
        .sidebar-mobile .nav-link.active {
            background: #C8E6C9;
            color: #1B5E20;
            border-left: 4px solid #2E7D32;
        }

/* Mobile */
@media (max-width: 991.98px) {

    #sidebarMenu {
        top: 65px;
        height: calc(100vh - 65px);
    }
}
/* ========================================
   MOBILE NAVBAR ACTIONS
======================================== */

.mobile-navbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* Mobile notification */
.mobile-notification {
    position: relative;
    width: 42px;
    height: 42px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .mobile-notification .notification-link {
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .mobile-notification .notification-link i {
            font-size: 22px;
            color: #ffc107;
        }

    /* Notification number */
    .mobile-notification .notification-count {
        position: absolute;
        top: -3px;
        right: -3px;
        min-width: 20px;
        height: 20px;
        padding: 0 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #dc3545;
        color: #fff;
        border-radius: 10px;
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
        z-index: 9999;
    }

/* Mobile menu button */
.mobile-menu-button {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 6px;
}

/* Only mobile/tablet */
@media (min-width: 992px) {
    .mobile-navbar-actions {
        display: none !important;
    }
}