/* Views Setup */
#app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
}

.view {
    display: none;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.view.active {
    display: flex;
    opacity: 1;
}

/* Login View */
#login-view {
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
}

.logo-area { margin-bottom: 30px; }
.logo-area .logo-icon { font-size: 3rem; margin-bottom: 10px; }
.logo-area h1 { font-size: 2rem; font-weight: 700; letter-spacing: -1px; }

.subtitle { color: var(--text-muted); margin-bottom: 24px; }
.error-msg { color: var(--danger); font-size: 0.9rem; margin-top: 12px; min-height: 20px; }

/* Dashboard Layout */
.sidebar {
    width: 280px;
    height: 100%;
    padding: 30px 0;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
}

.sidebar .logo-area.small {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 30px;
    margin-bottom: 40px;
}
.sidebar .logo-area.small .logo-icon { font-size: 1.8rem; margin: 0; }
.sidebar .logo-area.small h2 { font-size: 1.5rem; }

.menu-collapse {
    display: contents;
}

.nav-links { list-style: none; flex: 1; }
.nav-links li a {
    display: block;
    padding: 12px 30px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.nav-links li a:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.03); }
.nav-links li a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: var(--primary-light);
}

.user-profile {
    padding: 20px 30px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-profile .avatar { font-size: 2rem; }
.user-info .phone { display: block; font-weight: 500; font-size: 0.9rem; }
.user-info .logout { display: block; font-size: 0.8rem; color: var(--danger); text-decoration: none; margin-top: 4px; }

.content-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 30px 40px;
    align-items: center;
}

.content-section { 
    display: none; 
    animation: fadeIn 0.4s ease; 
    flex: 1;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
}
.content-section.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.section-header h1 { font-size: 2rem; font-weight: 600; }

.tabs {
    display: flex;
    background: var(--bg-element);
    border-radius: 8px;
    padding: 4px;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: var(--transition);
}
.tab-btn.active {
    background: var(--bg-panel);
}

/* Responsive Design */
@media (max-width: 768px) {
    #dashboard-view {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        z-index: 1000;
    }
    .sidebar .logo-area.small {
        margin: 0;
        padding: 0;
        width: 100%;
        justify-content: space-between;
    }
    .sidebar .logo-area.small h2 {
        display: block;
    }
    .mobile-menu-btn {
        display: block !important;
    }
    .menu-collapse {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-base);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
    }
    .sidebar.menu-open .menu-collapse {
        display: flex;
    }
    .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    .nav-links li a {
        padding: 12px 16px;
        border-left: 3px solid transparent;
        border-bottom: none;
        white-space: normal;
    }
    .nav-links li a.active {
        border-left-color: var(--primary);
        border-bottom-color: transparent;
        background: var(--primary-light);
    }
    .user-profile {
        display: flex;
        padding: 16px;
        border-top: 1px solid var(--border-color);
        border-left: none;
        margin-top: 0;
        width: 100%;
        margin-left: 0;
    }
    .user-info .phone {
        display: block;
    }
    .content-area {
        padding: 20px 16px;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .section-header h1 {
        font-size: 1.5rem;
    }
}
