/* === LAYOUT SYSTEM === */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: var(--z-sidebar);
    transition: width var(--transition-base);
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
}

.sidebar-logo {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--amber), var(--amber-dark));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
    box-shadow: var(--shadow-glow-amber);
}

.sidebar-brand { display: flex; flex-direction: column; overflow: hidden; white-space: nowrap; }
.sidebar-brand h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-brand span { font-size: 0.75rem; color: var(--amber); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }
.collapsed .sidebar-brand { display: none; }

.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }

.nav-section-title {
    font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.1em; padding: 16px 12px 8px; font-weight: 600;
}
.collapsed .nav-section-title { display: none; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-md);
    color: var(--text-secondary); cursor: pointer;
    transition: all var(--transition-fast);
    position: relative; margin-bottom: 2px; user-select: none;
}
.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active { background: var(--amber-glow); color: var(--amber); }
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 24px; background: var(--amber); border-radius: 0 3px 3px 0;
}
.nav-item i { font-size: 1.15rem; width: 24px; text-align: center; flex-shrink: 0; }
.nav-item span { font-size: 0.9rem; font-weight: 500; white-space: nowrap; }
.collapsed .nav-item span { display: none; }

.nav-badge {
    margin-left: auto; background: var(--red); color: white;
    font-size: 0.65rem; font-weight: 700; padding: 2px 7px;
    border-radius: 10px; min-width: 20px; text-align: center;
}
.collapsed .nav-badge { display: none; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border-primary); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-md); cursor: pointer; transition: background var(--transition-fast); }
.sidebar-user:hover { background: var(--bg-tertiary); }
.sidebar-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; color: white; flex-shrink: 0;
}
.sidebar-user-info .name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .role { font-size: 0.72rem; color: var(--text-muted); text-transform: capitalize; }
.collapsed .sidebar-user-info { display: none; }

/* === MAIN CONTENT === */
.main-content {
    flex: 1; margin-left: var(--sidebar-width); height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left var(--transition-base); overflow: hidden;
}
.main-content.expanded { margin-left: var(--sidebar-collapsed); }

/* === HEADER === */
.header {
    height: var(--header-height); background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; flex-shrink: 0; z-index: var(--z-header);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-toggle {
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.2rem; cursor: pointer; padding: 8px;
    border-radius: var(--radius-sm); transition: all var(--transition-fast);
}
.header-toggle:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.header-title { font-size: 1.25rem; font-weight: 700; }
.header-subtitle { font-size: 0.8rem; color: var(--text-muted); }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-btn {
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.1rem; cursor: pointer; padding: 8px 10px;
    border-radius: var(--radius-sm); transition: all var(--transition-fast);
    position: relative;
}
.header-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.header-btn .badge {
    position: absolute; top: 4px; right: 4px;
    width: 8px; height: 8px; background: var(--red);
    border-radius: 50%; border: 2px solid var(--bg-secondary);
}
.header-time {
    font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
    color: var(--text-muted); padding: 6px 12px;
    background: var(--bg-primary); border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
}

/* === PAGE CONTENT === */
.page-content { flex: 1; overflow-y: auto; padding: 24px; }

/* === GRID === */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-sidebar { grid-template-columns: 1fr 380px; }

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main-content { margin-left: 0 !important; }
}
