/* Shared customer portal shell: keep the sidebar and navigation consistent across pages. */
body {
    color: #142033 !important;
    background: #f4f6fa !important;
}

.sidebar {
    box-sizing: border-box;
    width: 260px !important;
    background: #111827 !important;
    color: #f8fafc !important;
    border-right: 1px solid #202b3b !important;
    padding: 22px 16px !important;
    box-shadow: 8px 0 28px rgba(15, 23, 42, .06);
}

.main {
    box-sizing: border-box;
    width: calc(100% - 260px) !important;
    margin-left: 260px !important;
    min-width: 0;
}

/* Prevent nested desktop panels from forcing the customer pages wider than the viewport. */
.main > .topbar,
.main > .content,
.main .content {
    box-sizing: border-box;
    min-width: 0;
}

.sidebar .brand,
.sidebar .logo {
    min-height: 74px;
    padding: 4px 10px 22px !important;
    margin: 0 0 18px !important;
    border-bottom: 1px solid rgba(226, 232, 240, .12) !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar .logo {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: auto auto;
}

.sidebar .logo::before {
    grid-column: 1;
    grid-row: 1 / 3;
}

.sidebar .logo h1 {
    grid-column: 2;
    grid-row: 1;
}

.sidebar .logo p {
    grid-column: 2;
    grid-row: 2;
}

.sidebar .brand.brand-profile {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: auto auto;
}

.sidebar .brand.brand-profile::before {
    grid-column: 1;
    grid-row: 1 / 3;
}

.sidebar .brand-icon,
.sidebar .logo::before,
.sidebar .brand.brand-profile::before {
    content: "SZ";
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #f8fafc !important;
    color: #111827 !important;
    font-size: 17px;
    font-weight: 900;
}

.sidebar .brand-name,
.sidebar .brand-text strong,
.sidebar .logo h1 {
    color: #f8fafc !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    letter-spacing: -.2px;
}

.sidebar .brand-name span,
.sidebar .logo h1 span {
    display: inline !important;
    margin: 0 !important;
    color: inherit !important;
}

.sidebar .brand-subtitle,
.sidebar .brand-text span,
.sidebar .logo p {
    margin-top: 4px !important;
    color: #9aa9bf !important;
    font-size: 12px !important;
}

.sidebar .menu-title,
.sidebar .nav-title {
    padding: 10px 12px !important;
    margin: 0 0 8px !important;
    color: #8fa0b8 !important;
    font-size: 11px !important;
    font-weight: 750 !important;
    letter-spacing: .09em;
}

.sidebar .nav,
.sidebar .menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar .nav a,
.sidebar .menu a {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px !important;
    border: 1px solid transparent;
    border-radius: 10px !important;
    background: transparent !important;
    color: #c5d0df !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.sidebar .nav a:hover,
.sidebar .menu a:hover {
    background: #202b3b !important;
    color: #fff !important;
}

.sidebar .nav a.active,
.sidebar .menu a.active {
    background: #f8fafc !important;
    color: #111827 !important;
    border-color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.sidebar .nav-icon,
.sidebar .menu-icon {
    width: 21px;
    flex: 0 0 21px;
    display: inline-flex;
    justify-content: center;
    color: inherit !important;
    font-size: 0 !important;
}

.sidebar .nav-icon::before,
.sidebar .menu-icon::before,
.sidebar .sidebar-bottom .nav-icon::before,
.sidebar .sidebar-bottom a > span:first-child::before {
    font-size: 15px;
    font-weight: 700;
}

.sidebar .nav a:nth-child(1) .nav-icon::before,
.sidebar .menu a:nth-child(1) .menu-icon::before { content: "⌂"; }
.sidebar .nav a:nth-child(2) .nav-icon::before,
.sidebar .menu a:nth-child(2) .menu-icon::before { content: "＋"; }
.sidebar .nav a:nth-child(3) .nav-icon::before,
.sidebar .menu a:nth-child(3) .menu-icon::before { content: "▤"; }
.sidebar .nav a:nth-child(4) .nav-icon::before,
.sidebar .menu a:nth-child(4) .menu-icon::before { content: "▣"; }
.sidebar .nav a:nth-child(5) .nav-icon::before,
.sidebar .menu a:nth-child(5) .menu-icon::before { content: "◉"; }
.sidebar .nav a:nth-child(6) .nav-icon::before,
.sidebar .menu a:nth-child(6) .menu-icon::before { content: "♧"; }
.sidebar .nav a:nth-child(7) .nav-icon::before,
.sidebar .menu a:nth-child(7) .menu-icon::before,
.sidebar .sidebar-bottom .nav-icon::before,
.sidebar .sidebar-bottom a > span:first-child::before { content: "↪"; }

.sidebar .sidebar-bottom {
    margin-top: auto;
}

.sidebar a.logout,
.sidebar a.logout-link {
    color: #ff9292 !important;
}

.sidebar a.logout:hover,
.sidebar a.logout-link:hover {
    background: rgba(239, 68, 68, .12) !important;
    color: #ffc0c0 !important;
}

.topbar,
.header,
.top-header {
    background: #fff !important;
    border-bottom-color: #e3e8f0 !important;
}

.customer-mobile-menu {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font-size: 20px;
    cursor: pointer;
}

@media (max-width: 800px) {
    .sidebar {
        width: 260px !important;
    }
    .main {
        width: 100% !important;
        margin-left: 0 !important;
    }
    .customer-mobile-menu {
        display: inline-grid;
        place-items: center;
        margin-right: 12px;
    }
}

/* App-like mobile navigation shared by the customer portal. */
.customer-bottom-nav { display: none; }

@media (max-width: 800px) {
    body {
        padding-bottom: 84px !important;
        padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
        overflow-x: hidden;
    }

    body .sidebar,
    body .sidebar.open {
        display: none !important;
        transform: none !important;
    }

    body .customer-mobile-menu { display: none !important; }

    body .main {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        overflow-x: clip;
    }

    .customer-bottom-nav {
        position: fixed;
        z-index: 9980;
        left: 0;
        right: 0;
        bottom: 0;
        inset: auto 0 0;
        min-height: 68px;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        gap: 2px;
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid #e8edf3;
        background: rgba(255, 255, 255, .97);
        box-shadow: 0 -8px 28px rgba(16, 24, 40, .08);
        backdrop-filter: blur(16px);
    }

    .customer-nav-item {
        position: relative;
        min-width: 0;
        min-height: 52px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border: 0;
        border-radius: 13px;
        background: transparent;
        color: #667085;
        font: inherit;
        font-size: 9px;
        font-weight: 700;
        line-height: 1.15;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .customer-nav-item svg {
        width: 21px;
        height: 21px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .customer-nav-item.is-active:not(.customer-nav-create) {
        background: #fff1f2;
        color: #d8232a;
    }

    .customer-nav-create { gap: 2px; overflow: visible; color: #d8232a; }
    .customer-nav-logout { color: #667085; }

    .customer-nav-create-icon {
        position: relative;
        z-index: 1;
        width: 54px;
        height: 54px;
        display: grid;
        place-items: center;
        margin-top: -23px;
        border: 3px solid #fff;
        border-radius: 50%;
        background: linear-gradient(145deg, #ff3445, #e8002a);
        color: #fff;
        box-shadow: 0 7px 17px rgba(239, 43, 45, .3);
        font-size: 39px;
        font-weight: 400;
        line-height: 1;
    }

    .customer-nav-create.is-active .customer-nav-create-icon { background: linear-gradient(145deg, #ff3445, #e8002a); }
    .customer-nav-create > span:last-child { position: relative; z-index: 1; margin-top: -1px; color: #bd1f25; font-size: 10px; font-weight: 750; white-space: nowrap; }

    .customer-nav-badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 23px);
        min-width: 16px;
        height: 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        border: 2px solid #fff;
        border-radius: 99px;
        background: #ef2b2d;
        color: #fff;
        font-size: 9px;
        font-weight: 800;
    }
    .customer-nav-badge[hidden] { display: none !important; }

    .customer-nav-more-wrap { position: relative; min-width: 0; }
    .customer-nav-more { width: 100%; }
    .customer-nav-more[aria-expanded="true"] { background: #f2f4f7; color: #182230; }

    .customer-more-menu {
        position: absolute;
        right: 0;
        bottom: calc(100% + 12px);
        width: 190px;
        padding: 7px;
        border: 1px solid #e4e9f0;
        border-radius: 15px;
        background: #fff;
        box-shadow: 0 14px 38px rgba(16, 24, 40, .18);
    }

    .customer-more-menu[hidden] { display: none; }
    .customer-more-menu a { min-height: 43px; display: flex; align-items: center; gap: 11px; padding: 0 12px; border-radius: 10px; color: #263449; font-size: 13px; font-weight: 700; text-decoration: none; }
    .customer-more-menu a:hover { background: #f6f8fb; }
    .customer-more-menu .customer-more-logout { color: #d8232a; }

    body .topbar,
    body .header,
    body .top-header {
        position: sticky;
        top: 0;
        z-index: 900;
        min-height: 64px;
        height: auto;
        padding: 10px 16px !important;
    }

    body .content {
        padding: 18px 14px 26px !important;
    }

    body .heading {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 18px;
    }

    body .heading h1,
    body .content h1 {
        font-size: clamp(22px, 6vw, 28px);
        line-height: 1.2;
    }

    body .panel,
    body .card,
    body .stat-card {
        border-radius: 15px;
    }

    body .panel-head {
        padding: 16px;
        font-size: 16px;
    }

    body .button,
    body button,
    body input[type="submit"],
    body input[type="button"],
    body a.button {
        min-height: 44px;
    }

    body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    body select,
    body textarea {
        max-width: 100%;
        font-size: 16px;
    }

    body .table-wrap,
    body .table-responsive,
    body .table-container,
    body .table-scroll {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Replace text-only customer portal marks with the supplied full brand logo. */
.sidebar .brand-icon { width:104px !important; height:52px !important; flex:0 0 104px !important; background:transparent !important; border-radius:0 !important; }
.sidebar .brand-icon img { display:block; width:100%; max-height:52px; object-fit:contain; }
.sidebar .customer-sidebar-logo { display:block; grid-column:1 / -1; grid-row:1; width:132px; max-width:100%; max-height:62px; height:auto; padding:4px; border-radius:8px; background:#fff; object-fit:contain; object-position:left center; }
.sidebar .logo { display:flex !important; flex-direction:column; align-items:flex-start; justify-content:center; gap:3px; }
.sidebar .logo::before, .sidebar .brand.brand-profile::before { display:none !important; content:none !important; }
.sidebar .logo h1 { display:none; }
.sidebar .logo p { margin:0 !important; }
.sidebar .brand.brand-profile { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:3px; }
.sidebar .brand.brand-profile .brand-subtitle { margin:0 !important; }

/* Keep the five customer actions on one consistent mobile navigation row. */
@media (max-width: 800px) {
    .customer-bottom-nav {
        box-sizing: border-box;
        height: calc(68px + env(safe-area-inset-bottom));
        min-height: calc(68px + env(safe-area-inset-bottom));
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        grid-template-rows: 1fr;
        grid-auto-flow: column;
        align-items: center;
        overflow: visible;
    }
    .customer-bottom-nav > .customer-nav-item {
        min-width: 0;
        width: 100%;
        min-height: 50px;
        gap: 2px;
        white-space: nowrap;
        font-size: 9px;
    }
    .customer-bottom-nav > .customer-nav-item svg {
        width: 19px;
        height: 19px;
        flex: 0 0 19px;
    }
    .customer-bottom-nav .customer-nav-create-icon {
        width: 49px;
        height: 49px;
        margin-top: -19px;
        font-size: 35px;
    }
    .customer-bottom-nav .customer-nav-create > span:last-child {
        font-size: 8px;
        letter-spacing: -.15px;
    }
    .customer-bottom-nav .customer-nav-badge {
        top: 1px;
        right: calc(50% - 20px);
    }
}

.customer-profile-menu[hidden] { display: none !important; }
.customer-profile-menu {
    position: fixed;
    z-index: 2147483002;
    width: min(430px, calc(100vw - 24px));
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #dce5f0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 22px 65px rgba(5, 24, 49, .32);
    color: #10223e;
    overscroll-behavior: contain;
    animation: customer-profile-menu-in .16s ease-out;
}
@keyframes customer-profile-menu-in {
    from { opacity: 0; transform: translateY(-5px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.customer-profile-menu-head {
    position: relative;
    overflow: hidden;
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: radial-gradient(circle at 93% 0%, rgba(90,153,211,.38), transparent 35%), linear-gradient(115deg, #071b34, #174876);
    color: #fff;
}
.customer-profile-menu-head::after { content:""; position:absolute; right:-23px; bottom:-47px; width:126px; height:126px; border:1px solid #ffffff18; border-radius:50%; box-shadow:0 0 0 14px #ffffff08,0 0 0 29px #ffffff06; pointer-events:none; }
.customer-profile-menu-avatar {
    position: relative;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.78);
    border-radius: 50%;
    background: linear-gradient(145deg, #ff4050, #df092c);
    color: white;
    font-size: 21px;
    font-weight: 850;
}
.customer-profile-menu-avatar img,
.customer-nav-profile-avatar img,
.dashboard-welcome-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.customer-profile-menu-avatar > span,
.customer-nav-profile-avatar > span,
.dashboard-welcome-avatar > span { position: relative; z-index: 0; }
.customer-profile-menu-identity { min-width: 0; display: grid; gap: 4px; flex: 1; }
.customer-profile-menu-identity strong { overflow: hidden; color: #fff; font-size: 16px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.customer-profile-menu-identity small { color: #d2dff0; font-size: 11px; }
.customer-profile-menu-close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border: 1px solid #ffffff35;
    border-radius: 50%;
    background: #ffffff12;
    color: #fff;
    font-size: 23px;
    cursor: pointer;
}
.customer-profile-menu-links { display: grid; padding: 7px 10px; }
.customer-profile-menu-links > a,
.customer-profile-photo-trigger {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #293a53;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.customer-profile-menu-links > a:hover,
.customer-profile-photo-trigger:hover { background: #f1f5fa; }
.customer-profile-menu-links > a > span:first-child,
.customer-profile-photo-trigger > span:first-child { width: 30px; height:30px; flex:0 0 30px; display:grid; place-items:center; border-radius:9px; background:#eef4fb; color:#416b92; font-size:17px; text-align:center; }
.customer-profile-menu-links svg,.customer-profile-photo-trigger svg,.customer-profile-signout svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.customer-profile-menu-links > a:hover > span:first-child,.customer-profile-photo-trigger:hover > span:first-child { background:#ffe7eb; color:#d82336; }
.customer-profile-signout {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 22px;
    border-top: 1px solid #edf0f5;
    color: #d82336;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}
.customer-profile-signout > span:first-child { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; background:#fff0f2; font-size:18px; }
.customer-nav-profile-avatar { position: relative; width: 22px; height: 22px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #ffe5e8; color: #d82336; font-size: 12px; font-weight: 850; }

/* A single animated glow travels around the outside of the five-item mobile nav. */
@property --customer-nav-glow-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}
@keyframes customer-nav-glow-orbit {
    to { --customer-nav-glow-angle: 360deg; }
}
@media (max-width: 800px) {
    .customer-bottom-nav {
        position: fixed;
        isolation: isolate;
        overflow: visible;
        border-radius: 20px;
    }
    .customer-bottom-nav::before {
        position: absolute;
        z-index: 0;
        inset: -2px;
        padding: 2px;
        border-radius: inherit;
        background: linear-gradient(110deg, #ff6476, #ffd47a, #ff516b);
        background: conic-gradient(from var(--customer-nav-glow-angle), transparent 0 62%, #ff6476 70%, #ffd47a 77%, #fff 82%, #ff516b 88%, transparent 96% 100%);
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        -webkit-mask-composite: xor;
        mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        mask-composite: exclude;
        filter: drop-shadow(0 0 5px rgba(239, 35, 60, .48));
        content: "";
        pointer-events: none;
        animation: customer-nav-glow-orbit 4.5s linear infinite;
    }
    @supports not (mask-composite: exclude) {
        .customer-bottom-nav::before { display: none; }
    }
    .customer-bottom-nav > .customer-nav-item { z-index: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .customer-bottom-nav::before { animation: none; }
}
