* {
    /* border: 1px dotted rgb(96 139 168); */
    box-sizing: border-box;
}

:root {
    --top-bar-height: 70px;
    --footer-height: 40px;
    --sidebar-width: 350px;
    --desktop-breakpoint: 1024px;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    flex-shrink: 0;
}

.dashboard-layout {
    /* border: 2px dotted rgb(157, 190, 212); */
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

.dashboard-main {
    /* border: 2px dotted rgb(24, 201, 204); */
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
    /* Mobile default: no margin adjustments needed */
    margin-left: 0;
}

/* Sidebar base styles */
.dashboard-sidebar {
    /* border: 2px dotted rgb(19, 209, 83); */
    width: var(--sidebar-width);
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Mobile default: positioned absolutely, hidden off-screen */
    position: absolute;
    transform: translateX(-100%);
    background-color: var(--bs-body-bg);
}

.dashboard-sidebar.open {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .dashboard-sidebar {
        position: relative;
        transform: translateX(0); /* Desktop default: open */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .dashboard-sidebar.closed {
        position: absolute;
        transform: translateX(-100%);
    }

    .sidebar-overlay {
        display: none;
    }
}

.sidebar-header {
    border-bottom: 1px solid var(--bs-secondary-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    flex-shrink: 0;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
}

.sidebar-footer {
    padding: 0.5rem 1rem;
    flex-shrink: 0;
    border-top: 1px solid var(--bs-gray-800);
    background: var(--bs-body-bg, #1a1a1a);
}

/* Overlay styles */
.sidebar-overlay {
    position: fixed;
    top: var(--top-bar-height);
    left: 0;
    width: 100%;
    height: calc(100% - var(--top-bar-height));
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Hide overlay on desktop */
@media (min-width: 1024px) {
    .sidebar-overlay {
        display: none;
    }
}

sl-card {
    display: flex !important;
    flex-direction: column !important;
}

sl-card::part(base) {
    display: flex;
    flex-direction: column;
    height: 100%;
}

sl-card::part(body) {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}