/* =====================================================================
   REDESIGN · PART 5 (19 Oct 2026)
   header · navigator · site status · power-factor dial · relative bars · aligned tables
   · protection single line · switchgear relay · trends calculator · electrical path
   ===================================================================== */

/* ---------- HEADER: bright title, bright search, nothing else ---------- */
header { background: linear-gradient(180deg, #1a2430 0%, #10161d 100%); border-bottom: 1px solid #2d3b4b; padding-top: 18px; }
header h1 { font-size: clamp(22px, 2.1vw, 32px); font-weight: 700; letter-spacing: .07em; gap: 14px; }
.hd-logo { width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(145deg, #ffa05a, #d9702f); color: #1a0f06; box-shadow: 0 0 0 1px rgba(255, 190, 130, .5), 0 6px 22px -4px rgba(255, 140, 60, .55); }
.hd-logo svg { width: 25px; height: 25px; }
.hd-name { color: #ffffff; text-shadow: 0 0 22px rgba(255, 255, 255, .28), 0 1px 0 rgba(0, 0, 0, .6); }
.hd-sub { color: #d3dbe4; font-weight: 500; font-size: 12.5px; letter-spacing: .09em; padding-left: 60px; }
.ws-tools.hd-tools { max-width: 560px; }
.ws-search { padding: 11px 18px; min-width: 300px; border: 1.5px solid #46586b; background: linear-gradient(180deg, #212d3a, #1a2430); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 4px 16px -8px rgba(0, 0, 0, .8); transition: border-color .2s, box-shadow .2s; }
.ws-search:hover { border-color: #6a819a; }
.ws-search:focus-within { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(198, 121, 63, .28), 0 4px 16px -8px rgba(0, 0, 0, .8); }
.ws-search svg { width: 18px; height: 18px; stroke: #e6edf4; stroke-width: 2.2; }
.ws-search input { color: #ffffff; font-size: 14px; font-weight: 500; }
.ws-search input::placeholder { color: #b8c4d0; opacity: 1; }
#liveClock { background: linear-gradient(160deg, #1f2a37, #151c26); border-color: #34455a; }
#clockDate { color: #cbd5df; }
#clockTime { color: #fff; }

/* ---------- NAVIGATOR: workspace cards with icons, a sliding marker, an animated tray of pages ---------- */
#flowTabRow { background: linear-gradient(180deg, rgba(14, 20, 27, .98), rgba(10, 15, 20, .98)); padding: 14px 28px 14px; gap: 0; border-bottom: 1px solid #243140; box-shadow: 0 10px 30px -18px #000; }
.rail1 { position: relative; grid-template-columns: 132px repeat(4, minmax(0, 1fr)); gap: 12px; padding-bottom: 10px; }
.rail1 #homeTab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; padding: 8px 12px; border-radius: 14px; border: 1px solid #26323e; border-left-width: 1px;
  background: linear-gradient(145deg, #1a232d, #111820); font-family: var(--disp); font-size: 12.5px; letter-spacing: .16em; transition: transform .2s, border-color .2s, box-shadow .25s; }
.rail1 #homeTab svg { width: 26px; height: 26px; stroke: #ffb27a; stroke-width: 1.8; transition: transform .3s; }
.rail1 #homeTab:hover { transform: translateY(-2px); border-color: #c6793f; }
.rail1 #homeTab:hover svg { transform: scale(1.12) translateY(-1px); }
.rail1 #homeTab.active { background: linear-gradient(145deg, #4a2b17, #2a1a10); border-color: #e0884a; box-shadow: 0 0 0 1px rgba(224, 136, 74, .5), 0 10px 26px -12px #e0884a; color: #fff; }

.rail-ws { position: relative; flex-direction: row; align-items: center; gap: 13px; padding: 10px 16px 10px 12px; border-radius: 14px; border: 1px solid #26323e; border-left: 1px solid #26323e;
  background: linear-gradient(145deg, #161f29, #10171e); transition: transform .22s, border-color .25s, box-shadow .3s, background .3s; overflow: hidden; }
.rail-ws::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120px 60px at 0 0, color-mix(in srgb, var(--wc) 22%, transparent), transparent 70%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.rail-ws:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--wc) 60%, #26323e); background: linear-gradient(145deg, #1a2531, #121a22); }
.rail-ws:hover::before, .rail-ws.on::before { opacity: 1; }
.rail-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; position: relative;
  background: color-mix(in srgb, var(--wc) 16%, #10171e); border: 1px solid color-mix(in srgb, var(--wc) 50%, #26323e); transition: background .3s, transform .3s, box-shadow .3s; }
.rail-ic svg { width: 22px; height: 22px; fill: none; stroke: var(--wc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .3s, transform .35s; }
.rail-ws:hover .rail-ic svg { transform: scale(1.14) rotate(-6deg); }
.rail-ws.on .rail-ic { background: var(--wc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--wc) 22%, transparent), 0 8px 22px -6px var(--wc); }
.rail-ws.on .rail-ic svg { stroke: #11171d; }
.rail-ws.on .rail-ic::after { content: ''; position: absolute; inset: -3px; border-radius: 15px; border: 2px solid var(--wc); opacity: 0; animation: railRing 2.4s ease-out infinite; }
@keyframes railRing { 0% { transform: scale(.9); opacity: .7; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.rail-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rail-ws b { display: flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: .15em; color: #fff; font-weight: 600; }
.rail-ws b i { font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: 0; padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, var(--wc) 20%, transparent); color: color-mix(in srgb, var(--wc) 70%, #fff); }
.rail-st { font-size: 11.5px; color: #a3b2c1; }
.rail-ws.on { background: linear-gradient(145deg, color-mix(in srgb, var(--wc) 16%, #161f29), #10171e); border-color: color-mix(in srgb, var(--wc) 70%, #26323e); box-shadow: 0 12px 30px -18px var(--wc); }
.rail-ws.on .rail-st { color: color-mix(in srgb, var(--wc) 45%, #fff); }
.rail-ws.cur b::after { display: none; }
.rail-ws.cur .rail-ic { outline: 2px solid color-mix(in srgb, var(--wc) 55%, transparent); outline-offset: 2px; }
.rail-mark { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; border-radius: 3px; background: var(--wc, #ff7a45); box-shadow: 0 0 14px 1px var(--wc, #ff7a45); pointer-events: none;
  transition: transform .5s cubic-bezier(.3, 1.25, .4, 1), width .5s cubic-bezier(.3, 1.25, .4, 1), background .3s, box-shadow .3s; }

.rail2 { --wc: #ff7a45; margin-top: 4px; min-height: 0; padding: 10px 12px; border-radius: 14px; position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 8%, #0f161d), #0c1217);
  border: 1px solid color-mix(in srgb, var(--wc) 32%, #1c2732); border-top: 2px solid var(--wc); transition: border-color .4s, background .4s; }
.rail2 .ws.on { animation: trayIn .35s ease both; }
@keyframes trayIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes tabIn { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.rail2 .ws-tabs { gap: 8px; }
#flowTabRow .rail2 .mode-tab { position: relative; padding: 9px 18px 9px 13px; gap: 9px; font-size: 12.5px; letter-spacing: .08em; border-radius: 11px; border: 1px solid #26323e; border-left: 1px solid #26323e; color: #dbe3ea;
  background: linear-gradient(145deg, #171f28, #121920); overflow: hidden;
  animation: tabIn .45s cubic-bezier(.2, .9, .3, 1.15) both; animation-delay: calc(var(--i, 0) * 60ms + 70ms); transition: transform .2s, border-color .2s, background .25s, box-shadow .25s; }
#flowTabRow .rail2 .mode-tab svg { display: block !important; width: 18px; height: 18px; stroke: var(--fc); stroke-width: 1.9; transition: transform .3s; }
#flowTabRow .rail2 .mode-tab:hover { transform: translateY(-2px); border-color: var(--fc); background: linear-gradient(145deg, color-mix(in srgb, var(--fc) 14%, #171f28), #121920); }
#flowTabRow .rail2 .mode-tab:hover svg { transform: scale(1.18) rotate(-5deg); }
#flowTabRow .rail2 .mode-tab::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--fc); box-shadow: 0 0 10px var(--fc); transition: width .35s ease; }
#flowTabRow .rail2 .mode-tab:hover::after { width: 38%; }
#flowTabRow .rail2 .mode-tab.active { color: #fff; border-color: var(--fc); background: linear-gradient(145deg, color-mix(in srgb, var(--fc) 30%, #171f28), color-mix(in srgb, var(--fc) 12%, #121920)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--fc) 50%, transparent), 0 8px 22px -10px var(--fc); }
#flowTabRow .rail2 .mode-tab.active::after { width: 100%; }
#flowTabRow .rail2 .mode-tab.active svg { stroke: #fff; }
@media (max-width: 1100px) { .rail1 { grid-template-columns: 110px repeat(2, minmax(0, 1fr)); } .rail1 #homeTab { grid-row: span 2; } .rail-mark { display: none; } }
@media (prefers-reduced-motion: reduce) { .rail-ws.on .rail-ic::after, .rail2 .ws.on, #flowTabRow .rail2 .mode-tab { animation: none; } .rail-mark { transition: none; } }

/* ---------- HOME · SITE STATUS headline ---------- */
.hp-bar { --sc: var(--mint); display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 14px 20px; border-radius: 14px; flex-wrap: nowrap;
  background: linear-gradient(100deg, color-mix(in srgb, var(--sc) 15%, #121a21) 0%, #121a21 60%); border: 1px solid color-mix(in srgb, var(--sc) 45%, #1f2a33); }
.hp-bar.hs-warn { --sc: var(--amber); } .hp-bar.hs-bad { --sc: var(--rose); }
.hp-lamp { position: relative; width: 22px; height: 22px; display: block; }
.hp-lamp i { position: absolute; inset: 4px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 14px var(--sc); }
.hp-lamp i + i { inset: 0; background: none; box-shadow: none; border: 2px solid var(--sc); animation: lampRing 2.2s ease-out infinite; }
@keyframes lampRing { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
.hp-vd .k { display: block; font-family: var(--disp); font-size: 10.5px; letter-spacing: .24em; color: #9fb0bf; }
.hp-bar h2 { font-family: var(--disp); font-size: 28px; font-weight: 600; letter-spacing: .1em; color: var(--sc); line-height: 1.1; text-shadow: 0 0 22px color-mix(in srgb, var(--sc) 45%, transparent); }
.hp-bar p { font-size: 13.5px; color: #d3dbe4; text-transform: none; min-width: 0; }
.hp-fig { display: flex; gap: 26px; }
.hp-fig span { display: flex; flex-direction: column; font-family: var(--mono); font-size: 12px; color: #9fb0bf; text-transform: none; }
.hp-fig b { font-size: 24px; font-weight: 500; color: #fff; line-height: 1.1; }
.hp-fig em { font-style: normal; font-family: var(--disp); font-size: 9.5px; letter-spacing: .16em; color: #7f8c99; text-transform: uppercase; margin-top: 2px; }
@media (max-width: 1150px) { .hp-bar { grid-template-columns: auto 1fr; } .hp-bar p, .hp-fig { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .hp-lamp i + i { animation: none; opacity: .5; } }

/* ---------- POWER-FACTOR DIAL ---------- */
.ic-svg.ic-pf { max-width: 250px; }
.ic-zn { fill: none; stroke-width: 7; stroke-linecap: butt; opacity: .9; }
.ic-zn.bad { stroke: #e0566a; } .ic-zn.mid { stroke: #e8a53a; } .ic-zn.good { stroke: #3fcf8e; }
.ic-mn { stroke: #0e1419; stroke-width: 1.4; }
.ic-tl { font-family: var(--mono); font-size: 7.6px; fill: #9fb0bf; font-weight: 600; }
.ic-tl.a { fill: var(--rose); } .ic-tl.n { fill: var(--amber); } .ic-tl.t { fill: var(--mint); }
.ic-pf .ic-needle { stroke: #fff; stroke-width: 2.4; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .8)); }
.ic-pf .ic-hub { fill: #222d39; stroke: #fff; stroke-width: 1.6; }
.ic-hub2 { fill: #fff; }

/* ---------- bars are always a share of the real whole ---------- */
.hp-tile .sh { position: relative; height: 6px; }
.hp-tile .sh::after, .hp-lst .bar::after, .rk-r .b::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent calc(25% - 1px), rgba(11, 16, 21, .85) calc(25% - 1px) 25%, transparent 25% calc(50% - 1px), rgba(11, 16, 21, .85) calc(50% - 1px) 50%, transparent 50% calc(75% - 1px), rgba(11, 16, 21, .85) calc(75% - 1px) 75%, transparent 75%); }
.hp-lst .bar, .rk-r .b { position: relative; }
.hp-tile .sh i, .hp-lst .bar i, .rk-r .b i { min-width: 3px; }
.rk-r { grid-template-columns: 30px minmax(0, 1.2fr) minmax(0, 1.4fr) 190px; }

/* ---------- TABLES: every header sits exactly over its column ---------- */
table.pt { border-collapse: separate; border-spacing: 0; }
.pt thead th, .pt tbody td, .pt tfoot td { padding: 11px 16px; }
.pt thead th { border-bottom: 1px solid #2d3b4b; }
.pt thead th:first-child, .pt tbody td:first-child { padding-left: 10px; }
.pt th.r, .pt td.r { text-align: right; }
.pt th.c, .pt td.c { text-align: center; }
.pt thead th.r u { margin: 0 6px 0 0; }
.pt td.r.m, .pt td.c.m { font-variant-numeric: tabular-nums; }
.pt td.sh, .pt th:has(+ th), .pt td.sh { min-width: 0; }
.pt td.sh { width: 250px; min-width: 210px; }
.pt td.sh .shw { display: flex; align-items: center; gap: 12px; }
.pt td.sh .bar { flex: 1; width: auto; min-width: 90px; height: 8px; margin: 0; position: relative; }
.pt td.sh .bar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent calc(50% - 1px), rgba(11, 16, 21, .8) calc(50% - 1px) 50%, transparent 50%); }
.pt td.sh .bar i { min-width: 3px; }
.pt td.sh .shw .m { flex: none; width: 56px; text-align: right; }
.pt tbody tr.drill:hover td { background: #16202a; }
.pt tfoot td { border-top: 2px solid #2d3b4b; font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: #fff; background: #111a22; }
.pt tfoot td:nth-child(2) { font-family: var(--disp); letter-spacing: .12em; font-size: 11.5px; color: #9fb0bf; }
.pt td.st, .pt th.c:last-child { width: 96px; }
