:root {
    --header-height: 64px;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 70px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', 'Quicksand', 'Comfortaa', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    position: relative;
}

/* Background handled by theme-variables.css */


/* Core Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: transparent;
    position: relative;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    flex: 1;
    padding: 1.5rem;
    padding-top: calc(var(--header-height) + 1.5rem);
    min-height: calc(100vh - var(--header-height));
    background-color: var(--bg-primary);
}

body[data-sidebar="collapsed"] .main-content {
    margin-left: var(--sidebar-width-collapsed);
    width: calc(100% - var(--sidebar-width-collapsed));
}

/* Sidebar States */
.sidebar {
    z-index: 1050;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .content {
        padding: 1rem;
    }

    body[data-sidebar="collapsed"] .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    body.sidebar-visible {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .sidebar-backdrop {
        display: none;
    }

    .sidebar-backdrop.show {
        display: block;
    }
}

/* iOS height fix */
@supports (-webkit-touch-callout: none) {
    .main-content,
    .content {
        min-height: -webkit-fill-available;
    }
}

/* Modern scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Touch-friendly adjustments */
@media (hover: none) {
    .clickable, 
    button,
    .user-profile,
    .nav-link {
        -webkit-tap-highlight-color: transparent;
    }
    
    input, 
    select, 
    textarea {
        font-size: 16px !important;
    }
}

/* Fix for iOS height issues */
@supports (-webkit-touch-callout: none) {
    .main-content {
        height: -webkit-fill-available;
    }
    
    .content {
        min-height: calc(100vh - var(--header-height));
        min-height: calc((var(--vh, 1vh) * 100) - var(--header-height));
    }
}

.header {
    z-index: 100;
}

/* Modern header adjustments for dashboard layout */
.dashboard-container .modern-header {
    width: 100%;
}