/* کانتینر اصلی */
.mlab-main-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-family: sans-serif, Tahoma, 'Segoe UI';
    direction: rtl;
    text-align: right;
    max-width: 1200px;
    margin: 0 auto;
}

/* سایدبار سمت راست (25% عرض) */
.mlab-sidebar {
    flex: 0 0 25%;
    background: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    min-width: 200px;
}

.mlab-sidebar h3 {
    margin-top: 0;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    font-size: 16px;
}

.mlab-category-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mlab-category-menu li {
    margin-bottom: 5px;
    font-size: 14px;
}

.mlab-category-menu a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: background 0.3s;
}

.mlab-category-menu a:hover,
.mlab-category-menu a.active {
    background-color: #0073aa;
    color: #fff;
}

.mlab-alpha-heading {
    margin-top: 20px;
}

.mlab-alpha-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.mlab-alpha-link {
    align-items: center;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
    display: inline-flex;
    font-size: 13px;
    font-weight: bold;
    height: 30px;
    justify-content: center;
    min-width: 30px;
    padding: 0 6px;
    text-decoration: none;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.mlab-alpha-link:hover,
.mlab-alpha-link.active {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* ناحیه محتوا (سمت چپ) */
.mlab-content-area {
    flex: 1;
    min-width: 300px;
}

/* کانتینر داخلی لیست */
.mlab-container {
    background: #fff;
    padding: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.mlab-list { margin-top: 15px; }

.mlab-item-wrapper {
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.mlab-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mlab-toggle-title {
    flex: 1;
    text-align: right;
    line-height: 1.4;
}

.mlab-toggle-cnp {
    flex-shrink: 0;
    background: #e8f4fc;
    border: 1px solid #b8d9ef;
    border-radius: 4px;
    color: #0073aa;
    font-size: 12px;
    font-weight: normal;
    padding: 4px 10px;
    white-space: nowrap;
}

.mlab-toggle-btn:hover {
    background-color: #e2e6ea;
    border-color: #ccc;
}

.mlab-toggle-btn.is-open {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
    border-radius: 5px 5px 0 0;
}

.mlab-toggle-btn.is-open .mlab-toggle-cnp {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.mlab-details {
    background-color: #fcfcfc;
    padding: 0;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 5px 5px;
    margin-bottom: 15px;
    overflow: hidden;
}

.mlab-content {
    padding: 16px;
}

.mlab-detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid #ddd;
    background: #f6f7f7;
}

.mlab-detail-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #50575e;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    margin-bottom: -1px;
    padding: 10px 14px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.mlab-detail-tab:hover {
    background: #fff;
    color: #0073aa;
}

.mlab-detail-tab.is-active {
    background: #fff;
    border-bottom-color: #0073aa;
    color: #0073aa;
    font-weight: bold;
}

.mlab-detail-panels {
    background: #fff;
}

.mlab-detail-panel {
    display: none;
    padding: 16px;
}

.mlab-detail-panel.is-active {
    display: block;
}

.mlab-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    line-height: 1.7;
}

.mlab-detail-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.mlab-detail-label {
    color: #0073aa;
    flex: 0 0 160px;
    font-weight: bold;
}

.mlab-detail-value {
    color: #333;
    flex: 1;
    min-width: 200px;
    white-space: pre-wrap;
}

.mlab-no-details {
    color: #646970;
    font-size: 13px;
    margin: 0;
    text-align: center;
}

/* استایل باکس جستجو */
.mlab-search-box {
    margin-bottom: 15px;
}

#mlab-search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Tahoma, sans-serif;
    box-sizing: border-box;
}

#mlab-search-input:focus {
    border-color: #0073aa;
    outline: none;
}

.mlab-pagination{
    margin-top:20px;
    text-align:center;
}

.page-btn{
    display:inline-block;
    padding:8px 12px;
    margin:3px;
    border:1px solid #0073aa;
    border-radius:4px;
    cursor:pointer;
    background:#fff;
}

.page-btn:hover{
    background:#0073aa;
    color:#fff;
}

.page-btn.active{
    background:#0073aa;
    color:#fff;
}

/* برای ریسپانسیو در موبایل */
@media (max-width: 768px) {
    .mlab-main-wrapper {
        flex-direction: column;
    }
    .mlab-sidebar {
        flex: auto;
        width: 100%;
    }
    .mlab-toggle-btn {
        flex-direction: column;
        align-items: stretch;
    }
    .mlab-toggle-cnp {
        align-self: flex-start;
    }
    .mlab-detail-label {
        flex: 0 0 100%;
    }
}