/* Bố cục tổng thể */
.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* SIDEBAR BÊN TRÁI */
.app-sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 22px;
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 12px 20px;
}

.section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.storage-analytics {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
    margin-top: auto;
}

/* Style cho thanh Dung lượng R2 */
.storage-progress-track {
    height: 6px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

.storage-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.5s ease-out, background-color 0.3s ease;
}

/* Tự động đổi màu khi sắp đầy */
.storage-progress-fill.warning {
    background: var(--warning);
}

.storage-progress-fill.danger {
    background: var(--danger);
}

.storage-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
}

.storage-info i {
    font-size: 24px;
    color: var(--primary);
}

.storage-details p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.storage-details strong {
    color: var(--text-main);
    font-weight: 600;
    background: var(--bg-app);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

/* KHU VỰC NỘI DUNG BÊN PHẢI */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-app);
    min-width: 0;
}

.main-header {
    height: 64px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: var(--shadow-sm);
    z-index: 5;
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb strong {
    color: var(--text-main);
    font-weight: 600;
}

.search-wrapper {
    position: relative;
    width: 280px;
}

.search-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}

.search-wrapper input {
    width: 100%;
    padding: 10px 10px 10px 36px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-app);
    transition: all 0.2s;
    outline: none;
}

.search-wrapper input:focus {
    background: var(--bg-surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.content-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    align-content: start;
}