:root {
    /* --- Color System (Slate Scale) --- */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* --- Brand Colors (Indigo) --- */
    --primary: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --primary-light: #e0e7ff;
    /* Indigo 100 */
    --accent: #ec4899;
    /* Pink 500 */

    /* --- Semantic Variables --- */
    --bg-app: var(--slate-100);
    --bg-sidebar: var(--slate-900);
    --bg-card: #ffffff;

    --text-main: var(--slate-800);
    --text-muted: var(--slate-500);
    --text-sidebar: var(--slate-400);
    --text-sidebar-active: #ffffff;

    --border-subtle: var(--slate-200);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* --- Dimensions --- */
    --sidebar-width: 280px;
    --header-height: 72px;
}

/* Reset & Base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', 'Pretendard', sans-serif;
    color: var(--text-main);
    background: var(--bg-app);
    height: 100vh;
    height: 100dvh;
    /* Mobile viewport fix */
    overflow: hidden;
}

/* --- Layout --- */
.app-container {
    display: flex;
    height: 100%;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-right: 1px solid var(--slate-800);
    color: var(--text-sidebar);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    padding-left: 8px;
}

.brand i {
    color: var(--primary);
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    /* Scrollbar formatting */
}

/* Custom Scrollbar for dark sidebar */
.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--slate-700);
    border-radius: 4px;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-500);
    font-weight: 700;
    margin-bottom: 12px;
    padding-left: 12px;
}

.nav-item {
    display: block;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    color: var(--slate-400);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--slate-200);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--slate-800);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    display: grid;
    place-items: center;
}

.info .name {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.info .status {
    color: var(--slate-500);
    font-size: 0.75rem;
}


/* --- Main Content --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-app);
}

/* Header */
.top-bar {
    height: var(--header-height);
    background: var(--bg-app);
    /* Transparent feel or solid? Solid matches bg */
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    justify-content: space-between;
    padding: 0 32px;
    position: relative;
    z-index: 50;
    /* Ensure it stays above content */
}

.header-left h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--slate-900);
}

.subtitle {
    font-size: 0.85rem;
    color: var(--slate-500);
}

/* --- Views Layout --- */
.content-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view-section {
    position: absolute;
    inset: 0;
    overflow: hidden;
    /* Prevent body scroll */
    display: flex;
    /* Use flex to manage scroll area */
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-out;
}

.view-section.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}