﻿:root {
    --top-offset: 110px;
}

@font-face {
    font-family: Vazir-FD;
    src: url(../../includes/fonts/Vazir-FD.ttf) format('truetype');
    font-weight: normal;
    font-style: normal;
}

.font-fix {
    font-family: Vazir-FD, sans-serif;
    font-weight: 700;
    /*font: bold;*/
}

/* پایه */
html, body {
    direction: rtl;
}

*, *::after,*::before{
    box-sizing: border-box;
}

.topbar {
    position: fixed;
    top: 0px;
    z-index: 1200;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 0px;
    height: 59px;
    padding: 5px 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    overflow: visible;
}
#top-nav-bar {
  height: 0;
  display: block;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  margin-left: auto;
  margin-right: auto;
  background-color: #fff;
}

.topbar .left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar .icon-btn {
    border: none;
    background: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
}

.topbar .search-box {
    position: relative;
}

    .topbar .search-box input {
        border: 1px solid #e9edf3;
        border-radius: 10px;
        padding: 8px 34px 8px 10px;
        outline: none;
    }

    .topbar .search-box i {
        position: absolute;
        right: 8px;
        top: 8px;
        font-size: 18px;
        color: #777;
    }

.topbar .right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left:3%;
}


body{
  padding-bottom: 100px;
}


.bottombar {
    position: fixed;
 /*   left: 5%;
    right: 5%;*/
    bottom: max(15px, env(safe-area-inset-bottom));
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
   /* border: 2px solid #00000021;*/
    border-radius: 20px;
    height: 65px;
    box-shadow: 0px 0px 20px #0000001A;
    margin: 0 5% 15px 5%;
    overflow: visible;
}


/*@media (max-width: 576px) {
    .bottombar {
        left: 8px;
        right: 8px;*/
        /*bottom: max(8px, env(safe-area-inset-bottom));*/
        /*border-radius: 16px;
    }
}*/


/* ===== Layout ===== */
.dashboard-wrap {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
    background-color: #f5f5f5;
    font-family: 'Vazir FD';
}

/* ===== Sidebar ===== */
.sidebar {
    width: 270px;
    min-width: 270px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 12px;
    height: calc(100vh - (var(--top-offset) + 80px));
    position: sticky;
    top: var(--top-offset);
    z-index: 1000;
    overflow: auto;
    transition: width .2s ease, min-width .2s ease, padding .2s ease, box-shadow .2s ease, transform .25s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

    .sidebar.collapsed {
        width: 72px;
        min-width: 72px;
        padding: 12px 8px;
    }

    .sidebar .brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px;
    }

        .sidebar .brand .title {
            font-weight: 700;
            font-size: 15px;
            color: #1b2330;
        }

    .sidebar .toggle {
        border: none;
        background: #f5f7fa;
        border-radius: 10px;
        padding: 6px 10px;
        cursor: pointer;
    }

    .sidebar .menu {
        list-style: none;
        padding: 0;
        margin: 6px 0 0 0;
    }

        .sidebar .menu li {
            margin-bottom: 4px;
        }

    .sidebar a.nav-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 12px;
        text-decoration: none;
        color: #2a3240;
        font-weight: 700;
        transition: background .2s, color .2s, transform .08s;
    }

        .sidebar a.nav-item:hover {
            background: #f0f6ff;
        }

    .sidebar a.active {
        background: #f0f2f5;
        color: #222;
        font-weight: 700;
    }

    .sidebar .icon {
        width: 20px;
        text-align: center;
        font-size: 18px;
    }

    .sidebar .badge {
        margin-right: auto;
        background: #ffeeee;
        color: #d93025;
        border-radius: 10px;
        padding: 1px 6px;
        font-size: 11px;
    }

    .sidebar .children {
        margin-right: 30px;
        margin-top: 4px;
    }

    .sidebar.collapsed .text,
    .sidebar.collapsed .badge,
    .sidebar.collapsed .children {
        display: none;
    }

/* ===== Content ===== */
.content {
    flex: 1;
    min-width: 0;
    background: #f5f5f5;
    border: 0px solid #e9edf3;
    border-radius: 18px;
    padding: 16px;
    /*box-shadow: 0 4px 14px rgba(0,0,0,0.04);*/
}

/* ===== Cards & Grid ===== */
.card {
    background: #fff;
    border: 1px solid #e9edf3;
    border-radius: 16px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: transform .15s, box-shadow .15s;
    /*margin-top:16px;*/
}

    .card:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    }

.grid {
    display: grid;
    /*grid-template-columns: repeat(12,1fr);*/
    gap: 5px;
    /*margin: 16px 0px;*/
}

.col-4 {
    grid-column: span 4;
}

.col-12 {
    grid-column: span 12;
}

/* ===== Profile Dropdown ===== */
.profile-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

    .profile-menu img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        object-fit: cover;
        background: #e9edf3;
    }

    .profile-menu .dropdown {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        background: #fff;
        border: 1px solid #e9edf3;
        border-radius: 12px;
        min-width: 180px;
        max-width: 70vw;
        max-height: 60vh;
        overflow: auto;
        box-shadow: 0 10px 24px rgba(0,0,0,.08);
        z-index: 2000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
        pointer-events: none;
    }

        .profile-menu .dropdown.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
            transition: opacity .15s ease, transform .15s ease, visibility 0s;
            pointer-events: auto;
        }

        .profile-menu .dropdown a,
        .profile-menu .dropdown button {
            display: block;
            width: 100%;
            text-align: right;
            padding: 10px 12px;
            background: #fff;
            border: none;
            color: #1b2330;
            text-decoration: none;
            font-weight: 500;
        }

            .profile-menu .dropdown a i, .profile-menu .dropdown button i {
                margin-left: 6px;
                font-size: 18px;
                vertical-align: middle;
            }

            .profile-menu .dropdown a:hover,
            .profile-menu .dropdown button:hover {
                background: #f6f9ff;
            }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    align-items: center;
    gap: 6px;
    border: 0px solid #0a66c2;
    color: black;
    background: #ffcb08;
    border-radius: 12px;
    padding: 8px 14px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

    .btn i {
        font-size: 18px;
    }

    .btn.secondary {
        background: #eef4ff;
        color: #0a66c2;
        border-color: #cfe1ff;
    }

    .btn.danger {
        background: #d93025;
        border-color: #d93025;
    }


    .btn:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

/* ===== Backdrop ===== */
.backdrop {
    display: none;
}

    .backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        z-index: 1500;
    }

/* ===== Form helpers ===== */
.kv {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    
    border: 2px solid #edf0f4;
    border-radius: 12px;
    height: 110%;
}

    .kv .k {
        color: #667085;
        min-width: 110px;
    }

    .kv .v {
        color: #1b2330;
        font-weight: 600;
    }

/*.kv .icon {
  opacity: .45;    
}*/


.kv .v {
    color: #111;
}


.kv .v.placeholder {
  color: #6b7280;         
opacity: .7;
font-weight: 400;
}


.kv.align-start {
    align-items: flex-start;
}

    .kv .icon i {
        opacity: .45;
        transition: opacity .2s ease;
    }

    .kv .v {
        display: flex;
        align-items: center;
        width: 100%;
    }

        .kv .v .as-text {
            width: 100%;
            border: 0;
            background: transparent;
            padding: 0;
            margin: 0;
            outline: none;
            font: inherit;
       color: inherit;
          line-height: inherit;
        }

            .kv .v .as-text::placeholder {
                color: #6b7280;
                opacity: .75;
            }

         
            .kv .v .as-text:focus {
                border-bottom: 1px dashed rgba(0,0,0,.25);
            }

.editing .kv .icon i {
    opacity: .6;
}


.kv .v.ro {
    color: #555;
    opacity: .9;
    cursor: not-allowed;
}



.form-control.ro {
    background: #f7f7f7;
    cursor: not-allowed;
}

.form-control {
    width: 100%;
    border: 1px solid #e6e9f0;
    border-radius: 10px;
    padding: 8px 10px;
    outline: none;
}

    .form-control:focus {
        border-color: #b8c5f0;
        box-shadow: 0 0 0 3px rgba(11,121,208,.08);
    }


@media (max-width: 992px) {
  .dashboard-wrap { flex-direction: column; }
  .sidebar{
    position:fixed; right:0; top:0; height:100vh; width:270px; min-width:270px;
    transform: translateX(100%); 
    border-radius: 0; border-left:1px solid #eee;
    box-shadow: 0 16px 40px rgba(0,0,0,.18);
    z-index: 1600; 
  }
  .sidebar.open{ transform: translateX(0); }
  .sidebar.collapsed{ width:270px; min-width:270px; } 
body.sidebar-open {
    overflow: hidden;
}


.col-4 {
    grid-column: span 12;
}
}

.bottombar {
    position: fixed;
   /* left: 0;
    right: 0;*/
    bottom: max(5px, env(safe-area-inset-bottom));
    width: 91vw;
    margin: 0; /* حذف marginهای 5% */
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0;
    height: 65px;
    box-shadow: 0 0 20px #0000001A;
}

@media (max-width: 576px) {
    .bottombar {
        border-radius: 16px;
    }
}

/* اگر آیتم‌های باتم‌بار فاصله می‌گیرند: */
.bottombar .item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 5px;
    /*margin: 16px 0px;*/
}

.col-12 {
    grid-column: 1 / -1;
}

.col-4 {
    grid-column: span 4;
}

@media (max-width: 992px) {
    .col-4 {
        grid-column: span 6;
    }
}

@media (max-width: 640px) {
    .col-4, .col-12 {
        grid-column: 1 / -1;
    }
}


/* =========================
   Topbar Auto Hide (on menu-scroll)
========================= */

.topbar {
    transition: transform .22s ease, box-shadow .22s ease;
    will-change: transform;
}

/* مخفی شدن هدر */
body.topbar-hidden .topbar {
    transform: translateY(-110%);
    box-shadow: none;
}

/* شِل صفحه زیر هدر: وقتی هدر مخفی شد، محتوا بالاتر بیاد */
.dashboard-shell {
    padding-top: var(--topbar-h); /* همون 56px */
    transition: padding-top .22s ease;
}

body.topbar-hidden .dashboard-shell {
    padding-top: 0;
}

/* سایدبار هم اگر top دارد، کمی بالا بیاید */
.sidebar {
    transition: top .22s ease;
}

body.topbar-hidden .sidebar {
    top: 56px; /* اگر می‌خوای بچسبه به سقف: 0 بگذار */
}

/* اگر داخل منو BottomBar نمی‌خوای */
/*body.hide-bottombar .bottombar,
body.hide-bottombar .jb-bottombar {
    display: none !important;
}

body.hide-bottombar {
    padding-bottom: 0 !important;
}*/

