/* ===== MAIN LAYOUT STYLES ===== */

#mainContent {
    height: 100vh;
    overflow: hidden;
    background-color: #f7f9fc;
    font-family: 'Sora', sans-serif;
    padding-top: 64px; /* Space for fixed header */
    padding-bottom: 28px; /* Space for fixed footer */
    display: flex;
    flex-direction: column;
}

/* ===== TOP HEADER ===== */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    color: #1a1a1a;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.brand-icon {
    width: auto;
    height: 28px;
    object-fit: contain;
}

.module-title {
    font-size: 16px;
    font-weight: 600;
    color: #4a5568;
    border-left: 2px solid #e8eaed;
    padding-left: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Menu Button */
.btn-open-menu {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f3f5;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-open-menu:hover {
    background: #e2e8f0;
    color: #1a1a1a;
}

/* Avatar Dropdown Wrapper */
.avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.user-avatar:hover {
    border-color: #7fad49;
}

.current-time {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
}

/* Dropdown Menu */
.avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1001;
    overflow: hidden;
    padding: 6px;
}

.avatar-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.avatar-dropdown button, .avatar-dropdown a {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    border-radius: 8px;
    text-decoration: none;
}

.avatar-dropdown button svg, .avatar-dropdown a svg {
    color: #7fad49;
    stroke-width: 2;
    flex-shrink: 0;
}

.avatar-dropdown button:hover, .avatar-dropdown a:hover {
    background: #f8f9fa;
    color: #1a1a1a;
}

.avatar-dropdown .text-danger {
    color: #dc2626 !important;
}

.avatar-dropdown .text-danger svg {
    color: #dc2626 !important;
}

.avatar-dropdown .text-danger:hover {
    background: #fef2f2;
}

.dropdown-divider {
    height: 1px;
    background: #f1f3f5;
    margin: 6px 0;
}

/* ===== RIGHT SIDE MENU ===== */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.side-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.05);
    transition: right 0.3s ease;
    z-index: 2001;
    display: flex;
    flex-direction: column;
}

.side-menu.show {
    right: 0;
}

.menu-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8eaed;
}

.menu-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.btn-close-menu {
    background: none;
    border: none;
    cursor: pointer;
    color: #b0b5ba;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-close-menu:hover {
    color: #ef4444;
}

.menu-body {
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: #4a5568;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-list li a.text-danger {
    color: #ef4444 !important;
}

.menu-list li a.text-danger svg {
    stroke: #ef4444 !important;
}

.menu-list li a svg {
    color: #7fad49;
    stroke-width: 2;
}

.menu-list li a:hover {
    background: #f4fdf8;
    color: #1a1a1a;
    padding-left: 28px;
}

/* ===== APP FOOTER ===== */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: #ffffff;
    border-top: 1px solid #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-size: 13px;
    color: #4a5568;
    z-index: 2000;
    flex-shrink: 0;
    user-select: none;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-label {
    font-weight: 400;
    color: #64748b;
}

.footer-value {
    font-weight: 700;
    color: #1e293b;
}

.footer-divider {
    width: 1px;
    height: 16px;
    background: #e2e8f0;
    margin: 0 4px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.powered-text {
    font-size: 8.5px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.8px;
}

.footer-logo {
    height: 12px;
    object-fit: contain;
    filter: brightness(0.8);
}

/* ===== THREADED HIERARCHY LINES ===== */
.tree-line-container {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    pointer-events: none;
    z-index: 10;
}

.tree-trunk {
    position: absolute;
    width: 2px;
    top: 0;
    bottom: 0;
}

.tree-branch {
    position: absolute;
    width: 14px;
    height: 60%;
    top: 0;
    border-left: 2px solid;
    border-bottom: 2px solid;
    border-bottom-left-radius: 5px;
}

/* Level colors */
.tree-lv-1 { border-color: #3b82f6; background-color: #3b82f6; }
.tree-lv-2 { border-color: #06b6d4; background-color: #06b6d4; }
.tree-lv-3 { border-color: #10b981; background-color: #10b981; }

.tree-relative-cell {
    position: relative !important;
    overflow: visible !important;
}
