/* v5 layout styles (moved from test_layout_v5.html) */
:root{
  --font-ui: "helveticalneue","optima",-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  --font-display: "optima","helveticalneue",-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;

      --app-header-h: 48px;
      --app-sidebar-w: 220px;
      --app-sidebar-w-collapsed: 72px;

      --fs-main: 15px;
      --fs-ui: 14px;
      --fs-small: 12px;

      --font-body: #7f7f80;
      --font-header: #2f2f2f;
      --font-corp-blue: #397A9C;
      --font-corp-gray: #5a5a5a;

      --bg: #f5f7f8;
      --panel: #ffffff;
      --text: #2f2f2f;
      --muted: #5a5a5a;
      --border: #c8cfd5;

      --shadow: 0 10px 30px rgba(0,0,0,.08);
      --radius-card: 8px;
      --radius-img: 8px;

      /* dropdown safety + offset */
      --dropdown-viewport-gap: 12px; /* top/bottom/left/right safety padding */
      --dropdown-offset: 10px;       /* gap between avatar and menu */
    }

@font-face {
  font-family: var(--font-ui);
  src: url("../fonts/helveticalneue/helveticalneue.eot");
  src: url("../fonts/helveticalneue/helveticalneue.eot?#iefix") format("embedded-opentype"), url("../fonts/helveticalneue/helveticalneue.ttf") format("truetype"), url("../fonts/helveticalneue/helveticalneue.svg#roboto") format("svg");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "optima";
  src: url("../fonts/optima/optima.eot");
  src: url("../fonts/optima/optima.eot?#iefix") format("embedded-opentype"), url("../fonts/optima/optima.ttf") format("truetype"), url("../fonts/optima/optima.svg#roboto") format("svg");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "optima";
  src: url("../fonts/optima-bold/optima-bold.eot");
  src: url("../fonts/optima-bold/optima-bold.eot?#iefix") format("embedded-opentype"), url("../fonts/optima-bold/optima-bold.ttf") format("truetype"), url("../fonts/optima-bold/optima-bold.svg#roboto") format("svg");
  font-weight: bold;
  font-style: normal;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: var(--fs-main);
  line-height: 1.45;
}

.app{ min-height: 100vh; }

.sidebar{
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--app-sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: width .22s ease, transform .22s ease;
}

.sidebar__logo{
  height: var(--app-header-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  flex: 0 0 auto;
  overflow: hidden;
}

.logo--full { display: block; height: 55px; width: auto; max-width: 100%; object-fit: contain; }
.logo--mini { display: none; height: 28px; width: auto; max-width: 100%; object-fit: contain; }
body.sidebar-collapsed .logo--full { display: none; }
body.sidebar-collapsed .logo--mini { display: block; }

.sidebar-handle{
  position: absolute;
  top: 50%;
  right: -16px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  /* box-shadow: 0 8px 20px rgba(0,0,0,.10); */
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 40;
}
.sidebar-handle__chev{
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  transform: translateX(-1px) translateY(-3px);
  user-select: none;
}
body.sidebar-collapsed .sidebar-handle__chev{
  transform: translateX(1px) translateY(4px) rotate(180deg);
}

.sidebar__nav-title{
  height: 22px;
  display: flex;
  align-items: center;
  margin: 10px 0 0;
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(90,90,90,.75);
}
body.sidebar-collapsed .sidebar__nav-title{ visibility: hidden; }

.sidebar__nav{
  padding: 8px 10px 14px;
  font-size: var(--fs-ui);
  color: var(--muted);
  overflow: hidden;
}

/* NEW: semantic nav list */
.nav-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

/* li wrapper */
.nav-item{
  margin: 0;
  padding: 0;
}

/* a = clickable row */
.nav-link{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-card);
  color: inherit;
  text-decoration: none;
  min-width: 0;
  min-height: 40px;   /* optional – prevents font-size ripple effects */

  /* pixel-perfect: prevent inline-image baseline quirks; 1.2 safe for 14-15px fonts */
  line-height: 1.4;
}

/* corp - blue - rgb(47 131 172) */
.nav-link:hover{ background: rgba(0,0,0,.04); color: #000; }
.nav-link.is-active{ background: rgba(0,0,0,.04); font-weight: 600; }

.nav-icon{
  width: 18px;
  height: 18px;
  flex: 0 0 auto;

  /* pixel-perfect: remove default inline image baseline gap */
  display: block;
}

.nav-item__label{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.sidebar__spacer{ flex: 1 1 auto; }

.sidebar__footer{
  border-top: 1px solid var(--border);
  padding: 10px;
  font-size: var(--fs-ui);
  color: var(--muted);
  display: grid;
  gap: 6px;
  flex: 0 0 auto;
  overflow: hidden;
}

.header{
  position: fixed;
  top: 0;
  left: var(--app-sidebar-w);
  right: 0;
  height: var(--app-header-h);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: var(--fs-ui);
  color: var(--muted);
  transition: left .22s ease;
}
.header .page-title {
  font-size: var(--fs-ui);
}
.header__left{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.btn{
  border: 1px solid var(--border);
  background: #fff;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-card);
  font-size: var(--fs-ui);
  cursor: pointer;
  color: var(--muted);
}
.blue-text{
  color: var(--font-corp-blue) !important;
}

.offcanvas-form-errors {
  display: block;
  font-style: italic;
  color: #b91c1c;
  font-size: 11px;
  font-weight: normal;
}


.offcanvas-update-required {
  margin-bottom: 8px;
}
.offcanvas-update-required ul {
  margin: 6px 0 0 18px;
  padding: 0;
}
/*
.btn:hover{ background: rgba(0,0,0,.03); }
*/
/* ===== Header Title Row (UPDATED: divider + dynamic clamp + animation hook) ===== */
.header__title{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* divider dot */
.title-sep{
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(90,90,90,.35);
  flex: 0 0 auto;
}

/* dynamic clamp: building & page title share space */
.building-name{
  display: inline-flex;
  align-items: center;
  gap: 8px;

  font-weight: 700;
  color: var(--muted);

  min-width: 0;        /* needed for ellipsis in flex */
  flex: 0 1 auto;      /* can shrink */
  max-width: 60%;      /* dynamic clamp */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.building-icon{
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.page-title{
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;

  min-width: 0;        /* allow ellipsis too */
  flex: 1 1 auto;      /* take remaining space */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* building switch animation */
.header__title.is-switching{
  pointer-events: none;
}
.header__title.is-switching .building-name,
.header__title.is-switching .page-title{
  animation: titleSwap .18s ease;
}
@keyframes titleSwap{
  from{ opacity: .35; transform: translateY(-2px); }
  to  { opacity: 1;   transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce){
  .header__title.is-switching .building-name,
  .header__title.is-switching .page-title{
    animation: none;
  }
}

.header__right{
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill{
  font-size: var(--fs-small);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* default dot */
.status-pill .dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}

/* ---------- No Data Alert Pill ---------- */
.status-pill.status-pill--ok {
  background-color: #166534; /* green */
  border-color: #166534;
  color: #ffffff;
}

/* Optional: nice pulsing dot even for live state (subtle) */
.status-pill.status-pill--ok .dot {
  background-color: #ffffff;
}

/* ---------- ALERT / ERROR ---------- */
@keyframes alert-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.4;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.status-pill.status-pill--alert {
  background-color: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

.status-pill.status-pill--alert .dot {
  background-color: #ffffff;
  animation: alert-pulse 1s ease-in-out infinite;
}


.status-pill.status-pill--ok {
  background-color: #166534; /* green */
  border-color: #166534;
  color: #ffffff;
}

.status-pill.status-pill--ok .dot {
  background-color: #ffffff;
}


/* ---------- ON / RUNNING ---------- */

.status-pill.is-on{
  border-color: rgba(5, 150, 105, .35);   /* emerald-600 */
  background: rgba(5, 150, 105, .10);
  color: #047857;                         /* emerald-700 */
  font-weight: 700;
}
/* subtle heartbeat pulse = "live system" */
.status-pill.is-on .dot{
  animation: statusPulse 1.6s ease-in-out infinite;
}

@keyframes statusPulse{
  0%   { transform: scale(1);   opacity: .65; }
  50%  { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(1);   opacity: .65; }
}
@media (prefers-reduced-motion: reduce){
  .status-pill.is-on .dot{ animation: none; }
}


/* ---------- STANDBY / OUTSIDE HOURS ---------- */
.status-pill.is-standby{
  border-color: var(--font-corp-gray);     /* blue-500 */
  background: rgb(90, 90, 90, .12);
  color: var(--font-corp-gray);            /* blue-800 */
  font-weight: 700;
}
/* standby dot should NOT pulse */
.status-pill.is-standby .dot{
  opacity: .75;
}

/* ---------- DEGRADED / PARTIAL ---------- */
.status-pill.is-warn{
  border-color: rgba(217, 119, 6, .40);   /* amber-600 */
  background: rgba(217, 119, 6, .12);
  color: #92400e;                         /* amber-800 */
  font-weight: 700;
}

/* ---------- OFF / STOPPED (existing) ---------- */
.status-pill.is-off{
  border-color: rgba(220, 38, 38, .35);
  background: rgba(220, 38, 38, .08);
  color: #b91c1c;
  font-weight: 700;
}
/* ---------- animation ---------- */
@keyframes statusPulse{
  0%   { transform: scale(1);   opacity: .85; }
  50%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1);   opacity: .85; }
}

/* accessibility */
@media (prefers-reduced-motion: reduce){
  .status-pill.is-on .dot{
    animation: none;
  }
}
.dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: .8;
}

/* ===== Avatar dropdown ===== */
.profile{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.avatar-btn{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: #4f8cac;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
}
.avatar-btn:focus{
  outline: 2px solid rgba(37, 99, 235, .35);
  outline-offset: 2px;
}

.profile-menu{
  position: fixed;
  left: 0;
  top: 0;

  width: max-content;
  min-width: 280px;
  max-width: min(520px, calc(100vw - (var(--dropdown-viewport-gap) * 2)));

  max-height: 60vh;
  overflow: auto;
  overscroll-behavior: contain;

  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 18px 45px rgba(0,0,0,.15);
  padding: 20px;

  opacity: 0;
  transform: scale(.98) translateY(-4px);
  transform-origin: top right;
  visibility: hidden;
  pointer-events: none;

  transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s;
  z-index: 9999;
}

.profile.is-open .profile-menu{
  opacity: 1;
  transform: scale(1) translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition: opacity .14s ease, transform .14s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce){
  .profile-menu,
  .profile.is-open .profile-menu{
    transition: none;
  }
}

.profile-menu__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.profile-menu__title{
  font-weight: 700;
  color: var(--text);
}
.menu-close{
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 6px;
  width: 30px;
  border-radius: 999px;
}
.menu-close:hover{ background: #e5e7eb; }

.profile-menu__body{ display: grid; gap: 12px; }

.profile-grid{
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 12px;
  row-gap: 12px;
  align-items: start;
}
.profile-grid__avatar{
  display: flex;
  justify-content: center;
  padding-top: 2px;
}
.profile-grid__content{
  display: grid;
  gap: 12px;
  min-width: 0;
}

.profile-user__avatar{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(0,0,0,.10);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: rgba(0,0,0,.65);
  text-transform: uppercase;
}

.profile-user__info{ min-width: 0; }

.profile-user__name{
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.profile-user__email{
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-kv{
  display: grid;
  gap: 4px;
}
.profile-kv__label{
  font-size: var(--fs-small);
  color: rgba(90,90,90,.75);
  font-weight: 600;
}
.profile-kv__value{
  color: var(--text);
  font-weight: 600;
}

.signout-form{ margin: 0; }

.btn-signout{
  margin-top: 10px;
  margin-bottom: 5px;
  height: 32px !important;
}

/* .btn-signout{
height: 30px;
border-radius: var(--radius-img);
border: 1px solid rgb(57, 122, 156);
background: rgb(57, 122, 156);
color: white;
font-weight: 400;
cursor: pointer;
padding: 0 12px;
justify-self: start;
font-size: 13px;
}
.btn-signout:hover{ background: #1b75d0; } */

.main{
  margin-left: var(--app-sidebar-w);
  margin-top: 0;
  padding: calc(var(--app-header-h) + 16px) 16px 16px;
  display: flex;
  min-height: 100vh;
  box-sizing: border-box;
  transition: margin-left .22s ease;
}

.main-card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 16px;
  flex: 1;
  min-height: 0;
}

h1{ margin: 0 0 10px; font-size: 20px; }
p{ margin: 0 0 8px; }

body.sidebar-collapsed .sidebar{ width: var(--app-sidebar-w-collapsed); }
body.sidebar-collapsed .header{ left: var(--app-sidebar-w-collapsed); }
body.sidebar-collapsed .main{ margin-left: var(--app-sidebar-w-collapsed); }
body.sidebar-collapsed .nav-item__label{ display: none; }

/* Collapsed sidebar (pixel-stable):
    Do NOT change padding/justify on collapse; only hide the label.
    This prevents icons "sliding out then sliding back" during the width transition. */
body.sidebar-collapsed .nav-link{
  justify-content: flex-start;   /* same as expanded */
  padding-left: 10px;           /* same as expanded */
  padding-right: 10px;          /* same as expanded */
}

/* Keep only the sidebar width animating */
.nav-link, .nav-icon, .nav-list, .sidebar__nav, .sidebar__footer{
  transition: none !important;
}
.mobile-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 25;
  display: none;
}

#btnToggleSidebarHeader{ display: none; }

@media (max-width: 900px){
  .sidebar{ transform: translateX(-105%); box-shadow: var(--shadow); }
  body.sidebar-open .sidebar{ transform: translateX(0); }
  .header{ left: 0 !important; }
  .main{ margin-left: 0 !important; }
  body.sidebar-open .mobile-overlay{ display: block; }
  #btnToggleSidebarHeader{ display: inline-flex; padding: 5px 10px;}
  .sidebar-handle{ display: none; }
}


.page-title{
  margin: 10px 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--muted);
  text-align: center;
}

.offcanvas-backdrop.show {
  opacity: .5;
  z-index: 30;
}


/* ===== Home page polish ===== */
.home-hero{
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: start;
}

.home-hero__text{
  display: grid;
  gap: 10px;
  align-content: start;
}

.home-subtitle{
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-ui);
}

.home-actions{
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.home-tile{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  min-width: 160px;

  border-radius: var(--radius-card);
  border: 1px solid #e5e7eb;;
  background: #f9fafb;
  text-decoration: none;

  color: var(--text);
  font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.home-tile:hover{
  border-color: #d1d5db;
  background: #e5e7eb;
  color: #111827;
}
.home-tile:active{ transform: translateY(1px); }

.home-hero__image{
  display: flex;
  justify-content: center;
  align-items: center;
}
.home-hero__image img{
  max-width: 680px;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius-img);
  border: 1px solid var(--border);
}

.home-kpis{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-kpi{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-card);
  padding: 14px;
}

.home-kpi__label{
  font-size: var(--fs-small);
  color: rgba(90,90,90,.75);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.home-kpi__value{
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px){
  .home-hero{ grid-template-columns: 1fr; }
  .home-hero__image img{ height: 190px; width: 100%}
  .home-actions{ flex-direction: column; }
  .home-tile{ width: 100%; min-width: 0; }
  .home-kpis{ grid-template-columns: 1fr; }
}

/* ===== Plant Overview Card ===== */
.plant-overview{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px; /* more professional than 14-16px for ops UI */
  padding: 14px;
}

.plant-overview__header{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.plant-overview__title{
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
}

.plant-overview__meta{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  color: var(--muted);
}

.meta-label{
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(90,90,90,.75);
}

.meta-value{
  font-weight: 700;
  color: var(--text);
}

.plant-overview__grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ov-item{
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  min-width: 0;
}

.ov-label{
  font-size: var(--fs-small);
  color: rgba(90,90,90,.75);
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ov-value{
  margin-top: 8px;
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-item--alerts .ov-value{
  font-weight: 800;
}

@media (max-width: 900px){
  .plant-overview__grid{
    grid-template-columns: 1fr;
  }
}


/* =========================
   Typography: brand vs UI
========================= */
.building-name, .page-title{ font-family: var(--font-display); }



/* =========================
   AHU TABLE TOKENS + DENSITY
========================= */
:root{
  --ahu-card-radius: 10px;
  --ahu-border: var(--border);
  --ahu-head-bg: #f6f8fa;
  --ahu-row-even: #fafbfc;
  --ahu-row-hover: #f1f5f9;

  /* default = comfortable */
  --ahu-th-py: 8px;
  --ahu-td-py: 4px;
  --ahu-cell-px: 10px;
  --ahu-font: var(--fs-ui);
}

/* global density switch (compact vs comfortable) */
html[data-density="compact"]{
  --ahu-th-py: 8px;
  --ahu-td-py: 4px;
  --ahu-cell-px: 10px;
  --ahu-font: 13px;
}

/* =========================
   AHU TABLE BASE
========================= */
.content-wrapper .form-table-wrap{
  background: #fff;
  border: 1px solid var(--ahu-border);
  border-radius: var(--ahu-card-radius);
  overflow: hidden;
}

/* sticky header requires a bounded scroll container — see calc() override below */
.content-wrapper .form-table-scroll{
  overflow: auto;
}

.content-wrapper .form-table{
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ahu-font);
  line-height: 1.35;
}

.content-wrapper .form-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ahu-head-bg);
  color: rgba(90,90,90,.82);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ahu-border);
  padding: var(--ahu-th-py) var(--ahu-cell-px);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.content-wrapper .form-table tbody td{
  padding: var(--ahu-td-py) var(--ahu-cell-px);
  border-bottom: 1px solid #e6eaee;
  color: var(--text);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.content-wrapper .form-table tbody tr:nth-child(even){ background: var(--ahu-row-even); }
.content-wrapper .form-table tbody tr:hover{ background: var(--ahu-row-hover); }

/* text / numeric alignment */
.content-wrapper .form-table .is-text{ text-align: left; }
.content-wrapper .form-table tbody td.fb-remark-cell{
  white-space: normal;
  text-align: left;
  min-width: 240px;
  max-width: 420px;
  line-height: 1.4;
}
.content-wrapper .form-table .is-num{
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* units: subtle */
.content-wrapper .unit{
  margin-left: 6px;
  font-size: 11px;
  color: rgba(90,90,90,.65);
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: none;
}


/* =========================
   AHU table: sticky Equipment column
========================= */
.content-wrapper .form-table thead th:first-child{
  position: sticky;
  left: 0;
  z-index: 3;                 /* above other header cells */
  background: var(--ahu-head-bg);
}

.content-wrapper .form-table tbody td:first-child{
  position: sticky;
  left: 0;
  z-index: 1;                 /* above other cells, below header */
  background: #fff;
}

/* keep zebra striping consistent for sticky first column */
.content-wrapper .form-table tbody tr:nth-child(even) td:first-child{
  background: var(--ahu-row-even);
}

/* subtle separator when scrolling horizontally */
.content-wrapper .form-table thead th:first-child,
.content-wrapper .form-table tbody td:first-child{
  box-shadow: 1px 0 0 0 rgba(0,0,0,.06);
}


/* status dot */
.content-wrapper .ball{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.content-wrapper .ball.green{ background: #16a34a; }
.content-wrapper .ball.red{ background: #dc2626; }

/* clickable AHU name */
.content-wrapper .summary-tbl-btn{
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
}
.content-wrapper .summary-tbl-btn:hover{ text-decoration: underline; }
.content-wrapper .summary-tbl-btn:focus-visible,
.fcu-group-toggle:focus-visible{
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 4px;
}

.equip-summary{
  margin: 8px 2px 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: #64748b;
}
.equip-run{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* empty state */
.content-wrapper .form-table tbody tr td[colspan]{
  text-align: center;
  color: var(--muted);
  padding: 18px;
}





/* =========================
   Page header (H1 + tools)
========================= */
.page-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 0 0 12px;
}
.page-h1{
  margin:0;
  font-size:16px;
  font-weight:900;
  color: var(--text);
  letter-spacing:-0.01em;
}

/* Baseline indicator for chiller plant page */
.page-title-baseline-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.page-title-baseline-wrapper .page-title {
  margin: 10px 0;
}

.baseline-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: rgba(100, 150, 255, 0.08);
  border-radius: 6px;
  border-left: 3px solid rgba(100, 150, 255, 0.3);
  font-size: 13px;
}

.baseline-label {
  font-weight: 600;
  color: var(--muted);
}

.baseline-value {
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}

.baseline-date-range {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.baseline-fallback-badge {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.7;
  cursor: help;
}

/* Density toggle button */
.density-toggle{
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.density-toggle:hover{ background: rgba(0,0,0,.03); }
.density-toggle:active{ transform: translateY(1px); }
.density-toggle__icon{
  font-size: 14px;
  line-height: 1;
  opacity: .8;
}
.density-toggle__label{ line-height: 1; }

/* =========================
   AHU density tokens
========================= */
:root{
  --ahu-card-radius: 10px;
  --ahu-border: var(--border);
  --ahu-head-bg: #f6f8fa;
  --ahu-row-even: #fafbfc;
  --ahu-row-hover: #f1f5f9;

  --ahu-th-py: 6px;
  --ahu-td-py: 5px;
  --ahu-cell-px: 8px;
  --ahu-font: var(--fs-ui);
}

html[data-density="compact"]{
  --ahu-th-py: 8px;
  --ahu-td-py: 4px;
  --ahu-cell-px: 8px;
  --ahu-font: 13px;
}


/* =========================
   Wide screen: keep content pleasantly readable
========================= */
@media (min-width: 1400px){
  .main-card{
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }
}


/* =========================================================
   AHU FIXES (2025-12-24)
   A) Sticky multi-row header (rowspan + 2 header rows)
   B) Remove wasted bottom space: table scroll fills available height
   C) Apply max-width to AHU table area (NOT .main-card)
========================================================= */

/* --- C) remove previous wide-screen max-width on main-card (if any) --- */
@media (min-width: 1400px){
  .main-card{
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* --- C) cap AHU table area width on ultra-wide screens --- */
@media (min-width: 1400px){
  .content-wrapper .page-head,
  .content-wrapper .form-table-wrap{
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* --- B) make main-card and AHU content use full available height --- */
.main-card{
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 100%;
}
.ahu{
  flex: 1 1 auto;
  min-height: 0;
}
.content-wrapper .form-table-wrap{
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.content-wrapper .form-table-scroll{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  max-height: calc(100dvh - var(--app-header-h) - 150px);
}

/* --- A) sticky thead with 2 rows --- */
/* Set a predictable height for the first header row so row 2 can stick under it */
:root{
  --ahu-head-row1-h: 34px;
}

/* First header row sticks to top */
.content-wrapper .form-table thead tr:first-child th{
  top: 0;
}

/* Second header row sticks under the first row */
.content-wrapper .form-table thead tr:nth-child(2) th{
  top: var(--ahu-head-row1-h);
  z-index: 4;
}

/* Ensure header cells use consistent height so the offset is correct */
.content-wrapper .form-table thead tr:first-child th{
  height: var(--ahu-head-row1-h);
}

/* Rowspan=2 header cells (e.g., EQUIPMENT / RUN STATUS / TRIP STATUS) should cover both rows cleanly */
.content-wrapper .form-table thead th[rowspan]{
  z-index: 5;                 /* above row-2 headers */
  background: var(--ahu-head-bg);
  vertical-align: middle;
}

/* Keep sticky first column header above everything */
/* .content-wrapper .form-table thead th:first-child{
  z-index: 6;
} */

.content-wrapper .form-table th{
  text-align: center !important;
}
.content-wrapper .form-table thead th[rowspan]:first-child{
  text-align: left;
  z-index: 8;
}



/* =========================================================
   VAV PAGE (match AHU table language)
========================================================= */
:root{
  --vav-card-radius: var(--ahu-card-radius);
  --vav-border: var(--ahu-border);
  --vav-head-bg: var(--ahu-head-bg);
  --vav-row-even: var(--ahu-row-even);
  --vav-row-hover: var(--ahu-row-hover);
}

/* VAV table container */
.content-wrapper.vav .form-table-wrap{
  background: #fff;
  border: 1px solid var(--vav-border);
  border-radius: var(--vav-card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.content-wrapper.vav .form-table-scroll{
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100dvh - var(--app-header-h) - 150px);
}

.content-wrapper.vav .form-table{
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ahu-font);
  line-height: 1.35;
  min-width: 980px;
}

/* Single-row sticky header (prevents "empty first row") */
.content-wrapper.vav .form-table thead th{
  position: sticky;
  top: 0 !important;
  z-index: 4;
  background: var(--vav-head-bg);
  color: rgba(90,90,90,.82);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--vav-border);
  padding: var(--ahu-th-py) var(--ahu-cell-px);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.content-wrapper.vav .form-table tbody td{
  padding: var(--ahu-td-py) var(--ahu-cell-px);
  border-bottom: 1px solid #e6eaee;
  color: var(--text);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.content-wrapper.vav .form-table tbody tr:nth-child(even){ background: var(--vav-row-even); }
.content-wrapper.vav .form-table tbody tr:hover{ background: var(--vav-row-hover); }

/* Sticky Equipment column */
.content-wrapper.vav .form-table thead th:first-child{
  position: sticky;
  left: 0;
  z-index: 6;
  background: var(--vav-head-bg);
  box-shadow: 1px 0 0 0 rgba(0,0,0,.06);
}
.content-wrapper.vav .form-table tbody td:first-child{
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 0 rgba(0,0,0,.06);
  text-align: center;
  font-weight: normal;
}
.content-wrapper.vav .form-table tbody tr:nth-child(even) td:first-child{
  background: var(--vav-row-even);
}

/* =========================================================
   VAV level selector (rename from group-level-sub-menu)
   Suggested name: .vav-level-tabs
========================================================= */
.vav-level-tabs{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
   justify-content: center;
}
.vav-level-tabs__item{ display: inline-flex; }

.vav-level-tabs .js-vav-level{
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.vav-level-tabs .js-vav-level:hover{
  border-color: #d1d5db;
  background: #e5e7eb;
  color: #111827;
}
.vav-level-tabs .js-vav-level.active{
  border-color: #5a5a5a;
  background: #5a5a5a;
  color: #ffffff;
}


/* =========================================================
   AHU / VAV selector for Feedback page
========================================================= */

.ahu-vav-tabs{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
   justify-content: center;
}
.ahu-vav-tabs__item{ display: inline-flex; }

.ahu-vav-tabs .js-ahu-vav-tabs{
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.ahu-vav-tabs .js-ahu-vav-tabs:hover{
  border-color: #d1d5db;
  background: #e5e7eb;
  color: #111827;
}
.ahu-vav-tabs .js-ahu-vav-tabs.active{
  border-color: #5a5a5a;
  background: #5a5a5a;
  color: #ffffff;
}













/* no-data rows */
.content-wrapper.vav .row_no_data td{ color: rgba(90,90,90,.55) !important; }
.content-wrapper.vav .row_no_data td button{ color: rgba(90,90,90,.55) !important; cursor: default; }
.content-wrapper.vav .row_no_data td button:hover{ text-decoration: none; }

/* =========================================================
   Make table areas fill the viewport so sticky headers are testable
   Applies to AHU + VAV pages
========================================================= */

/* Make the main content area a vertical flex container */
.dashboard-main{
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Make the inner content wrapper stretch */
.dashboard-main .content-wrapper{
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Make main-card fill remaining height */
.dashboard-main .main-card{
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* The page body (AHU/VAV container) should fill height too */
.dashboard-main .main-card .ahu,
.dashboard-main .main-card .vav{
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Make the table card fill remaining height */
.dashboard-main .main-card .form-table-wrap{
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* Make the scroll container take the rest and actually scroll */
.dashboard-main .main-card .form-table-scroll{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}



/* =========================================================
   FEEDBACK PAGE (align with AHU/VAV tables)
========================================================= */

/* .content-wrapper.feedback .main-content{
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
} */

/* Feedback has more text columns: allow horizontal scroll on smaller screens */
.content-wrapper.feedback .form-table{
  min-width: 1100px;
}

/* Allow Remark/Notes to wrap */
.content-wrapper.feedback .form-table tbody td:nth-child(7),
.content-wrapper.feedback .form-table tbody td:nth-child(8){
  white-space: normal;
  max-width: 380px;
}

/* Equipment button styled like link */
.content-wrapper.feedback .js-open-feedback{
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
}
.content-wrapper.feedback .js-open-feedback:hover{
  text-decoration: underline;
}

/* Pagination styling consistent with AHU/VAV */
.content-wrapper.feedback .pagination{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.content-wrapper.feedback .pagination a,
.content-wrapper.feedback .pagination span{
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--fs-ui);
}
.content-wrapper.feedback .pagination a:hover{
  background: rgba(0,0,0,.03);
  color: var(--text);
}
.content-wrapper.feedback .pagination span{
  opacity: .65;
}

/* Actions row spacing */
.content-wrapper.feedback .form-table-actions{
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* =========================================================
   Feedback table column sizing
========================================================= */


/*
.content-wrapper.feedback td:last-child{
  font-weight: 700;
  color: #2563eb;
}
*/


/* =========================================================
   Feedback: align table + actions perfectly
========================================================= */

.content-wrapper.feedback .form-table-wrap,
.content-wrapper.feedback .form-table-actions{
  max-width: 1400px;   /* same value as AHU/VAV table area */
  margin-left: auto;
  margin-right: auto;
  }


/* =========================================================
   FEEDBACK: prevent table "overflowing" the card
   - keep wrap aligned but never wider than the available content area
   - ensure horizontal scroll stays inside .form-table-scroll
========================================================= */

.content-wrapper.feedback .form-table-wrap,
.content-wrapper.feedback .form-table-actions{
  /* avoid forcing width:100% + max-width in a way that can exceed the padded card */
  width: min(1400px, 100%);
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.content-wrapper.feedback .form-table-wrap{
  overflow: hidden; /* keep borders/rounded corners clean */
}

.content-wrapper.feedback .form-table-scroll{
  overflow: auto;          /* contain both x and y scrolling */
  -webkit-overflow-scrolling: touch;
}

/* When table is wider than the wrap, let it be wider so the scroll container can scroll */
.content-wrapper.feedback .form-table{
  width: max(100%, 1100px);
}



/* =========================================================
   FEEDBACK: brand-aligned status pills (New / In Progress / Closed)
========================================================= */

.fb-status{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: var(--fs-small);
  font-weight: 800;
  white-space: nowrap;
}

/* NEW — corporate blue */
.fb-status.is-new{
  color: #1E66A0;
  border-color: rgba(30, 102, 160, 0.35);
}

/* IN PROGRESS — warm muted amber (balanced against blue) */
.fb-status.is-progress{
  color: #8A5A12; /* muted amber-brown */
  background: rgba(217, 142, 36, 0.14);
  border-color: rgba(217, 142, 36, 0.45);
}

/* CLOSED — corporate gray */
.fb-status.is-closed{
  color: #4A4F52;
  background: rgba(74, 79, 82, 0.12);
  border-color: rgba(74, 79, 82, 0.35);
}

/* =========================================================
   FEEDBACK DRAWER (override Bootstrap look)
========================================================= */

/* --- Drawer shell --- */
#offcanvasFeedback{
  width: 520px;
  background: #fff;
  border-left: 1px solid var(--border);
  font-family: var(--font-ui);
}

/* Header */
#offcanvasFeedback .offcanvas-header{
  padding: 13px 16px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  background-color: #fff;
}

#offcanvasFeedback .title-section-smaller{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text);
}

#offcanvasFeedback .title-section-smaller img{
  width: 18px;
  height: 18px;
  opacity: .7;
}

/* Close button – neutralize Bootstrap size */
#offcanvasFeedback .btn-close{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background-color: transparent;
  opacity: .6;
}
#offcanvasFeedback .btn-close:hover{
  opacity: 1;
  background: rgba(0,0,0,.05);
}

/* Body */
#offcanvasFeedback .offcanvas-body{
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

/* Loading text */
#offcanvasFeedback #oc-loading{
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* --- Section blocks --- */
#offcanvasFeedback .info{
  padding: 12px 0;
}
#offcanvasFeedback .info:last-child{
  border-bottom: 0;
}



/* Section titles*/
#offcanvasFeedback .info > .description-bigger,
#offcanvasFeedback .info td:first-child{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  color: rgba(90,90,90,.75);
}

/* --- Metric tables inside drawer --- */
#offcanvasFeedback .table-info{
  border-collapse: collapse;
  width: 100%;
}
#offcanvasFeedback .table-info td{
  padding: 6px 0;
  font-size: 12px;
  vertical-align: middle;
}
/* Left labels */
#offcanvasFeedback .table-info td:first-child{
  color: var(--text);
  font-weight: 500;
}



#offcanvasFeedback .table-info tr + tr td{
  border-top: 1px solid rgba(200,207,213,.45);
}


/* Column headers (READING / SET POINT) */
#offcanvasFeedback .table-info td.blue{
  font-size: 12px;
  font-weight: 800;
  color: var(--font-corp-blue);
  letter-spacing: .05em;
}

/* Numeric values */
#offcanvasFeedback .table-info td:not(:first-child){
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Operator remark --- */
#offcanvasFeedback .operator-remark-section span,
#offcanvasFeedback .submitted-by-section span{
  display: block;
  font-size: 12px;
  color: var(--text);
}

/* --- Notes textarea --- */
#offcanvasFeedback .note-section textarea{
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 8px;
  border: 1px solid var(--border);
  resize: vertical;
}

/* --- Footer --- */
#offcanvasFeedback .offcanvas-footer{
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* Save button */
#offcanvasFeedback #oc-save-btn{
  height: 34px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 8px;
  color: #fff;
  border: 0;
}
#offcanvasFeedback #oc-save-btn:hover{
  opacity: .9;
}

/* Save status text */
#offcanvasFeedback #oc-save-status{
  font-size: 14px;
  color: var(--muted);
}

#ahu-remark-text, #vav-remark-text{
  background-color: #f4f3f3;
  min-height: 50px;
  border-radius: 8px;
  padding: 6px 6px;
}
#ahu-submitted-by-text, #vav-submitted-by-text {
  background-color: #f4f3f3;
  border-radius: 8px;
  padding: 6px;
}

/* =========================
   VAV DRAWER layout
========================= */
/* =========================
   Minimal offcanvas + utility classes
   (so drawers work even without Bootstrap CSS)
========================= */

.d-none{ display:none !important; }
.d-flex{ display:flex !important; }
.align-items-center{ align-items:center !important; }
.gap-3{ gap: 12px !important; }
.w-100{ width:100% !important; }
.text-end{ text-align:right !important; }
.text-uppercase{ text-transform:uppercase !important; }

/* Base offcanvas */
.offcanvas{
  position: fixed;
  top: 0;
  bottom: 0;
  width: min(520px, 92vw);
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.offcanvas-end{ right: 0; }
.offcanvas.show{ transform: translateX(0); }

.offcanvas-header{
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}
.offcanvas-body{
  padding: 16px 18px;
  overflow: auto;
  flex: 1 1 auto;
}
.offcanvas-footer{
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  bottom: 0;
}

/* close button */
.btn-close{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(57,122,156,.35);
  background: rgba(57,122,156,.08);
  cursor: pointer;
  display:grid;
  place-items:center;
}
.btn-close::before{
  content: "×";
  font-size: 19px;
  line-height: 1;
  color: #2c6b8a;
  transform: translateY(-1px);
}
.btn-close:hover{ background: rgba(57,122,156,.14); }

/* =========================
   VAV drawer details
========================= */

#offcanvasVAV .title-section-smaller{
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
#offcanvasVAV .title-section-smaller img{
  width: 18px;
  height: 18px;
  opacity: .75;
}
#offcanvasVAV #vav-loading{
  font-size: 14px !important;
  color: var(--muted);
}
#offcanvasVAV .info{
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}
#offcanvasVAV .description-bigger{
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  color: rgba(90,90,90,.85);
  margin-bottom: 8px;
}
#offcanvasVAV .table-info{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
#offcanvasVAV .table-info td{
  padding: 8px 6px;
  vertical-align: middle;
}
#offcanvasVAV .table-info tr + tr td{
  border-top: 1px solid rgba(200,207,213,.45);
}
#offcanvasVAV .table-info td.blue{
  color: #2c6b8a;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}
#offcanvasVAV .input-info{
  width: 72px;
  border: 1px solid rgba(200,207,213,.85);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  background: #fff;
  outline: none;
}
#offcanvasVAV .input-info:focus{
  border-color: rgba(57,122,156,.55);
  box-shadow: 0 0 0 3px rgba(57,122,156,.12);
}
#offcanvasVAV textarea#vav-remark{
  min-height: 92px;
  resize: vertical;
  line-height: 1.35;
}
#offcanvasVAV #vav-save-btn{
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(57,122,156,.35);
  color: #fff;
  font-weight: 800;
  cursor:pointer;
}
#offcanvasVAV #vav-save-btn:hover{ filter: brightness(1.05); }
#offcanvasVAV #vav-save-btn:disabled{
  opacity: .7;
  cursor: default;
}
#offcanvasVAV #vav-save-status{
  margin-top: 8px !important;
  font-size: 12px !important;
  color: var(--muted);
}




/* =========================================================
   VAV DRAWER USING FEEDBACK DRAWER (override Bootstrap look)
========================================================= */

/* --- Drawer shell --- */
#offcanvasVAV{
  width: 520px;
  background: #fff;
  border-left: 1px solid var(--border);
  font-family: var(--font-ui);
}

/* Header */
#offcanvasVAV .offcanvas-header{
  padding: 13px 16px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  background-color: #fff;
}

#offcanvasVAV .title-section-smaller{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text);
}

#offcanvasVAV .title-section-smaller img{
  width: 18px;
  height: 18px;
  opacity: .7;
}

/* Close button – neutralize Bootstrap size */
#offcanvasVAV .btn-close{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background-color: transparent;
  opacity: .6;
}
#offcanvasVAV .btn-close:hover{
  opacity: 1;
  background: rgba(0,0,0,.05);
}

/* Body */
#offcanvasVAV .offcanvas-body{
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

/* Loading text */
#offcanvasVAV #oc-loading{
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* --- Section blocks --- */
#offcanvasVAV .info{
  padding: 12px 0;
}
#offcanvasVAV .info:last-child{
  border-bottom: 0;
}

/* Section titles */
#offcanvasVAV .info > .description-bigger,
#offcanvasVAV .info td:first-child{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  color: rgba(90,90,90,.75);
}

/* --- Metric tables inside drawer --- */
#offcanvasVAV .table-info{
  border-collapse: collapse;
  width: 100%;
}

#offcanvasVAV .table-info td{
  padding: 6px 0;
  font-size: 12px;
  vertical-align: middle;
}

/* Left labels */
#offcanvasVAV .table-info td:first-child{
  color: var(--text);
  font-weight: 500;
}

/* Column headers (READING / SET POINT) */
#offcanvasVAV .table-info td.blue{
  font-size: 12px;
  font-weight: 800;
  color: var(--font-corp-blue);
  letter-spacing: .05em;
}

/* Numeric values */
#offcanvasVAV .table-info td:not(:first-child){
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Operator remark --- */
#offcanvasVAV .operator-remark-section span{
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--text);
}

/* --- Notes textarea --- */
#offcanvasVAV .note-section textarea{
  margin-top: 6px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.4;
  border-radius: 8px;
  border: 1px solid var(--border);
  resize: vertical;
}

/* --- Footer --- */
#offcanvasFeedback .offcanvas-footer{
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* Save button */
#offcanvasVAV #vav-save-btn{
  height: 34px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 8px;
  color: #fff;
  border: 0;
}
#offcanvasVAV #vav-save-btn:hover{
  opacity: .9;
}

/* Save status text */
#offcanvasVAV #vav-save-status{
  font-size: 14px;
  color: var(--muted);
}


/* =========================
   AHU DRAWER layout
========================= */
/* =========================
   Minimal offcanvas + utility classes
   (so drawers work even without Bootstrap CSS)
========================= */


/* =========================
   VAV drawer details
========================= */

#offcanvasAHU .title-section-smaller{
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
#offcanvasAHU .title-section-smaller img{
  width: 18px;
  height: 18px;
  opacity: .75;
}
#offcanvasAHU #vav-loading{
  font-size: 14px !important;
  color: var(--muted);
}
#offcanvasAHU .info{
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 5px;
}
#offcanvasAHU .description-bigger{
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  color: rgba(90,90,90,.85);
  margin-bottom: 8px;
}
#offcanvasAHU .table-info{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
#offcanvasAHU .table-info td{
  padding: 8px 6px;
  vertical-align: middle;
}
#offcanvasAHU .table-info tr + tr td{
  border-top: 1px solid rgba(200,207,213,.45);
}
#offcanvasAHU .table-info td.blue{
  color: #2c6b8a;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}
#offcanvasAHU .input-info{
  width: 72px;
  border: 1px solid rgba(200,207,213,.85);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  background: #fff;
  outline: none;
}
#offcanvasAHU .input-info:focus{
  border-color: rgba(57,122,156,.55);
  box-shadow: 0 0 0 3px rgba(57,122,156,.12);
}
#offcanvasAHU textarea#vav-remark{
  min-height: 92px;
  resize: vertical;
  line-height: 1.35;
}
#offcanvasAHU #vav-save-btn{
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(57,122,156,.35);
  background: #2c6b8a;
  color: #fff;
  font-weight: 800;
  cursor:pointer;
}
#offcanvasAHU #vav-save-btn:hover{ filter: brightness(1.05); }
#offcanvasAHU #vav-save-btn:disabled{
  opacity: .7;
  cursor: default;
}
#offcanvasAHU #vav-save-status{
  margin-top: 8px !important;
  font-size: 14px !important;
  color: var(--muted);
}




/* =========================================================
   AHU DRAWER USING FEEDBACK DRAWER (override Bootstrap look)
========================================================= */

/* --- Drawer shell --- */
#offcanvasAHU{
  width: 520px;
  background: #fff;
  border-left: 1px solid var(--border);
  font-family: var(--font-ui);
}

/* Header */
#offcanvasAHU .offcanvas-header{
  padding: 13px 16px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  background-color: #fff;
}

#offcanvasAHU .title-section-smaller{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text);
}

#offcanvasAHU .title-section-smaller img{
  width: 18px;
  height: 18px;
  opacity: .7;
}

/* Close button – neutralize Bootstrap size */
#offcanvasAHU .btn-close{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background-color: transparent;
  opacity: .6;
}
#offcanvasAHU .btn-close:hover{
  opacity: 1;
  background: rgba(0,0,0,.05);
}

/* Body */
#offcanvasAHU .offcanvas-body{
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

/* Loading text */
#offcanvasAHU #oc-loading{
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* --- Section blocks --- */
#offcanvasAHU .info:last-child{
  border-bottom: 0;
}

/* Section titles */
#offcanvasAHU .info > .description-bigger,
#offcanvasAHU .info td:first-child{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  color: rgba(90,90,90,.75);
}

/* --- Metric tables inside drawer --- */
#offcanvasAHU .table-info{
  border-collapse: collapse;
  width: 100%;
}

#offcanvasAHU .table-info td{
  padding: 6px 0;
  font-size: 12px;
  vertical-align: middle;
}

/* Left labels */
#offcanvasAHU .table-info td:first-child{
  color: var(--text);
  font-weight: 500;
}

/* Column headers (READING / SET POINT) */
#offcanvasAHU .table-info td.blue{
  font-size: 12px;
  font-weight: 600;
  color: var(--font-corp-blue);
  letter-spacing: .05em;
}

/* Numeric values */
#offcanvasAHU .table-info td:not(:first-child){
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Operator remark --- */
#offcanvasAHU .operator-remark-section span{
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--text);
}

/* --- Notes textarea --- */
#offcanvasAHU .note-section textarea{
  margin-top: 6px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.4;
  border-radius: 8px;
  border: 1px solid var(--border);
  resize: vertical;
}

/* --- Footer --- */
#offcanvasAHU .offcanvas-footer{
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* Save button */
#offcanvasAHU #oc-save-btn{
  height: 34px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 8px;
  color: #fff;
  border: 0;
}
#offcanvasAHU #oc-save-btn:hover{
  opacity: .9;
}

/* Save status text */
#offcanvasAHU #oc-save-status{
  font-size: 14px;
  color: var(--muted);
}



/* =========================
   Drawer shared styles
========================= */
.drawer-sub-header,
#offcanvasVAV .table-info td.drawer-sub-header,
#offcanvasAHU .table-info td.drawer-sub-header,
#offcanvasFeedback .table-info td.drawer-sub-header{
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 12px 0 8px;
  padding-bottom: 4px;
}

/* ============================ HOME CHART AREA ======================== */
/* ============================ HOME CHART AREA ======================== */
/* ============================ HOME CHART AREA ======================== */
/* ============================ HOME CHART AREA ======================== */
/* ============================ HOME CHART AREA ======================== */
/* ============================ HOME CHART AREA ======================== */
/* ============================ HOME CHART AREA ======================== */
/* ============================ HOME CHART AREA ======================== */
/* ============================ HOME CHART AREA ======================== */


section.section-dashboard .home-chart {
  padding: 3rem 3rem;
  background-color: #F5F7F7;
  border: 0.1rem solid #C8CFD5;
  border-radius: 0.8rem;
  margin-top: 3rem;
}

@media (max-width: 991px) {
  section.section-dashboard .home-chart {
    padding: 3rem 1.5rem;
  }
}


#homeChartTitle {
  margin: 20px 0;
  font-weight: 600;
  text-align: center;
  color: var(--font-corp-blue);
}


/* === SECONDARY CHART reveal/hide animation === */

/* Base */
.chart-secondary{
  overflow:hidden;
  opacity:0;
  transform:translateY(10px);
  max-height:0;
  transition:
    opacity .28s ease-out,
    transform .28s ease-out,
    max-height .28s ease-out;
}

/* When compare mode selected */
/*
.chart-tools-row[data-mode="compare"] ~ .dashboard-main .chart-secondary,
.chart-tools-row[data-mode="compare"] + .chart-area .chart-secondary {
  opacity:1;
  transform:translateY(0);
  max-height:2000px;
}
/*
/* When returning to single mode (fade/slide up) */
/*
.chart-tools-row:not([data-mode="compare"]) ~ .dashboard-main .chart-secondary,
.chart-tools-row:not([data-mode="compare"]) + .chart-area .chart-secondary {
  opacity:0;
  transform:translateY(10px);
  max-height:0;
}
*/





/* === Secondary chart wrapper: animated open/close === */

#secondary-chart-wrapper{
  /* closed by default */
  overflow:hidden;
  max-height:0;
  opacity:0;
  transform:translateY(6px);
  margin-top:10px;

  transition:
    max-height .24s ease,
    opacity   .20s ease,
    transform .20s ease;
}

/* open state, controlled by JS via .is-open */
#secondary-chart-wrapper.is-open{
  max-height:800px;           /* just needs to be > chart height */
  opacity:1;
  transform:translateY(0);
}

/* Secondary metric filter: only fade/slide, no own height animation */
#secondaryMetricFilter{
  opacity:0;
  transform:translateY(6px);
  /* let the wrapper control height; filter just sits inside */
  transition:
    opacity   .18s ease,
    transform .18s ease;
}

/* When secondary chart is open, show the filter smoothly */
#secondary-chart-wrapper.is-open #secondaryMetricFilter{
  opacity:1;
  transform:translateY(0);
}





/* === Chiller chart tools row: Single / Compare toggle === */
.chart-tools-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  max-width: 60%;
  margin: 20px auto;
  padding: 5px;
  background-color: #f9f9f9;
  border-radius: 999px;
}

@media (max-width: 1220px){
.chart-tools-row{
  max-width: 80%;
  }
}

@media (max-width: 991px) {
.chart-tools-row{
  max-width: 100%;
  }
}

@media (max-width: 640px) {
.chart-tools-row{
    border-radius: 20px;
  }
.chart-mode-toggle, .chart-tools-row__actions{
    margin: 0 auto;
  }
.chart-metric-buttons{
    justify-content: center;
    margin: 10px auto!important;
  }
}








/* === Link cursor / Link zoom – transition-based animation === */

#btn-link-cursor,
#btn-link-zoom{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  white-space:nowrap;
  /* colors/padding from .btn.btn-ghost */

  /* Hidden/small state (Single) */
  opacity:0;
  transform:scale(0.85) translateX(4px);
  pointer-events:none;

  /* Smooth animation both ways */
  transition:
    opacity 0.20s ease-out,
    transform 0.20s ease-out;
}

/* Compare: fade/zoom IN */
.chart-tools-row[data-mode="compare"] #btn-link-cursor,
.chart-tools-row[data-mode="compare"] #btn-link-zoom{
  opacity:1;
  transform:scale(1) translateX(0);
  pointer-events:auto;
}

/* Stagger: Link zoom appears slightly after cursor */
.chart-tools-row[data-mode="compare"] #btn-link-zoom{
  transition-delay:0.06s;
}

/* When going back to Single, remove extra delay so fade-out is clean */
.chart-tools-row:not([data-mode="compare"]) #btn-link-cursor,
.chart-tools-row:not([data-mode="compare"]) #btn-link-zoom{
  transition-delay:0s;
}



















.chart-mode-toggle{
  position:relative;
  display:inline-flex;
  align-items:stretch;
  padding:3px;
  border-radius:999px;
  background:#e5e7eb;
  overflow:hidden;
}

/* sliding background */
.chart-mode-toggle::before{
  content:"";
  position:absolute;
  inset:3px;
  width:100px;
  border-radius:999px;
  background:rgb(57,122,156);   /* corp blue */
  transform:translateX(0);
  transition:transform .22s ease;
}

/* when in compare mode, slide to the right */
.chart-mode-toggle[data-mode="compare"]::before{
  transform:translateX(100%);
}

/* tabs */
.chart-mode-toggle__btn{
  position:relative;
  flex:1 0 0;                  /* each half gets equal width */
  border:0;
  width:100px;
  background:transparent;
  padding:6px 10px;
  border-radius:999px;
  font-size:var(--fs-small);
  font-weight:600;
  color:#4b5563;
  cursor:pointer;
  line-height:1.2;
  text-align:center;
  z-index:1;                    /* above slider */
}

.chart-mode-toggle__btn.is-active{
  color:#ffffff;
}


/* ghost-style buttons to match pills but less heavy */
.btn.btn-ghost{
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  width:100px;
  background: #ffffff;
  font-size: var(--fs-small);
  color: #4b5563;
}
.btn.btn-ghost:hover{
  background: rgba(0,0,0,.03);
}

.btn.btn-ghost.is-active{
  background:rgb(57,122,156);
  border-color:rgba(57,122,156,.55);
  color: #ffffff;
  font-weight:600;
}

.btn.btn-ghost:focus {
  box-shadow: none;
}

/* Hide the legacy toggle */
.chart-tools-legacy-toggle{
  display: none !important;
}

section.section-dashboard /* ===== Home chart filters (button-style pills) ===== */
.home-chart-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.home-top.custom-col-3{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chiller-summary-card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.home-chart-content{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin: 12px 0 18px;
}

/* chart filter row spacing */
/* chart filter row spacing */
.chart-metric-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
  font-size: 13px;
}

.chart-metric-buttons .item {
  /* monochrome pill buttons */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  min-width: unset;
  border-radius: 999px;
  border: 1px solid #e5e7eb;        /* gray-200 */
  background: #f9fafb;              /* gray-50 */
  color: #374151;                   /* gray-700 */
  font-weight: 600;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition:
    background-color .15s ease,
    border-color .15s ease,
    color .15s ease,
    box-shadow .15s ease;
}

.chart-metric-buttons .item:hover {
  border-color: #d1d5db;            /* gray-300 */
  background: #e5e7eb;              /* gray-200 */
  color: #111827;                   /* gray-900 */
}

.chart-metric-buttons .item.active {
  border-color: #5a5a5a;
  background: #5a5a5a;
  color: #ffffff;
}



/* COMPARISON CHART BUTTON */
section.section-dashboard .home-chart-filter-secondary .filter-date-wrapper {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}






/* keep date input height aligned with pills */
section.section-dashboard .home-chart-filter .filter-date input {
  min-height: 3.6rem;
  padding: 0.8rem 1.2rem 0.8rem 3.6rem;
  border-radius: 999px;
}

section.section-dashboard .home-chart-filter .filter-date {
  position: relative;
}
section.section-dashboard .home-chart-filter .filter-date:before {
  content: "\f073";
  font-family: "FontAwesome";
  position: absolute;
  top: 50%;
  left: 2rem;
  transform: translateY(-50%);
}
section.section-dashboard .home-chart-filter .filter-date input {
  border: 0.1rem solid #C8CFD5;
  border-radius: 0.6rem;
  min-height: 4.8rem;
  padding: 1.2rem 2rem 1.2rem 4rem;
}
section.section-dashboard .home-chart-filter .filter-date:after {
  content: "\f078";
  font-family: "FontAwesome";
  position: absolute;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
}
section.section-dashboard .home-chart-info {
  position: absolute;
  left: -3rem;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}
@media (max-width: 575px) {
  section.section-dashboard .home-chart-info {
    display: none;
  }
}
section.section-dashboard .home-chart-main {
  position: relative;
  /* padding-left: 6rem; */
}
@media (max-width: 575px) {
   .home-chart-main {
    padding-left: 0;
  }
}
/* Wrap date + button side by side */
.home-chart-filter .filter-date-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #f9fafb;
  border-radius: 999px;
  padding: 2px;
  border: 1px solid #e5e7eb;
}

.home-chart-filter #datepicker {
  width: 90px;
  text-align: center;
  border: 0;
  background-color: transparent;
}

/* “Latest Data” button style */
.home-chart-filter .btn-chartjs-arrow {
  width: 26px;
  height: 26px;
  display: block;
  text-align: center;
  padding-top: 1.5px;
  padding-left: 1.5px;
  border-radius: 999px;
}

.home-chart-filter .btn-chartjs-arrow:hover {
  border-color: #d1d5db;
  background: #e5e7eb;
  color: #111827;
}




  /* section.section-dashboard .home-chart-filter .btn-latest-date:hover {
  background-color: #3e3f40;
} */

/* Hide the browser's built-in calendar icon on the right */
 .home-chart-filter .filter-date input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
}

/* Make it still look like a normal text field */
 .home-chart-filter .filter-date input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
}
/* 1. Hide the browser's built-in calendar / dropdown icon on the right */
.home-chart-filter .filter-date input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
}

/* 2. Remove our custom right icon (::after) completely */
 .home-chart-filter .filter-date::after {
    content: none !important;
    display: none !important;
}

.csv-download-ready {
    border-color: #28a745 !important;
    color: #28a745 !important;
    font-weight: bold;
}



/* -------------- START NEW CHILLER CARD CSS -------------- */


/* =========================
   Layouts (Sample 02 & 03)
   ========================= */

/* Sample 02 (desktop: 3 cards in a row, then responsive down) */
.chiller-summary-grid {
  display: grid;
  gap: clamp(12px, 1.6vw, 18px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .chiller-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .chiller-summary-grid {
    grid-template-columns: 1fr; /* becomes Sample 03 style */
  }
}

/* If you explicitly want Sample 03 stacked everywhere: */
.chiller-summary-stack {
  display: grid;
  gap: clamp(12px, 1.6vw, 18px);
  grid-template-columns: 1fr;
}


/* =========================
   KPI Card (your new style)
   ========================= */

.chiller-summary-card {
  background: #fff;
  border: 0.1rem solid #C8CFD5;
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
  padding: clamp(8px, 2vw, 12px);
}

.chiller-summary-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(10px, 1.4vw, 14px);
}

.chiller-summary-card__title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2px;
  color: var(--muted);
}

.chiller-summary-card__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #9aa0a6;
  background: #fff;
  border: 1px solid transparent;
  user-select: none;
}

/* 3 columns inside the card: LIVE (big), Baseline, Savings */
.chiller-summary-kpi {
  display: grid;
  align-items: end;
  gap: clamp(10px, 1.2vw, 14px);
  grid-template-columns: 1.35fr 0.85fr 1fr;
}

@media (max-width: 640px) {
  .chiller-summary-kpi {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .chiller-summary-kpi__baseline,
  .chiller-summary-kpi__savings {
    display: flex;
    flex-direction: column;
    align-items: center;     /* center pill + label */
    justify-content: flex-end;
    gap: 6px;
    }
}

/* Prevent pill from stretching horizontally */
/* .chiller-summary-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  white-space: nowrap;
} */

/* Label always below pill */
.chiller-summary-kpi__label {
  display: block;
  margin-top: 3px;
  text-align: center;
  white-space: nowrap;
  font-size: var(--fs-small);
  color: #9aa0a6;
  text-transform: none;
}


/* Let grid items shrink properly */
.chiller-summary-kpi > * { min-width: 0; }

/* Desktop: wrapper should not affect the 3-column layout */
.chiller-summary-kpi__right {
  display: contents; /* baseline & savings behave like direct children */
}

/* Mobile: Live on top, then baseline+savings as a 2-up row */
@media (max-width: 640px) {
  .chiller-summary-kpi {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chiller-summary-kpi__right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
  }
}


/* LIVE */
.chiller-summary-kpi__live .chiller-summary-kpi__value {
  font-family: "helveticalneue" !important;
  font-weight: 400;
  font-size: 36px;
  line-height: 0.95;
  letter-spacing: -0.5px;
  color: #000;
}

.chiller-summary-kpi__baseline .chiller-summary-kpi__value {
  font-family: "helveticalneue" !important;
  font-weight: 400;
  /* font-size: clamp(20px, 1.8vw, 30px); */
  line-height: 1.05;
  color: #111;
}

.chiller-summary-pill-wrapper {
  text-align: center;
}
.chiller-summary-kpi__baseline .chiller-summary-pill {
  border: 0;
}

/* Prevent KPI pill overflow in the “awkward middle” widths */
.chiller-summary-kpi,
.chiller-summary-pill-wrapper {
  min-width: 0; /* allows flex children to shrink */
}

.chiller-summary-pill__value {
  white-space: nowrap;
}



/* Savings pill */
.chiller-summary-pill {
  font-family: "helveticalneue" !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  font-weight: 400;
  font-size: 16px;
  line-height: 1;
  border: 1px solid;
  background: #fff;
  white-space: nowrap;
}

.chiller-summary-pill__arrow {
  font-size: 0.8em;
}

/* Positive savings (green) */
.chiller-summary-kpi__savings.is-positive .chiller-summary-pill {
  color: #1f7a3a;
  border-color: #bfe8cc;
  background: #ecfdf3;
}

/* Negative savings (red) */
.chiller-summary-kpi__savings.is-negative .chiller-summary-pill {
  color: #c2413b;
  border-color: #f0b8b3;
  background: #fff1f0;
}


@media (max-width: 1220px){

}

@media (max-width: 998px) {
  .chiller-summary-pill{
    font-size: var(--fs-small);
    padding: 6px;
    gap: 3px;
    font-size: 13px;
    border: 1px solid;
  }
}



/* -------------- END NEW CHILLER CARD CSS -------------- */



/* .description-smaller { font-size: 12px; }
.chiller-summary-card-item { font-size: 20px; } */

.home-title {
  width: 100%;
  display: block;
  text-align: center;
}

.home-image {
  width: 100%;
  display: block;
  text-align: center;
  margin-top: 20px;
}
.home-image img {
  width: 60%;

}
section.section-dashboard .dashboard-info {
  padding: 10px 30px;
}





@media (max-width: 1180px) and (min-width: 992px) {
  .chiller-summary-kpi {
    gap: clamp(8px, 1vw, 12px);
  }

  /* Main numbers */
  .chiller-summary-kpi__value {
    font-size: clamp(18px, 1.8vw, 22px);
    line-height: 1.05;
  }

  /* Savings pill */
  .chiller-summary-pill {
    padding: 6px 10px;
    gap: 6px;
  }

  .chiller-summary-pill__value {
  font-size: var(--fs-small);
  }
}




@media (max-width: 1599px) {
  .description-smaller { font-size: var(--fs-small); }
  .chiller-summary-card-item { font-size: 20px; }
  /* .chiller-summary-baseline,
  .chiller-summary-live,
  .chiller-summary-savings {
      font-size: 1.4rem;
    } */

  .home-title {
    width: 100%;
    display: block;
    text-align: center;
  }

  .home-image {
    width: 100%;
    display: block;
    text-align: center;
    margin-top: 20px;
  }
  .home-image img {
    width: 60%;

  }
  section.section-dashboard .dashboard-info {
    padding: 10px 30px;
  }

}


/* Responsive: chiller KPI cards (3→2→1 columns) */
.home-top.custom-col-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 18px);
}
/* @media (max-width: 980px) {
  .home-top.custom-col-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
} */
@media (max-width: 640px) {
  .home-top.custom-col-3 { grid-template-columns: 1fr; }
}


/* --- Daily Average cards (second row) --- */
.daily-avg-row {
  margin-top: clamp(8px, 1vw, 14px);
}

.daily-avg-row .chiller-summary-card {
  border-style: dashed;
}

.daily-avg-row .chiller-summary-card__title {
  font-size: 12px;
}

.daily-avg-row .chiller-summary-kpi__live .chiller-summary-kpi__value {
  font-size: 28px;
}

/* 5-minute RT/EFF look-ahead, shown only when the table setting is set. */
.chiller-lookahead {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--muted);
}

.chiller-lookahead__label {
  color: #7C3AED;
  font-weight: 600;
}

.chiller-lookahead__value {
  font-family: "helveticalneue" !important;
  font-size: 16px;
  color: #111;
}

.chiller-lookahead__delta {
  white-space: nowrap;
}

.chiller-lookahead__delta.is-positive {
  color: #1f7a3a;
}

.chiller-lookahead__delta.is-negative {
  color: #c2413b;
}

.chiller-prediction-caption {
  margin: 6px 0 0;
  font-size: var(--fs-small);
  color: #9aa0a6;
}

.chiller-lookahead-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 18px);
  margin-top: 8px;
}

.chiller-lookahead-chart {
  position: relative;
  height: 160px;
}

.chiller-lookahead-toolbar,
.chiller-lookahead-note {
  grid-column: 1 / -1;
}

.chiller-lookahead-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chiller-lookahead-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #e5e7eb;
}

.chiller-lookahead-toggle__btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  line-height: 1.2;
}

.chiller-lookahead-toggle__btn.is-active {
  background: rgb(57, 122, 156);
  color: #fff;
}

.chiller-lookahead-note {
  margin: 0;
  font-size: var(--fs-small);
  color: #9aa0a6;
}

@media (max-width: 640px) {
  .chiller-lookahead-charts {
    grid-template-columns: 1fr;
  }
}

.chiller-prediction-stale {
  margin-left: 8px;
  font-weight: 600;
  color: #9a6700;
}


/* --- Baseline date picker --- */
.filter-date-wrapper--baseline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  background-color: #f9fafb;
  border-radius: 999px;
  padding: 2px 8px 2px 10px;
  border: 1px dashed #d1d5db;
}

.baseline-date-label {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
  margin: 0;
}

.filter-date-wrapper--baseline .filter-date input {
  width: 90px;
  text-align: center;
  border: 0;
  background-color: transparent;
  font-size: 12px;
}

.filter-date-wrapper--baseline .filter-date input[type="date"]::-webkit-calendar-picker-indicator {
  display: none !important;
}

.filter-date-wrapper--baseline .filter-date input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
}

.btn-clear-baseline {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
}

.btn-clear-baseline:hover {
  background: #e5e7eb;
  color: #111827;
}

@media (max-width: 768px) {
  .filter-date-wrapper--baseline {
    margin-left: 0;
    margin-top: 6px;
  }
}


/* Prevent clipping on smaller widths */
.content-wrapper,
.section-dashboard,
.dashboard-main,
.dashboard-info {
  max-width: 100%;
  min-width: 0;
}

.home,
.home-chart,
.home-chart-main,
.home-chart-show {
  max-width: 100%;
  min-width: 0;
}

/* IMPORTANT: give Chart.js a stable box to render into */
.home-chart-show{
  position: relative;
  width: 100%;
  height: 300px;      /* desktop default */
  min-height: 280px;  /* prevents collapse */
}

/* make canvas obey the container (not its HTML attributes) */
.home-chart-show canvas{
  width: 100% !important;
  height: 100% !important;
  display: block;
  padding: 10px 0;
}
/* Responsive: smaller chart height on narrow screens */
@media (max-width: 991px) {
  .home-chart-show {
    height: 320px;
  }
}
@media (max-width: 640px){
  .home-chart-show{
    height: 320px;
    min-height: 260px;
  }
}

/* Allow chart area to scroll horizontally if needed (very narrow screens) */
@media (max-width: 520px) {
  .home-chart-main { overflow-x: auto; }
}


/* ============================ OFFCANVAS CHART AREA ======================== */
/* ============================ OFFCANVAS CHART AREA ======================== */
/* ============================ OFFCANVAS CHART AREA ======================== */
/* ============================ OFFCANVAS CHART AREA ======================== */
/* ============================ OFFCANVAS CHART AREA ======================== */
/* ============================ OFFCANVAS CHART AREA ======================== */
/* ============================ OFFCANVAS CHART AREA ======================== */
/* ============================ OFFCANVAS CHART AREA ======================== */
/* ============================ OFFCANVAS CHART AREA ======================== */


/* AHU chart legend styling */
.ahu-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
  position: absolute
}

/* Make the legend items a row of pills that wrap */
.ahu-chart-legend #ahu-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
}

/* Each row is basically just an inline container */
.ahu-chart-legend .legend-row {
  display: flex;
  align-items: center;
}



/* Base pill */
.ahu-chart-legend .legend-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-small);
  border: 1px solid #d1d5db;
  background-color: #f3f4f6;
  cursor: pointer;
}


/* Dimmed when hidden in chart */
.ahu-chart-legend .legend-label.muted {
  opacity: 0.35;
  filter: grayscale(0.6);
}

.ahu-chart-legend .legend-row.muted .legend-label {
  opacity: 0.45;
  background-color: #e5e7eb;
}

/* Metric-specific colours (soft, so they still look “dashboard-y”) */
.ahu-chart-legend .legend-label[data-metric-key="ahu_kw"] {
  background-color: rgba(255, 171, 64, 0.25);   /* warm orange */
  border-color: rgba(255, 171, 64, 0.55);
}

.ahu-chart-legend .legend-label[data-metric-key="rat"],
.ahu-chart-legend .legend-label[data-metric-key="sat"] {
  background-color: rgba(33, 150, 243, 0.25);   /* blue for temps */
  border-color: rgba(33, 150, 243, 0.55);
}

.ahu-chart-legend .legend-label[data-metric-key="ratsp"],
.ahu-chart-legend .legend-label[data-metric-key="satsp"] {
  background-color: rgba(76, 175, 80, 0.25);    /* green for SPs */
  border-color: rgba(76, 175, 80, 0.55);
}

.ahu-chart-legend .legend-label[data-metric-key="co2"] {
  background-color: rgba(244, 67, 54, 0.25);    /* red for CO2 */
  border-color: rgba(244, 67, 54, 0.55);
}

.ahu-chart-legend .legend-label[data-metric-key="co2sp"] {
  background-color: rgba(233, 30, 99, 0.25);    /* magenta-ish SP */
  border-color: rgba(233, 30, 99, 0.55);
}

.ahu-chart-legend .legend-label[data-metric-key="sap"] {
  background-color: rgba(121, 85, 72, 0.25);    /* brown-ish for pressure */
  border-color: rgba(121, 85, 72, 0.55);
}


/* muted = hidden dataset */
.ahu-chart-legend .legend-label.muted {
  opacity: 0.4;
}

/* Hide / Show all links */
.ahu-legend-link {
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

/* TEMP STYLING */
.chiller-summary-card {
  border: 0.1rem solid #C8CFD5;
  border-radius: 0.6rem;
}

/*  CHART ICONS  */
.prev-next-page-icon {
  width:1em;
  height:1em;
  color:#58595A;
  cursor:pointer;
  filter: invert(27%) sepia(4%) saturate(0%) hue-rotate(181deg) brightness(91%) contrast(87%);
}

.fb-page-end.prev-next-page-icon {
  cursor: default;
}

/* ============ LOGIN ======== Can Delete ================== */
.title-section {
  font-size: 24px;
  line-height: 1.3;
  font-weight: normal;
}

/* =========================
   AUTH / LOGIN PAGE
========================= */

.auth-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  font-family: var(--font-ui, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif);
  color: var(--text);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}

.auth-logo img {
  max-height: 40px;
  width: auto;
}

.auth-title {
  margin: 10px 0 0;
  font-family: var(--font-display, var(--font-ui));
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--text);
}

.auth-subtitle {
  margin: 0;
  text-align: center;
  font-size: var(--fs-ui);
  color: var(--muted);
}

.auth-alert {
  border-radius: 8px;
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: rgba(254, 242, 242, 0.95);
  color: #991b1b;
  padding: 10px 12px;
  font-size: var(--fs-ui);
}

/* Form layout */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-label {
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(90, 90, 90, 0.85);
  font-weight: 700;
}

.auth-label-required {
  color: #dc2626;
}

/* The actual inputs (from Django form) */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  font: inherit;
  font-size: var(--fs-ui);
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: rgba(57, 122, 156, 0.8);
  box-shadow: 0 0 0 3px rgba(57, 122, 156, 0.16);
}

/* Input error message*/
.errorlist {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-small);
  color: #b91c1c;
}


/* Password wrapper */
.auth-input-wrap--password .auth-input {
  padding-right: 40px; /* space for eye icon */
}

.auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
}

.auth-password-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Field errors */
.auth-field-errors {
  font-size: var(--fs-small);
  color: #b91c1c;
}

/* Actions */
.auth-actions {
  margin-top: 10px;
}


button.animate-blue-btn {
  width: 100%;
  height: 38px;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--fs-ui);
  color: #fff;

  /* base gradient using your corp blue family */
  background-image: linear-gradient(
    135deg,
    #4d94b8,
    #135c90,
    #4d94b8
  );
  background-size: 200% 200%;
  background-position: 0% 50%;

  border: none;              /* override bootstrap border if any */
  outline: none;
  transition: background-position 0.3s ease, opacity 0.2s ease;
  animation: animate-blue-btn-gradient-shift 6s ease infinite;
}

/* animate gradient only on hover – no movement, no shadow */
button.animate-blue-btn:hover {
  animation: animate-blue-btn-gradient-shift 3s ease infinite;
  opacity: 1;                 /* keep text crisp */
  animation-duration: 1s; /* speeds up on hover (optional) */
}

@keyframes animate-blue-btn-gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

button.animate-blue-btn:focus {
  box-shadow: none;
}


/* Help text */
.auth-help-text {
  margin-top: 4px;
  font-size: var(--fs-small);
  color: var(--muted);
  text-align: center;
}

/* Footer */
.auth-footer {
  margin-top: 16px;
}

.auth-footer-text {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}


  /* Auto-Latest indicator for always-on monitoring screens */
  .auto-latest-indicator{
    position: fixed;
    top: 88px;
    right: 16px;
    z-index: 1060;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  }
  .auto-latest-indicator.is-off{
    opacity: 0.65;
  }
  @media (max-width: 768px){
    .auto-latest-indicator{ top: 76px; right: 12px; }
  }

/* Comfort range Upper Bound stepper (FCU/AHU offcanvas, COMFORT_RANGE_STEPPER_ENABLED) */
.comfort-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}
.comfort-stepper-btn {
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(200, 207, 213, 0.85);
  border-radius: 6px;
  background: #ffffff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.comfort-stepper-btn:hover:not(:disabled) {
  border-color: rgba(57, 122, 156, 0.55);
}
.comfort-stepper-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.comfort-stepper-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  background: #f7f9fa;
}
/* These offcanvas panels style .input-info with width:100% + 8px/12px padding
   (ID+class specificity) which would otherwise squeeze the stepper's
   narrower table column to ~0 usable content width. Override with equal-or-higher
   specificity so the value stays readable. */
#offcanvasFCU #oc-fcu-upper-bound-sp.comfort-stepper-value,
#offcanvasAHU #oc-upper-bound-sp.comfort-stepper-value {
  width: auto;
  min-width: 0;
  padding: 4px 2px;
}
/* Caption above the stepper — the delta box shows an adjustment (e.g. "-2.0"),
   not the bound itself, so it sits in its own merged cell (colspan=2) rather
   than under the "Upper Bound" column header, which was read as the target
   value instead of an offset. */
.comfort-stepper-caption {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-bottom: 4px;
}
/* Resulting absolute upper bound, shown under the delta stepper so the
   technician can confirm what the +/- clicks resolve to (e.g. "-2.0" -> 25.0). */
.comfort-stepper-preview {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-top: 4px;
}

/* Manual DAMPER / VSD control panel (CSM only) — the Apply button sits under
   the input table rather than in the drawer footer, so the write-back action
   stays visually separate from the feedback/comfort-range Update button. */
.control-actions {
  margin-top: 8px;
}
