/* Suite 5 · Oil (تحلیل و بهره‌وری پالایشگاه): رنگ شاخص کهربایی، سطوح سرمه‌ای، آرم پالایشگاه. ساختار و منطق برنامه دست‌نخورده است. */
:root:not([data-theme=light]){--o-bg:#081528;--o-panel:#0a1a30;--o-surface:#0f2038;--o-raised:#162a4a;--o-text:#e9f1fc;--o-muted:#93a8c8;--o-faint:#6f86a8;--o-line:#1f3858;--o-hover:#162a48;--o-accent:#f0b429;--o-accent-ink:#1d1503;--o-accent-text:#f5c04a;--o-accent-soft:rgba(240,180,41,.14);--o-ok:#5fe0b0;--o-ok-soft:rgba(47,191,138,.16);--o-err:#ff9d8a;--o-warn:#f0b429;--o-shadow:0 12px 36px rgba(0,0,0,.28)}
[data-theme=light]{--o-bg:#edf1f7;--o-panel:#ffffff;--o-surface:#ffffff;--o-raised:#f2f5fa;--o-text:#0e2240;--o-muted:#4c617d;--o-faint:#7a8ca6;--o-line:#cbd8e8;--o-hover:#e8eef7;--o-accent:#e8a912;--o-accent-ink:#1d1503;--o-accent-text:#8a5d00;--o-accent-soft:rgba(232,169,18,.16);--o-ok:#0d7a55;--o-ok-soft:rgba(13,122,85,.12);--o-err:#a63a22;--o-warn:#8a5d00;--o-shadow:0 10px 30px rgba(28,45,90,.08)}
html,html body{background:var(--o-bg);color:var(--o-text)}
body .muted{color:var(--o-muted)}
body .eyebrow{color:var(--o-faint)}
body h1,body h2,body h3{color:var(--o-text)}
body a:focus-visible,body button:focus-visible{outline-color:var(--o-accent)}
/* برند: آرم گرد پالایشگاه */
.brand img{display:none}
.brand::before{content:"";flex:none;width:44px;height:44px;border-radius:50%;background:center/cover var(--s5-emblem);border:2px solid rgba(255,255,255,.16)}
[data-theme=light] .brand::before{border-color:var(--o-line)}
.brand strong span{color:var(--o-accent-text);opacity:.9}
/* ناوبری کناری */
body .sidebar{background:var(--o-panel);color:var(--o-text);border-inline-start:1px solid var(--o-line);box-shadow:inset 0 3px 0 var(--o-accent)}
body .sidebar .workspace-label{color:var(--o-faint);margin-top:22px}
body nav button{color:var(--o-muted)}
body nav button:hover{background:var(--o-hover);color:var(--o-text)}
body nav button.active{background:var(--o-raised);color:var(--o-text);box-shadow:inset -3px 0 0 var(--o-accent)}
body nav button.active svg{color:var(--o-accent-text)}
body .nav-count{background:var(--o-accent);color:var(--o-accent-ink)}
body .future-note{color:var(--o-muted);border-top-color:var(--o-line)}
body .future-note small{color:var(--o-faint)}
body .admin-link{color:var(--o-muted)}
body .admin-link:hover{color:var(--o-text)}
body .user-panel{border-top-color:var(--o-line)}
body .user-panel small{color:var(--o-faint)}
body .avatar{background:var(--o-raised);color:var(--o-accent-text);border:1px solid var(--o-line)}
body .icon-button:hover{background:var(--o-hover)}
.sidebar .s5-sw{display:block;width:100%;margin:18px 0 0}
.sidebar .s5-sw>summary span{display:inline}
.sidebar .s5-sw>summary{width:100%;justify-content:center;min-height:42px;border-radius:12px}
.sidebar .s5-pop{inset-inline:0;width:auto;grid-template-columns:1fr}
body .scrim{background:rgba(3,9,18,.62)}
/* نوار بالا */
body .topbar{background:var(--o-panel);border-bottom-color:var(--o-line)}
body .topbar-title{color:var(--o-muted)}
body .connection{color:var(--o-muted)}
body .connection i{background:var(--o-ok);box-shadow:0 0 0 3px var(--o-ok-soft)}
body .connection.offline i{background:var(--o-warn);box-shadow:0 0 0 3px var(--o-accent-soft)}
.s5-theme{width:38px;height:38px;border-radius:10px;border:1px solid var(--o-line);background:var(--o-surface);color:var(--o-muted);display:inline-flex;align-items:center;justify-content:center;padding:0}
.s5-theme:hover{background:var(--o-hover);color:var(--o-text)}
.s5-theme svg{width:18px;height:18px;fill:currentColor}
.s5-theme .s5-sun{display:none}
[data-theme=light] .s5-theme .s5-sun{display:block}
[data-theme=light] .s5-theme .s5-moon{display:none}
/* صفحه‌ها و کارت‌ها */
body .page-heading p{color:var(--o-muted)}
body .metrics section,body .panel,body .equipment-card,body .submit-bar,body .phase-stats>div,body .phase-table,body .assistant-answer,body .ui-recovery{background:var(--o-surface);border-color:var(--o-line);color:var(--o-text);box-shadow:var(--o-shadow)}
body .metrics section:first-child{background:linear-gradient(135deg,rgba(240,180,41,.13),var(--o-surface) 62%);border-color:rgba(240,180,41,.38)}
body .metrics small,body .value small{color:var(--o-muted)}
body .metrics section>span:last-child{color:var(--o-faint)}
body .metrics .value{color:var(--o-text)}
body .health-text{color:var(--o-ok)}
body .panel-head small,body .equipment-card p,body .equipment-value small,body .equipment-card footer,body .run-row small,body .queue-row small,body .submit-bar small,body .content-footer,body .composition-total,body .report-meta{color:var(--o-faint)}
body .heater-bars button{color:var(--o-text)}
body .heater-bars button>div{background:var(--o-raised)}
body .heater-bars button>div>span{background:linear-gradient(90deg,#c58a0c,var(--o-accent))}
body .run-row{background:transparent;border-bottom-color:var(--o-line);color:var(--o-text)}
body .run-row:hover{background:var(--o-hover)}
body .run-icon{background:var(--o-raised);color:var(--o-accent-text)}
body .run-row>svg{color:var(--o-faint)}
body .equipment-card:hover{border-color:var(--o-accent)}
body .equipment-icon{background:var(--o-accent-soft);color:var(--o-accent-text)}
body .equipment-card footer{border-top-color:var(--o-line)}
body .step{background:var(--o-accent-soft);color:var(--o-accent-text)}
body .result-box{background:var(--o-raised);border-color:var(--o-line)}
body .result-box>small{color:var(--o-muted)}
body .source-note{background:var(--o-raised);border-color:var(--o-line)}
body .source-note svg{color:var(--o-accent-text)}
body .source-note p{color:var(--o-muted)}
body .empty{color:var(--o-muted)}
body .empty>svg{background:var(--o-raised);color:var(--o-accent-text)}
body .empty p{color:var(--o-faint)}
body .json{background:var(--o-raised);color:var(--o-text)}
body .queue-row{border-bottom-color:var(--o-line)}
body .phase-table td,body .phase-table th{border-bottom-color:var(--o-line)}
body .assistant-heading p{color:var(--o-muted)}
body .assistant-source{border-bottom-color:var(--o-line)}
body .ui-recovery button{background:transparent;color:var(--o-accent-text);border-color:var(--o-accent)}
/* اجزای MUI */
html body .MuiButton-contained{background:var(--o-accent);color:var(--o-accent-ink);font-weight:800}
html body .MuiButton-contained:hover{background:var(--o-accent);filter:brightness(1.07)}
html body .MuiButton-contained.Mui-disabled{background:var(--o-raised);color:var(--o-faint)}
html body .MuiButton-text,html body .MuiButton-outlined{color:var(--o-accent-text)}
html body .MuiButton-text:hover,html body .MuiButton-outlined:hover{background:var(--o-accent-soft)}
html body .MuiButton-text.Mui-disabled{color:var(--o-faint)}
html body .MuiButton-colorError{color:var(--o-err)}
html body .MuiButton-colorInherit{color:inherit}
html body .MuiInputBase-root,html body .MuiOutlinedInput-root{color:var(--o-text)}
html body .MuiInputBase-input{color:var(--o-text)}
html body .MuiOutlinedInput-notchedOutline{border-color:var(--o-line)}
html body .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline{border-color:var(--o-faint)}
html body .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline{border-color:var(--o-accent);border-width:2px}
html body .MuiInputLabel-root{color:var(--o-muted)}
html body .MuiInputLabel-root.Mui-focused{color:var(--o-accent-text)}
html body .MuiSelect-icon,html body .MuiSvgIcon-root.MuiSelect-icon{color:var(--o-muted)}
html body .MuiOutlinedInput-root{background:var(--o-raised)}
html body .MuiCheckbox-root,html body .MuiSwitch-root .MuiSwitch-switchBase{color:var(--o-faint)}
html body .MuiCheckbox-root.Mui-checked{color:var(--o-accent)}
html body .MuiFormControlLabel-label{color:var(--o-text)}
html body .MuiPaper-root{background-color:var(--o-surface);color:var(--o-text)}
html body .MuiDialog-paper{border:1px solid var(--o-line);box-shadow:0 30px 80px rgba(0,0,0,.45)}
html body .MuiMenuItem-root:hover,html body .MuiMenuItem-root.Mui-focusVisible{background:var(--o-hover)}
html body .MuiMenuItem-root.Mui-selected{background:var(--o-accent-soft)}
html body .MuiAccordion-root{background:var(--o-raised);border-color:var(--o-line);color:var(--o-text)}
html body .MuiChip-root{color:var(--o-text);border-color:var(--o-line)}
html body .MuiChip-outlinedSuccess{color:var(--o-ok);border-color:var(--o-ok)}
html body .MuiChip-outlinedError{color:var(--o-err);border-color:var(--o-err)}
html body .MuiChip-filled{background:var(--o-raised)}
html body .MuiAlert-root{border:1px solid var(--o-line);color:var(--o-text)}
html body .MuiAlert-standardInfo{background:rgba(61,139,255,.12);border-color:rgba(61,139,255,.35)}
html body .MuiAlert-standardInfo .MuiAlert-icon{color:#6fa8ff}
html body .MuiAlert-standardWarning{background:var(--o-accent-soft);border-color:rgba(240,180,41,.4)}
html body .MuiAlert-standardWarning .MuiAlert-icon{color:var(--o-warn)}
html body .MuiAlert-standardError{background:rgba(255,157,138,.12);border-color:rgba(255,157,138,.4)}
html body .MuiAlert-standardError .MuiAlert-icon{color:var(--o-err)}
html body .MuiAlert-standardSuccess{background:var(--o-ok-soft);border-color:rgba(47,191,138,.4)}
html body .MuiAlert-standardSuccess .MuiAlert-icon{color:var(--o-ok)}
html body .MuiCircularProgress-root{color:var(--o-accent)}
html body .MuiDivider-root{border-color:var(--o-line)}
/* نمودار */
.chart .recharts-area-curve{stroke:var(--o-accent)}
.chart .recharts-area-area{fill:var(--o-accent);fill-opacity:.16}
.chart .recharts-cartesian-grid line{stroke:var(--o-line)}
.chart .recharts-text,.chart .recharts-cartesian-axis-tick-value{fill:var(--o-muted)}
.chart .recharts-tooltip-wrapper .recharts-default-tooltip{background:var(--o-surface)!important;border-color:var(--o-line)!important;color:var(--o-text)}
/* صفحهٔ ورود: همان چیدمان طراحی مشترک؛ همیشه تیره */
.login-shell{--o-bg:#081528;--o-panel:#0a1a30;--o-surface:rgba(9,21,40,.86);--o-raised:#0c1c33;--o-text:#e9f1fc;--o-muted:#93a8c8;--o-faint:#6f86a8;--o-line:#27406a;--o-accent:#f0b429;--o-accent-ink:#1d1503;--o-accent-text:#f5c04a;--o-accent-soft:rgba(240,180,41,.14);--o-err:#ff9d8a;color:var(--o-text);grid-template-columns:minmax(380px,500px) 1fr;background:linear-gradient(270deg,rgba(6,16,29,.92),rgba(6,16,29,.5) 45%,rgba(6,16,29,.1)),url(/s5/hero-oil.webp) left center/cover no-repeat,#06101d}
.login-shell .login-panel{order:-1;background:transparent;margin:0;padding:28px clamp(16px,4vw,56px);min-height:100vh;justify-content:center}
.login-shell .login-panel form{max-width:none;width:100%;padding:36px 32px;gap:20px;background:rgba(9,21,40,.82);border:1px solid #27406a;border-radius:22px;backdrop-filter:blur(14px);box-shadow:0 30px 80px rgba(0,0,0,.45)}
.login-shell .login-panel h2{color:#e9f1fc}
.login-shell .login-panel .eyebrow{color:var(--o-accent-text)}
.login-shell .login-panel .muted{color:var(--o-muted)}
.login-shell .login-footer{width:calc(100% - 2*clamp(16px,4vw,56px));color:#6f86a8;left:clamp(16px,4vw,56px);bottom:18px}
.login-shell .login-intro{background:transparent;min-height:100vh;padding:48px clamp(24px,5vw,72px)}
.login-shell .login-intro:before{display:none}
.login-shell .login-intro h1{color:#fff;text-shadow:0 2px 24px rgba(0,0,0,.6)}
.login-shell .login-intro p{color:#cfe0f5;text-shadow:0 1px 14px rgba(0,0,0,.7)}
.login-shell .login-intro .eyebrow{color:var(--o-accent-text)}
.login-shell .login-proof{color:#cfe0f5}
.login-shell .login-proof svg{color:var(--o-accent-text)}
.login-shell .brand strong{color:#fff}
.login-shell .MuiOutlinedInput-root{background:rgba(5,12,24,.6)}
@media(max-width:1200px){.login-shell{grid-template-columns:minmax(360px,460px) 1fr}}
@media(max-width:900px){.login-shell{grid-template-columns:1fr}.login-shell .login-panel{order:0;min-height:unset;padding:0 18px 70px}.login-shell .login-intro{min-height:unset;padding:26px 22px 22px}}
@media(max-width:760px){.login-shell{display:flex;background:linear-gradient(180deg,rgba(6,16,29,.6),rgba(6,16,29,.95) 70%),url(/s5/hero-oil.webp) 28% top/cover no-repeat,#06101d}.login-shell .login-panel{min-height:unset;flex:1;padding:6px 16px 76px}.login-shell .login-panel form{padding:26px 20px}.login-shell .login-footer{left:16px;width:calc(100% - 32px)}}
