﻿.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #f5f7fb;
}

.app-sidebar {
    width: 250px;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #172554;
}

.app-main {
    flex: 1;
    min-width: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-content {
    flex: 1;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
}

.app-header {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .app-sidebar {
        width: 70px;
    }

    .app-content {
        padding: 16px;
    }
}

/* Sidebar */
.sidebar-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 22px 14px;
    color: #ffffff;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
}

.brand-info h3 {
    font-size: 16px;
    margin: 0;
    font-weight: 600;
}

.brand-info span {
    display: block;
    font-size: 11px;
    color: #a5b4fc;
    margin-top: 3px;
}

.sidebar-menu {
    flex: 1;
    padding-top: 20px;
}

.menu-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #94a3b8;
    padding: 18px 10px 9px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin-bottom: 4px;
    border-radius: 7px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

    .sidebar-link:hover {
        background: rgba(255,255,255,0.08);
        color: #ffffff;
    }

    .sidebar-link.active {
        background: #2563eb;
        color: #ffffff;
        font-weight: 600;
    }

.menu-icon {
    width: 20px;
    text-align: center;
    font-size: 17px;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 18px 8px 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #cbd5e1;
}

    .sidebar-footer small {
        display: block;
        font-size: 10px;
        font-weight: 400;
        letter-spacing: 0;
        color: #94a3b8;
        margin-top: 5px;
    }

/* Responsive sidebar */
@media (max-width: 768px) {
    .sidebar-container {
        padding: 18px 8px;
    }

    .brand-info,
    .menu-section-toggle,
    .sidebar-link span:not(.menu-icon),
    .sidebar-footer {
        display: none;
    }

    .sidebar-brand {
        justify-content: center;
        padding: 0 0 22px;
    }

    .sidebar-link {
        justify-content: center;
        padding: 12px 5px;
    }
}

/* Collapsible Sidebar Sections */

.menu-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 18px 10px 9px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: left;
    cursor: pointer;
}

    .menu-section-toggle:hover {
        color: #ffffff;
    }

.section-arrow {
    font-size: 16px;
    transition: transform 0.2s ease;
    transform: rotate(-90deg);
}

    .section-arrow.expanded {
        transform: rotate(0deg);
    }

.menu-section-toggle:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Application Header */

.app-header {
    min-height: 76px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    gap: 20px;
}

.header-left h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #172554;
}

.header-left span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info strong {
    display: block;
    font-size: 13px;
    color: #1e293b;
}

.user-info span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #64748b;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    padding: 9px 13px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .logout-button:hover {
        background: #fef2f2;
        border-color: #fecaca;
        color: #dc2626;
    }

@media (max-width: 768px) {
    .app-header {
        padding: 12px 16px;
    }

    .header-left span,
    .user-info {
        display: none;
    }

    .header-right {
        gap: 12px;
    }
}
