/* ══════════════════════════════════════════════════════
   TMS FRONTEND SIDEBAR STYLES
   Scoped under .tms-app-frame to avoid conflicts
   ══════════════════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
}
body {
    font-family: 'Montserrat', sans-serif !important;
}

/* Full-height flex wrapper */
.tms-app-frame {
    display: flex;
    min-height: 100vh;
    /* background: #f1f5f9; */
}

/* ── Sidebar ─────────────────────────────────────── */
.tms-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

/* Logo / Brand */
.tms-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 0px 18px;
    /* border-bottom: 1px solid #f1f5f9; */
    text-decoration: none;
}

.tms-sidebar-brand__icon {
    width: 38px;
    height: 38px;
    /* background: linear-gradient(135deg, #4f46e5, #7c3aed); */
    background: linear-gradient(145deg, #4b0082 0%, #120022 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    flex-shrink: 0;
}
.tms-sidebar-brand__logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    padding: 6px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(75, 0, 130, 0.08);
    border-radius: 12px;
}

.tms-sidebar-brand__text {
    line-height: 1.2;
}

.tms-sidebar-brand__name {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
}

.tms-sidebar-brand__sub {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

/* User profile strip */
.tms-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    margin: 12px 10px 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.tms-sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.tms-sidebar-profile__name {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    text-transform: capitalize;
}

.tms-sidebar-profile__role {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

/* Section label */
.tms-sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    padding: 10px 20px 4px;
    margin-top: 4px;
}

/* Nav list */
.tms-sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 4px 10px 10px;
    flex: 1;
}

.tms-sidebar-nav li {
    margin: 0;
    padding: 0;
}

.tms-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition:
        background 0.15s,
        color 0.15s;
    margin-bottom: 2px;
    position: relative;
}

.tms-sidebar-nav a:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.tms-sidebar-nav a.tms-sb-active {
    background: var(--tms-sb-color-bg, #ede9fe);
    color: var(--tms-sb-color, #4f46e5);
    font-weight: 700;
}

.tms-sidebar-nav a.tms-sb-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 2px;
    background: var(--tms-sb-color, #4f46e5);
}

.tms-sidebar-nav__icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Sidebar footer (logout) */
.tms-sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.tms-sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    text-decoration: none;
    transition: background 0.15s;
}

.tms-sidebar-logout:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* Mobile toggle button */
.tms-sb-toggle {
    display: none;
    position: fixed;
    top: 45px;
    right: 29px;
    z-index: 999;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 18px;
    color: #475569;
    line-height: 1;
}

/* Main content area */
.tms-sidebar-main {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
    background: #f0f0f1;
    /* prevent flex blowout */
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
    .tms-sidebar {
        position: fixed;
        left: -270px;
        top: 0;
        height: 100vh;
        transition: left 0.25s ease;
        z-index: 500;
    }

    .tms-sidebar.tms-sb-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .tms-sb-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tms-sb-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 499;
        backdrop-filter: blur(2px);
    }

    .tms-sb-overlay.tms-sb-open {
        display: block;
    }

    .tms-sidebar-main {
        /* padding-top: 60px; */
        width: 80%;
    }
}
