:root{--bg:#06161d;--bg2:#0a222c;--panel:#0d2a35cc;--panel2:#123845cc;--line:#1e4b57;--text:#eaf8fb;--muted:#86a7b0;--cyan:#38d4df;--teal:#21c7a8;--green:#4ad6a2;--yellow:#e3c85c;--red:#ff6b78;--purple:#a681ff;--shadow:0 18px 45px rgba(0,0,0,.28);--radius:20px}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:radial-gradient(circle at 20% 0%,#103644 0,#06161d 34%,#041016 100%);color:var(--text);font-family:Inter,Tajawal,sans-serif}body{min-height:100vh}button,input,select{font:inherit}.glass-card{background:linear-gradient(160deg,rgba(18,57,70,.92),rgba(8,31,40,.9));border:1px solid rgba(83,170,190,.2);box-shadow:var(--shadow);backdrop-filter:blur(14px);border-radius:var(--radius)}.app-shell{min-height:100vh;padding:14px}.topbar{display:grid;grid-template-columns:1.25fr auto 1fr;align-items:center;gap:18px;padding:14px 18px;position:sticky;top:10px;z-index:50}.brand-block{display:flex;align-items:center;gap:12px}.brand-mark{width:50px;height:50px;border-radius:15px;display:grid;place-items:center;background:linear-gradient(145deg,#1a6573,#113845);font-size:23px}.brand-title{font-weight:700;font-size:16px}.brand-subtitle{font-size:11px;color:var(--muted);margin-top:3px}.main-nav{display:flex;gap:8px;background:rgba(1,15,20,.35);padding:5px;border-radius:14px}.nav-link{color:#9fbac1;text-decoration:none;padding:10px 16px;border-radius:11px;display:flex;gap:8px;align-items:center;font-size:13px}.nav-link.active{color:white;background:linear-gradient(180deg,#1d5a69,#113b46);box-shadow:inset 0 -2px 0 var(--cyan)}.topbar-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px}.live-pill,.icon-btn,.profile-chip{border:1px solid rgba(85,170,190,.25);background:rgba(17,52,63,.82);color:var(--text);border-radius:14px}.live-pill{padding:9px 11px;font-size:12px}.pulse-dot,.online-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--green);margin-inline-end:7px;box-shadow:0 0 10px var(--green)}.icon-btn{height:40px;padding:0 12px;cursor:pointer}.profile-chip{display:flex;align-items:center;gap:8px;padding:5px 9px}.avatar{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:#1e5664;font-size:11px}.profile-copy{display:grid;text-align:start}.profile-copy b{font-size:12px}.profile-copy small{color:var(--muted);font-size:9px}.page-content{padding:16px 2px}.kpi-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.kpi-grid.four{grid-template-columns:repeat(4,1fr)}.kpi-card{padding:15px;display:flex;gap:14px;align-items:center;min-height:105px}.kpi-icon{width:54px;height:54px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(145deg,#194d5c,#123440);font-size:22px;color:#b8fbff}.danger-icon{color:#ff9ca6}.kpi-card div:last-child{display:grid;gap:3px}.kpi-card span{font-size:12px;color:var(--muted)}.kpi-card strong{font-size:30px;line-height:1}.kpi-card small{font-size:10px}.ok{color:var(--green)!important}.warn{color:var(--yellow)!important}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(340px,.72fr);gap:12px;margin-top:12px}.main-column,.side-column{display:grid;gap:12px;align-content:start}.panel{overflow:hidden}.panel-head{display:flex;justify-content:space-between;align-items:center;padding:15px 16px;border-bottom:1px solid rgba(88,165,183,.16)}.panel-head.compact{padding:12px 14px}.panel-head h3{margin:0 0 4px;font-size:16px}.panel-head p{margin:0;color:var(--muted);font-size:10px}.panel-meta{color:var(--muted);font-size:10px}.ghost-btn,.primary-btn,.mini-btn,.small-round,.table-action{border:1px solid rgba(85,170,190,.25);color:var(--text);background:#123844;border-radius:10px;cursor:pointer}.ghost-btn{padding:9px 12px}.primary-btn{padding:10px 14px;background:linear-gradient(180deg,#1f7182,#14515f);box-shadow:inset 0 -1px 0 #4ccad6}.small-round{width:34px;height:34px;border-radius:50%}.map-panel #siteMap{height:355px;background:#d9e2df}.leaflet-container{font-family:Inter,Tajawal,sans-serif}.table-wrap{overflow:auto}.data-table{width:100%;border-collapse:collapse;min-width:680px}.data-table th,.data-table td{padding:13px 14px;text-align:start;border-bottom:1px solid rgba(87,157,172,.13);font-size:11px}.data-table th{font-weight:600;color:#9eb9c0;background:rgba(3,19,25,.22)}.data-table td small{display:block;color:var(--muted);margin-top:3px}.status-pill{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;font-size:10px;border:1px solid transparent}.status-pill i{width:7px;height:7px;border-radius:50%;background:currentColor}.ok-pill{color:#71e4b7;background:rgba(58,168,127,.12);border-color:rgba(74,214,162,.2)}.blue-pill{color:#67dce5;background:rgba(56,212,223,.1);border-color:rgba(56,212,223,.2)}.warn-pill{color:#f1d270;background:rgba(227,200,92,.1)}.purple-pill{color:#bda6ff;background:rgba(166,129,255,.12)}.neutral-pill{color:#a1b8be;background:rgba(160,184,190,.08)}.site-list-panel{padding-bottom:10px}.search-box{margin:10px 12px;display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px solid rgba(81,161,179,.16);background:rgba(2,19,25,.35);border-radius:10px}.search-box input{border:0;background:transparent;color:white;outline:0;width:100%}.filter-row{display:flex;gap:7px;padding:0 12px 10px}.filter{flex:1;border:1px solid rgba(85,170,190,.18);background:#102f39;color:#97b4bc;padding:7px;border-radius:999px;font-size:10px}.filter.active{color:#d9feff;border-color:#35c4d2}.site-list{display:grid;gap:8px;padding:0 10px}.site-item{display:flex;justify-content:space-between;align-items:center;text-align:start;color:white;background:rgba(18,51,61,.72);border:1px solid rgba(87,159,175,.13);border-radius:12px;padding:11px}.site-item.active{background:linear-gradient(90deg,rgba(22,70,81,.9),rgba(13,46,57,.85));border-color:rgba(67,190,205,.3)}.site-item small{display:block;color:var(--muted);font-size:9px;margin-top:3px}.site-detail{padding-bottom:12px}.site-detail-head{display:flex;justify-content:space-between;align-items:flex-start;padding:16px;border-bottom:1px solid rgba(87,159,175,.13)}.site-detail-head h2{margin:2px 0 4px}.site-detail-head p{margin:0;color:var(--muted);font-size:10px}.eyebrow{font-size:9px;letter-spacing:.15em;color:#67dce5}.pump-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:12px}.pump-card{position:relative;padding:11px 8px;background:rgba(5,30,38,.55);border:1px solid rgba(83,161,178,.16);border-radius:13px;display:grid;gap:5px;text-align:center}.pump-num{font-size:10px;color:#7bd9e1}.pump-card b{font-size:11px}.pump-card small{font-size:9px;color:var(--muted)}.signal{display:inline-block;width:9px;height:9px;border-radius:50%;margin:auto}.signal.on{background:var(--green);box-shadow:0 0 9px var(--green)}.signal.off{background:#657f85}.mini-btn{font-size:9px;padding:5px 7px}.tank-card{margin:0 12px 12px;border:1px solid rgba(83,161,178,.16);border-radius:14px;padding:12px;background:rgba(5,30,38,.55)}.tank-title{display:flex;justify-content:space-between}.tank-visual{display:flex;align-items:center;justify-content:space-around;padding-top:12px}.tank-shell{width:110px;height:84px;border:3px solid #84aab2;border-radius:12px 12px 18px 18px;position:relative;overflow:hidden;display:grid;place-items:center;font-weight:700;font-size:11px}.water-fill{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(180deg,#38d4df,#1a8da0);opacity:.7}.water-fill.high{height:78%}.tank-shell span{z-index:2}.level-states{display:grid;gap:9px}.level-states div{display:flex;align-items:center;gap:8px;font-size:10px}.level-states .signal{margin:0}.activity-card{margin:0 12px;padding:10px;border-radius:12px;background:rgba(14,64,67,.38);border:1px solid rgba(74,214,162,.15);display:flex;justify-content:space-between;font-size:10px}.activity-card small{color:var(--muted)}.page-heading{display:flex;justify-content:space-between;align-items:flex-end;padding:10px 4px 18px}.page-heading h1{margin:5px 0;font-size:30px}.page-heading p{margin:0;color:var(--muted);font-size:12px}.heading-actions{display:flex;gap:8px}.config-layout{display:grid;grid-template-columns:230px 1fr;gap:12px}.config-menu{padding:10px;align-self:start}.config-tab{width:100%;display:grid;grid-template-columns:26px 1fr auto;align-items:center;text-align:start;gap:8px;padding:12px;border:0;background:transparent;color:#aac1c7;border-radius:10px;margin-bottom:5px}.config-tab.active{background:#153e4a;color:white;box-shadow:inset 3px 0 0 var(--cyan)}[dir="rtl"] .config-tab.active{box-shadow:inset -3px 0 0 var(--cyan)}.config-tab small{background:#0a2b34;padding:3px 6px;border-radius:999px}.config-content{min-height:560px}.config-pane,.log-pane{display:none}.config-pane.active,.log-pane.active{display:block}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:16px}.form-card{display:grid;gap:8px;padding:15px;border:1px solid rgba(86,160,176,.16);border-radius:14px;background:rgba(4,27,34,.3)}.form-card label{font-size:10px;color:var(--muted)}.form-card input,.form-card select,.toolbar-row input,.toolbar-row select{background:#0a2932;border:1px solid rgba(85,170,190,.16);color:white;border-radius:9px;padding:10px}.table-action{padding:7px 9px}.logs-panel{margin-top:12px}.tabs-row{display:flex;gap:8px;padding:10px;border-bottom:1px solid rgba(86,160,176,.14)}.log-tab{border:0;background:transparent;color:#9fb9c0;padding:10px 14px;border-radius:9px}.log-tab.active{background:#143d48;color:white}.toolbar-row{display:flex;gap:8px;align-items:center;padding:12px}.search-box.wide{margin:0;flex:1}.login-shell{min-height:100vh;display:grid;grid-template-columns:1.15fr .85fr;align-items:center;gap:5vw;padding:7vw;position:relative;overflow:hidden}.login-ambient{position:absolute;border-radius:50%;filter:blur(50px);opacity:.45}.ambient-one{width:420px;height:420px;background:#0f7785;top:-100px;left:-120px}.ambient-two{width:330px;height:330px;background:#136c5d;right:10%;bottom:-170px}.login-brand-panel{position:relative;z-index:2;max-width:640px}.hero-logo{width:82px;height:82px;border-radius:24px;background:linear-gradient(145deg,#1e6876,#10333e);display:grid;place-items:center;font-size:36px;box-shadow:var(--shadow)}.login-brand-panel h1{font-size:50px;line-height:1.05;margin:24px 0 16px;max-width:600px}.login-brand-panel p{color:#a3c1c8;font-size:17px;line-height:1.7;max-width:590px}.hero-metrics{display:flex;gap:18px;margin-top:30px}.hero-metrics div{min-width:125px;padding:14px;border-radius:14px;background:rgba(14,47,57,.55);border:1px solid rgba(93,179,197,.16);display:grid}.hero-metrics strong{font-size:24px}.hero-metrics span{font-size:10px;color:var(--muted)}.auth-card{position:relative;z-index:2;padding:10px 26px 28px;max-width:510px;width:100%;justify-self:end}.auth-tabs{display:flex;background:rgba(2,18,24,.4);padding:5px;border-radius:12px;margin:6px 0 22px}.auth-tab{flex:1;border:0;background:transparent;color:#93b1b8;padding:10px;border-radius:9px}.auth-tab.active{background:#174654;color:white}.auth-pane{display:none}.auth-pane.active{display:block}.auth-header h2{font-size:26px;margin:0 0 6px}.auth-header p{color:var(--muted);font-size:12px;margin-bottom:22px}.auth-card form{display:grid;gap:8px}.auth-card label{font-size:11px;color:#b9cdd2;margin-top:5px}.input-wrap{display:flex;align-items:center;gap:10px;background:#08252e;border:1px solid rgba(90,169,187,.17);border-radius:11px;padding:0 12px}.input-wrap input{height:44px;flex:1;background:transparent;border:0;outline:0;color:white}.auth-row{display:flex;justify-content:space-between;align-items:center;margin:6px 0 10px;font-size:10px}.auth-row a{color:#64d9e3}.checkline{display:flex;align-items:center;gap:6px}.auth-submit{height:46px;border:0}.login-lang{position:absolute;top:22px;right:22px;z-index:5}.rtl .login-lang,[dir="rtl"] .login-lang{right:auto;left:22px}@media(max-width:1100px){.topbar{grid-template-columns:1fr auto}.main-nav{order:3;grid-column:1/-1;justify-content:center}.kpi-grid{grid-template-columns:repeat(2,1fr)}.dashboard-grid{grid-template-columns:1fr}.side-column{grid-template-columns:1fr 1fr}.login-shell{grid-template-columns:1fr;padding:7vw}.login-brand-panel{text-align:center;margin:auto}.hero-logo{margin:auto}.hero-metrics{justify-content:center}.auth-card{justify-self:center}.login-brand-panel h1{font-size:40px}.config-layout{grid-template-columns:1fr}.config-menu{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.config-tab{margin:0}.form-grid{grid-template-columns:1fr}}@media(max-width:720px){.app-shell{padding:8px}.topbar{position:relative;top:0;display:flex;flex-wrap:wrap}.brand-subtitle,.profile-copy,.live-pill{display:none}.topbar-actions{margin-inline-start:auto}.main-nav{width:100%;overflow:auto}.nav-link{flex:1;justify-content:center}.kpi-grid,.kpi-grid.four{grid-template-columns:1fr}.side-column{grid-template-columns:1fr}.pump-grid{grid-template-columns:1fr}.login-shell{padding:80px 18px 30px}.login-brand-panel h1{font-size:32px}.hero-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.hero-metrics div{min-width:0}.config-menu{grid-template-columns:1fr 1fr}.page-heading{align-items:flex-start;gap:15px;flex-direction:column}.toolbar-row{flex-wrap:wrap}.form-grid{padding:10px}}
[dir="rtl"] body{font-family:Tajawal,Inter,sans-serif}[dir="rtl"] .topbar,[dir="rtl"] .brand-block,[dir="rtl"] .site-detail-head,[dir="rtl"] .tank-title,[dir="rtl"] .activity-card,[dir="rtl"] .panel-head,[dir="rtl"] .page-heading{direction:rtl}.lang-label{margin-inline-start:6px}
.api-error{padding:10px 12px;border:1px solid rgba(255,107,120,.35);background:rgba(255,107,120,.10);color:#ffadb5;border-radius:10px;font-size:12px;margin-bottom:10px}.loading-state{padding:20px;color:var(--muted);font-size:12px}.clickable-row{cursor:pointer}.clickable-row:hover{background:rgba(56,212,223,.05)}.pump-control:disabled{opacity:.45;cursor:not-allowed}.profile-chip{text-decoration:none}.danger-btn{border:1px solid rgba(255,107,120,.3);background:rgba(255,107,120,.09);color:#ff9ba5;border-radius:10px;padding:9px 12px;cursor:pointer}.card-actions,.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.pending-feature{max-width:650px;margin:40px auto;padding:35px;text-align:center;color:var(--muted)}.pending-feature i{font-size:38px;color:var(--cyan);margin-bottom:14px}.pending-feature h3{color:var(--text);margin:8px}.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.65);z-index:200;display:grid;place-items:center;padding:20px}.modal-backdrop[hidden]{display:none}.modal{width:min(620px,95vw);max-height:90vh;overflow:auto}.modal-form{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:18px}.modal-form label{font-size:10px;color:var(--muted);align-self:end}.modal-form input,.modal-form select{background:#0a2932;border:1px solid rgba(85,170,190,.16);color:white;border-radius:9px;padding:10px}.modal-actions{grid-column:1/-1}.modal code,.panel code{color:#67dce5}@media(max-width:720px){.modal-form{grid-template-columns:1fr}.modal-actions{grid-column:1}}

/* Phase 3: live Auto / Manual operating mode control */
.mode-control-card{margin:12px 12px 0;padding:12px 13px;border:1px solid rgba(83,161,178,.18);border-radius:14px;background:linear-gradient(145deg,rgba(8,38,47,.78),rgba(5,27,34,.62));display:flex;align-items:center;justify-content:space-between;gap:14px}.mode-control-copy{display:grid;gap:3px;min-width:0}.mode-control-copy strong{font-size:16px}.mode-control-copy small{font-size:9px;color:var(--muted);line-height:1.4}.mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:4px;background:rgba(1,17,22,.55);border:1px solid rgba(85,170,190,.16);border-radius:12px;min-width:190px}.mode-btn{border:1px solid transparent;background:transparent;color:#8eaab1;border-radius:9px;padding:9px 11px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:6px;font-size:10px;transition:.18s ease}.mode-btn:hover:not(:disabled){color:#d8fbff;background:rgba(56,212,223,.07)}.mode-btn.active-auto{color:#79e3ec;background:rgba(56,212,223,.13);border-color:rgba(56,212,223,.28);box-shadow:inset 0 -1px 0 rgba(56,212,223,.5)}.mode-btn.active-manual{color:#7be4b8;background:rgba(71,215,162,.13);border-color:rgba(71,215,162,.28);box-shadow:inset 0 -1px 0 rgba(71,215,162,.5)}.mode-btn.pending{color:#f1d270;background:rgba(227,200,92,.10);border-color:rgba(227,200,92,.22)}.mode-btn:disabled{opacity:.48;cursor:not-allowed}.toast-stack{position:fixed;right:22px;bottom:22px;z-index:500;display:grid;gap:8px;max-width:min(390px,calc(100vw - 44px))}[dir="rtl"] .toast-stack{right:auto;left:22px}.dms-toast{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:12px;background:rgba(7,30,38,.97);border:1px solid rgba(85,170,190,.24);box-shadow:0 16px 40px rgba(0,0,0,.35);font-size:11px;animation:toastIn .18s ease}.dms-toast i{margin-top:1px}.dms-toast.success{border-color:rgba(71,215,162,.35);color:#9cf0cd}.dms-toast.error{border-color:rgba(255,107,120,.38);color:#ffb0b7}.dms-toast.info{border-color:rgba(56,212,223,.35);color:#9cebf1}@keyframes toastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media(max-width:720px){.mode-control-card{align-items:stretch;flex-direction:column}.mode-switch{min-width:0;width:100%}}

/* Phase 4: three-column control-room dashboard */
.control-room-grid{display:grid;grid-template-columns:minmax(300px,.88fr) minmax(480px,1.45fr) minmax(250px,.68fr);gap:12px;margin-top:12px;align-items:start}.monitor-column{display:grid;gap:12px;align-content:start}.site-operations-column,.site-browser-column{min-width:0}.control-map-panel #siteMap{height:390px}.monitoring-feed-panel{min-height:330px}.monitoring-feed{display:grid;max-height:390px;overflow:auto}.monitor-event{display:grid;grid-template-columns:34px 1fr auto;gap:10px;align-items:start;padding:11px 13px;border-bottom:1px solid rgba(87,159,175,.11)}.monitor-event:last-child{border-bottom:0}.monitor-event-icon{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:rgba(56,212,223,.09);color:#75dfe7}.monitor-event.warn .monitor-event-icon{background:rgba(227,200,92,.1);color:#f1d270}.monitor-event.offline .monitor-event-icon{background:rgba(255,107,120,.1);color:#ff9aa5}.monitor-event b{display:block;font-size:10px;margin-bottom:3px}.monitor-event p{margin:0;color:var(--muted);font-size:9px;line-height:1.45}.monitor-event time{color:#6f969f;font-size:8px;white-space:nowrap}.operations-panel{min-height:720px}.site-health-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:rgba(83,161,178,.13);border-bottom:1px solid rgba(83,161,178,.13)}.site-health-strip>div{padding:11px 14px;background:rgba(5,30,38,.72);display:grid;gap:3px}.site-health-strip span{font-size:8px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.site-health-strip strong{font-size:10px}.section-caption{display:flex;justify-content:space-between;align-items:end;padding:16px 14px 4px}.section-caption span{font-size:11px;font-weight:700}.section-caption small{font-size:8px;color:var(--muted)}.operations-pumps{grid-template-columns:repeat(3,1fr);padding-top:8px}.operations-pumps .pump-card{min-height:135px;align-content:center}.operations-tank{margin-top:8px}.site-list-tall{min-height:720px;max-height:calc(100vh - 170px);display:flex;flex-direction:column}.site-list-tall .site-list{overflow:auto;padding-bottom:12px}.site-count-badge{min-width:32px;height:28px;padding:0 8px;border-radius:9px;display:grid;place-items:center;background:#0a2b34;color:#77dce5;font-size:10px}.site-browser-column .filter-row .filter{min-width:0}.site-browser-column .site-item{min-height:62px}.site-browser-column .site-item.active{box-shadow:inset 3px 0 0 var(--cyan)}[dir="rtl"] .site-browser-column .site-item.active{box-shadow:inset -3px 0 0 var(--cyan)}
@media(max-width:1280px){.control-room-grid{grid-template-columns:minmax(280px,.8fr) minmax(460px,1.3fr)}.site-browser-column{grid-column:1/-1}.site-list-tall{min-height:0;max-height:none}.site-list-tall .site-list{display:grid;grid-template-columns:repeat(3,1fr);max-height:260px}.site-list-tall .panel-head,.site-list-tall .search-box,.site-list-tall .filter-row{max-width:none}}
@media(max-width:900px){.control-room-grid{grid-template-columns:1fr}.monitor-column,.site-operations-column,.site-browser-column{grid-column:auto}.site-browser-column{grid-row:1}.site-list-tall .site-list{grid-template-columns:1fr 1fr}.control-map-panel #siteMap{height:320px}.operations-panel{min-height:0}}
@media(max-width:600px){.site-list-tall .site-list{grid-template-columns:1fr}.site-health-strip{grid-template-columns:1fr}.section-caption{align-items:start;flex-direction:column;gap:4px}.operations-pumps{grid-template-columns:1fr}}

/* Phase 5: live refresh + simplified selected-site header */
.site-head-status{display:grid;justify-items:end;gap:6px;min-width:120px}.site-head-status small{font-size:9px;color:var(--muted);white-space:nowrap}[dir="rtl"] .site-head-status{justify-items:start}.site-health-strip{display:none!important}


/* Phase 6: fixed desktop viewport + compact control room */
@media (min-width:1281px){
  .dashboard-shell{height:100vh;min-height:0;overflow:hidden;display:flex;flex-direction:column;padding:10px 12px}
  .dashboard-shell .topbar{position:relative;top:0;flex:0 0 auto;padding:10px 16px}
  .dashboard-shell .brand-mark{width:44px;height:44px;border-radius:13px;font-size:20px}
  .dashboard-shell .page-content{flex:1;min-height:0;overflow:hidden;padding:10px 2px 0;display:flex;flex-direction:column}
  .dashboard-shell .kpi-grid{flex:0 0 auto;gap:10px}
  .dashboard-shell .kpi-card{min-height:82px;padding:10px 12px;gap:11px}
  .dashboard-shell .kpi-icon{width:46px;height:46px;border-radius:14px;font-size:19px}
  .dashboard-shell .kpi-card strong{font-size:25px}
  .dashboard-shell .control-room-grid{flex:1;min-height:0;height:auto;margin-top:10px;align-items:stretch;grid-template-columns:minmax(275px,.84fr) minmax(470px,1.52fr) minmax(225px,.64fr);gap:10px}
  .dashboard-shell .monitor-column{height:100%;min-height:0;display:grid;grid-template-rows:minmax(0,.53fr) minmax(0,.47fr);gap:10px}
  .dashboard-shell .control-map-panel,.dashboard-shell .monitoring-feed-panel,.dashboard-shell .operations-panel,.dashboard-shell .site-list-tall{height:100%;min-height:0}
  .dashboard-shell .control-map-panel{display:flex;flex-direction:column}
  .dashboard-shell .control-map-panel #siteMap{height:auto;min-height:0;flex:1}
  .dashboard-shell .monitoring-feed-panel{display:flex;flex-direction:column}
  .dashboard-shell .monitoring-feed{flex:1;min-height:0;max-height:none;overflow:auto}
  .dashboard-shell .operations-panel{min-height:0;overflow:hidden;padding-bottom:8px}
  .dashboard-shell .site-list-tall{min-height:0;max-height:none}
  .dashboard-shell .site-list-tall .site-list{flex:1;min-height:0;overflow:auto}
  .dashboard-shell .site-detail-head{padding:11px 14px}
  .dashboard-shell .site-detail-head h2{font-size:20px;margin:1px 0 2px}
  .dashboard-shell .mode-control-card{margin:9px 10px 0;padding:9px 11px}
  .dashboard-shell .mode-switch{min-width:178px}
  .dashboard-shell .mode-btn{padding:7px 9px}
  .dashboard-shell .section-caption{padding:10px 12px 3px}
  .dashboard-shell .operations-pumps{padding:6px 10px;gap:7px}
  .dashboard-shell .operations-pumps .pump-card{min-height:102px;padding:7px}
  .dashboard-shell .tank-card{margin:0 10px 8px;padding:9px}
  .dashboard-shell .tank-visual{padding-top:7px}
  .dashboard-shell .tank-shell{width:96px;height:70px}
  .dashboard-shell .level-states{gap:6px}
  .dashboard-shell .activity-card{margin:0 10px;padding:7px 9px}
  .dashboard-shell .panel-head{padding:10px 12px}
  .dashboard-shell .panel-head.compact{padding:9px 11px}
  .dashboard-shell .panel-head h3{font-size:14px}
  .dashboard-shell .search-box{margin:8px 10px;padding:7px 9px}
  .dashboard-shell .filter-row{padding:0 10px 8px}
  .dashboard-shell .site-browser-column .site-item{min-height:52px;padding:9px}
}


/* Phase 7: hard-lock dashboard to viewport; only site list/log feed may scroll */
html:has(body.dashboard-page),
body.dashboard-page {
  height: 100%;
  max-height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.dashboard-page {
  height: 100dvh;
  min-height: 0 !important;
}

body.dashboard-page .dashboard-shell {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0 !important;
  overflow: hidden !important;
}

@media (min-width:1281px) {
  body.dashboard-page .dashboard-shell {
    padding: 8px 10px;
  }

  body.dashboard-page .topbar {
    min-height: 66px;
    padding: 8px 14px;
  }

  body.dashboard-page .page-content {
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    overflow: hidden !important;
    padding: 8px 2px 0;
  }

  body.dashboard-page .kpi-grid {
    gap: 8px;
  }

  body.dashboard-page .kpi-card {
    min-height: 76px;
    padding: 8px 11px;
  }

  body.dashboard-page .kpi-icon {
    width: 42px;
    height: 42px;
  }

  body.dashboard-page .kpi-card strong {
    font-size: 23px;
  }

  body.dashboard-page .control-room-grid {
    flex: 1 1 auto;
    height: 0;
    min-height: 0;
    overflow: hidden;
    margin-top: 8px;
    gap: 8px;
    align-items: stretch;
  }

  body.dashboard-page .monitor-column,
  body.dashboard-page .site-operations-column,
  body.dashboard-page .site-browser-column {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  body.dashboard-page .monitor-column {
    grid-template-rows: minmax(0, .50fr) minmax(0, .50fr);
    gap: 8px;
  }

  body.dashboard-page .control-map-panel,
  body.dashboard-page .monitoring-feed-panel,
  body.dashboard-page .operations-panel,
  body.dashboard-page .site-list-tall {
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
  }

  body.dashboard-page .control-map-panel #siteMap {
    min-height: 0;
    height: 0;
    flex: 1 1 auto;
  }

  body.dashboard-page .monitoring-feed {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }

  body.dashboard-page .site-list-tall .site-list {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }

  body.dashboard-page .operations-panel {
    overflow: hidden !important;
  }

  body.dashboard-page .site-detail-head {
    padding: 9px 12px;
  }

  body.dashboard-page .mode-control-card {
    margin: 7px 9px 0;
    padding: 7px 10px;
  }

  body.dashboard-page .section-caption {
    padding: 8px 10px 2px;
  }

  body.dashboard-page .operations-pumps {
    padding: 5px 9px;
  }

  body.dashboard-page .operations-pumps .pump-card {
    min-height: 94px;
  }

  body.dashboard-page .tank-card {
    margin: 0 9px 6px;
    padding: 7px 9px;
  }

  body.dashboard-page .tank-shell {
    width: 90px;
    height: 64px;
  }

  body.dashboard-page .activity-card {
    margin: 0 9px;
    padding: 6px 8px;
  }
}

/* Phase 8 - live equipment animation */
.pump-animation{width:34px;height:34px;margin:0 auto 1px;position:relative;display:grid;place-items:center;border-radius:50%;background:rgba(100,127,133,.09);border:1px solid rgba(115,153,160,.18);color:#6f898f;transition:.25s ease}
.pump-animation .fa-fan{font-size:17px;position:relative;z-index:2}
.pump-animation.running{color:#69e6b7;background:rgba(74,214,162,.12);border-color:rgba(74,214,162,.35);box-shadow:0 0 18px rgba(74,214,162,.13)}
.pump-animation.running .fa-fan{animation:dmsPumpSpin .75s linear infinite}
.pump-ring{position:absolute;inset:3px;border-radius:50%;border:1px dashed currentColor;opacity:.38}
.pump-animation.running .pump-ring{animation:dmsPumpPulse 1.25s ease-in-out infinite}
@keyframes dmsPumpSpin{to{transform:rotate(360deg)}}
@keyframes dmsPumpPulse{0%,100%{transform:scale(.92);opacity:.25}50%{transform:scale(1.08);opacity:.65}}
.pump-card.pump-running{border-color:rgba(74,214,162,.25);background:linear-gradient(180deg,rgba(7,49,48,.55),rgba(5,30,38,.55))}
.animated-tank{isolation:isolate;box-shadow:inset 0 0 18px rgba(1,15,20,.45)}
.animated-water{transition:height 1.1s cubic-bezier(.2,.8,.2,1);overflow:visible!important;opacity:.82!important}
.water-wave{position:absolute;left:-35%;width:170%;height:16px;top:-8px;border-radius:45%;background:rgba(145,247,255,.26)}
.wave-one{animation:dmsWave 3.2s linear infinite}
.wave-two{top:-5px;opacity:.45;animation:dmsWaveReverse 4.5s linear infinite}
@keyframes dmsWave{to{transform:translateX(28%) rotate(8deg)}}
@keyframes dmsWaveReverse{to{transform:translateX(-28%) rotate(-8deg)}}
.tank-level-label{z-index:5!important;text-align:center;padding:3px 5px;border-radius:6px;background:rgba(3,17,23,.46);backdrop-filter:blur(2px)}
.auth-success{margin:0 0 14px;padding:11px 12px;border-radius:10px;border:1px solid rgba(74,214,162,.28);background:rgba(74,214,162,.09);color:#80e9bf;font-size:12px}
[dir="rtl"] .site-detail-head,[dir="rtl"] .panel-head,[dir="rtl"] .tank-title{direction:rtl}
