/* =========================================
   GLOBAL FIX
   Without this, any element combining
   width:100% with padding will overflow its
   flex/grid container and knock siblings out
   of alignment.
========================================= */

.relay-dashboard,
.relay-dashboard * {
    box-sizing: border-box;
}

/* Ensure page fills viewport and remove default body margin
   which can produce a white gap at the bottom in some layouts */
html, body {
    height: 100%;
    margin: 0;
    background: #f8fafc;
}

/* =========================================
   RELAY SHARED LAYOUT
   Switched to CSS Grid so the sidebar and
   main content column are always forced to
   the same height, regardless of how much
   content either one has.
========================================= */

.relay-dashboard {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    margin: 0;
    background: #f8fafc;
    font-family: Arial, sans-serif;
}


/* =========================================
   SIDEBAR
========================================= */

.relay-sidebar {
    width: 230px;
    min-width: 230px;
    background: #0f172a;
    color: white;
    padding: 18px 12px;
	height: 100%;

}

.relay-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 20px;
}

.relay-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
	margin: 10px;

}

.relay-brand-name {
    font-size: 16px;
    font-weight: 700;
}

.relay-brand-subtitle {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 2px;
}

.relay-navigation {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.relay-nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
}

.relay-nav-item:hover {
    background: #699ac9;
    color: white;
}

.relay-nav-item.active {
    background: #202b59;
    color: white;
}

.relay-nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.relay-navigation span {
    color: white;
}


/* =========================================
   SHARED MAIN AREA
========================================= */

.relay-main-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.relay-main {
    flex: 1;
    min-height: 0;
    padding: 25px 28px;
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-width: none;
    background-color: #f8fafc;
    background-image: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.16), transparent 55%);
}


/* =========================================
   CLIENT COMPANY FILTER DROPDOWNS 
========================================= */

.client-company-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.client-company-filters select {
    padding: 0px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    min-width: 160px;
}


/* =========================================
   TOP BAR
========================================= */

.relay-topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 66px;
    padding: 0 24px;
    background: #faf9ff;
    border-bottom: 1px solid #e2e8f0;
	padding-top: 12px;
    flex-shrink: 0;
}

.relay-topbar-title-block {
    flex-shrink: 0;
    line-height: 1.35;
}

.relay-topbar-crumb {
    font-size: 11px;
    color: #94a3b8;
}

.relay-topbar-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.relay-topbar-search {
    position: relative;
    flex: 1;
    max-width: 420px;
    min-width: 0;
    align-self: center;   /* prevents the wrapper from stretching to fill the topbar's full height */
}

.relay-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #94a3b8;
    pointer-events: none;
    line-height: 1;
}

.relay-topbar-search input {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 12px 0 34px;
    font-size: 13px;
    background: #f8fafc;
    display: block;
}

.relay-topbar-action-btn {
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 18px;
    height: 38px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
}

.relay-topbar-action-btn:hover {
    background: #4f46e5;
}

.relay-topbar-bell {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.relay-topbar-bell-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
}

.relay-topbar-divider {
    width: 1px;
    height: 28px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.relay-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    cursor: pointer;
}

.relay-user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.relay-user-avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #6366f1;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.relay-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.relay-user-role {
    font-size: 11px;
    color: #94a3b8;
}

.relay-user-chevron {
    color: #94a3b8;
    font-size: 11px;
}


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

@media (max-width: 900px) {

    .relay-dashboard {
        grid-template-columns: 200px 1fr;   /* was: resizing .relay-sidebar directly */
    }

}


@media (max-width: 750px) {

    .relay-dashboard {
         grid-template-columns: 1fr;
    }

    .relay-sidebar {
        display: none;
    }

    .relay-main {
        padding: 20px;
    }

}
