/* ///////////////////////////////
///CSS for manager-portal.html///
///////////////////////////////*/

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

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    font-family: 'DM Sans', sans-serif;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}


/* ============================ */
/* ============================ */
/* ============MAIN============ */
/* ============================ */
/* ============================ */


/* desktop */

.nav {
    z-index: 100;
    height: 56px;
    background-color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: relative;
}

.main {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: stretch;
    min-height: calc(100vh - 56px);
    width: 100%;
    max-width: 100%;
}

/* nav */

.nav .brand-logo {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--white);
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    padding-right: 12px;
}

.nav .brand-logo-img {
    display: inline-block;
    height: 32px;
    width: auto;
    max-width: min(160px, 42vw);
    object-fit: contain;
    vertical-align: middle;
}

.nav .brand-logo span {
    color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.nav-link {
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}


.manager-badge {
    font-size: 9px;
    font-weight: 700;
    background: var(--primary);
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.06em;
    text-align: center;
}


/* side bar */

.sidebar {
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0;
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-top {
    flex: 1;
}

.sidebar-bottom {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}


.sidebar-label {
    padding-top: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 1.25rem;
    margin-bottom: 6px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 1.25rem;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-item {
    color: var(--text-secondary);
}

.sidebar-item a {
    color: inherit;
    text-decoration: none;
}
.sidebar-item.active {
    background: var(--bg-accent);
    color: var(--primary-dark);
    border-left-color: var(--accent2);
    font-weight: 500;
}

.sidebar-item:hover { 
    background: var(--bg); 
    color: var(--text-primary); 
}

.contents {
    min-height: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.page {
    display: none;
    margin: 3rem;
}

.page.active {
    display: block;
}

.page-lazy-loading,
.page-lazy-error {
    color: var(--text-muted);
    font-size: 14px;
    margin: 1rem 0;
}

.page-lazy-error {
    color: #DC2626;
}

.mobile-head {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--bg-accent);
    display: none;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: 6px;
}

.header-button {
    display: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--bg-accent);
    background: var(--white);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--black);
    font-size: 16px;
    transition: all 0.15s;
}

.drawer-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--bg-accent);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.15s;
}

.drawer-close:hover {
    background-color: red;
    color: var(--white);
    border-color: red;
}

@media (max-width: 850px){
    .nav {
        padding: 0 0.75rem;
        gap: 8px;
    }

    .nav .brand-logo {
        font-size: 15px;
        padding-right: 8px;
    }

    .nav .brand-logo-img {
        height: 26px;
        max-width: min(120px, 38vw);
    }

    .nav-right {
        gap: 8px;
    }

    .nav-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .sidebar {
        position: fixed;
        top: 0px;
        z-index: 301;
        left: 0;
        bottom: 0;
        width: min(260px, 85vw);
        background: var(--white);
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid var(--border);
        padding: 0;
    }

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

    .main {
        grid-template-columns: 1fr;
    }

    .page {
        margin: 1rem 0.75rem;
        max-width: 100%;
        min-width: 0;
    }

    .mobile-head {
        display: flex;
    }

    .header-button {
        display: flex;
    }
}

@media (max-width: 380px) {
    .nav .brand-logo {
        font-size: 13px;
    }

    .nav-right {
        gap: 6px;
    }
}



/* page */

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-sub {
    font-size: 13px;
    color: var(--text-secondary);
    padding-bottom: 25px;
}

/* cards */

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

@media (max-width: 1100px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .cards {
        grid-template-columns: 1fr;
    }
}

.cards-container {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    border-radius: 8px;
    padding: 1.1rem 1.25rem;
    transition: border-color 0.3s ease, box-shadow 0.2s ease;
}

.cards-container:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.card-icon {
    font-size: 1.15rem;
    opacity: 0.3;
    flex-shrink: 0;
}

.sub-text {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.main-text {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 0.4rem;
}

.stat-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

/* accent borders - set by JS */
.cards-container.accent-green { border-left-color: var(--green); }
.cards-container.accent-amber { border-left-color: var(--amber); }
.cards-container.accent-red   { border-left-color: var(--red);   }

/* stat-sub tones - set by JS */
.stat-sub.stat-green { color: var(--green); }
.stat-sub.stat-amber { color: var(--amber); }
.stat-sub.stat-red   { color: var(--red);   }

