:root {
    --psh-bg: #040b13;
    --psh-soft: #07111d;
    --psh-panel: #0a1624;
    --psh-border: rgba(255,255,255,.085);
    --psh-gold: #d7a64a;
    --psh-gold-bright: #f0c66d;
    --psh-gold-soft: rgba(215,166,74,.14);
    --psh-white: #f7f8fa;
    --psh-text: #dfe4eb;
    --psh-muted: #8e9aaa;
}

body.proit-portal-shell-mode {
    margin: 0 !important;
    overflow: hidden !important;
    background: var(--psh-bg) !important;
    color: var(--psh-text) !important;
    font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important;
}
body.proit-portal-shell-mode > .navbar,
body.proit-portal-shell-mode > #navbar,
body.proit-portal-shell-mode > .web-footer,
body.proit-portal-shell-mode > .page-content-wrapper,
body.proit-portal-shell-mode > .main-section { display: none !important; }

#proit-portal-shell,
#proit-portal-shell * { box-sizing: border-box; }
#proit-portal-shell {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    grid-template-columns: 255px minmax(0,1fr);
    overflow: hidden;
    background: radial-gradient(circle at 78% -20%,rgba(189,135,42,.075),transparent 34%),linear-gradient(135deg,#050c15 0%,#06111e 48%,#030912 100%);
    color: var(--psh-text);
    font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.psh-sidebar { height: 100vh;display:flex;flex-direction:column;overflow:hidden;border-right:1px solid rgba(255,255,255,.075);background:linear-gradient(180deg,#06101b,#040b13);box-shadow:12px 0 40px rgba(0,0,0,.18); }
.psh-brand { min-height:116px;display:flex;align-items:center;gap:14px;padding:0 25px;border-bottom:1px solid var(--psh-border);color:var(--psh-white)!important;text-decoration:none!important; }
.psh-brand-logo { width:170px;height:auto;display:block;mix-blend-mode:screen;filter:drop-shadow(0 8px 18px rgba(0,0,0,.24)); }
.psh-brand strong,.psh-brand small { display:block; }
.psh-brand strong { color:var(--psh-gold-bright);font-size:17px;font-weight:800;letter-spacing:.055em; }
.psh-brand small { margin-top:5px;color:#b79a61;font-size:10px;letter-spacing:.20em; }
.psh-reel { position:relative;flex:0 0 43px;width:43px;height:43px;overflow:hidden;border:1px solid rgba(255,224,153,.65);border-radius:50%;background:radial-gradient(circle at 35% 28%,#f7d889,#d19c3e 55%,#8d6222);box-shadow:0 0 0 4px rgba(216,165,73,.07),0 9px 28px rgba(0,0,0,.25); }
.psh-reel::before { content:"";position:absolute;top:9px;left:9px;width:9px;height:9px;border-radius:50%;background:#172130;box-shadow:16px 0 0 #172130,0 16px 0 #172130,16px 16px 0 #172130; }
.psh-reel i { position:absolute;top:18px;left:18px;width:7px;height:7px;border-radius:50%;background:#172130; }
.psh-nav { display:flex;flex-direction:column;gap:7px;padding:21px 15px;overflow-y:auto; }
.psh-nav-item { min-height:51px;display:flex;align-items:center;gap:15px;padding:0 17px;border:1px solid transparent;border-radius:10px;background:transparent;color:#b5becb!important;font-size:13px;font-weight:500;text-decoration:none!important;transition:background .16s ease,color .16s ease,border .16s ease,transform .16s ease; }
.psh-nav-item:hover { transform:translateX(2px);background:rgba(255,255,255,.035);color:#fff!important; }
.psh-nav-item.active { border-color:rgba(215,166,74,.42);background:linear-gradient(100deg,rgba(120,83,29,.32),rgba(57,43,23,.72));color:#fff!important;box-shadow:0 10px 27px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.035); }
.psh-nav-item.disabled { cursor:not-allowed;opacity:.45; }
.psh-nav-item.disabled:hover { transform:none;background:transparent;color:#b5becb!important; }
.psh-nav-icon { width:22px;color:#9aa6b7;font-size:19px;line-height:1;text-align:center; }
.psh-nav-item.active .psh-nav-icon { color:var(--psh-gold-bright); }
.psh-ai-link { margin-top:5px; }
.psh-sidebar-bottom { margin-top:auto;padding:15px 17px 20px; }
.psh-user-card { min-height:66px;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:10px;padding:11px;border:1px solid var(--psh-border);border-radius:12px;background:rgba(255,255,255,.022); }
.psh-avatar { width:38px;height:38px;display:grid;place-items:center;border:1px solid rgba(215,166,74,.28);border-radius:50%;background:linear-gradient(135deg,#4c371b,#17120c);color:#ffe5a8;font-size:11px;font-weight:800; }
.psh-user-copy { min-width:0; }
.psh-user-copy strong,.psh-user-copy small { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.psh-user-copy strong { color:var(--psh-white);font-size:11px; }
.psh-user-copy small { margin-top:3px;color:var(--psh-muted);font-size:9px; }
.psh-support { min-height:43px;display:flex;align-items:center;gap:10px;margin-top:10px;padding:0 10px;color:var(--psh-muted)!important;font-size:10px;text-decoration:none!important; }
.psh-support > span { width:22px;height:22px;display:grid;place-items:center;border-radius:50%;background:#9da8b7;color:#07111d;font-weight:900; }
.psh-support b { margin-left:auto;font-size:17px; }
.psh-main { min-width:0;height:100vh;overflow-y:auto;padding:39px 45px 24px;color:var(--psh-text); }
.psh-topbar { min-height:91px;display:flex;align-items:flex-start;justify-content:space-between;gap:28px;margin-bottom:22px; }
.psh-eyebrow { display:block;margin-bottom:7px;color:var(--psh-gold-bright);font-size:9px;font-weight:800;letter-spacing:.18em; }
.psh-topbar h1 { margin:0;color:var(--psh-white);font-size:29px;font-weight:720;letter-spacing:-.035em; }
.psh-topbar p { margin:7px 0 0;color:#a8b1bf;font-size:13px; }
.psh-topbar-actions { display:flex;align-items:center;gap:14px; }
.psh-search { width:290px;height:43px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:9px;padding:0 10px 0 14px;border:1px solid rgba(255,255,255,.11);border-radius:11px;background:rgba(9,20,34,.92);color:var(--psh-muted); }
.psh-search input { min-width:0;border:0!important;outline:0!important;background:transparent!important;color:#eef1f5!important;font-size:11px;box-shadow:none!important; }
.psh-search input::placeholder { color:#8290a2; }
.psh-search kbd { padding:3px 7px;border:1px solid var(--psh-border);border-radius:6px;background:#07111d;color:#aeb6c3;font:9px/1.2 inherit; }
.psh-home-button { width:43px;height:43px;display:grid;place-items:center;border:1px solid var(--psh-border);border-radius:11px;background:rgba(9,20,34,.92);color:var(--psh-gold-bright)!important;text-decoration:none!important; }
.psh-account { position:relative; }
.psh-account-trigger { min-width:104px;height:43px;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 11px;border:1px solid var(--psh-border);border-radius:11px;background:rgba(9,20,34,.92);color:var(--psh-text);cursor:pointer; }
.psh-account-trigger:hover,.psh-account.open .psh-account-trigger { border-color:rgba(215,166,74,.38);background:rgba(15,28,43,.98); }
.psh-account-avatar { width:27px;height:27px;display:grid;place-items:center;border:1px solid rgba(215,166,74,.32);border-radius:50%;background:linear-gradient(135deg,#4c371b,#17120c);color:#ffe5a8;font-size:9px;font-weight:800; }
.psh-account-label { color:#dce2eb;font-size:11px;font-weight:650; }
.psh-account-chevron { color:#8e9aaa;font-size:13px; }
.psh-account-menu { position:absolute;z-index:30;top:52px;right:0;width:220px;overflow:hidden;border:1px solid rgba(255,255,255,.11);border-radius:12px;background:#0a1624;box-shadow:0 22px 55px rgba(0,0,0,.45); }
.psh-account-menu[hidden] { display:none!important; }
.psh-account-summary { padding:15px;border-bottom:1px solid var(--psh-border); }
.psh-account-summary strong,.psh-account-summary small { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.psh-account-summary strong { color:var(--psh-white);font-size:12px; }
.psh-account-summary small { margin-top:4px;color:var(--psh-muted);font-size:10px; }
.psh-account-menu>a,.psh-account-menu>button { width:100%;min-height:40px;display:flex;align-items:center;padding:0 15px;border:0;border-bottom:1px solid rgba(255,255,255,.045);background:transparent;color:#cbd2dc!important;font:500 11px/1.2 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;text-align:left;text-decoration:none!important;cursor:pointer; }
.psh-account-menu>a:hover,.psh-account-menu>button:hover { background:rgba(215,166,74,.1);color:var(--psh-gold-bright)!important; }
.psh-account-menu>button:last-child { border-bottom:0;color:#ffb0a9!important; }
.psh-account-menu>button:disabled { cursor:wait;opacity:.65; }
.psh-content { min-height:calc(100vh - 205px); }
.psh-footer { padding:24px 2px 4px;color:#5f6b7a;font-size:9px;letter-spacing:.08em; }

@media (max-width:1180px) {
    #proit-portal-shell { grid-template-columns:220px minmax(0,1fr); }
    .psh-main { padding:32px 25px 22px; }
}
@media (max-width:820px) {
    body.proit-portal-shell-mode { overflow:auto!important; }
    #proit-portal-shell { position:relative;min-height:100vh;grid-template-columns:1fr;overflow:visible; }
    .psh-sidebar { height:auto;position:sticky;top:0;z-index:5;border-right:0;border-bottom:1px solid var(--psh-border); }
    .psh-brand { min-height:70px; }
    .psh-brand-logo { width:138px; }
    .psh-nav { flex-direction:row;overflow-x:auto;padding:9px 14px; }
    .psh-nav-item { min-width:max-content;min-height:42px;padding:0 12px; }
    .psh-sidebar-bottom { display:none; }
    .psh-main { height:auto;overflow:visible;padding:24px 16px; }
    .psh-topbar { flex-direction:column; }
    .psh-topbar-actions { width:100%; }
    .psh-search { width:auto;flex:1; }
    .psh-account-menu { position:fixed;z-index:1000;top:150px;right:16px;left:16px;width:auto; }
}

/* ==========================================================
   STAGE 4.2 — Old School secure sign-in
========================================================== */

body.proit-old-school-login {
    min-height: 100vh !important;
    margin: 0 !important;
    background:
        radial-gradient(circle at 82% 8%,rgba(215,166,74,.12),transparent 27%),
        radial-gradient(circle at 12% 92%,rgba(43,91,145,.16),transparent 31%),
        linear-gradient(140deg,#02070d 0%,#06111d 52%,#030912 100%) !important;
    color: var(--psh-text) !important;
    font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important;
}

body.proit-old-school-login .navbar,
body.proit-old-school-login .web-footer,
body.proit-old-school-login footer:not(.psh-footer),
body.proit-old-school-login [data-login-powered],
body.proit-old-school-login .st-login-powered,
body.proit-old-school-login .solvronix-powered-by,
body.proit-old-school-login .powered-by-solvronix {
    display: none !important;
}

body.proit-old-school-login .login-page,
body.proit-old-school-login .login-wrapper,
body.proit-old-school-login .page-card-wrapper,
body.proit-old-school-login .for-login,
body.proit-old-school-login .web-page-content,
body.proit-old-school-login .page_content,
body.proit-old-school-login main {
    background: transparent !important;
}

body.proit-old-school-login .web-page-content,
body.proit-old-school-login .page_content,
body.proit-old-school-login main {
    min-height: 100vh !important;
}

body.proit-old-school-login .page-card-wrapper,
body.proit-old-school-login .for-login {
    width: 100% !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 32px 18px !important;
}

body.proit-old-school-login .osp-login-card {
    position: relative !important;
    width: min(100%,460px) !important;
    max-width: 460px !important;
    margin: auto !important;
    padding: 0 34px 27px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255,255,255,.105) !important;
    border-radius: 18px !important;
    background: linear-gradient(155deg,rgba(12,28,46,.985),rgba(5,14,24,.995)) !important;
    color: var(--psh-text) !important;
    box-shadow: 0 28px 80px rgba(0,0,0,.46),inset 0 1px 0 rgba(255,255,255,.035) !important;
}

body.proit-old-school-login .osp-login-card::before {
    content: "";
    position: absolute;
    top: -90px;
    right: -75px;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(215,166,74,.13);
    border-radius: 50%;
    pointer-events: none;
}

body.proit-old-school-login .osp-login-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 -34px 25px;
    padding: 22px 34px;
    border-bottom: 1px solid var(--psh-border);
    background: rgba(3,10,18,.46);
}

body.proit-old-school-login .osp-login-reel {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border: 1px solid rgba(255,224,153,.68);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%,#f7d889,#d19c3e 55%,#8d6222);
    box-shadow: 0 0 0 4px rgba(216,165,73,.07),0 9px 28px rgba(0,0,0,.25);
}

body.proit-old-school-login .osp-login-reel::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 9px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #172130;
    box-shadow: 17px 0 0 #172130,0 17px 0 #172130,17px 17px 0 #172130;
}

body.proit-old-school-login .osp-login-reel i {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #172130;
}

body.proit-old-school-login .osp-login-brand-copy strong,
body.proit-old-school-login .osp-login-brand-copy small {
    display: block;
}

body.proit-old-school-login .osp-login-brand-copy strong {
    color: var(--psh-gold-bright) !important;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .055em;
}

body.proit-old-school-login .osp-login-brand-copy small {
    margin-top: 4px;
    color: #b79a61 !important;
    font-size: 9px;
    letter-spacing: .2em;
}

body.proit-old-school-login .osp-login-card .page-card-head img,
body.proit-old-school-login .osp-login-card .login-logo,
body.proit-old-school-login .osp-login-card .app-logo,
body.proit-old-school-login .osp-login-card > img {
    display: none !important;
}

body.proit-old-school-login .osp-login-card .page-card-head,
body.proit-old-school-login .osp-login-card .login-header {
    margin: 0 0 22px !important;
    padding: 0 !important;
    text-align: left !important;
}

body.proit-old-school-login .osp-login-card h1,
body.proit-old-school-login .osp-login-card h2,
body.proit-old-school-login .osp-login-card h3,
body.proit-old-school-login .osp-login-card h4 {
    margin: 0 0 7px !important;
    color: var(--psh-white) !important;
    font-size: 26px !important;
    font-weight: 730 !important;
    line-height: 1.18 !important;
    letter-spacing: -.025em !important;
    text-align: left !important;
}

body.proit-old-school-login .osp-login-card p,
body.proit-old-school-login .osp-login-card .login-subtitle,
body.proit-old-school-login .osp-login-card .login-description {
    color: var(--psh-muted) !important;
    font-size: 12px !important;
    text-align: left !important;
}

body.proit-old-school-login .osp-login-card form {
    margin: 0 !important;
}

body.proit-old-school-login .osp-login-card .form-group {
    margin-bottom: 16px !important;
}

body.proit-old-school-login .osp-login-card label {
    display: block !important;
    margin: 0 0 7px !important;
    color: #c6ced9 !important;
    font-size: 11px !important;
    font-weight: 650 !important;
}

body.proit-old-school-login .osp-login-card input,
body.proit-old-school-login .osp-login-card .form-control {
    width: 100% !important;
    min-height: 48px !important;
    padding: 0 14px !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    border-radius: 10px !important;
    outline: 0 !important;
    background: #06111d !important;
    color: #f3f5f8 !important;
    -webkit-text-fill-color: #f3f5f8 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.018) !important;
    font-size: 13px !important;
}

body.proit-old-school-login .osp-login-card input:focus,
body.proit-old-school-login .osp-login-card .form-control:focus {
    border-color: rgba(215,166,74,.65) !important;
    box-shadow: 0 0 0 3px rgba(215,166,74,.105) !important;
}

body.proit-old-school-login .osp-login-card input:-webkit-autofill,
body.proit-old-school-login .osp-login-card input:-webkit-autofill:hover,
body.proit-old-school-login .osp-login-card input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #06111d inset !important;
    -webkit-text-fill-color: #f3f5f8 !important;
    caret-color: #f3f5f8 !important;
}

body.proit-old-school-login .osp-login-card input::placeholder {
    color: #68768a !important;
    -webkit-text-fill-color: #68768a !important;
}

body.proit-old-school-login .osp-login-card .btn-login,
body.proit-old-school-login .osp-login-card button[type="submit"] {
    width: 100% !important;
    min-height: 48px !important;
    margin-top: 7px !important;
    border: 1px solid rgba(255,224,153,.34) !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg,#9b6b25,#d7a64a) !important;
    color: #140f08 !important;
    font-size: 13px !important;
    font-weight: 780 !important;
    box-shadow: 0 10px 26px rgba(0,0,0,.2) !important;
}

body.proit-old-school-login .osp-login-card .btn-login:hover,
body.proit-old-school-login .osp-login-card button[type="submit"]:hover {
    background: linear-gradient(135deg,#aa772c,#e3b65a) !important;
}

body.proit-old-school-login .osp-login-card a {
    color: #d9bd82 !important;
    font-size: 11px !important;
    text-decoration: none !important;
}

body.proit-old-school-login .osp-login-card a:hover {
    color: var(--psh-gold-bright) !important;
}

body.proit-old-school-login .osp-login-card .alert,
body.proit-old-school-login .osp-login-card .invalid-login,
body.proit-old-school-login .osp-login-card .login-error {
    margin: 12px 0 !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(235,87,87,.28) !important;
    border-radius: 9px !important;
    background: rgba(235,87,87,.09) !important;
    color: #ffaaaa !important;
    font-size: 11px !important;
}

body.proit-old-school-login .osp-login-footer {
    margin: 24px 0 0;
    padding-top: 17px;
    border-top: 1px solid var(--psh-border);
    color: #657183;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .17em;
    text-align: center;
}

@media (max-width:520px) {
    body.proit-old-school-login .page-card-wrapper,
    body.proit-old-school-login .for-login {
        padding: 16px 12px !important;
    }

    body.proit-old-school-login .osp-login-card {
        padding: 0 22px 23px !important;
        border-radius: 14px !important;
    }

    body.proit-old-school-login .osp-login-brand {
        margin: 0 -22px 22px;
        padding: 19px 22px;
    }
}


/* PORTAL SVG ICONS V2 */

.psh-icon-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.psh-nav-icon {
    display: grid;
    place-items: center;
}

.psh-nav-icon .psh-icon-svg {
    width: 19px;
    height: 19px;
}

.psh-search > span {
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
}

.psh-search > span .psh-icon-svg {
    width: 16px;
    height: 16px;
}

.psh-home-button .psh-icon-svg {
    width: 18px;
    height: 18px;
}

.psh-account-chevron {
    width: 14px;
    height: 14px;
    display: grid;
    place-items: center;
}

.psh-account-chevron .psh-icon-svg {
    width: 13px;
    height: 13px;
}

.psh-support > span {
    display: grid;
    place-items: center;
}

.psh-support > span .psh-icon-svg {
    width: 14px;
    height: 14px;
}

.psh-support > b {
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
}

.psh-support > b .psh-icon-svg {
    width: 16px;
    height: 16px;
}



/* ==========================================================
   PORTAL ROUTE LOADER V2
   Short transition mask — never a blocking screen
   ========================================================== */

html.proit-portal-loading,
html.proit-portal-loading body {
    background: #030b13 !important;
}


#proit-portal-loader {
    position: fixed;
    inset: 0;
    z-index: 2147483647;

    display: grid;
    place-items: center;

    background:
        rgba(3, 11, 19, .82);

    backdrop-filter:
        blur(3px);

    -webkit-backdrop-filter:
        blur(3px);

    opacity: 1;

    transition:
        opacity .16s ease;
}


#proit-portal-loader.is-hiding {
    opacity: 0;
    pointer-events: none;
}


.psh-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 13px;

    padding: 20px 24px;

    border:
        1px solid
        rgba(215, 166, 74, .14);

    border-radius: 16px;

    background:
        rgba(5, 17, 29, .88);

    box-shadow:
        0 18px 55px
        rgba(0, 0, 0, .28);
}


.psh-loader-spinner {
    position: relative;

    width: 34px;
    height: 34px;

    border-radius: 50%;

    border:
        1px solid
        rgba(215, 166, 74, .14);
}


.psh-loader-spinner::before {
    content: "";

    position: absolute;
    inset: -1px;

    border-radius: 50%;

    border:
        2px solid transparent;

    border-top-color:
        #d7a64a;

    border-right-color:
        rgba(215, 166, 74, .38);

    animation:
        psh-loader-spin
        .72s linear infinite;
}


.psh-loader-spinner span {
    position: absolute;

    inset: 10px;

    border-radius: 50%;

    background:
        rgba(215, 166, 74, .16);

    box-shadow:
        0 0 18px
        rgba(215, 166, 74, .16);
}


.psh-loader-text {
    color: #98a4b3;

    font-size: 11px;
    font-weight: 600;

    letter-spacing: .035em;
}


@keyframes psh-loader-spin {
    to {
        transform: rotate(360deg);
    }
}


@media (
    prefers-reduced-motion: reduce
) {
    .psh-loader-spinner::before {
        animation-duration: 1.6s;
    }
}



/* ==========================================================
   PORTAL NAV FOCUS V1
   Only the real active module may look active.
   ========================================================== */

.psh-nav-item:focus,
.psh-nav-item:focus-visible {
    outline: none !important;
}


.psh-nav-item:not(.active):focus,
.psh-nav-item:not(.active):focus-visible {
    border-color:
        rgba(255,255,255,.10) !important;

    background:
        rgba(255,255,255,.025) !important;

    box-shadow:
        none !important;
}


.psh-nav-item.active:focus,
.psh-nav-item.active:focus-visible {
    border-color:
        rgba(215,166,74,.42) !important;

    background:
        linear-gradient(
            100deg,
            rgba(120,83,29,.32),
            rgba(57,43,23,.72)
        ) !important;

    box-shadow:
        0 10px 27px rgba(0,0,0,.18),
        inset 0 1px 0
        rgba(255,255,255,.035) !important;
}


/* ==========================================================
   CASTING FIRST PAINT GUARD V1
   Prevent standard Frappe UI from appearing before Portal Shell.
   ========================================================== */

body:has(.proit-dashboard),
body:has(.cast-shell),
body:has(.q-shell) {
    background:
        #030b13 !important;
}


body:has(.proit-dashboard):not(.proit-portal-shell-mode)
    > .navbar,

body:has(.proit-dashboard):not(.proit-portal-shell-mode)
    > #navbar,

body:has(.proit-dashboard):not(.proit-portal-shell-mode)
    > .web-footer,

body:has(.proit-dashboard):not(.proit-portal-shell-mode)
    > .page-content-wrapper,

body:has(.proit-dashboard):not(.proit-portal-shell-mode)
    > .main-section,

body:has(.cast-shell):not(.proit-portal-shell-mode)
    > .navbar,

body:has(.cast-shell):not(.proit-portal-shell-mode)
    > #navbar,

body:has(.cast-shell):not(.proit-portal-shell-mode)
    > .web-footer,

body:has(.cast-shell):not(.proit-portal-shell-mode)
    > .page-content-wrapper,

body:has(.cast-shell):not(.proit-portal-shell-mode)
    > .main-section,

body:has(.q-shell):not(.proit-portal-shell-mode)
    > .navbar,

body:has(.q-shell):not(.proit-portal-shell-mode)
    > #navbar,

body:has(.q-shell):not(.proit-portal-shell-mode)
    > .web-footer,

body:has(.q-shell):not(.proit-portal-shell-mode)
    > .page-content-wrapper,

body:has(.q-shell):not(.proit-portal-shell-mode)
    > .main-section {
    visibility:
        hidden !important;
}


/*
 * If the Frappe structure differs and wraps the page deeper,
 * keep its known chrome invisible until our shell exists.
 */
body:has(.proit-dashboard):not(.proit-portal-shell-mode)
    .desk-sidebar,

body:has(.proit-dashboard):not(.proit-portal-shell-mode)
    .page-head,

body:has(.cast-shell):not(.proit-portal-shell-mode)
    .desk-sidebar,

body:has(.cast-shell):not(.proit-portal-shell-mode)
    .page-head,

body:has(.q-shell):not(.proit-portal-shell-mode)
    .desk-sidebar,

body:has(.q-shell):not(.proit-portal-shell-mode)
    .page-head {
    visibility:
        hidden !important;
}


/* PORTAL CHARTS PREMIUM V2 */

.psc-chart {
    min-height: 250px;
}


.psc-empty {
    min-height: 220px;
    display: grid;
    place-items: center;
    color: #788a9d;
    font-size: 13px;
}


/* BARS */

.psc-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}


.psc-bar-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
    opacity: 0;
    animation:
        psc-fade-up
        .46s ease
        forwards;
    animation-delay:
        var(--psc-delay);
}


.psc-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #aeb9c7;
    font-size: 12px;
}


.psc-bar-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.psc-bar-meta strong {
    min-width: 26px;
    color: #f6f8fb;
    font-size: 12px;
    text-align: right;
}


.psc-bar-track {
    position: relative;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background:
        linear-gradient(
            180deg,
            rgba(25,45,62,.88),
            rgba(17,35,51,.88)
        );
    box-shadow:
        inset 0 1px 2px
        rgba(0,0,0,.35);
}


.psc-bar-fill {
    height: 100%;
    border-radius: inherit;
    transform-origin: left center;
    animation:
        psc-bar-grow
        .72s
        cubic-bezier(.2,.75,.25,1)
        both;
    animation-delay:
        var(--psc-delay);
}


.psc-accent-gold {
    background:
        linear-gradient(
            90deg,
            #9f6d1f,
            #d7a93f 52%,
            #f1ca68
        );
    box-shadow:
        0 0 18px
        rgba(215,169,63,.20);
}


.psc-accent-green {
    background:
        linear-gradient(
            90deg,
            #218760,
            #43c78d 55%,
            #79ddb1
        );
    box-shadow:
        0 0 18px
        rgba(67,199,141,.18);
}


/* DONUT */

.psc-ring-layout {
    min-height: 250px;
    display: grid;
    grid-template-columns:
        210px minmax(0,1fr);
    align-items: center;
    gap: 30px;
}


.psc-ring-stage {
    position: relative;
    width: 195px;
    height: 195px;
    display: grid;
    place-items: center;
}


.psc-ring-glow {
    position: absolute;
    inset: 27%;
    border-radius: 50%;
    background:
        rgba(215,169,63,.13);
    filter: blur(22px);
}


.psc-ring {
    position: relative;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter:
        drop-shadow(
            0 8px 18px
            rgba(0,0,0,.25)
        );
}


.psc-ring-track,
.psc-ring-segment {
    fill: none;
    stroke-width: 12;
}


.psc-ring-track {
    stroke:
        rgba(36,58,77,.72);
}


.psc-ring-segment {
    transform-origin: 60px 60px;
    opacity: 0;
    animation:
        psc-ring-in
        .62s ease forwards;
    animation-delay:
        var(--psc-delay);
    transition:
        opacity .15s ease,
        stroke-width .15s ease;
}


.psc-ring-segment:hover {
    opacity: .82 !important;
    stroke-width: 15;
}


.psc-palette-0 { stroke:#d7a93f; }
.psc-palette-1 { stroke:#46c992; }
.psc-palette-2 { stroke:#6da1dd; }
.psc-palette-3 { stroke:#a984ce; }
.psc-palette-4 { stroke:#db7e73; }
.psc-palette-5 { stroke:#77899a; }


.psc-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}


.psc-ring-center strong {
    color: #f6f8fb;
    font-size: 38px;
    line-height: 1;
    font-weight: 760;
    letter-spacing: -.03em;
}


.psc-ring-center span {
    margin-top: 7px;
    color: #8292a2;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
}


.psc-ring-legend {
    display: flex;
    flex-direction: column;
    gap: 11px;
}


.psc-ring-legend-row {
    display: grid;
    grid-template-columns:
        9px minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 28px;
    color: #aeb9c7;
    font-size: 12px;
}


.psc-ring-legend-row strong {
    color: #f1f5f9;
    font-size: 12px;
}


.psc-ring-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}


.psc-bg-0 { background:#d7a93f; }
.psc-bg-1 { background:#46c992; }
.psc-bg-2 { background:#6da1dd; }
.psc-bg-3 { background:#a984ce; }
.psc-bg-4 { background:#db7e73; }
.psc-bg-5 { background:#77899a; }


/* DOCUMENT PIPELINE */

.psc-pipeline {
    display: grid;
    grid-template-columns:
        repeat(4,minmax(0,1fr));
    gap: 10px;
}


.psc-stage {
    position: relative;
    min-height: 96px;
    padding: 13px;
    border:
        1px solid
        rgba(130,154,178,.12);
    border-radius: 13px;
    background:
        linear-gradient(
            180deg,
            rgba(14,35,51,.78),
            rgba(8,26,41,.80)
        );
    opacity: .52;
    transition:
        transform .16s ease,
        border-color .16s ease,
        opacity .16s ease;
}


.psc-stage.is-active {
    opacity: 1;
    border-color:
        rgba(215,169,63,.30);
    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.025);
}


.psc-stage:hover {
    transform:
        translateY(-2px);
}


.psc-stage-index {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: #07131e;
    font-size: 10px;
    font-weight: 850;
}


.psc-stage strong {
    display: block;
    margin-top: 11px;
    color: #f5f7fa;
    font-size: 23px;
    line-height: 1;
}


.psc-stage > span {
    display: block;
    margin-top: 7px;
    color: #8797a7;
    font-size: 10px;
    line-height: 1.25;
}


.psc-pipeline-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top:
        1px solid
        rgba(128,153,177,.12);
    color: #8191a1;
    font-size: 11px;
}


.psc-pipeline-total strong {
    color: #d9b45d;
    font-size: 13px;
}


/* ANALYTICS POLISH */

.analytics-v3-feature {
    background:
        radial-gradient(
            circle at 22% 44%,
            rgba(211,161,59,.055),
            transparent 38%
        ),
        linear-gradient(
            180deg,
            rgba(10,29,45,.98),
            rgba(7,23,37,.98)
        ) !important;
}


@keyframes psc-bar-grow {
    from {
        transform: scaleX(0);
        opacity: .25;
    }

    to {
        transform: scaleX(1);
        opacity: 1;
    }
}


@keyframes psc-ring-in {
    from {
        opacity: 0;
        transform:
            scale(.94);
    }

    to {
        opacity: 1;
        transform:
            scale(1);
    }
}


@keyframes psc-fade-up {
    from {
        opacity: 0;
        transform:
            translateY(5px);
    }

    to {
        opacity: 1;
        transform:
            translateY(0);
    }
}


@media (max-width: 900px) {

    .psc-ring-layout {
        grid-template-columns:
            170px minmax(0,1fr);
        gap: 20px;
    }

    .psc-ring-stage {
        width: 160px;
        height: 160px;
    }

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


@media (max-width: 600px) {

    .psc-ring-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .psc-ring-legend {
        width: 100%;
    }

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


@media (
    prefers-reduced-motion: reduce
) {

    .psc-bar-row,
    .psc-bar-fill,
    .psc-ring-segment {
        animation-duration:
            .01ms !important;
    }
}


/* ANALYTICS PREMIUM V3.1 POLISH */


/* Cleaner chart interaction */

.psc-bar-row {
    padding: 4px 6px;
    margin: -4px -6px;
    border-radius: 9px;
    transition:
        background .16s ease,
        transform .16s ease;
}


.psc-bar-row:hover {
    background:
        rgba(255,255,255,.018);
}


.psc-bar-row.is-active:hover {
    background:
        rgba(215,169,63,.035);
    transform:
        translateX(2px);
}


.psc-bar-row.is-active
.psc-bar-meta strong {
    color: #f2c966;
}


.psc-bar-row.is-active
.psc-bar-track {
    box-shadow:
        inset 0 1px 2px
        rgba(0,0,0,.34),
        0 0 18px
        rgba(215,169,63,.025);
}


/* Larger, better balanced production ring */

.psc-ring-layout {
    grid-template-columns:
        245px minmax(0,1fr);
    gap: 20px;
}


.psc-ring-stage {
    width: 225px;
    height: 225px;
}


.psc-ring-center strong {
    font-size: 43px;
}


.psc-ring-center span {
    margin-top: 8px;
    font-size: 11px;
}


.psc-ring-glow {
    inset: 25%;
    filter: blur(26px);
}


.psc-ring-legend {
    gap: 8px;
}


.psc-ring-legend-row {
    min-height: 25px;
}


/* Better panel visual depth */

.analytics-v2-panel {
    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.018),
        0 12px 28px
        rgba(0,0,0,.08);
}


.analytics-v2-panel:hover {
    border-color:
        rgba(143,166,188,.21);
}


/* Active document stage */

.psc-stage.is-active {
    background:
        radial-gradient(
            circle at 78% 18%,
            rgba(215,169,63,.075),
            transparent 42%
        ),
        linear-gradient(
            180deg,
            rgba(17,39,56,.92),
            rgba(9,27,42,.92)
        );
}


.psc-stage.is-active strong {
    color: #f3cb69;
}


/* Keep zeros quiet */

.psc-stage:not(.is-active) strong,
.psc-bar-row:not(.is-active)
.psc-bar-meta strong {
    color: #8392a1;
}


/* Responsive ring */

@media (max-width: 1100px) {

    .psc-ring-layout {
        grid-template-columns:
            195px minmax(0,1fr);
    }

    .psc-ring-stage {
        width: 185px;
        height: 185px;
    }

    .psc-ring-center strong {
        font-size: 36px;
    }
}


@media (max-width: 600px) {

    .psc-ring-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .psc-ring-stage {
        width: 190px;
        height: 190px;
    }
}


/* ANALYTICS PREMIUM V3.2 FINAL POLISH */


/* Bring the production legend closer to the ring */

.psc-ring-layout {
    grid-template-columns:
        232px minmax(0,1fr);
    gap: 8px;
}


.psc-ring-legend {
    align-self: center;
    max-width: 210px;
}


.psc-ring-legend-row {
    padding: 3px 0;
}


/* Zero-value rows should stay visually secondary */

.psc-bar-row:not(.is-active)
.psc-bar-meta {
    opacity: .58;
}


.psc-bar-row:not(.is-active)
.psc-bar-track {
    opacity: .46;
}


.psc-bar-row:not(.is-active):hover {
    background:
        rgba(255,255,255,.012);
    transform: none;
}


/* Make the current document workflow stage clearer */

.psc-stage.is-active {
    border-color:
        rgba(215,169,63,.52);

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.035),
        0 0 0 1px
        rgba(215,169,63,.055),
        0 10px 24px
        rgba(0,0,0,.10);
}


.psc-stage.is-active
.psc-stage-index {
    box-shadow:
        0 0 16px
        rgba(215,169,63,.14);
}


.psc-stage.is-active strong {
    text-shadow:
        0 0 18px
        rgba(215,169,63,.12);
}


/* Keep polish restrained on smaller screens */

@media (max-width: 1100px) {

    .psc-ring-layout {
        grid-template-columns:
            190px minmax(0,1fr);
        gap: 12px;
    }
}


@media (max-width: 600px) {

    .psc-ring-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .psc-ring-legend {
        width: 100%;
        max-width: none;
    }
}


/* PRODUCTION V3B BUSINESS DOSSIER */


/* Tab counts */

[data-production-tab] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}


.production-tab-count {
    min-width: 20px;
    height: 20px;

    display: inline-grid;
    place-items: center;

    padding: 0 6px;

    border-radius: 999px;

    background:
        rgba(132,151,170,.10);

    color: #7f91a2;

    font-size: 9px;
    font-weight: 800;

    line-height: 1;
}


[data-production-tab].active
.production-tab-count {
    background:
        rgba(215,169,63,.16);

    color: #e2b755;
}


/* System codes are secondary */

.production-hub
.production-code {
    opacity: .66;
    letter-spacing: .07em;
}


/* Casting summary */

.production-casting-summary {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 15px;
}


.production-casting-stat {
    min-width: 118px;

    padding: 14px 15px;

    border:
        1px solid
        rgba(137,157,177,.13);

    border-radius: 13px;

    background:
        linear-gradient(
            180deg,
            rgba(15,36,53,.90),
            rgba(9,27,42,.90)
        );
}


.production-casting-stat.primary {
    border-color:
        rgba(215,169,63,.34);

    background:
        radial-gradient(
            circle at 82% 0%,
            rgba(215,169,63,.09),
            transparent 52%
        ),
        linear-gradient(
            180deg,
            rgba(17,38,55,.95),
            rgba(9,27,42,.95)
        );
}


.production-casting-stat strong {
    display: block;

    color: #f2f5f8;

    font-size: 24px;
    line-height: 1;
}


.production-casting-stat.primary strong {
    color: #e8bc55;
}


.production-casting-stat span {
    display: block;

    margin-top: 7px;

    color: #7e8f9f;

    font-size: 10px;
}


/* Candidate list */

.production-casting-list {
    overflow: hidden;

    border:
        1px solid
        rgba(137,157,177,.14);

    border-radius: 14px;

    background:
        rgba(8,25,39,.48);
}


.production-casting-row {
    appearance: none;

    width: 100%;
    min-height: 70px;

    display: grid;

    grid-template-columns:
        minmax(0,1fr)
        auto
        auto;

    align-items: center;

    gap: 14px;

    padding: 12px 16px;

    border: 0;

    border-bottom:
        1px solid
        rgba(137,157,177,.10);

    background: transparent;

    color: inherit;

    cursor: pointer;

    text-align: left;

    transition:
        background .16s ease,
        transform .16s ease;
}


.production-casting-row:last-child {
    border-bottom: 0;
}


.production-casting-row:hover {
    background:
        rgba(215,169,63,.028);

    transform:
        translateX(2px);
}


.production-casting-person {
    min-width: 0;
}


.production-casting-person strong {
    display: block;

    overflow: hidden;

    color: #eef3f7;

    font-size: 12px;
    font-weight: 680;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.production-casting-person span {
    display: block;

    margin-top: 4px;

    color: #708293;

    font-size: 9px;
}


.production-casting-open {
    color: #d9ad4d;

    font-size: 10px;
    font-weight: 750;

    white-space: nowrap;
}


.production-casting-empty {
    min-height: 160px;

    display: grid;
    place-items: center;

    padding: 20px;

    color: #748596;

    font-size: 11px;

    text-align: center;
}


@media (max-width: 760px) {

    .production-casting-row {
        grid-template-columns:
            minmax(0,1fr)
            auto;
    }

    .production-casting-open {
        grid-column: 1 / -1;

        justify-self: start;
    }

    .production-casting-stat {
        flex:
            1 1 calc(50% - 10px);

        min-width: 0;
    }
}


/* PRODUCTION V3C FINAL OVERVIEW */


/* Five operational KPIs */

.production-hub
.production-metrics.detail {
    grid-template-columns:
        repeat(4,minmax(0,1fr));

    gap: 9px;
}


.production-hub
.production-metrics.detail
> div {
    min-width: 0;

    padding:
        13px 12px;
}


.production-hub
.production-metrics.detail
strong {
    font-size: 20px;
}


.production-hub
.production-metrics.detail
span {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Internal production ID is secondary */

.production-hub
.production-dossier-hero
.production-code {
    opacity: .46;

    font-size: 9px;

    letter-spacing: .07em;
}


/* Business type below production name */

.production-hub
.production-dossier-hero
.production-overview-main
p {
    margin-top: 7px;

    color: #8292a2;

    font-size: 11px;
}


/* Clean business overview */

.production-hub
[data-production-panel="overview"] {
    padding-bottom: 0;
}


.production-hub
.production-overview-grid {
    margin-bottom: 0;
}


.production-hub
.production-info-card {
    background:
        linear-gradient(
            180deg,
            rgba(14,33,49,.92),
            rgba(8,24,38,.92)
        );

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.018);
}


@media (max-width: 1100px) {

    .production-hub
    .production-metrics.detail {
        grid-template-columns:
            repeat(3,minmax(0,1fr));
    }
}


@media (max-width: 650px) {

    .production-hub
    .production-metrics.detail {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }
}


/* PRODUCTION V4B CONTEXTUAL WORKFLOWS */


/* Contextual actions in dossier sections */

.production-hub
.production-workflow-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 14px;

    min-width: 0;
}


.production-hub
.production-workflow-actions
> p {
    margin: 0;

    text-align: right;
}


.production-hub
.production-workflow-buttons {
    display: flex;
    align-items: center;

    gap: 8px;

    flex: 0 0 auto;
}


/* Workflow dialog */

.production-workflow-dialog-overlay {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;

    padding: 0;

    border: 0;

    background:
        rgba(2,10,17,.78);

    color: #edf2f6;

    backdrop-filter:
        blur(5px);
}


.production-workflow-dialog-overlay::backdrop {
    background:
        rgba(2,10,17,.76);
}


.production-workflow-dialog {
    width:
        min(
            620px,
            calc(100vw - 32px)
        );

    margin:
        min(12vh,100px)
        auto 30px;

    overflow: hidden;

    border:
        1px solid
        rgba(215,169,63,.22);

    border-radius: 17px;

    background:
        linear-gradient(
            180deg,
            #0b1f30,
            #071725
        );

    box-shadow:
        0 30px 90px
        rgba(0,0,0,.42);
}


.production-workflow-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding:
        21px 22px 18px;

    border-bottom:
        1px solid
        rgba(143,166,188,.11);
}


.production-workflow-dialog-head
span {
    color: #d8aa46;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: .14em;
}


.production-workflow-dialog-head
h2 {
    margin:
        5px 0 0;

    color: #f2f5f8;

    font-size: 20px;
    font-weight: 720;
}


.production-workflow-dialog-head
p {
    margin:
        6px 0 0;

    color: #788a9a;

    font-size: 10px;
}


.production-workflow-dialog-head
> button {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border:
        1px solid
        rgba(143,166,188,.15);

    border-radius: 9px;

    background:
        rgba(255,255,255,.02);

    color: #8b9baa;

    font-size: 20px;

    cursor: pointer;
}


.production-workflow-dialog-body {
    padding:
        20px 22px;
}


.production-workflow-grid {
    display: grid;

    grid-template-columns:
        repeat(2,minmax(0,1fr));

    gap: 13px;
}


.production-workflow-field {
    display: block;

    margin-bottom: 14px;
}


.production-workflow-field.full {
    width: 100%;
}


.production-workflow-field
> span {
    display: block;

    margin-bottom: 7px;

    color: #a8b4bf;

    font-size: 10px;
    font-weight: 650;
}


.production-workflow-field
small {
    margin-left: 4px;

    color: #667787;

    font-weight: 500;
}


.production-workflow-field
input,
.production-workflow-field
select,
.production-workflow-field
textarea {
    width: 100%;

    min-height: 40px;

    padding:
        9px 11px;

    border-radius: 9px;

    font-size: 12px;

    outline: none;
}


.production-workflow-field
textarea {
    min-height: 88px;

    resize: vertical;
}


.production-workflow-error {
    min-height: 18px;

    color: #dd8a84;

    font-size: 10px;
}


.production-workflow-dialog-actions {
    display: flex;
    justify-content: flex-end;

    gap: 9px;

    padding:
        15px 22px 19px;

    border-top:
        1px solid
        rgba(143,166,188,.10);
}


@media (max-width: 800px) {

    .production-hub
    .production-section-head.compact {
        align-items:
            flex-start;
    }

    .production-hub
    .production-workflow-actions {
        flex-direction:
            column;

        align-items:
            flex-end;
    }

    .production-workflow-grid {
        grid-template-columns:
            1fr;
    }
}


@media (max-width: 600px) {

    .production-hub
    .production-workflow-actions {
        align-items:
            stretch;

        width: 100%;
    }

    .production-hub
    .production-workflow-actions
    > p {
        text-align: left;
    }

    .production-hub
    .production-workflow-buttons {
        flex-wrap: wrap;
    }

    .production-workflow-dialog {
        margin:
            24px auto;
    }
}


/* PRODUCTION V4C SEASON CENTRIC */

/*
 * Episode remains an internal compatibility object.
 * Client-facing Production and Signing workflows are Season based.
 */

.production-hub
.production-season {
    min-height: 0;
}

.production-hub
.production-season-head {
    border-bottom: 0;
}

.forms-sessions-app
label:has(#fs-filter-episode) {
    display: none !important;
}

/* ==========================================================
   OLD SCHOOL MOBILE PORTAL SHELL V1
   <= 768px

   Goals:
   - suppress native Frappe desktop chrome
   - keep one portal shell only
   - convert portal sidebar to fixed bottom navigation
   - compact portal header
   - protect iPhone safe areas
   - eliminate horizontal overflow

   Desktop >= 769px is intentionally untouched.
   ========================================================== */

@media (max-width: 768px) {

    /* ------------------------------------------------------
       1. GLOBAL MOBILE CANVAS
       ------------------------------------------------------ */

    html {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        background: #030b13 !important;
    }

    body.proit-portal-shell-mode {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow-x: hidden !important;

        background: #030b13 !important;

        color-scheme: dark;
    }


    /* ------------------------------------------------------
       2. REMOVE NATIVE FRAPPE / SOLVRONIX DESKTOP CHROME

       This is intentionally scoped ONLY while our portal shell
       is mounted.
       ------------------------------------------------------ */

    body.proit-portal-shell-mode .navbar,
    body.proit-portal-shell-mode #navbar,
    body.proit-portal-shell-mode .desk-navbar,
    body.proit-portal-shell-mode .body-sidebar-container,
    body.proit-portal-shell-mode .body-sidebar,
    body.proit-portal-shell-mode .desk-sidebar,
    body.proit-portal-shell-mode .layout-side-section,
    body.proit-portal-shell-mode .page-head,
    body.proit-portal-shell-mode .page-head-content,
    body.proit-portal-shell-mode .web-footer {
        display: none !important;
    }


    /* ------------------------------------------------------
       3. REMOVE FRAPPE DESKTOP GEOMETRY

       Do NOT hide these ancestors because the portal may live
       inside them. Only neutralize their layout.
       ------------------------------------------------------ */

    body.proit-portal-shell-mode .main-section,
    body.proit-portal-shell-mode .page-content-wrapper,
    body.proit-portal-shell-mode .page-container,
    body.proit-portal-shell-mode .page-body,
    body.proit-portal-shell-mode .layout-main,
    body.proit-portal-shell-mode .layout-main-section {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        left: auto !important;

        background: #030b13 !important;
    }


    /* ------------------------------------------------------
       4. PORTAL SHELL
       ------------------------------------------------------ */

    body.proit-portal-shell-mode #proit-portal-shell {
        position: relative !important;

        display: block !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        min-height: 100vh !important;
        min-height: 100dvh !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow-x: hidden !important;

        background: #030b13 !important;
    }


    /* ------------------------------------------------------
       5. PORTAL SIDEBAR -> MOBILE BOTTOM NAV
       ------------------------------------------------------ */

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-sidebar {
        position: fixed !important;

        z-index: 2147483000 !important;

        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: 0 !important;

        margin: 0 !important;

        padding:
            7px
            8px
            calc(
                7px
                + env(safe-area-inset-bottom, 0px)
            )
            !important;

        border: 0 !important;
        border-top:
            1px solid
            rgba(255,255,255,.09)
            !important;

        border-radius: 0 !important;

        background:
            rgba(3, 11, 19, .96)
            !important;

        box-shadow:
            0 -12px 35px
            rgba(0,0,0,.28)
            !important;

        -webkit-backdrop-filter:
            blur(18px);

        backdrop-filter:
            blur(18px);

        overflow: hidden !important;
    }


    /* Logo/user/support belong to desktop sidebar only. */

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-brand,

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-sidebar-bottom {
        display: none !important;
    }


    /* Horizontal touch navigation. */

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-nav {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;

        width: 100% !important;
        max-width: 100% !important;

        gap: 4px !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        scrollbar-width: none;

        -webkit-overflow-scrolling: touch;

        overscroll-behavior-x: contain;

        scroll-snap-type:
            x proximity;
    }

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-nav::-webkit-scrollbar {
        display: none;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-nav-item {
        flex:
            0 0
            76px !important;

        width: 76px !important;
        min-width: 76px !important;

        min-height: 56px !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;

        gap: 5px !important;

        margin: 0 !important;
        padding: 6px 4px !important;

        border:
            1px solid
            transparent
            !important;

        border-radius:
            11px !important;

        background:
            transparent
            !important;

        color:
            #9ba8b8
            !important;

        font-size:
            10px !important;

        font-weight:
            650 !important;

        line-height:
            1.05 !important;

        text-align:
            center !important;

        text-decoration:
            none !important;

        scroll-snap-align:
            center;

        box-shadow:
            none !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-nav-item
    .psh-nav-icon {
        flex:
            0 0
            21px !important;

        width:
            21px !important;

        height:
            21px !important;

        display:
            grid !important;

        place-items:
            center !important;

        color:
            currentColor !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-nav-item
    .psh-nav-icon
    .psh-icon-svg {
        width:
            20px !important;

        height:
            20px !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-nav-item
    > span:last-child {
        display:
            block !important;

        width:
            100% !important;

        overflow:
            hidden !important;

        white-space:
            nowrap !important;

        text-overflow:
            ellipsis !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-nav-item.active {
        border-color:
            rgba(215,166,74,.38)
            !important;

        background:
            linear-gradient(
                145deg,
                rgba(119,82,28,.42),
                rgba(54,40,21,.78)
            )
            !important;

        color:
            #f0c66d
            !important;

        box-shadow:
            inset 0 1px 0
            rgba(255,255,255,.035)
            !important;
    }


    /* ------------------------------------------------------
       6. MAIN AREA
       ------------------------------------------------------ */

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-main {
        position:
            relative !important;

        width:
            100% !important;

        max-width:
            100% !important;

        min-width:
            0 !important;

        min-height:
            100vh !important;

        min-height:
            100dvh !important;

        margin:
            0 !important;

        padding:
            0 0
            calc(
                78px
                + env(safe-area-inset-bottom, 0px)
            )
            !important;

        overflow-x:
            hidden !important;

        background:
            #030b13 !important;
    }


    /* ------------------------------------------------------
       7. MOBILE PORTAL HEADER
       ------------------------------------------------------ */

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-topbar {
        position:
            sticky !important;

        z-index:
            1100 !important;

        top:
            0 !important;

        width:
            100% !important;

        min-height:
            62px !important;

        display:
            flex !important;

        align-items:
            center !important;

        justify-content:
            space-between !important;

        gap:
            12px !important;

        margin:
            0 !important;

        padding:
            11px
            14px
            !important;

        border-bottom:
            1px solid
            rgba(255,255,255,.075)
            !important;

        background:
            rgba(3,11,19,.95)
            !important;

        box-shadow:
            0 8px 25px
            rgba(0,0,0,.16)
            !important;

        -webkit-backdrop-filter:
            blur(16px);

        backdrop-filter:
            blur(16px);
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-topbar
    > div:first-child {
        flex:
            1 1 auto !important;

        min-width:
            0 !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-eyebrow,

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-topbar
    p {
        display:
            none !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-topbar
    h1 {
        width:
            100% !important;

        max-width:
            100% !important;

        margin:
            0 !important;

        overflow:
            hidden !important;

        color:
            #f4f6f8 !important;

        font-size:
            19px !important;

        font-weight:
            720 !important;

        line-height:
            1.2 !important;

        letter-spacing:
            -.025em !important;

        white-space:
            nowrap !important;

        text-overflow:
            ellipsis !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-topbar-actions {
        flex:
            0 0 auto !important;

        display:
            flex !important;

        align-items:
            center !important;

        gap:
            7px !important;

        margin:
            0 !important;
    }


    /* Desktop search + redundant Home button disappear.
       Bottom nav owns navigation on mobile. */

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-search,

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-home-button {
        display:
            none !important;
    }


    /* Account becomes compact avatar button. */

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-account-trigger {
        width:
            42px !important;

        min-width:
            42px !important;

        height:
            42px !important;

        min-height:
            42px !important;

        display:
            grid !important;

        place-items:
            center !important;

        margin:
            0 !important;

        padding:
            0 !important;

        border-radius:
            12px !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-account-label,

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-account-chevron {
        display:
            none !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-account-avatar {
        margin:
            0 !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-account-menu {
        position:
            fixed !important;

        z-index:
            2147483100 !important;

        top:
            68px !important;

        right:
            12px !important;

        left:
            auto !important;

        width:
            min(
                310px,
                calc(100vw - 24px)
            )
            !important;

        max-width:
            calc(100vw - 24px)
            !important;
    }


    /* ------------------------------------------------------
       8. PORTAL CONTENT
       ------------------------------------------------------ */

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-content {
        width:
            100% !important;

        max-width:
            100% !important;

        min-width:
            0 !important;

        margin:
            0 !important;

        padding:
            0 !important;

        overflow-x:
            hidden !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-content
    > * {
        max-width:
            100% !important;

        min-width:
            0 !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-footer {
        display:
            none !important;
    }


    /* ------------------------------------------------------
       9. COMMON PORTAL PAGE ROOT SAFETY
       ------------------------------------------------------ */

    body.proit-portal-shell-mode
    .proit-dashboard,

    body.proit-portal-shell-mode
    .production-hub,

    body.proit-portal-shell-mode
    .documents-hub,

    body.proit-portal-shell-mode
    .forms-hub,

    body.proit-portal-shell-mode
    .forms-sessions-app,

    body.proit-portal-shell-mode
    .media-hub,

    body.proit-portal-shell-mode
    .ai-workspace,

    body.proit-portal-shell-mode
    .cast-shell,

    body.proit-portal-shell-mode
    .q-shell {
        width:
            100% !important;

        max-width:
            100% !important;

        min-width:
            0 !important;

        overflow-x:
            hidden !important;
    }


    img,
    video,
    iframe {
        max-width:
            100%;
    }
}


/* ----------------------------------------------------------
   SMALL PHONE TUNING
   ---------------------------------------------------------- */

@media (max-width: 430px) {

    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-topbar {
        min-height:
            58px !important;

        padding:
            9px
            12px
            !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-topbar
    h1 {
        font-size:
            18px !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-account-trigger {
        width:
            40px !important;

        min-width:
            40px !important;

        height:
            40px !important;

        min-height:
            40px !important;
    }


    body.proit-portal-shell-mode
    #proit-portal-shell
    .psh-nav-item {
        flex-basis:
            72px !important;

        width:
            72px !important;

        min-width:
            72px !important;
    }
}

/* END OLD SCHOOL MOBILE PORTAL SHELL V1 */

/* ==========================================================
   OLD SCHOOL MOBILE PRE-MOUNT GUARD V2

   portal_navigation.js adds html.proit-portal-route BEFORE
   PortalShell.mount(), so native Frappe chrome cannot occupy
   the mobile viewport during first paint.
   ========================================================== */

@media (max-width: 768px) {

    html.proit-portal-route,
    html.proit-portal-route body {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow-x: hidden !important;

        background: #030b13 !important;
    }


    /*
     * Native Frappe / Solvronix chrome.
     *
     * IMPORTANT:
     * We do NOT hide .main-section or .page-content-wrapper
     * here because the custom Frappe page root still lives
     * inside them until PortalShell.mount() moves it.
     */

    html.proit-portal-route
    body
    > .navbar,

    html.proit-portal-route
    body
    > #navbar,

    html.proit-portal-route
    body
    .desk-navbar,

    html.proit-portal-route
    body
    .body-sidebar-container,

    html.proit-portal-route
    body
    .body-sidebar,

    html.proit-portal-route
    body
    .desk-sidebar,

    html.proit-portal-route
    body
    .layout-side-section,

    html.proit-portal-route
    body
    .page-head,

    html.proit-portal-route
    body
    .page-head-content {

        display: none !important;
    }


    /*
     * Neutralize native Desk geometry without hiding the
     * custom page root.
     */

    html.proit-portal-route
    body
    .main-section,

    html.proit-portal-route
    body
    .page-content-wrapper,

    html.proit-portal-route
    body
    .page-container,

    html.proit-portal-route
    body
    .page-body,

    html.proit-portal-route
    body
    .layout-main,

    html.proit-portal-route
    body
    .layout-main-section {

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        left: auto !important;
    }
}

/* END OLD SCHOOL MOBILE PRE-MOUNT GUARD V2 */

