@import url('../lib/bootstrap-icons/font/bootstrap-icons.min.css');
@import url('../font/vazirmatn/vazirmatn-font-face.min.css');
@import url('../font/vazirmatn/misc/farsi-digits/vazirmatn-fd-font-face.min.css');
@import url('../lib/bootstrap/css/bootstrap.rtl.css');

:root {
    --sidebarWidth: 17vw;
    --mainWidth: 83vw;
}

html {
    position: relative;
    min-height: 100%;
}
body {
    font-family: 'Vazirmatn FD';
}
.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    width:var(--mainWidth);
    flex: 1;
}
table{
    white-space:nowrap;
}

@media (min-width: 1200px) {
    html {
        font-size: 16px;
    }
    .navbar-toggler {
        display: none;
    }

    .collapse {
        /* Never collapse the sidebar for wide screens */
        display: block;
    }

    .nav-scrollable {
        /* Allow sidebar to scroll for tall menus */
        height: calc(100vh - 3.5rem);
        overflow-y: auto;
    }

    .page {
        flex-direction: row;
    }
    
    .sidebar {
        width: var(--sidebarWidth);
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

        .top-row.auth a:first-child {
            flex: 1;
            text-align: right;
            width: 0;
        }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

@media (max-width: 1199px) {
 main{
     width:100vw;
 }
    .collapse {
        display: block;
    }
    .top-row:not(.auth) {
        display: none;
    }

    .top-row.auth {
        justify-content: space-between;
    }

    .top-row a, .top-row .btn-link {
        margin-left: 0;
    }

}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}


a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.top-row {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

    .top-row a, .top-row .btn-link {
        white-space: nowrap;
        margin-left: 1.5rem;
        text-decoration: none;
    }

        .top-row a:hover, .top-row .btn-link:hover {
            text-decoration: underline;
        }

        .top-row a:first-child {
            overflow: hidden;
            text-overflow: ellipsis;
        }



.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-top-row {
    height: 3.5rem;
    background-color: rgba(0,0,0,0.4);
}

.navbar-brand {
    font-size: 1.1rem;
}

.bi {
    width: 2rem;
    font-size: 1.1rem;
    vertical-align: text-top;
    top: -2px;
}

.nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

    .nav-item:first-of-type {
        padding-top: 1rem;
    }

    .nav-item:last-of-type {
        padding-bottom: 1rem;
    }

    .nav-item a {
        color: #d7d7d7;
        border-radius: 4px;
        height: 3rem;
        display: flex;
        align-items: center;
        line-height: 3rem;
    }

        .nav-item a.active {
            background-color: rgba(255,255,255,0.25);
            color: white;
        }

        .nav-item a:hover {
            background-color: rgba(255,255,255,0.1);
            color: white;
        }


.icon {
    cursor: pointer;
    font-size:2rem;
    padding: 0 2px 0 2px;
    width: 15%;
}

.sub-menu {
    margin-top: 0.5rem;
}

.sub-menu .nav-item {
    padding-left: 2rem !important;
}


.nav-item-header {
    color: white;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
}
.nav-item-header:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.myModalFooter {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    border-top: 0.3vh solid #dee2e6;
    padding: 2% 4%;
}

.myfieldset {
    background: #eceff1;
    border-radius: 5px;
    border: 1px solid #cfd8dc;
    width: 100%;
    border-radius: 0px;
}

.myfieldset legend {
    width: auto;
    padding: 0.5rem;
    background: #ffffff;
    border: 1px solid #cfd8dc;
    -moz-box-shadow: -2px 2px 11px #cfd8dc;
    -webkit-box-shadow: -2px 2px 11px #cfd8dc;
    box-shadow: -2px 2px 11px #cfd8dc;
    font-weight: bold;
    border-radius: 5px;
    font-size: 14px;
    color: lightslategray;
    float: none;
}

.ltr {
    direction: ltr;
}

.w-30 {
    width: 30% !important;
}.w-35 {
    width: 35% !important;
}.w-40 {
    width: 40% !important;
}.w-45 {
    width: 45% !important;
}

/* ============================================================
   GLASSMORPHISM / MINIMAL DASHBOARD
   ============================================================ */

/* Colorful gradient backdrop so the frosted glass effect is visible */
.glass-dashboard {
    position: relative;
    padding: 2rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 35%, #6a11cb 100%);
    overflow: hidden;
}

/* Decorative blurred blobs to enhance the glass look */
.glass-dashboard::before,
.glass-dashboard::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    z-index: 0;
}
.glass-dashboard::before {
    width: 280px;
    height: 280px;
    top: -90px;
    right: -60px;
    background: #00c6ff;
}
.glass-dashboard::after {
    width: 320px;
    height: 320px;
    bottom: -120px;
    left: -80px;
    background: #e100ff;
}
.glass-dashboard > * {
    position: relative;
    z-index: 1;
}

/* Section title inside the dashboard */
.glass-section-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    margin: 1.2rem 0 0.8rem;
    padding-right: 0.5rem;
    border-right: 4px solid rgba(255, 255, 255, 0.6);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.glass-section-title:first-child {
    margin-top: 0;
}

/* Main dashboard heading — no right accent border */
h1.glass-section-title {
    border-right: none;
    padding-right: 0;
}

/* The minimal frosted glass box */
.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.9rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 1.1rem 1rem;
    color: #fff;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    background: rgba(255, 255, 255, 0.22);
}

.glass-card-icon {
    font-size: 1.7rem;
    line-height: 1;
    opacity: 0.95;
}

.glass-card-label {
    font-size: 0.92rem;
    font-weight: 600;
    opacity: 0.95;
    margin: 0;
}

.glass-card-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.glass-card-unit {
    font-size: 0.78rem;
    opacity: 0.8;
    margin: 0;
}

/* Total (جمع) section — warm gold/amber accent that complements the
   cool blue-purple gradient while highlighting the summary row */
.glass-card-total {
    background: rgba(255, 193, 7, 0.22);
    border: 1px solid rgba(255, 215, 100, 0.45);
}
.glass-card-total:hover {
    background: rgba(255, 193, 7, 0.32);
}

/* Fallback for browsers without backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass-card {
        background: rgba(255, 255, 255, 0.55);
        color: #1e3c72;
    }
    .glass-card-value {
        text-shadow: none;
    }
}

@media (max-width: 575.98px) {
    .glass-dashboard {
        padding: 1.2rem 0.6rem;
    }
    .glass-card-value {
        font-size: 1.35rem;
    }
}
