:root {
    --header-height: 60px;
    --sidebar-width: 250px;
    --footer-height: 50px;
    --primary-color: #007bff;
    --text-color: #333;
    --bg-color: #f4f4f9;
    --sidebar-bg: #fff;
    --header-bg: #fff;
    --border-color: #e1e1e1;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Layout Wrapper */
.layout-wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    position: relative;
    top: var(--header-height);
}

/* Header */
.main-header {
    height: var(--header-height);
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    justify-content: space-between;
}

.brand {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    margin-right: 1rem;
}

/* Sidebar */
.main-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    transition: margin-left 0.3s ease;
    flex-shrink: 0;
    position: fixed;
    top: var(--header-height);
    bottom: var(--footer-height); /* Or 0 if footer is not fixed/sticky in that way */
    overflow-y: auto;
    left: 0;
    height: calc(100vh - var(--header-height));
}

.main-sidebar.collapsed {
    margin-left: calc(var(--sidebar-width) * -1);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: block;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav li a:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: var(--sidebar-width); /* Default state */
    transition: margin-left 0.3s ease;
    margin-top: 0; 
}

.main-content.expanded {
    margin-left: 0;
}

/* Footer */
.main-footer {
    height: var(--footer-height);
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto; /* Pushes footer to bottom if flex container has height */
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
}

/* Helper to push content down if using fixed header */
/* But here we used margin-top on layout-wrapper or relative positioning. 
   Since header is fixed, layout-wrapper needs to start below it. 
*/

/* Adjustments for footer visibility */
/* If footer is fixed, we need to ensure content doesn't go behind it. */
.main-content {
    /* Adding padding bottom to prevent content hiding behind fixed footer */
    padding-bottom: calc(var(--footer-height) + 2rem);
    min-height: 100vh; /* Ensure bg covers full height */
}
