/* ================================================
   ToMires Layout — layout.css
   ================================================ */

/* ===== Topbar ===== */

.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.topbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-5);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.topbar-username {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Hamburger Button ===== */

.menu-toggle-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: var(--space-2);
}

.menu-toggle-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

/* ===== App Layout ===== */

.app-layout {
    display: flex;
    flex-direction: row-reverse;
    padding-top: 60px;
    min-height: 100vh;
}

/* ===== Sidebar ===== */

.sidebar {
    position: fixed;
    top: 60px;
    right: 0;
    width: 240px;
    height: calc(100vh - 60px);
    background: linear-gradient(
        160deg,
        #1e3a5f 0%,
        #0f2442 60%,
        #0a1a32 100%
    );
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

/* ===== Sidebar User ===== */

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: var(--radius-full);
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--accent) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.sidebar-user-name {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sidebar-user-role {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.5);
    display: block;
}

/* ===== Sidebar Divider ===== */

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: var(--space-3) 0;
    flex-shrink: 0;
}

/* ===== Sidebar Navigation ===== */

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
    padding: 10px var(--space-3);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: var(--radius-full);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.sidebar-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.sidebar-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 700;
}

.sidebar-link.active::before {
    transform: scaleY(1);
}

.sidebar-link-icon {
    font-size: 1.1rem;
    width: 24px;
    min-width: 24px;
    text-align: center;
    display: inline-block;
    flex-shrink: 0;
}

.sidebar-link-text {
    display: inline-block;
    flex: 1;
    white-space: nowrap;
}

/* ===== Logout Button ===== */

.logout-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
    padding: 10px var(--space-3);
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: rgba(255, 100, 100, 0.9);
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    width: 100%;
    transition: var(--transition-fast);
    margin-top: var(--space-2);
    white-space: nowrap;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ff8080;
    border-color: rgba(239, 68, 68, 0.4);
}

/* ===== Sidebar Footer ===== */

.sidebar-footer {
    text-align: center;
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.2);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    flex-shrink: 0;
}

/* ===== Sidebar Overlay ===== */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 60px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 80;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== Main Content ===== */

.main-content {
    flex: 1;
    margin-right: 240px;
    min-height: calc(100vh - 60px);
    width: calc(100% - 240px);
}

.content-inner {
    padding: var(--space-8);
    max-width: 1200px;
    margin: 0 auto;
}

.auth-brand-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-10);
}

.auth-brand-logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    width: 40px;
    border-radius: 50px;
}

.auth-brand-logo-text {
    font-size: var(--font-size-4xl);
    font-weight: 900;
    color: white;
    letter-spacing: -0.03em;
}

/* ===== Responsive (Mobile) ===== */

@media (max-width: 768px) {

    .menu-toggle-btn {
        display: flex;
    }

    .topbar-user {
        display: none;
    }

    .sidebar {
        transform: translateX(100%);
        width: 260px;
        box-shadow: var(--shadow-xl);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        width: 100%;
    }

    .content-inner {
        padding: var(--space-4);
    }

    .auth-brand-logo {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--space-2);
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .auth-brand-logo-icon {
        font-size: 1.5rem;
        width: 40px;
        border-radius: 50px;
    }

    .auth-brand-logo-text {
        font-size: var(--font-size-xl);
        font-weight: 900;
    }
}