
/* GENERAL RESET */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f6f6fa;
    color: #292638;
}


/* MAIN LAYOUT */

.app-container {
    display: flex;
    min-height: 100vh;
}


/* SIDEBAR */

.sidebar {
    width: 240px;
    background: #292044;
    color: white;
    padding: 25px 15px;

    display: flex;
    flex-direction: column;
}

.logo {
    padding: 5px 10px 30px;
}

.logo h2 {
    font-size: 21px;
    letter-spacing: 1px;
}

.logo p {
    font-size: 11px;
    color: #bcb4d2;
    margin-top: 6px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.menu a {
    text-decoration: none;
    color: #d5cfe4;
    padding: 13px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.menu a:hover,
.menu a.active {
    background: #51416f;
    color: white;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 10px 0;
    color: #aaa1c2;
    font-size: 11px;
}


/* MAIN CONTENT */

.main-content {
    flex: 1;
    min-width: 0;
    padding: 25px;
}


/* TOP BAR */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.topbar h3 {
    font-size: 17px;
}

.topbar p {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: #e9e3f5;
    color: #51416f;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: bold;
}


/* PAGE HEADINGS */

.page-heading {
    margin-bottom: 22px;
}

.page-heading h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.page-heading p {
    font-size: 13px;
    color: #888;
}


/* DASHBOARD CARDS */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 25px;
}

.summary-card {
    background: white;
    padding: 22px 18px;
    border-radius: 8px;
    border: 1px solid #eceaf1;
}

.summary-card p {
    font-size: 13px;
    color: #888;
}

.summary-card h2 {
    margin-top: 12px;
    font-size: 23px;
    color: #51416f;
}


/* CONTENT AREA */

.content-card {
    background: white;
    padding: 22px;
    border-radius: 8px;
    border: 1px solid #eceaf1;
}

.content-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
}

.empty-state {
    padding: 35px 10px;
    text-align: center;
    color: #999;
    font-size: 13px;
}


/* PAGE NAVIGATION */

.page {
    display: none;
}

#dashboard {
    display: block;
}

.page:target {
    display: block;
}

.page:target ~ .page {
    display: none;
}

/* Keep dashboard hidden when another page is selected */
body:has(.page:target:not(#dashboard)) #dashboard {
    display: none;
}



/* =========================================
   RESPONSIVE LAYOUT
========================================= */

/* Desktop: permanent sidebar, no hamburger */
.menu-toggle {
    display: none;
    border: 0;
    background: #51416f;
    color: #fff;
    font-size: 23px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-overlay {
    display: none;
}

@media (min-width: 851px) {
    .main-content {
        padding: 32px 36px;
    }

    .topbar {
        margin-top: 8px;
        padding: 20px 24px;
    }
}

/* Tablet */
@media (min-width: 601px) and (max-width: 850px) {
    .sidebar {
        width: 190px;
    }

    .main-content {
        padding: 18px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile: sidebar becomes a slide-out drawer */
@media (max-width: 600px) {
    html,
    body {
        width: 100%;
        overflow-x: hidden;
    }

    .app-container {
        display: block;
        width: 100%;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(82vw, 280px);
        height: 100vh;
        height: 100dvh;
        z-index: 1001;
        padding: 24px 16px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        transform: translateX(-110%);
        transition: transform 0.25s ease;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.16);
    }

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

    .logo {
        padding: 8px 10px 30px;
    }

    .menu {
        display: flex;
        flex-direction: column;
        gap: 8px;
        overflow: visible;
    }

    .menu a {
        display: block;
        white-space: normal;
        font-size: 15px;
        padding: 15px;
    }

    .sidebar-footer {
        display: block;
    }

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1000;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    body.nav-open .nav-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.nav-open {
        overflow: hidden;
    }

    .main-content {
        display: block;
        width: 100%;
        min-width: 0;
        padding: 12px;
    }

    .topbar {
        display: flex;
        width: 100%;
        margin: 0 0 22px;
        padding: 14px 12px;
        border-radius: 10px;
        gap: 8px;
    }

    .menu-toggle {
        display: block;
        flex: 0 0 42px;
    }

    .topbar h3 {
        font-size: 17px;
    }

    .topbar p {
        font-size: 12px;
    }

    .user-info {
        gap: 7px;
        font-size: 12px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    .page-heading {
        margin-bottom: 18px;
    }

    .page-heading h2 {
        font-size: 21px;
    }

    .page-heading p {
        font-size: 14px;
        line-height: 1.45;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .summary-card {
        min-width: 0;
        padding: 18px 12px;
        border-radius: 10px;
    }

    .summary-card p {
        font-size: 13px;
        line-height: 1.4;
    }

    .summary-card h2 {
        font-size: 19px;
        overflow-wrap: anywhere;
    }

    .content-card {
        padding: 16px 12px;
        border-radius: 10px;
    }

    .content-card h3 {
        font-size: 17px;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }

    .table-wrapper {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Very narrow phones */
@media (max-width: 360px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .user-info span {
        display: none;
    }
}

/* BUILDTRACK MOBILE GLASS SIDEBAR */

@media (max-width: 600px) {
    
    .sidebar {
        top: 70px !important;
        bottom: auto !important;
        
        height: auto !important;
        max-height: calc(100dvh - 90px);
        
        background: rgba(65, 40, 105, 0.78) !important;
        
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-left: none;
        
        border-radius: 0 18px 18px 0;
        
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
        
        overflow-y: auto;
    }
    
}

@media (max-width: 600px) {

    body .sidebar {
        background-color: rgba(65, 40, 105, 0.38) !important;
        background-image: none !important;

        backdrop-filter: blur(20px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(160%) !important;

        border: 1px solid rgba(255, 255, 255, 0.22) !important;
    }

}

/* PREMIUM GUEST AUTHENTICATION BUTTONS */

#guest-auth-links {
    display: flex;
    align-items: center;
    gap: 9px;
}

#guest-auth-links button {
    min-height: 36px;
    padding: 8px 15px;
    border: 1px solid #ded6e9;
    border-radius: 7px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .2px;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

#guest-sign-in {
    background: #fff;
    color: #51416f;
}

#guest-sign-in:hover {
    background: #f6f3f9;
    border-color: #bdb0d0;
}

#guest-sign-up {
    background: #51416f;
    border-color: #51416f !important;
    color: #fff;
}

#guest-sign-up:hover {
    background: #3f3158;
    border-color: #3f3158 !important;
}

#guest-auth-links button:active {
    transform: scale(.97);
}

@media(max-width:600px) {
    #guest-auth-links {
        gap: 6px;
    }
    
    #guest-auth-links button {
        min-height: 34px;
        padding: 7px 10px;
        font-size: 11px;
    }
}

