#app-shell {
    display: grid;
    grid-template-rows: 60px 1fr;
    grid-template-columns: 240px 1fr;
    height: 100vh;
    width: 100vw;
}

/* TOP HEADER */
#top-header {
    grid-row: 1;
    grid-column: 1 / span 2;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 10;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.company-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
    filter: brightness(1.15);
}

.logo-section svg {
    color: var(--accent);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 20px;
}

.offline-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--success-dim);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.offline-dot {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

.header-actions {
    display: flex;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 12px;
}

.header-action-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.header-action-item:hover {
    color: var(--accent);
}

/* SIDEBAR */
#sidebar {
    grid-row: 2;
    grid-column: 1;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 12px 10px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    transition: width var(--transition-normal);
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: var(--bg-card);
}

.nav-item.active {
    color: var(--bg-primary);
    background-color: var(--accent);
    font-weight: 600;
}

.nav-item.active svg {
    color: var(--bg-primary);
}

/* MAIN CONTENT */
#main-content {
    grid-row: 2;
    grid-column: 2;
    background-color: var(--bg-primary);
    overflow-y: auto;
    position: relative;
    padding: 25px;
}

.page-view {
    display: none;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.page-view.active {
    display: flex;
}

.page-header {
    margin-bottom: 5px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* DRAWER OVERLAY */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 101;
    display: flex;
    flex-direction: column;
    transition: right var(--transition-normal);
}

.drawer.active {
    right: 0;
}
