.card{background:linear-gradient(145deg,rgba(15,31,52,.98),rgba(8,23,40,.98));border:1px solid rgba(79,108,148,.27);border-radius:16px;padding:16px;box-shadow:0 12px 30px rgba(0,0,0,.18)}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.cards-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}.section-title,.hero-title{display:flex;justify-content:space-between;align-items:end;gap:12px;margin:20px 0 10px}.section-title h2,.hero-title h2{font-size:15px;margin:0}.section-title span,.hero-sub{font-size:11px;color:var(--muted)}.kpi{min-height:122px;position:relative;overflow:hidden}.kpi:after{content:"";position:absolute;width:110px;height:110px;border-radius:50%;right:-35px;top:-35px;opacity:.15;background:currentColor}.kpi .label{font-size:11px;text-transform:uppercase;color:#a6b8cf;font-weight:800;letter-spacing:.5px}.kpi .value{font-size:30px;font-weight:900;margin:10px 0 5px}.unit{font-size:13px;margin-left:5px;color:#a5b9d2}.kpi-foot{font-size:10px;color:#7890ad}.kpi-ac{border-left:4px solid var(--cyan);color:var(--cyan)}.kpi-dc{border-left:4px solid var(--green);color:var(--green)}.kpi-energy{border-left:4px solid var(--yellow);color:var(--yellow)}.kpi-eff{border-left:4px solid var(--purple);color:var(--purple)}.badge,.role-badge{display:inline-block;padding:5px 9px;border-radius:999px;background:#172840;border:1px solid #324968;font-size:10px;font-weight:900}.status-online{color:#a9ffd5;border-color:#2d795b;background:#12352a}.status-offline{color:#ffabb7;border-color:#7f3846;background:#351924}.role-superadmin{color:#ffd66b}.role-admin{color:#aee5ff}.role-user{color:#b7ffd6}.table-wrap{overflow:auto;max-width:100%}table{width:100%;border-collapse:collapse;font-size:12px}th,td{padding:10px;border-bottom:1px solid rgba(70,95,130,.28);text-align:left;white-space:nowrap}th{color:#91a8c7;font-size:10px;text-transform:uppercase;background:#0b1829;position:sticky;top:0}.btn,button{border:0;border-radius:10px;padding:10px 14px;background:linear-gradient(135deg,#2563eb,#3b82f6);color:white;font-weight:800;cursor:pointer}.secondary{background:#23334f}.danger{background:#a52d40}.green{background:linear-gradient(135deg,#0f956c,#24b785)}input,select{width:100%;background:#0b1728;border:1px solid #304867;color:white;border-radius:10px;padding:10px 11px}.form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.alert{padding:11px 14px;border-radius:10px;background:#382632;border:1px solid #6e3445;margin-bottom:15px}.success{background:#16352d;border-color:#286553}.login{min-height:100vh;display:grid;place-items:center;padding:25px;background:radial-gradient(circle at 50% 0,rgba(36,200,255,.13),transparent 35%),linear-gradient(180deg,#07111f,#091625)}.login-card{width:min(465px,100%);padding:28px}.login-title{text-align:center}.login-logo{width:105px}.field{margin:12px 0}.login button{width:100%;margin-top:13px}.data-summary{display:grid;grid-template-columns:repeat(6,minmax(110px,1fr));gap:10px}.mini-kpi{border-radius:12px;padding:11px;background:#0b182a;border:1px solid rgba(80,109,149,.28)}.m-label{font-size:9px;color:#8fa5c3;font-weight:800}.m-value{font-size:17px;font-weight:850;margin-top:4px}

/* V4 dashboard KPI layout */
.kpi-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.kpi-total{border-left:4px solid var(--orange);color:var(--orange);background:linear-gradient(145deg,rgba(50,32,20,.96),rgba(28,23,31,.98))}


/* V8.7 Elegant Login */
body.login-page{
    min-height:100vh;
    background:
      radial-gradient(circle at 15% 20%, rgba(60,130,246,.16), transparent 34%),
      radial-gradient(circle at 85% 18%, rgba(14,165,233,.12), transparent 32%),
      linear-gradient(135deg,#eef5ff 0%,#f8fbff 44%,#edf4ff 100%);
}
.login-shell,
.login-wrapper{
    position:relative;
    isolation:isolate;
}
.login-shell::before,
.login-wrapper::before{
    content:"";
    position:absolute;
    inset:-60px;
    background:
      linear-gradient(120deg,rgba(255,255,255,.7),rgba(255,255,255,.18));
    filter:blur(18px);
    border-radius:40px;
    z-index:-1;
}
.login-card{
    border:1px solid rgba(148,163,184,.22);
    background:rgba(255,255,255,.90);
    box-shadow:0 24px 70px rgba(15,23,42,.16);
    backdrop-filter:blur(18px);
}
.login-brand-panel{
    width:min(210px,72%);
    margin:0 auto 18px;
    padding:18px 22px;
    border-radius:24px;
    background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
    border:1px solid rgba(37,99,235,.10);
    box-shadow:
      0 12px 32px rgba(15,23,42,.10),
      inset 0 1px 0 rgba(255,255,255,.95);
}
.login-brand-panel img{
    display:block;
    width:100%;
    height:auto;
    object-fit:contain;
    filter:drop-shadow(0 8px 12px rgba(15,23,42,.10));
}
.login-eyebrow{
    margin:4px 0 8px;
    text-align:center;
    font-size:.72rem;
    font-weight:800;
    letter-spacing:.16em;
    color:#2563eb;
}
.login-card h1,
.login-title{
    text-align:center;
    letter-spacing:-.02em;
    color:#0f172a;
}
.login-subtitle{
    text-align:center;
    color:#64748b;
    line-height:1.6;
}
.login-card input,
.login-card select{
    background:#f8fbff;
    border:1px solid #dbe7f5;
    transition:border-color .2s ease,box-shadow .2s ease,background .2s ease;
}
.login-card input:focus,
.login-card select:focus{
    background:#fff;
    border-color:#60a5fa;
    box-shadow:0 0 0 4px rgba(59,130,246,.12);
}
.login-card button[type="submit"],
.login-card .btn-primary{
    background:linear-gradient(135deg,#0f6fff 0%,#2563eb 50%,#1d4ed8 100%);
    border:none;
    box-shadow:0 10px 24px rgba(37,99,235,.28);
}
.login-card button[type="submit"]:hover,
.login-card .btn-primary:hover{
    transform:translateY(-1px);
    box-shadow:0 14px 28px rgba(37,99,235,.34);
}
.login-footer-note{
    color:#94a3b8;
    text-align:center;
    font-size:.78rem;
}


/* V8.8 Login refinement
   White background is intentionally limited to the UNPAM logo area only. */
body.login-page{
    min-height:100vh;
    background:
      radial-gradient(circle at 18% 20%, rgba(37,99,235,.18), transparent 34%),
      radial-gradient(circle at 82% 15%, rgba(14,165,233,.14), transparent 30%),
      linear-gradient(135deg,#0b1f3a 0%,#123b6d 48%,#0d2748 100%);
}

body.login-page .login-shell,
body.login-page .login-wrapper{
    position:relative;
    isolation:isolate;
}

body.login-page .login-shell::before,
body.login-page .login-wrapper::before{
    content:"";
    position:absolute;
    inset:-50px;
    background:
      radial-gradient(circle at 50% 20%,rgba(96,165,250,.16),transparent 36%),
      linear-gradient(135deg,rgba(255,255,255,.05),rgba(255,255,255,.015));
    filter:blur(20px);
    border-radius:36px;
    z-index:-1;
}

body.login-page .login-card{
    background:linear-gradient(180deg,rgba(11,31,58,.92),rgba(13,39,72,.88));
    border:1px solid rgba(148,163,184,.22);
    box-shadow:0 28px 70px rgba(2,8,23,.38);
    backdrop-filter:blur(20px);
    color:#eaf2ff;
}

body.login-page .login-brand-panel{
    width:min(190px,66%);
    margin:0 auto 20px;
    padding:14px 18px;
    border-radius:18px;
    background:#ffffff;
    border:1px solid rgba(255,255,255,.92);
    box-shadow:
      0 14px 30px rgba(2,8,23,.28),
      inset 0 1px 0 rgba(255,255,255,1);
}

body.login-page .login-brand-panel img{
    display:block;
    width:100%;
    height:auto;
    object-fit:contain;
    filter:none;
}

body.login-page .login-eyebrow{
    margin:2px 0 8px;
    text-align:center;
    font-size:.72rem;
    font-weight:800;
    letter-spacing:.16em;
    color:#93c5fd;
}

body.login-page .login-card h1,
body.login-page .login-title{
    text-align:center;
    color:#ffffff;
    letter-spacing:-.02em;
}

body.login-page .login-subtitle{
    text-align:center;
    color:#cbd5e1;
    line-height:1.6;
}

body.login-page .login-card label{
    color:#dbeafe;
}

body.login-page .login-card input,
body.login-page .login-card select{
    background:rgba(255,255,255,.08);
    color:#f8fbff;
    border:1px solid rgba(148,163,184,.30);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}

body.login-page .login-card input::placeholder{
    color:#94a3b8;
}

body.login-page .login-card input:focus,
body.login-page .login-card select:focus{
    background:rgba(255,255,255,.11);
    border-color:#60a5fa;
    box-shadow:0 0 0 4px rgba(59,130,246,.16);
}

body.login-page .login-card button[type="submit"],
body.login-page .login-card .btn-primary{
    background:linear-gradient(135deg,#38bdf8 0%,#2563eb 55%,#1d4ed8 100%);
    border:none;
    color:#fff;
    box-shadow:0 12px 26px rgba(37,99,235,.32);
}

body.login-page .login-card button[type="submit"]:hover,
body.login-page .login-card .btn-primary:hover{
    transform:translateY(-1px);
    box-shadow:0 16px 32px rgba(37,99,235,.40);
}

body.login-page .login-footer-note{
    color:#94a3b8;
    text-align:center;
    font-size:.78rem;
}

@media (max-width:720px){
    body.login-page .login-brand-panel{
        width:min(170px,70%);
        padding:12px 15px;
    }
}


/* V8.9 - Node-RED inspired login, scoped only to login page */
body.nodered-login{
  margin:0;
  min-height:100vh;
  overflow-x:hidden;
  background:#111827;
  color:#e5eefb;
}
.nr-login-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(420px,.85fr);
}
.nr-brand-panel{
  position:relative;
  display:flex;
  align-items:center;
  padding:72px clamp(44px,7vw,110px);
  overflow:hidden;
  background:
    radial-gradient(circle at 20% 20%,rgba(14,165,233,.18),transparent 30%),
    radial-gradient(circle at 82% 74%,rgba(59,130,246,.16),transparent 34%),
    linear-gradient(145deg,#0b1220 0%,#101b2f 46%,#13213a 100%);
  border-right:1px solid rgba(148,163,184,.12);
}
.nr-brand-panel::before{
  content:"";
  position:absolute;
  inset:0;
  opacity:.18;
  background-image:
    linear-gradient(rgba(148,163,184,.08) 1px,transparent 1px),
    linear-gradient(90deg,rgba(148,163,184,.08) 1px,transparent 1px);
  background-size:34px 34px;
  mask-image:linear-gradient(to right,#000,transparent 92%);
}
.nr-brand-panel::after{
  content:"";
  position:absolute;
  width:420px;height:420px;
  right:-180px;top:50%;
  transform:translateY(-50%);
  border:1px solid rgba(56,189,248,.12);
  border-radius:50%;
  box-shadow:
    0 0 0 65px rgba(56,189,248,.025),
    0 0 0 130px rgba(56,189,248,.018);
}
.nr-brand-content{position:relative;z-index:2;max-width:720px}
.nr-logo-box{
  width:170px;
  padding:13px 16px;
  border-radius:16px;
  background:#fff;
  box-shadow:0 18px 45px rgba(0,0,0,.28);
  margin-bottom:34px;
}
.nr-logo-box img{display:block;width:100%;height:auto}
.nr-system-kicker{
  margin-bottom:12px;
  color:#7dd3fc;
  font-size:.78rem;
  font-weight:800;
  letter-spacing:.18em;
}
.nr-brand-panel h1{
  margin:0;
  font-size:clamp(2.8rem,5vw,5.1rem);
  line-height:.98;
  letter-spacing:-.055em;
  color:#f8fbff;
}
.nr-brand-copy{
  max-width:650px;
  margin:24px 0 30px;
  color:#aab8cc;
  font-size:1rem;
  line-height:1.8;
}
.nr-flow{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:14px 16px;
  width:max-content;max-width:100%;
  border:1px solid rgba(125,211,252,.14);
  border-radius:12px;
  background:rgba(2,8,23,.28);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}
.nr-flow span{
  color:#cde8ff;
  font-size:.7rem;font-weight:800;letter-spacing:.08em;
}
.nr-flow i{
  width:24px;height:1px;background:linear-gradient(90deg,#0ea5e9,#38bdf8);
  position:relative;
}
.nr-flow i::after{
  content:"";position:absolute;right:-1px;top:-3px;
  border-left:5px solid #38bdf8;border-top:3px solid transparent;border-bottom:3px solid transparent;
}
.nr-brand-foot{
  margin-top:26px;
  display:flex;align-items:center;gap:9px;
  color:#7f91a9;font-size:.78rem;
}
.nr-dot,.nr-live-dot{
  width:8px;height:8px;border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 5px rgba(34,197,94,.10),0 0 14px rgba(34,197,94,.55);
}

.nr-auth-panel{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:48px;
  background:
    radial-gradient(circle at 85% 12%,rgba(59,130,246,.09),transparent 24%),
    #0d1422;
}
.nr-auth-card{
  width:min(430px,100%);
  padding:34px;
  border:1px solid rgba(148,163,184,.15);
  border-radius:16px;
  background:#121d2d;
  box-shadow:0 24px 70px rgba(0,0,0,.34);
}
.nr-auth-head{
  display:flex;align-items:center;gap:14px;
  margin-bottom:8px;
}
.nr-auth-mark{
  width:50px;height:50px;display:grid;place-items:center;
  border-radius:12px;
  color:#7dd3fc;
  background:rgba(14,165,233,.09);
  border:1px solid rgba(56,189,248,.14);
}
.nr-auth-mark svg,.nr-input-icon svg,.nr-login-btn svg{
  fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
.nr-auth-mark svg{width:28px;height:28px}
.nr-auth-eyebrow{
  color:#64748b;
  font-size:.68rem;font-weight:800;letter-spacing:.16em;
}
.nr-auth-head h2{
  margin:3px 0 0;
  color:#f8fafc;
  font-size:1.7rem;
  letter-spacing:-.03em;
}
.nr-auth-subtitle{
  margin:0 0 26px;
  color:#8fa0b6;
  font-size:.9rem;
}
.nr-form{display:grid;gap:18px}
.nr-field label{
  display:block;margin:0 0 7px;
  color:#b8c5d6;
  font-size:.78rem;font-weight:700;
}
.nr-input-wrap{position:relative}
.nr-input-icon{
  position:absolute;left:13px;top:50%;transform:translateY(-50%);
  width:19px;height:19px;color:#64748b;pointer-events:none;
}
.nr-input-icon svg{width:100%;height:100%}
.nr-input-wrap input{
  width:100%;
  height:48px;
  padding:0 14px 0 42px;
  border-radius:9px;
  border:1px solid #2a3a50;
  background:#0c1523;
  color:#eaf2ff;
  outline:none;
  transition:.18s ease;
}
.nr-input-wrap input::placeholder{color:#506176}
.nr-input-wrap input:focus{
  border-color:#0ea5e9;
  box-shadow:0 0 0 3px rgba(14,165,233,.10);
  background:#0b1626;
}
.nr-login-btn{
  height:50px;
  display:flex;align-items:center;justify-content:center;gap:10px;
  border:0;border-radius:9px;
  color:#fff;
  font-weight:800;
  background:linear-gradient(135deg,#0ea5e9,#2563eb);
  box-shadow:0 10px 26px rgba(37,99,235,.20);
  cursor:pointer;
  transition:.18s ease;
}
.nr-login-btn:hover{transform:translateY(-1px);filter:brightness(1.04)}
.nr-login-btn svg{width:19px;height:19px}
.nr-alert{
  margin:0 0 20px;
  background:rgba(239,68,68,.10);
  border-color:rgba(248,113,113,.28);
  color:#fecaca;
}
.nr-auth-footer{
  margin-top:28px;padding-top:18px;
  border-top:1px solid rgba(148,163,184,.10);
  display:flex;justify-content:space-between;gap:14px;align-items:center;
  color:#708198;font-size:.72rem;
}
.nr-auth-footer>div{display:flex;align-items:center;gap:8px}
.nr-live-dot{width:6px;height:6px}
.nr-auth-footer small{color:#4f6177}

@media (max-width:980px){
  .nr-login-shell{grid-template-columns:1fr}
  .nr-brand-panel{min-height:auto;padding:44px 28px 36px}
  .nr-brand-panel h1{font-size:clamp(2.4rem,9vw,4rem)}
  .nr-brand-copy{margin-bottom:20px}
  .nr-auth-panel{padding:34px 20px 48px}
}
@media (max-width:560px){
  .nr-flow{display:none}
  .nr-logo-box{width:145px;margin-bottom:26px}
  .nr-auth-card{padding:26px 20px}
  .nr-auth-footer{align-items:flex-start;flex-direction:column}
}


/* V8.10 - Login always fits desktop viewport without page scrolling */
html:has(body.nodered-login),
body.nodered-login{
    width:100%;
    height:100%;
    min-height:100%;
    margin:0;
    overflow:hidden;
}

body.nodered-login .nr-login-shell{
    width:100vw;
    height:100vh;
    min-height:0;
    overflow:hidden;
    grid-template-columns:minmax(0,1.15fr) minmax(380px,.85fr);
}

body.nodered-login .nr-brand-panel,
body.nodered-login .nr-auth-panel{
    height:100vh;
    min-height:0;
    box-sizing:border-box;
    overflow:hidden;
}

body.nodered-login .nr-brand-panel{
    padding:clamp(24px,5vh,58px) clamp(34px,6vw,90px);
}

body.nodered-login .nr-logo-box{
    width:clamp(125px,11vw,165px);
    margin-bottom:clamp(16px,3vh,28px);
    padding:10px 14px;
}

body.nodered-login .nr-brand-panel h1{
    font-size:clamp(2.35rem,4.5vw,4.65rem);
}

body.nodered-login .nr-brand-copy{
    margin:clamp(14px,2.5vh,22px) 0 clamp(14px,2.5vh,24px);
    line-height:1.65;
}

body.nodered-login .nr-brand-foot{
    margin-top:clamp(14px,2.5vh,22px);
}

body.nodered-login .nr-auth-panel{
    padding:clamp(18px,4vh,42px);
}

body.nodered-login .nr-auth-card{
    max-height:calc(100vh - 36px);
    box-sizing:border-box;
    padding:clamp(22px,3.5vh,32px);
}

body.nodered-login .nr-auth-subtitle{
    margin-bottom:clamp(16px,2.8vh,24px);
}

body.nodered-login .nr-form{
    gap:clamp(12px,2vh,18px);
}

body.nodered-login .nr-auth-footer{
    margin-top:clamp(16px,2.6vh,24px);
    padding-top:clamp(12px,2vh,18px);
}

/* Short desktop/laptop screens: compact vertical spacing further. */
@media (min-width:981px) and (max-height:760px){
    body.nodered-login .nr-brand-panel{padding-top:24px;padding-bottom:24px}
    body.nodered-login .nr-logo-box{width:130px;margin-bottom:14px;padding:8px 12px}
    body.nodered-login .nr-system-kicker{margin-bottom:7px;font-size:.68rem}
    body.nodered-login .nr-brand-panel h1{font-size:2.7rem}
    body.nodered-login .nr-brand-copy{margin:12px 0 14px;font-size:.88rem;line-height:1.5}
    body.nodered-login .nr-flow{padding:10px 12px}
    body.nodered-login .nr-brand-foot{margin-top:12px}
    body.nodered-login .nr-auth-card{padding:22px 26px}
    body.nodered-login .nr-auth-mark{width:44px;height:44px}
    body.nodered-login .nr-auth-head h2{font-size:1.45rem}
    body.nodered-login .nr-auth-subtitle{margin-bottom:16px}
    body.nodered-login .nr-form{gap:12px}
    body.nodered-login .nr-input-wrap input{height:44px}
    body.nodered-login .nr-login-btn{height:46px}
    body.nodered-login .nr-auth-footer{margin-top:16px;padding-top:12px}
}

/* Mobile/tablet may need natural document flow because two panels stack. */
@media (max-width:980px){
    html:has(body.nodered-login),
    body.nodered-login{
        height:auto;
        min-height:100%;
        overflow:auto;
    }
    body.nodered-login .nr-login-shell{
        width:100%;
        height:auto;
        min-height:100vh;
        overflow:visible;
    }
    body.nodered-login .nr-brand-panel,
    body.nodered-login .nr-auth-panel{
        height:auto;
        min-height:0;
        overflow:visible;
    }
}


/* V8.29 — Show/hide password eye control */
.nr-input-wrap{
  position:relative;
}
.nr-input-wrap input#password{
  padding-right:48px;
}
.nr-password-toggle{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  padding:0;
  border:0;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:transparent;
  color:#7890ad;
  cursor:pointer;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}
.nr-password-toggle:hover{
  background:rgba(36,200,255,.08);
  color:#24c8ff;
}
.nr-password-toggle:active{
  transform:translateY(-50%) scale(.96);
}
.nr-password-toggle svg{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.nr-password-toggle .eye-closed{display:none}
.nr-password-toggle.is-visible .eye-open{display:none}
.nr-password-toggle.is-visible .eye-closed{display:block}


/* V8.31 — Keep UNPAM logo fully visible in login/public header */
.public-brand img,
.nr-logo-box img,
.login-brand-panel img{
  object-fit:contain !important;
  object-position:center !important;
  overflow:visible !important;
}


/* V8.38 — Login security UI */
.nr-honeypot{
  position:absolute !important;
  left:-10000px !important;
  top:auto !important;
  width:1px !important;
  height:1px !important;
  overflow:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
}
.nr-security-alert{
  margin:10px 0 14px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(36,200,255,.24);
  background:rgba(36,200,255,.07);
  color:#b9dced;
  font-size:11px;
  line-height:1.45;
}
