:root {
    --primary: #2c6db4;
    --primary-dark: #0d47a1;
    --secondary: #1a73e8;
    --accent: #4cc9f0;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --bold-shadow: 0 0 10px 1px rgba(164, 174, 195, 0.8);
    --transition: all 0.4s ease;
    --transform: translateY(-3px);
    --sidebar-width: 200px; /* افزایش عرض سایدبار */
    --content-padding: 12px; /* پدینگ متغیر */
    --header-height: 60px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    background: none;
}
body {
    margin: 0;
    height: 100vh;
    background-color: #f5f7fa;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
/* ---- هدر ثابت در بالای صفحه ---- */
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    background: linear-gradient(90deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 0 30px;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: var(--transition);
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}
.hamburger-menu {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}
.hamburger-menu:hover {
    transform: scale(1.1);
    background: #1d4ed8;
}

.topbar-actions {
    display: flex;
    gap: 25px;
    align-items: center;
}
/* ---- سایدبار ---- */
.sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #1e3a8a 0%, #0f1b3d 100%);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    z-index: 5;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    transition: all 0.4s ease;
    user-select: none;
}
.sidebar-menu {
    padding: 20px 0;
    flex-grow: 1;
}
.link-container{
    max-height: 75vh;
    overflow: auto;
}
.link-container::-webkit-scrollbar {
    width: 4px;
}
.link-container::-webkit-scrollbar-track {
    background: none;
    border-radius: 10em;
}
.link-container::-webkit-scrollbar-thumb {
    background-color: var(--gray);
    border-radius: 10em;
    height: 50px;
}
.sidebar a {
    display: flex;
    align-items: center;
    padding: 9px 13px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 10pt;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    margin: 2px 5px;
    gap: 12px;
    border-radius: var(--radius);
}
.sidebar a:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #fff;
    transform: translateX(-5px);
}
.sidebar a i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    color: #93c5fd;
}
.sidebar a.active {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
    border-left: 4px solid #3b82f6;
}
.sidebar-menu {
    padding: 20px 0;
}
.menu-item {
    position: relative;
    margin: 0 5px;
}
.menu-item > a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding-right: 10px;
}
.menu-item > a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-right: 4px solid var(--accent);
}
.menu-item > a i {
    margin-left: 15px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}
.menu-item > a span {
    text-wrap-mode: nowrap;
}
.menu-item > a .chevron {
    margin-right: auto;
    font-size: 0.9rem;
    transition: var(--transition);
}
.menu-item.active .chevron {
    transform: rotate(180deg);
}
.submenu {
    list-style: none;
    background: rgba(0, 0, 0, 0.15);
    border-right: 3px solid var(--accent);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding-right: 0 !important;
    padding-left:  0 !important;
    margin-bottom: 0 !important;
}
.menu-item.active .submenu {
    max-height: 300px;
}
.submenu li a {
    display: block;
    padding: 8px 10px 8px 35px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 9pt;
    transition: var(--transition);
    position: relative;
}
.submenu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.submenu li a::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
}
.submenu li a.active {
    color: var(--accent);
    font-weight: 500;
}
.submenu li a.active::before {
    background: var(--accent);
}
.menu-item.active > .submenu {
    display: block;
    max-height: 500px;
    opacity: 1;
}
.menu-item.active > a .chevron {
    transform: rotate(180deg);
}

.extra-toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}
.extra-toggle-label {
    margin-right: 15px;
    margin-left: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 100;
    cursor: pointer;
}
.extra-toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.extra-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.extra-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.extra-slider:before {
    position: absolute;
    content: "";
    height: 15px;
    width: 15px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .extra-slider {
    background-color: var(--secondary);
}
input:checked + .extra-slider:before {
    transform: translateX(18px);
}
.sidebar-footer{
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12px;
    background-color: #ffffff26;
    color: var(--light);
    border: 1px solid var(--light);
    border-top-right-radius: 15px;
    border-top-left-radius: 15px;
    margin-top: auto;
    padding: 15px 10px;
}
.sms-row{
    display: flex;
    justify-content: space-between;
}
.charge-sms{
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease-in-out;
}
.charge-sms:hover{
    transform: translateY(-3px);
    box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.5);
}

/* ---- محتوای اصلی ---- */
.main-content {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    right: var(--sidebar-width);
    padding: var(--content-padding);
    overflow-y: auto;
    background: #f9f9f9;
    z-index: 10;
    transition: all 0.4s ease;
    width: calc(100% - var(--sidebar-width));
}
.main-content.expanded {
    right: 0;
    width: 100%;
}
.content-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
    max-width: 100%; /* حداکثر عرض */
    overflow-x: auto; /* اسکرول افقی در صورت نیاز */
    margin: 0 auto;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

/* ---- دکمه خروج ---- */
#logout-btn {
    position: relative;
}
#logout-btn button {
    background: none;
    color: var(--primary);
    border-radius: var(--radius);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    padding-left: 10px;
}
#logout-btn button:hover {
    transform: translateY(-1px);
}

/* ---- رسپانسیو ---- */
@media (max-width: 768px) {
    .topbar{
        padding: 0 12px;
    }
    .hamburger-menu {
        width: 26px;
        height: 26px; 
    }
    .hamburger-menu i{
       font-size: 14px;
    }
    .sidebar {
        transform: translateX(100%);
        z-index: 100;
    }
    .sidebar.expanded {
        transform: translateX(0);
    }
    .main-content {
        right: 0;
        width: 100%;
    }
}
@media (max-width: 468px) {
    .sidebar a {
        font-size: 9pt;
    }
    .sidebar li a {
        font-size: 8pt;
    }
    .sidebar-footer {
        font-size: 8pt;
        padding: 10px 10px;
    }
}

.container{
    padding: 0;
    width: 100%;
}