.topbar {
    height: 48px;
    background: var(--bg-topbar);
    color: var(--fg-topbar);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 0 16px 0 0;
    border-bottom: 1px solid var(--border-topbar);
    box-shadow: 0 1px 0 var(--border-topbar);
}

.top-left {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 0;
    padding-left: 2px;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
}

.top-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    justify-self: center;
}

/* Brand Logo */
.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Main Layout Grid */
.layout {
    display: grid;
    grid-template-columns: 50px 220px 1fr 10px 1fr;
    grid-template-rows: 1fr;
    grid-template-areas: "activity explorer workbench gutter terminal";
    gap: 0;
   height: calc(100vh - 48px - 25px) !important;
    min-height: 0;

}

/* --- STATUS BAR  --- */
.status-bar {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: 25px; /* Tăng từ 22px lên 25px cho chữ không bị cắt */
    
    background-color: var(--accent-color); 
    color: #fff;
    
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    
    padding: 0 15px; /* Padding 2 bên rộng hơn chút */
    font-size: 12px;
    user-select: none;
    z-index: 9999;
    box-sizing: border-box;
    line-height: 1; /* Quan trọng: Để chữ căn giữa chuẩn */
}

.status-right { 
    display: flex; 
    gap: 20px; 
    align-items: center;
}

.status-item { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    cursor: default; /* Bỏ con trỏ tay để đỡ tưởng bấm được */
}
body.theme-light .status-bar {
    background-color: #008c8c;
    /* Light mode vẫn dùng xanh hoặc tím */
    color: #fff;
}

.status-left,
.status-right {
    display: flex;
    gap: 15px;
}

.status-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-item:hover {
    opacity: 0.8;
}

/* --- ACTIVITY BAR (THANH ICON DỌC) --- */
.activity-bar {
    grid-area: activity;
    background-color: #1e1e1e;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-right: 1px solid #252526;
}

/* Từng ô icon */
.activity-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* 1. Con trỏ bàn tay */
    color: #858585;
    /* Màu xám mặc định */
    position: relative;
    transition: color 0.2s;
    /* Hiệu ứng mượt */
}

/* Khi di chuột vào (Hover) */
.activity-item:hover {
    color: #fff;
    /* 2. Sáng lên màu trắng */
}

/* Khi đang chọn (Active) */
.activity-item.active {
    color: #fff;
    border-left: 2px solid var(--accent-color);
    /* 3. Viền sáng bên trái */
}

.activity-item svg {
    width: 24px;
    height: 24px;
}

/* CSS Project Item */
.project-item {
    background: #333;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-item:hover {
    background: #444;
    border-color: #007acc;
}

.project-name {
    font-weight: bold;
    color: #fff;
}

.project-date {
    font-size: 12px;
    color: #aaa;
}


.btn-dark-pill {
    white-space: nowrap;
    /* Bắt buộc không xuống dòng */
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: auto;
    /* Cho phép co nhỏ */
}

/* ========================================================== */
/* FIX GIAO DIỆN MOBILE & TABLET (< 1024px) */
/* ========================================================== */

@media (max-width: 1024px) {
    /* Layout Mobile: 1 Cột, Sidebar Ẩn, Terminal Dưới */
    .layout {
        display: grid !important;
        grid-template-columns: 50px 1fr !important;
        grid-template-rows: 1fr 10px 200px;
        grid-template-areas: "activity workbench" "activity gutter" "activity terminal" !important;
        height: calc(100vh - 48px) !important;
        overflow: hidden;
    }

    /* Gutter: Hiện để kéo terminal */
    .gutter {
        display: block !important; grid-area: gutter; cursor: row-resize !important;
        background-color: #1e1e1e; border-top: 1px solid #333; height: 100%; width: 100%; z-index: 100;
    }

    /* Topbar Compact */
    .topbar { padding: 0 5px; gap: 5px; }
    .brand-logo { height: 24px; }
    #userDisplay { display: none !important; }

    /* Terminal Mobile */
    .terminal-panel {
        grid-area: terminal; display: flex !important;
        background-color: #1e1e1e; border-top: 1px solid #333; z-index: 10; min-height: 0;
    }

    /* Sidebar: Overlay Mode */
    .file-explorer {
        position: fixed !important; top: 48px; left: 50px; bottom: 0;
        width: 80% !important; max-width: 300px; z-index: 9999;
        background-color: #1e1e1e; border-right: 1px solid #444;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
        display: none !important;
    }
    .file-explorer.mobile-visible { display: flex !important; }

    /* Modals Centering Fix */
    .modal-content, .project-modal-box {
        position: fixed !important; top: 50% !important; left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important; max-width: 400px !important;
        max-height: 80vh !important; margin: 0 !important;
        z-index: 10000 !important; display: flex; flex-direction: column;
    }

    .pm-body, #projectListContainer { flex: 1; overflow-y: auto; min-height: 150px; }
    
    .pm-footer, .modal-actions {
        flex-direction: column-reverse; gap: 10px; padding: 10px;
    }
    .pm-footer button, .modal-actions button { width: 100%; }

    /* Force Show Actions on Mobile */
    .project-actions, .delete-project-btn { opacity: 1 !important; }
}

.project-actions {
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}


.project-item:hover .project-actions {
    opacity: 1;
}


.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    color: #858585;
}

.action-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.delete-btn:hover {
    color: #ff6b6b;
}

#deleteConfirmModal {
    z-index: 99999 !important;
}

/* Trong style.css */
.project-rename-input {
    background: #3c3c3c;
    color: white;
    border: 1px solid #007acc;
    padding: 2px 5px;
    border-radius: 2px;
    outline: none;
    font-size: 13px;
    width: 100%;
}

.hidden {
    display: none !important;
}