/* ==========================================================================
   PractisBase Design System & Master Variables
   ========================================================================== */
:root {
    /* Color Palette */
    --primary-navy: #0B1120;       /* Deep corporate navy for sidebar */
    --primary-cerulean: #0284c7;   /* Modern teal/blue for active states & buttons */
    --primary-cerulean-hover: #0369a1;
    --text-main: #334155;          /* Slate gray for readability */
    --text-muted: #64748b;         /* Lighter slate for secondary text */
    --bg-canvas: #f8fafc;          /* Very light gray for the main app background */
    --bg-surface: #ffffff;         /* Pure white for cards and headers */
    --border-light: #e2e8f0;       /* Subtle borders for structure */

    /* Spacing & Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;

    /* Borders & Shadows */
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   CSS Reset & Base Typography
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ==========================================================================
   Dashboard App Shell (CSS Grid)
   ========================================================================== */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    min-height: 100vh;
}

/* --- Sidebar --- */
.app-sidebar {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    background-color: var(--bg-surface); /* Pure white background */
    border-right: 1px solid var(--border-light); /* Crisp separator line */
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-brand {
    height: auto;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light); /* Lighter border line */
}

.sidebar-brand img {
    width: 100%;
    max-width: 180px;
    height: auto;
    object-fit: contain;
}

.sidebar-brand span {
    color: var(--primary-cerulean);
}

.sidebar-nav {
    padding: var(--space-md);
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    color: var(--text-muted); /* Slate gray for resting links */
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(2, 132, 199, 0.08); /* Very subtle cerulean tint */
    color: var(--primary-cerulean); /* Pops blue when active or hovered */
}

/* --- Top Header --- */
.app-header {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    
    /* The premium gradient transition */
    background: linear-gradient(90deg, var(--primary-navy) 0%, var(--primary-cerulean) 100%);
    
    border-bottom: none; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    box-shadow: var(--shadow-md);
    z-index: 5;
}

.header-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff; /* Crisp white text to contrast the navy */
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: #e2e8f0; /* Light slate for the user's name */
}

.avatar {
    width: 32px;
    height: 32px;
    background-color: var(--primary-cerulean); /* Teal accent for the avatar */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.2); /* Subtle premium ring */
}

/* --- Main Content Area --- */
.app-main {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    padding: var(--space-lg);
    overflow-y: auto;
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .app-sidebar {
        display: none; /* We will add a JS hamburger menu later */
    }
    .app-header, .app-main {
        grid-column: 1 / 2;
    }
}