﻿/* Shell: [ sidebar full height | main column ] â€” sidebar is either expanded or minimal rail */
.mf-shell {
    --mf-sidebar-w-expanded: 300px;
    --mf-sidebar-w-minimal: 72px;
    --mf-topbar-h: 5.25rem;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 100vh;
    width: 100%;
    background: var(--mf-bg);
}

.mf-sidebar {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--ta-sidebar-bg, #0f0a1e) 0%, var(--ta-sidebar-bg-mid, #1a1333) 100%);
    color: var(--ta-sidebar-text, #fff);
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 20;
    transition: width 0.28s ease;
}

.mf-sidebar--expanded {
    width: var(--mf-sidebar-w-expanded);
}

.mf-sidebar--minimal {
    width: var(--mf-sidebar-w-minimal);
    overflow-x: visible;
    overflow-y: auto;
    z-index: 25;
}

.mf-main-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--mf-bg);
}

.mf-content {
    flex: 1;
    padding: 1.5rem 1.5rem 2rem;
    overflow: auto;
}

/* --- Top bar --- */

/* App shell top bar â€” main column only */
.mf-topbar {
    display: flex;
    align-items: center;
    gap: 1rem 1.25rem;
    min-height: var(--mf-topbar-h, 5.25rem);
    padding: 0.85rem 1.5rem;
    background: #f8fafb;
    border-bottom: 1px solid #e8eef2;
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    box-shadow: 0 1px 0 rgba(14, 42, 56, 0.04);
}

@media (min-width: 992px) {
    .mf-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem) auto auto;
        align-items: center;
        column-gap: 1rem;
    }

    .mf-topbar-start {
        grid-column: 1;
    }

    .mf-topbar-search-wrap {
        grid-column: 2;
    }

    .mf-topbar-lang {
        grid-column: 3;
    }

    .mf-topbar-end {
        grid-column: 4;
        margin-left: 0;
    }
}

@media (max-width: 991.98px) {
    .mf-topbar {
        flex-wrap: wrap;
        row-gap: 0.75rem;
    }

    .mf-topbar-search-wrap {
        order: 4;
        flex: 1 1 100%;
        max-width: none;
    }

    .mf-topbar-end {
        margin-left: auto;
    }
}

@media (max-width: 767.98px) {
    .mf-topbar {
        align-items: flex-start;
    }
}

.mf-topbar-start {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1 1 0;
    overflow: hidden;
}

.mf-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #0e2a38;
    background: #fff;
    box-shadow: 0 4px 14px rgba(14, 42, 56, 0.12), 0 1px 2px rgba(14, 42, 56, 0.06);
    transition: box-shadow 0.15s ease, transform  0.15s ease;
}

.mf-menu-btn:hover {
    box-shadow: 0 6px 18px rgba(14, 42, 56, 0.14);
}

.mf-menu-btn:active {
    transform: scale(0.98);
}

.mf-page-heading {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

/* Title row: back link beside page title (never stacked above the title). */
.mf-page-heading-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    min-width: 0;
}

.mf-topbar-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0d9488;
    text-decoration: none;
    line-height: 1.2;
    max-width: min(12rem, 40vw);
}

.mf-topbar-back span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-topbar-back:hover {
    text-decoration: none;
    color: #0f766e;
}

.mf-topbar-back:hover span:last-child {
    text-decoration: underline;
}

.mf-topbar-back-icon {
    font-size: 1rem;
    line-height: 1;
}

.mf-shell--rtl .mf-topbar-back-icon {
    transform: scaleX(-1);
}

.mf-page-heading-row .mf-page-title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.mf-page-title {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 700;
    color: #0e2a38;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.mf-page-kicker {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-topbar-search-wrap {
    flex: 0 1 14rem;
    min-width: 9rem;
    max-width: 14rem;
}

.mf-topbar-lang {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.mf-lang {
    position: relative;
}

.mf-lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.75rem;
    padding: 0 0.85rem 0 0.95rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0e2a38;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(14, 42, 56, 0.05);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.mf-lang-trigger:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(14, 42, 56, 0.08);
}

.mf-lang-trigger-text {
    max-width: 7.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mf-lang-chevron {
    flex-shrink: 0;
    color: #64748b;
}

.mf-lang-dropdown {
    position: absolute;
    top: calc(100% + 0.4rem);
    inset-inline-end: 0;
    min-width: 11rem;
    padding: 0.35rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8eef2;
    box-shadow: 0 12px 40px rgba(14, 42, 56, 0.12);
    z-index: 420;
}

.mf-lang-item {
    display: block;
    width: 100%;
    text-align: inherit;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: #0e2a38;
    cursor: pointer;
    transition: background 0.12s ease;
}

.mf-lang-item:hover {
    background: #f8fafb;
}

.mf-lang-item--active {
    background: #f0fdfa;
    color: #0d9488;
    font-weight: 600;
}

.mf-search {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(14, 42, 56, 0.04);
}

.mf-search-ico {
    flex-shrink: 0;
    color: #94a3b8;
}

.mf-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
    color: #0e2a38;
    min-width: 0;
}

.mf-search-input::placeholder {
    color: #94a3b8;
}

.mf-search-input:focus {
    outline: none;
}

.mf-topbar-end {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    margin-left: auto;
}

.mf-icon-round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #fff;
    color: #0e2a38;
    box-shadow: 0 4px 14px rgba(14, 42, 56, 0.1), 0 1px 2px rgba(14, 42, 56, 0.05);
    transition: box-shadow 0.15s ease;
    position: relative;
    padding: 0;
}

.mf-icon-round:hover {
    box-shadow: 0 6px 18px rgba(14, 42, 56, 0.12);
}

.mf-bell-btn {
    border: 1px solid #eef2f5;
}

.mf-bell-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

.mf-user {
    position: relative;
}

.mf-avatar-btn {
    border: 1px solid rgba(43, 187, 173, 0.45);
    background: linear-gradient(160deg, #fff 0%, #f0fdfa 100%);
    color: #0d9488;
}

.mf-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 240px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(14, 42, 56, 0.15);
    border: 1px solid #e8eef2;
    padding: 0.75rem 0;
    z-index: 400;
}

.mf-dropdown-user {
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.mf-dropdown-name {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: #0e2a38;
}

.mf-dropdown-email {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.mf-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 0;
}

.mf-dropdown-list li a {
    display: block;
    padding: 0.5rem 1rem;
    color: #0e2a38;
    text-decoration: none;
    font-size: 0.9rem;
}

.mf-dropdown-list li a:hover {
    background: #f8fafb;
}

.mf-dropdown-logout a {
    color: #c2410c !important;
    font-weight: 500;
}

