﻿/*==================================================
SMARTBAN DASHBOARD
SECTION 1
LAYOUT + NAVBAR + SIDEBAR
==================================================*/

:root {
    --sidebar-width: 290px;
    --sidebar-collapse: 90px;
    --navbar-height: 84px;
    --primary: #0D6EFD;
    --primary-dark: #1D4ED8;
    --bg: #F7FAFD;
    --border: rgba(0,0,0,.05);
    --shadow: 0 10px 30px rgba(0,0,0,.06);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--bg);
    font-family: 'Vazirmatn',sans-serif;
}


/*========================================
NAVBAR
========================================*/

#mainNavbar {
    position: fixed;
    top: 0;
    right: var(--sidebar-width);
    left: 0;
    height: var(--navbar-height);
    z-index: 1200;
    background: rgba(255,255,255,.93);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: .35s;
}

body.sidebar-collapsed #mainNavbar {
    right: var(--sidebar-collapse);
}


/*========================================
SIDEBAR
========================================*/

#sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg,#fff,#FBFCFE);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: var(--navbar-height);
    z-index: 1100;
    transition: .35s;
}

    #sidebar.collapsed {
        width: var(--sidebar-collapse);
    }


/*========================================
CONTENT
========================================*/

.dashboard-wrapper {
    width: 100%;
    height: 100%;
}

#dashboardContent {
    margin-top: var(--navbar-height);
    margin-right: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    overflow: auto;
    padding: 30px;
    transition: .35s;
}

body.sidebar-collapsed #dashboardContent {
    margin-right: var(--sidebar-collapse);
}


/*========================================
SIDEBAR HEADER
========================================*/

.sidebar-logo {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

    .sidebar-logo img {
        width: 42px;
        height: 42px;
    }

    .sidebar-logo span {
        font-size: 20px;
        font-weight: 800;
        color: #163A5F;
        white-space: nowrap;
    }


/*========================================
HAMBURGER
========================================*/

#sidebarToggle {
    position: fixed;
    top: 20px;
    right: calc(var(--sidebar-width) - 23px);
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
    z-index: 1400;
    transition: .35s ease;
}

body.sidebar-collapsed #sidebarToggle {
    right: calc(var(--sidebar-collapse) + 10px);
}

#sidebarToggle:hover {
    background: #EEF5FF;
}

#sidebarToggle i {
    font-size: 22px;
    color: #0D6EFD;
}
/*==================================================
SECTION 2
MENU + SUBMENU + USER PANEL
==================================================*/

/*==========================
MENU
==========================*/

.sidebar-menu {
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

    .sidebar-menu li {
        margin: 5px 14px;
    }

        .sidebar-menu li > a {
            display: flex;
            align-items: center;
            height: 52px;
            padding: 0 18px;
            gap: 14px;
            border-radius: 14px;
            color: #44546A;
            text-decoration: none;
            font-weight: 600;
            transition: .25s;
            position: relative;
            overflow: hidden;
        }

            .sidebar-menu li > a i {
                width: 24px;
                text-align: center;
                font-size: 20px;
                color: #0D6EFD;
                transition: .25s;
            }

            .sidebar-menu li > a:hover {
                background: #EEF5FF;
                color: #0D6EFD;
                transform: translateX(-4px);
                box-shadow: 0 8px 18px rgba(13,110,253,.08);
            }

                .sidebar-menu li > a:hover i {
                    transform: scale(1.15);
                }

            .sidebar-menu li > a::before {
                content: "";
                position: absolute;
                top: 0;
                right: 0;
                width: 4px;
                height: 100%;
                background: #0D6EFD;
                opacity: 0;
                transition: .25s;
            }

            .sidebar-menu li > a:hover::before {
                opacity: 1;
            }

        /*==========================
ACTIVE
==========================*/

        .sidebar-menu li.active {
            position: relative;
        }

            .sidebar-menu li.active > a {
                background: linear-gradient(135deg,#0D6EFD,#1D4ED8);
                color: #fff;
                box-shadow: 0 12px 28px rgba(13,110,253,.20);
            }

                .sidebar-menu li.active > a i {
                    color: #fff;
                }

            .sidebar-menu li.active::before {
                content: "";
                position: absolute;
                right: -14px;
                top: 8px;
                width: 5px;
                height: 36px;
                border-radius: 20px;
                background: #0D6EFD;
            }

/*==========================
BADGE
==========================*/

.menu-badge {
    margin-right: auto;
    min-width: 26px;
    height: 22px;
    border-radius: 20px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0D6EFD;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-menu li.active .menu-badge {
    background: #fff;
    color: #0D6EFD;
}

/*==========================
SUBMENU
==========================*/

.has-submenu .submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
}

.has-submenu.open .submenu {
    max-height: 300px;
    margin-top: 6px;
}

.submenu li {
    margin: 2px 0;
}

.submenu a {
    display: flex;
    align-items: center;
    height: 44px;
    padding-right: 58px;
    border-radius: 12px;
    color: #6C7A92;
    text-decoration: none;
    transition: .25s;
}

    .submenu a:hover {
        background: #EEF5FF;
        color: #0D6EFD;
    }

.submenu-arrow {
    margin-right: auto;
    transition: .3s;
}

.has-submenu.open .submenu-arrow {
    transform: rotate(-90deg);
}

/*==========================
USER CARD
==========================*/

.sidebar-user {
    margin: 22px 14px;
    padding: 14px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    background: linear-gradient(135deg,#0D6EFD,#1D4ED8);
    box-shadow: 0 18px 35px rgba(13,110,253,.18);
    transition: .25s;
}

    .sidebar-user:hover {
        transform: translateY(-3px);
    }

.sidebar-user-avatar {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

    .sidebar-user-info strong {
        font-size: 15px;
    }

    .sidebar-user-info small {
        font-size: 12px;
        opacity: .85;
    }
/*=========================================
SIDEBAR COLLAPSE
=========================================*/

#sidebar.collapsed {
    width: 90px;
}

    #sidebar.collapsed .sidebar-logo span,
    #sidebar.collapsed .sidebar-user-info,
    #sidebar.collapsed .menu-badge,
    #sidebar.collapsed .submenu,
    #sidebar.collapsed .submenu-arrow,
    #sidebar.collapsed .sidebar-menu span {
        display: none;
    }

    #sidebar.collapsed .sidebar-menu a {
        justify-content: center;
        padding: 0;
    }

        #sidebar.collapsed .sidebar-menu a i {
            margin: 0;
            font-size: 22px;
        }


/*=========================================
CONTENT
=========================================*/

#dashboardContent {
    margin-right: 290px;
    transition: .35s ease;
}

body.sidebar-collapsed #dashboardContent {
    margin-right: 90px;
}


/*=========================================
NAVBAR
=========================================*/

#mainNavbar {
    right: 290px;
    transition: .35s ease;
}

body.sidebar-collapsed #mainNavbar {
    right: 90px;
}


/*=========================================
HAMBURGER BUTTON
=========================================*/

#sidebarToggle {
    position: fixed;
    top: 20px;
    right: 310px; /* کنار سایدبار */

    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
    z-index: 2000;
    transition: .35s;
}

body.sidebar-collapsed #sidebarToggle {
    right: 130px;
    transform: translateX(50%);
}
/*==========================
MOBILE
==========================*/
@media (max-width:991.98px) {

    #sidebar {
        right: -290px;
        width: 290px;
        transition: .35s;
    }

        #sidebar.show {
            right: 0;
        }

    #dashboardContent {
        margin-right: 0;
    }

    #mainNavbar {
        right: 0;
        padding-right: 0;
    }

    #sidebarToggle {
        right: 15px;
        top: 18px;
    }
}
/* ===============================
   Mobile Bottom Bar
================================== */

.mobile-bottom-bar {
    display: none;
}

@media (max-width:1199px) {

    .desktop-only {
        display: none !important;
    }

    .mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: #fff;
        border-top: 1px solid rgba(0,0,0,.08);
        box-shadow: 0 -5px 20px rgba(0,0,0,.08);
        justify-content: space-around;
        align-items: center;
        z-index: 3000;
    }

    .mobile-bottom-btn {
        width: 52px;
        height: 52px;
        border: none;
        background: transparent;
        font-size: 26px;
        color: #0D6EFD;
    }

    #dashboardContent {
        padding-bottom: 90px;
    }

    .mobile-bottom-bar .dropdown {
        position: static;
    }

    .mobile-bottom-bar .dropdown-menu {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        bottom: 80px !important;
        top: auto !important;
        width: auto !important;
        max-width: none !important;
        inset: auto 12px 80px 12px !important;
        transform: none !important;
        margin: 0 !important;
        z-index: 5000;
    }

    .mobile-bottom-bar .user-menu {
        right: 12px !important;
    }

    .mobile-bottom-bar .notification-menu {
        right: 70px !important;
    }

    .mobile-bottom-bar .notification-menu,
    .mobile-bottom-bar .user-menu {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        left: 12px !important;
        right: 12px !important;
        inset: auto 12px 80px 12px !important;
    }
}

/* وقتی سایدبار موبایل باز است نوار پایین مخفی شود */
@media (max-width:991.98px) {

    body.mobile-sidebar-open .mobile-bottom-bar {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(100%);
        transition: .3s ease;
    }

    .mobile-bottom-bar {
        transition: .3s ease;
    }
}
.dashboard-container {
    padding: 0 10px 10px;
}

.dashboard-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 8px 25px rgba(0,0,0,.08);
    transition: .25s;
}

    .kpi-card:hover {
        transform: translateY(-4px);
    }

    .kpi-card i {
        font-size: 34px;
        color: #0D6EFD;
    }

    .kpi-card small {
        display: block;
        color: #7b8ba5;
        font-size: 13px;
    }

    .kpi-card h3 {
        margin: 0;
        font-size: 24px;
        font-weight: 700;
        color: #163A5F;
    }

.dashboard-map {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,.08);
    margin-bottom: 25px;
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-weight: 700;
    color: #163A5F;
    font-size: 18px;
}

    .dashboard-title i {
        color: #0D6EFD;
        font-size: 22px;
    }

.solar-map {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(70px,1fr));
    gap: 14px;
}

.solar-panel {
    aspect-ratio: 1/.55;
    border-radius: 8px;
    cursor: pointer;
    transition: .25s;
    border: 2px solid transparent;
    background: repeating-linear-gradient( 90deg, #214f86 0, #214f86 10px, #183d69 10px, #183d69 12px );
}

    .solar-panel:hover {
        transform: scale(1.06);
        border-color: #0D6EFD;
    }

    .solar-panel.warning {
        box-shadow: 0 0 0 3px #ffc107 inset;
    }

    .solar-panel.hotspot {
        position: relative;
    }

        .solar-panel.hotspot::after {
            content: "";
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #ff2b2b;
            position: absolute;
            top: 35%;
            left: 48%;
            box-shadow: 0 0 10px red;
        }
/*=========================================
    Dashboard Workspace
=========================================*/

.dashboard-workspace {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

.dashboard-map {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,.08);
}

.panel-inspector {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,.08);
    position: sticky;
    top: 100px;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    color: #163A5F;
    margin-bottom: 20px;
}

.panel-image {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.solar-preview {
    width: 220px;
    aspect-ratio: 1/.58;
    border-radius: 10px;
    background: repeating-linear-gradient( 90deg, #214f86 0, #214f86 26px, #183d69 26px, #183d69 29px );
}

.panel-data {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
}

    .panel-item span {
        color: #6b7b8d;
    }

    .panel-item strong {
        color: #0D6EFD;
        font-weight: 700;
    }

/*=========================================
    Responsive
=========================================*/

@media(max-width:991.98px) {

    .dashboard-workspace {
        grid-template-columns: 1fr;
    }

    .panel-inspector {
        position: static;
    }
}

.solar-panel.selected {
    border: 3px solid #0D6EFD;
    transform: scale(1.08);
    box-shadow: 0 0 18px rgba(13,110,253,.45);
}
.panel-body {
    width: 230px;
    aspect-ratio: 1/.58;
    background: #143b69;
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 5px;
    padding: 8px;
    position: relative;
    border: 4px solid #222;
}

.cell {
    background: linear-gradient(#2d6ca6,#1b4674);
    border-radius: 2px;
    box-shadow: inset 0 0 2px rgba(255,255,255,.5);
}

#hotspotMark {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: red;
    display: none;
    box-shadow: 0 0 20px red;
    animation: hotspotBlink 1s infinite;
}

@keyframes hotspotBlink {

    0% {
        opacity: 1;
    }

    50% {
        opacity: .25;
    }

    100% {
        opacity: 1;
    }
}
.solar-workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.solar-row {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.string-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.string-name {
    width: 120px;
    font-weight: 700;
    color: #0D6EFD;
}

.string-wire {
    flex: 1;
    height: 4px;
    background: #0D6EFD;
    border-radius: 20px;
}

.inverter-area {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}
.array-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding: 0 8px;
}

.array-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #163A5F;
}

    .array-title i {
        color: #0D6EFD;
        font-size: 22px;
    }

.array-info {
    color: #6F7F94;
    font-size: 13px;
    font-weight: 600;
}
.solar-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}

.solar-panel {
    width: 72px;
    height: 42px;
    border-radius: 10px;
    background: #1F4E8C;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

    .solar-panel::before {
        content: "";
        position: absolute;
        inset: 0;
        background: repeating-linear-gradient( 90deg, rgba(255,255,255,.15) 0, rgba(255,255,255,.15) 2px, transparent 2px, transparent 12px );
    }

    .solar-panel.healthy {
        background: #1F4E8C;
    }

    .solar-panel.warning {
        border: 3px solid #F4B400;
    }

    .solar-panel.hotspot {
        border: 3px solid #E53935;
    }

        .solar-panel.hotspot::after {
            content: "";
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #ff2d2d;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
        }
.combiner-area {
    display: flex;
    justify-content: center;
    margin: 25px 0 15px;
}

.combiner-box {
    width: 150px;
    padding: 16px;
    border-radius: 16px;
    background: #F8FAFC;
    border: 2px solid #0D6EFD;
    text-align: center;
    cursor: pointer;
    transition: .25s;
}

    .combiner-box:hover {
        background: #EEF5FF;
    }

    .combiner-box i {
        font-size: 30px;
        color: #0D6EFD;
        display: block;
        margin-bottom: 8px;
    }

    .combiner-box h6 {
        margin: 0;
        font-weight: 700;
    }

    .combiner-box small {
        color: #6F7F94;
    }
.string-wire {
    flex: 1;
    height: 4px;
    background: #0D6EFD;
    position: relative;
    border-radius: 20px;
}

.string-end {
    position: absolute;
    left: 0;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #0D6EFD;
    border-radius: 50%;
    transform: translate(-50%,-50%);
}
.combiner-wire {
    width: 4px;
    height: 45px;
    background: #0D6EFD;
    margin: auto;
    border-radius: 10px;
    position: relative;
}

    .combiner-wire::after {
        content: "";
        position: absolute;
        bottom: -6px;
        left: 50%;
        transform: translateX(-50%);
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #0D6EFD;
    }
.inverter-area {
    display: flex;
    justify-content: center;
    width: 100%;
/*    align-items: center;

*/    
    clear: both;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.inverter-box {
    margin: 0 auto;
    width: 180px;
    padding: 18px;
    background: #ffffff;
    border: 2px solid #0D6EFD;
    border-radius: 18px;
    text-align: center;
    cursor: pointer;
    transition: .25s;
    box-shadow: 0 10px 25px rgba(13,110,253,.08);
}

    .inverter-box:hover {
        transform: translateY(-4px);
        background: #F8FBFF;
        box-shadow: 0 15px 35px rgba(13,110,253,.18);
    }

.inverter-icon {
    width: 58px;
    height: 58px;
    margin: auto;
    margin-bottom: 12px;
    border-radius: 16px;
    background: #EEF5FF;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .inverter-icon i {
        font-size: 30px;
        color: #0D6EFD;
    }

.inverter-box h6 {
    margin: 0;
    font-weight: 700;
    color: #163A5F;
}

.inverter-box small {
    display: block;
    margin-top: 6px;
    color: #738195;
}