/* The signed-in sidebar, shared by every page that has one.
 *
 * These rules used to live inside agent_developer_sidebar.html, which meant
 * only the agent workspace could have a sidebar: a buyer's bookings page had
 * no way to reach them. They are a stylesheet now so that every signed-in
 * page can use the same furniture, and so there is one copy to change.
 *
 * The markup is templates/users/_sidebar.html; who sees which links is
 * users/sidebar.py.
 */

#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    background-color: #f4f6f9;
    min-height: calc(100vh - 56px);
}

#sidebar-wrapper {
    min-width: 280px;
    max-width: 280px;
    background: #111c24;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

#sidebar-wrapper.collapsed {
    min-width: 0;
    max-width: 0;
    overflow: hidden;
    border-right: none;
}

.sidebar-heading {
    padding: 20px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-info {
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-left-color: rgba(0, 135, 81, 0.5);
}

.sidebar-link.active {
    background: rgba(0, 135, 81, 0.15);
    color: #2ed573;
    font-weight: 600;
    border-left-color: #2ed573;
}

.sidebar-link i {
    font-size: 1.15rem;
    width: 25px;
    margin-right: 12px;
    transition: transform 0.2s;
}

.sidebar-link:hover i {
    transform: scale(1.15);
}

/* The label above each group of links. It is what makes the list readable as
   "these are mine as a landlord" rather than as twenty-four peers. */
.sidebar-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.35);
    padding: 18px 24px 6px 24px;
    font-weight: 700;
}

#page-content-wrapper {
    flex: 1;
    width: 100%;
    /* min-width:0 is what stops a wide table inside a flex child from
       pushing the whole page sideways. */
    min-width: 0;
    overflow-x: hidden;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
}

.partner-topbar {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
}

.btn-toggle-sidebar {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.btn-toggle-sidebar:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.plan-badge-pill {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(0, 135, 81, 0.1);
    color: #008751;
    border: 1px solid rgba(0, 135, 81, 0.2);
}

/* Workspace tab strip: scrolls sideways on a phone rather than wrapping into
   a tall block, so the page content stays where the eye expects it. */
.ws-tabs-wrap {
    background: #fff;
    border-bottom: 1px solid #e6e9ef;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.ws-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.ws-tabs::-webkit-scrollbar { display: none; }

.ws-tab {
    flex: 0 0 auto;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ws-tab:hover { color: #0f172a; }

.ws-tab.active {
    color: #008751;
    border-bottom-color: #008751;
}

/* On a phone the sidebar is a drawer: off-screen until asked for, over the
   page rather than squeezing it into a column nothing fits in. */
@media (max-width: 768px) {
    #sidebar-wrapper {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -290px;
        height: 100%;
        z-index: 1045;
    }

    #sidebar-wrapper.show-mobile {
        left: 0;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }
}
