/* JANAF EMS component styles.
   Datta Able tokens (light default, dark under html[data-ems-theme="dark"]) and
   only the component rules this product uses. Add a rule here when a template
   needs it; do not paste whole sections. */

/* ------------------------------------------------------------------ */
/*  Datta Able palette (2026-10-20: the owner asked for the stock look)  */
/*                                                                     */
/*  Light theme is the default: #f4f7fa page, white cards, #3f4d67     */
/*  sidebar, #04a9f5 primary. The dark theme mirrors Datta Able's own   */
/*  layouts/dark.css. Every EMS component reads these tokens, so the    */
/*  look follows from here.                                             */
/* ------------------------------------------------------------------ */
:root {
  --da-primary: #04a9f5;
  --da-primary-dark: #038fd0;
  --da-secondary: #748892;
  --da-success: #1de9b6;
  --da-info: #3ebfea;
  --da-warning: #f4c22b;
  --da-danger: #f44236;
  --da-dark: #37474f;
  --da-sidebar: #3f4d67;
  --da-sidebar-active: #333f54;
  --da-submenu: #39465e;
  --da-menu-text: #a9b7d0;
  --da-menu-active: #1dc4e9;

  /* legacy brand names, remapped so older rules resolve to the stock set */
  --brand-deep-green: #3f4d67;
  --brand-forest: #333f54;
  --brand-energy: #04a9f5;
  --brand-gold: #04a9f5;
  --brand-light-gold: #04a9f5;
  --brand-off-white: #ffffff;
  --brand-green-black: #f4f7fa;
  --brand-mist: #a9b7d0;
  --ems-chart-grey: #c9d0d5;
  --ems-chart-blue: #5b9bd5;
  --ems-chart-sell: #f4c22b;   /* dispatch bars: sell / discharge */
  --ems-chart-charge: #04a9f5; /* dispatch bars: charge */

  /* surfaces */
  --ems-bg: #f4f7fa;
  --ems-panel: #ffffff;
  --ems-panel-2: #ffffff;
  --ems-border: #e2e5e8;
  --ems-border-hot: #04a9f5;

  /* text */
  --ems-text: #373a3c;
  --ems-text-strong: #111111;
  --ems-muted: #888888;

  /* accent (the former gold slot) */
  --ems-gold: #04a9f5;
  --ems-gold-bright: #04a9f5;

  /* status */
  --ems-green: #1de9b6;
  --ems-cyan: #04a9f5;
  --ems-amber: #f4c22b;
  --ems-red: #f44236;

  /* shell */
  --ems-menu-text: #a9b7d0;
  --ems-shell-1: #3f4d67;
  --ems-shell-2: #3f4d67;
  --ems-submenu-bg: #39465e;

  /* derived surfaces */
  --ems-surf-1: #ffffff;
  --ems-surf-2: #ffffff;
  --ems-surf-3: #f4f7fa;
  --ems-surf-4: #f8fafc;
  --ems-surf-5: #ffffff;
  --ems-surf-6: #f8fafc;
  --ems-surf-7: #f4f7fa;
  --ems-surf-8: #f0f4f8;
  --ems-ovl-025: rgba(0, 0, 0, 0.03);
  --ems-ovl-028: rgba(0, 0, 0, 0.03);
  --ems-ovl-03: rgba(0, 0, 0, 0.03);
  --ems-ovl-035: rgba(0, 0, 0, 0.04);
  --ems-ovl-04: rgba(0, 0, 0, 0.04);
  --ems-ovl-045: rgba(0, 0, 0, 0.05);
  --ems-ovl-06: rgba(0, 0, 0, 0.06);
  --ems-ovl-07: rgba(0, 0, 0, 0.07);
  --ems-ovl-075: rgba(0, 0, 0, 0.08);
  --ems-ovl-08: rgba(0, 0, 0, 0.09);
  --ems-ovl-10: rgba(0, 0, 0, 0.10);
  --ems-ovl-14: rgba(0, 0, 0, 0.12);
}
html[data-ems-theme="dark"] {
  /* Datta Able layouts/dark.css */
  --brand-off-white: #ffffff;
  --brand-green-black: #212224;
  --ems-bg: #212224;
  --ems-panel: #323437;
  --ems-panel-2: #323437;
  --ems-border: #2d2f31;
  --ems-border-hot: #04a9f5;
  --ems-text: #adb7be;
  --ems-text-strong: #ffffff;
  --ems-muted: #888888;
  --ems-surf-1: #323437;
  --ems-surf-2: #323437;
  --ems-surf-3: #282a2c;
  --ems-surf-4: #2d2f31;
  --ems-surf-5: #323437;
  --ems-surf-6: #282a2c;
  --ems-surf-7: #282a2c;
  --ems-surf-8: #232527;
  --ems-ovl-025: rgba(255, 255, 255, 0.025);
  --ems-ovl-028: rgba(255, 255, 255, 0.028);
  --ems-ovl-03: rgba(255, 255, 255, 0.03);
  --ems-ovl-035: rgba(255, 255, 255, 0.035);
  --ems-ovl-04: rgba(255, 255, 255, 0.04);
  --ems-ovl-045: rgba(255, 255, 255, 0.045);
  --ems-ovl-06: rgba(255, 255, 255, 0.06);
  --ems-ovl-07: rgba(255, 255, 255, 0.07);
  --ems-ovl-075: rgba(255, 255, 255, 0.075);
  --ems-ovl-08: rgba(255, 255, 255, 0.08);
  --ems-ovl-10: rgba(255, 255, 255, 0.1);
  --ems-ovl-14: rgba(255, 255, 255, 0.14);
}
html,
body {
  background: var(--ems-bg) !important;
  color: var(--ems-text) !important;
}
body {
  letter-spacing: 0;
}
a,
a:hover {
  color: var(--ems-text);
}
.pcoded-navbar,
.pcoded-navbar.navbar-dark,
.pcoded-navbar.menupos-fixed {
  background: var(--da-sidebar) !important;
  box-shadow: 1px 0 20px 0 rgb(63, 77, 103);
}
.pcoded-navbar .navbar-brand,
.pcoded-navbar .navbar-wrapper {
  background: transparent !important;
}
.pcoded-navbar .navbar-brand {
  background: transparent !important;
}
.b-brand {
  gap: 10px;
}
.b-brand .ems-brand-logo {
  display: block;
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
  object-fit: contain;
  flex: 0 0 34px;
}
.b-brand .b-bg {
  background: var(--da-primary) !important;
}
.b-brand .b-title {
  color: #fff !important;
  font-weight: 700;
  letter-spacing: 0;
  /* At the template's 18px a long product name runs past the sidebar edge
     under the header buttons. 15px fits with room. */
  font-size: 15px;
  margin-left: 6px;
  white-space: nowrap;
}
.pcoded-navbar .pcoded-inner-navbar > li.pcoded-menu-caption > label {
  color: #e8edf7 !important;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.pcoded-navbar .pcoded-inner-navbar li > a {
  color: var(--ems-menu-text) !important;
}
.pcoded-navbar .pcoded-inner-navbar li > a {
  position: relative;
  transition: background .16s ease, color .16s ease;
}
.pcoded-navbar .pcoded-inner-navbar li > a:hover {
  color: var(--da-menu-active) !important;
  background: transparent !important;
}
.pcoded-navbar .pcoded-inner-navbar li.pcoded-trigger > a,
.pcoded-navbar .pcoded-inner-navbar li.active > a {
  color: #fff !important;
  background: var(--da-sidebar-active) !important;
}
/* A gold rail on the active row. One clear "you are here" marker instead of a
   tinted block that competes with the status colours in the content area. */
.pcoded-navbar .pcoded-inner-navbar > li.active > a::before,
.pcoded-navbar .pcoded-inner-navbar > li.pcoded-trigger > a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--da-menu-active);
}
.pcoded-navbar .pcoded-inner-navbar > li.active > a .pcoded-micon i,
.pcoded-navbar .pcoded-inner-navbar > li.pcoded-trigger > a .pcoded-micon i {
  color: #fff !important;
}
.pcoded-navbar .pcoded-submenu {
  background: var(--da-submenu) !important;
}
.pcoded-navbar .pcoded-submenu li.active > a {
  color: var(--da-menu-active) !important;
  font-weight: 600;
}
.pcoded-navbar .pcoded-inner-navbar .pcoded-submenu li > a {
  padding-top: 9px;
  padding-bottom: 9px;
}
.pcoded-navbar .pcoded-inner-navbar .pcoded-submenu .pcoded-submenu li > a {
  color: var(--ems-muted) !important;
  padding-left: 74px;
}
.pcoded-micon i {
  color: inherit;
}
.pcoded-header,
.pcoded-header.navbar-light {
  background: var(--ems-surf-1) !important;
  box-shadow: 0 1px 20px 0 rgba(69, 90, 100, 0.08);
}
.pcoded-header .navbar-nav > li > a,
.pcoded-header .dropdown-toggle,
.pcoded-header .mobile-menu,
.pcoded-header .b-title {
  color: var(--ems-text) !important;
}
.pcoded-main-container,
.pcoded-content,
.pcoded-inner-content,
.main-body,
.page-wrapper {
  background: var(--ems-bg) !important;
}
.card {
  background: var(--ems-panel) !important;
  border: none !important;
  border-radius: 0 !important;
  color: var(--ems-text) !important;
  box-shadow: 0 1px 20px 0 rgba(69, 90, 100, 0.08);
}
.ems-page {
  min-height: calc(100vh - 190px);
}
.ems-panel-label {
  color: var(--da-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ems-page__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(29, 233, 182, 0.35);
  border-radius: 999px;
  color: var(--ems-green);
  font-size: 12px;
  font-weight: 700;
}
.ems-status-dot {
  width: 8px;
  height: 8px;
  background: var(--ems-green);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(29, 233, 182, 0.8);
}
.ems-mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ems-cyan);
  cursor: pointer;
  transition: color 0.16s ease, transform 0.16s ease;
}
.ems-mode-toggle:hover {
  color: var(--ems-green);
  transform: rotate(-12deg);
}
.ems-toolbar,
.ems-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.ems-toolbar h2,
.ems-table-header h3,
.ems-admin-card h3 {
  margin: 6px 0 0;
  color: var(--ems-text-strong);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}
.ems-toolbar__actions {
  display: inline-flex;
  gap: 8px;
}
.ems-message-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.ems-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--ems-text);
  background: rgba(4, 169, 245, 0.08);
  border: 1px solid rgba(4, 169, 245, 0.18);
  border-radius: 8px;
}
.ems-message i {
  color: var(--ems-cyan);
}
.ems-message--success {
  background: rgba(29, 233, 182, 0.08);
  border-color: rgba(29, 233, 182, 0.2);
}
.ems-message--success i {
  color: var(--ems-green);
}
.ems-message--error {
  background: rgba(244, 66, 54, 0.08);
  border-color: rgba(244, 66, 54, 0.2);
}
.ems-message--error i {
  color: var(--ems-red);
}
.ems-icon-button,
.ems-table-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--ems-cyan);
  background: rgba(4, 169, 245, 0.08);
  border: 1px solid rgba(4, 169, 245, 0.24);
  border-radius: 8px;
}
.ems-table-icon {
  width: 30px;
  height: 30px;
  margin-right: 6px;
}
.ems-table-icon--danger {
  color: var(--ems-red);
  border-color: rgba(244, 66, 54, 0.28);
  background: rgba(244, 66, 54, 0.08);
}
.ems-admin-grid {
  display: grid;
  gap: 16px;
}
.ems-admin-grid--roles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ems-admin-grid--policy {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}
.ems-admin-card {
  padding: 20px;
  background: linear-gradient(180deg, var(--ems-panel-2), var(--ems-panel));
  border: 1px solid var(--ems-border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}
.ems-admin-card--wide {
  margin-top: 16px;
}
.ems-admin-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ems-admin-card p {
  min-height: 66px;
  margin: 14px 0;
  color: var(--ems-muted);
  line-height: 1.55;
}
.ems-admin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--ems-cyan);
  background: rgba(4, 169, 245, 0.1);
  border: 1px solid rgba(4, 169, 245, 0.24);
  border-radius: 8px;
}
.ems-admin-card--green .ems-admin-icon,
.ems-admin-card--green .ems-admin-badge {
  color: var(--ems-green);
  border-color: rgba(29, 233, 182, 0.28);
  background: rgba(29, 233, 182, 0.08);
}
.ems-admin-card--amber .ems-admin-icon,
.ems-admin-card--amber .ems-admin-badge {
  color: var(--ems-amber);
  border-color: rgba(4, 169, 245, 0.3);
  background: rgba(4, 169, 245, 0.08);
}
.ems-admin-card--danger .ems-admin-icon,
.ems-admin-card--danger .ems-admin-badge {
  color: var(--ems-red);
  border-color: rgba(244, 66, 54, 0.3);
  background: rgba(244, 66, 54, 0.08);
}
.ems-admin-badge,
.ems-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  color: var(--ems-cyan);
  background: rgba(4, 169, 245, 0.08);
  border: 1px solid rgba(4, 169, 245, 0.24);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.ems-pill--green {
  color: var(--ems-green);
  border-color: rgba(29, 233, 182, 0.28);
  background: rgba(29, 233, 182, 0.08);
}
.ems-pill--red {
  color: var(--ems-red);
  border-color: rgba(244, 66, 54, 0.28);
  background: rgba(244, 66, 54, 0.08);
}
.ems-admin-badge--green {
  color: var(--ems-green);
  border-color: rgba(29, 233, 182, 0.28);
  background: rgba(29, 233, 182, 0.08);
}
.ems-admin-badge--amber {
  color: var(--ems-amber);
  border-color: rgba(4, 169, 245, 0.3);
  background: rgba(4, 169, 245, 0.08);
}
.ems-admin-badge--red {
  color: var(--ems-red);
  border-color: rgba(244, 66, 54, 0.3);
  background: rgba(244, 66, 54, 0.08);
}
.ems-admin-scope {
  min-height: 48px;
  padding: 12px;
  color: var(--ems-text-strong);
  background: var(--ems-ovl-03);
  border: 1px solid var(--ems-ovl-06);
  border-radius: 8px;
}
.ems-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.ems-table {
  width: 100%;
  min-width: 760px;
  color: var(--ems-text);
  border-collapse: collapse;
}
.ems-table th,
.ems-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--ems-ovl-06);
  text-align: left;
  vertical-align: middle;
}
.ems-table th {
  color: var(--ems-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ems-empty {
  color: var(--ems-muted);
  text-align: center !important;
}
.ems-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ems-form label {
  display: block;
}
.ems-form label span {
  display: block;
  margin-bottom: 8px;
  color: var(--ems-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.ems-form input,
.ems-form select,
.ems-form textarea,
.ems-password-form input {
  width: 100%;
  padding: 10px 12px;
  color: var(--ems-text);
  background: var(--ems-ovl-04);
  border: 1px solid var(--ems-border);
  border-radius: 8px;
}
.ems-form input,
.ems-form select,
.ems-password-form input {
  height: 44px;
}
.ems-form textarea {
  min-height: 76px;
  resize: vertical;
}
.ems-form select {
  appearance: none;
}
.ems-form select option,
.ems-form select optgroup {
  color: #07111f;
  background: #f7fbff;
}
.ems-form select option:checked {
  color: #ffffff;
  background: #12324a;
}
.ems-form input:disabled {
  color: var(--ems-muted);
  cursor: not-allowed;
}
.ems-form input:focus,
.ems-form select:focus,
.ems-form textarea:focus,
.ems-password-form input:focus {
  border-color: rgba(4, 169, 245, 0.52);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(4, 169, 245, 0.1);
}
.ems-form-grid--dense {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ems-checkline {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 24px;
}
.ems-checkline input {
  width: 18px;
  height: 18px;
  accent-color: var(--ems-green);
}
.ems-checkline span {
  margin: 0 !important;
  color: var(--ems-text) !important;
  font-size: 13px !important;
  text-transform: none !important;
}
.ems-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.ems-password-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.8fr) auto;
  gap: 8px;
  width: min(100%, 540px);
}
.ems-filter-form {
  margin-bottom: 18px;
  padding: 14px;
  background: var(--ems-ovl-025);
  border: 1px solid var(--ems-ovl-06);
  border-radius: 8px;
}
.ems-policy-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--ems-text);
  background: rgba(29, 233, 182, 0.05);
  border: 1px solid rgba(29, 233, 182, 0.14);
  border-radius: 8px;
}
.ems-policy-item i {
  color: var(--ems-green);
}
.ems-modal .modal-content {
  color: var(--ems-text);
  background: linear-gradient(180deg, var(--ems-panel-2), var(--ems-panel));
  border: 1px solid rgba(4, 169, 245, 0.18);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
}
.ems-modal .modal-header,
.ems-modal .modal-footer {
  border-color: var(--ems-ovl-08);
}
.ems-modal .modal-title {
  margin: 6px 0 0;
  color: var(--ems-text-strong);
  font-size: 18px;
  font-weight: 700;
}
.ems-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ems-ovl-08);
}
.ems-permission-panel {
  margin-top: 0;
}
.ems-icon-button:disabled,
.ems-table-icon:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}
.ems-permission-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.ems-permission-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--ems-muted);
  background: var(--ems-ovl-035);
  border: 1px solid var(--ems-ovl-06);
  border-radius: 8px;
}
.ems-permission-legend i {
  color: var(--ems-cyan);
}
.ems-permission-table {
  min-width: 1180px;
}
.ems-permission-table th,
.ems-permission-table td {
  text-align: center;
}
.ems-permission-table th:first-child,
.ems-permission-table th:nth-child(2),
.ems-permission-table td:first-child,
.ems-permission-table td:nth-child(2) {
  text-align: left;
}
.ems-permission-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 220px;
}
.ems-permission-item span {
  color: var(--ems-text);
  font-weight: 650;
}
.ems-permission-item small,
.ems-permission-parent {
  color: var(--ems-muted);
  font-size: 11px;
}
.ems-permission-item--level-1 {
  padding-left: 18px;
}
.ems-permission-item--level-2 {
  padding-left: 36px;
}
.ems-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.ems-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ems-switch span {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  background: var(--ems-ovl-10);
  border: 1px solid var(--ems-ovl-14);
  border-radius: 999px;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.ems-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: var(--ems-muted);
  border-radius: 50%;
  transition: transform 0.18s ease, background 0.18s ease;
}
.ems-switch input:checked + span {
  background: rgba(29, 233, 182, 0.18);
  border-color: rgba(29, 233, 182, 0.42);
}
.ems-switch input:checked + span::after {
  transform: translateX(14px);
  background: var(--ems-green);
}
.ems-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ems-pager__btn {
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ems-text-strong);
  background: var(--ems-ovl-04);
  border: 1px solid rgba(4, 169, 245, 0.22);
  transition: border-color 0.15s ease, opacity 0.15s ease;
}
.ems-pager__btn:hover:not(:disabled) {
  border-color: var(--ems-cyan);
}
.ems-pager__btn:disabled {
  opacity: 0.4;
  cursor: default;
}
@media (max-width: 991.98px) {
  .ems-page__header {
    align-items: flex-start;
    flex-direction: column;
  }
  .ems-admin-grid--roles,
  .ems-admin-grid--policy,
  .ems-form-grid,
  .ems-form-grid--dense,
  .ems-password-form {
    grid-template-columns: 1fr;
  }
}
/* ==================================================================== */
/*  EMS COMPONENT LAYER                                                 */
/*                                                                      */
/*  Instrument-panel language: dense, measured, hairline-ruled. Colour   */
/*  is never decorative -- green reads OK/export, cyan reads active/     */
/*  import, amber reads degraded, red reads fault. Anything that is not  */
/*  carrying a status stays neutral.                                     */
/*                                                                      */
/*  Everything below is written against the tokens at the top of this    */
/*  file, so the light theme follows automatically.                      */
/* ==================================================================== */
:root {
  --ems-accent: var(--da-primary);
  --ems-radius: 0px;
  --ems-radius-sm: 4px;
  --ems-hairline: rgba(0, 0, 0, 0.08);
  --ems-rule: rgba(0, 0, 0, 0.06);
  --ems-glow: rgba(4, 169, 245, 0.25);
  --ems-lift: 0 1px 20px 0 rgba(69, 90, 100, 0.08);
  --ems-mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Consolas, monospace;
  --ems-micro: 0.68rem;
}
html[data-ems-theme="dark"] {
  --ems-hairline: rgba(255, 255, 255, 0.12);
  --ems-rule: rgba(255, 255, 255, 0.08);
  --ems-lift: 0 1px 20px 0 rgba(0, 0, 0, 0.08);
}
/* Numbers are the product. Tabular figures stop columns dancing on every
   refresh and are the single biggest credibility win on a metering page. */
.ems-page,
.ems-page input,
.ems-page select,
.ems-page table {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv01" 1;
}
/* -------------------------------------------------------- page shell */
.ems-page {
  padding: 4px 2px 40px;
  color: var(--ems-text);
}
.ems-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ems-hairline);
}
.ems-page__header h1 {
  margin: 6px 0 0;
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ems-text-strong);
}
.ems-page__header > div > p {
  margin: 8px 0 0;
  max-width: 68ch;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ems-muted);
}
.ems-page__eyebrow {
  font-size: var(--ems-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ems-muted);
  opacity: 0.85;
}
.ems-page__status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  padding: 7px 14px;
  border: 1px solid var(--ems-border);
  border-radius: 999px;
  background: var(--ems-panel);
  font-size: var(--ems-micro);
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ems-text-strong);
  white-space: nowrap;
}
/* ------------------------------------------------------ status dot */
.ems-status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--ems-green);
  box-shadow: 0 0 0 3px rgba(29, 233, 182, 0.14);
}
/* A slow pulse says "this is live" without demanding attention. */
.ems-page__status .ems-status-dot { animation: ems-breathe 2.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .ems-page__status .ems-status-dot { animation: none; }
}
/* ---------------------------------------------------------- toolbar */
.ems-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.ems-toolbar input[type="date"],
.ems-toolbar input[type="text"] {
  padding: 6px 12px;
  border: 1px solid var(--ems-border);
  border-radius: var(--ems-radius-sm);
  background: var(--ems-panel);
  color: var(--ems-text);
  font-size: 0.82rem;
  font-family: var(--ems-mono);
}
.ems-toolbar .btn {
  border-radius: var(--ems-radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 14px;
}
.ems-toolbar .btn-outline-light {
  border-color: var(--ems-border);
  color: var(--ems-muted);
  background: transparent;
}
.ems-toolbar .btn-outline-light:hover {
  border-color: var(--ems-border-hot);
  color: var(--ems-text-strong);
  background: var(--ems-panel);
}
/* ------------------------------------------------------------- card */
.ems-page .card.ems-card,
.ems-page section.ems-card {
  position: relative;
  margin-bottom: 20px;
  border: 1px solid var(--ems-border);
  border-radius: var(--ems-radius);
  background: var(--ems-panel);
  box-shadow: var(--ems-lift);
  overflow: hidden;
}
.ems-page .ems-card::before { display: none; }
.ems-page .ems-card > .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ems-hairline);
  background: transparent;
}
.ems-page .ems-card > .card-header h5 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ems-text-strong);
}
.ems-page .ems-card > .card-header h5 i { color: var(--ems-accent); font-size: 0.95rem; }
/* The base theme paints .card-body solid black, which punches a hole in the
   card's own gradient. The card owns the surface; the body only owns padding. */
.ems-page .ems-card > .card-body {
  padding: 18px;
  background: transparent;
}
/* ------------------------------------------------------------ badge */
.ems-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--ems-border);
  border-radius: 4px;
  background: var(--ems-panel);
  font-size: var(--ems-micro);
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ems-muted);
  white-space: nowrap;
}
.ems-badge--muted { opacity: 0.62; }
/* ---------------------------------------------------------- callout */
.ems-callout {
  position: relative;
  margin-bottom: 20px;
  padding: 14px 18px 14px 20px;
  border: 1px solid var(--ems-border);
  border-left-width: 3px;
  border-radius: var(--ems-radius-sm);
  background: var(--ems-panel);
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--ems-text);
}
.ems-callout h4 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 7px;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--ems-text-strong);
}
.ems-callout p:last-child,
.ems-callout ul:last-child { margin-bottom: 0; }
.ems-callout ul { margin: 0; padding-left: 18px; }
.ems-callout li + li { margin-top: 4px; }
.ems-callout--warning { border-left-color: var(--ems-amber); }
.ems-callout--warning h4 i { color: var(--ems-amber); }
.ems-callout--info { border-left-color: var(--ems-cyan); }
.ems-callout--info h4 i { color: var(--ems-cyan); }
.ems-callout--danger { border-left-color: var(--ems-red); }
.ems-callout--danger h4 i { color: var(--ems-red); }
/* --------------------------------------------------------- key list */
.ems-kv-list { margin: 0; padding: 0; list-style: none; }
.ems-kv-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ems-rule);
  font-size: 0.82rem;
}
.ems-kv-list li:last-child { border-bottom: 0; }
.ems-kv-list li > span {
  color: var(--ems-muted);
  flex: 0 0 auto;
  white-space: nowrap;
}
.ems-kv-list li > strong {
  color: var(--ems-text-strong);
  font-weight: 600;
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
  /* Long endpoints and URLs break inside the value, never by splitting the
     label into two lines. */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ems-kv-list code {
  font-family: var(--ems-mono);
  font-size: 0.76rem;
  color: var(--ems-cyan);
  background: none;
  padding: 0;
}
/* ------------------------------------------------------------ table */
.ems-page table.ems-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ems-text);
  font-size: 0.82rem;
}
.ems-page table.ems-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--ems-border);
  background: var(--ems-panel);
  font-size: var(--ems-micro);
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ems-muted);
  white-space: nowrap;
}
.ems-page table.ems-table tbody td {
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--ems-rule);
  vertical-align: middle;
}
.ems-page table.ems-table tbody tr:hover td { background: rgba(255, 255, 255, 0.022); }
.ems-page table.ems-table tbody tr:last-child td { border-bottom: 0; }
.ems-page table.ems-table code {
  font-family: var(--ems-mono);
  font-size: 0.76rem;
  color: var(--ems-cyan);
  background: none;
  padding: 0;
}
.ems-table--compact tbody td,
.ems-table--compact thead th { padding: 6px 10px; font-size: 0.78rem; }
/* ------------------------------------------------------------- text */
.ems-hint {
  margin: 0 0 14px;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--ems-muted);
}
.ems-hint:last-child { margin-bottom: 0; }
.ems-hint code {
  font-family: var(--ems-mono);
  font-size: 0.74rem;
  color: var(--ems-cyan);
  background: rgba(4, 169, 245, 0.07);
  padding: 1px 5px;
  border-radius: 3px;
}
.ems-empty {
  margin: 0;
  padding: 26px 18px;
  border: 1px dashed var(--ems-border);
  border-radius: var(--ems-radius-sm);
  text-align: center;
  font-size: 0.84rem;
  color: var(--ems-muted);
}
/* ------------------------------------------------------------- form */
.ems-field { margin-bottom: 16px; }
.ems-field > label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--ems-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ems-muted);
}
.ems-field input[type="text"],
.ems-field input[type="number"],
.ems-field input[type="date"],
.ems-field input[type="time"],
.ems-field select,
.ems-field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--ems-border);
  border-radius: var(--ems-radius-sm);
  background: var(--ems-bg);
  color: var(--ems-text-strong);
  font-size: 0.84rem;
  font-family: var(--ems-mono);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.ems-field input:focus,
.ems-field select:focus,
.ems-field textarea:focus {
  outline: none;
  border-color: var(--ems-border-hot);
  box-shadow: 0 0 0 3px var(--ems-glow);
}
.ems-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ems-green);
  vertical-align: middle;
}
.ems-field__error {
  display: block;
  margin-top: 5px;
  font-size: 0.73rem;
  color: var(--ems-red);
}
.ems-form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 28px;
}
.ems-form-actions .btn-primary {
  padding: 9px 20px;
  border: 0;
  border-radius: var(--ems-radius-sm);
  background: var(--da-primary);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: #fff;
}
.ems-form-actions .btn-primary:hover { filter: brightness(1.08); }
.ems-message-stack { display: grid; gap: 10px; margin-bottom: 20px; }
.ems-message {
  padding: 11px 16px;
  border: 1px solid var(--ems-border);
  border-left: 3px solid var(--ems-cyan);
  border-radius: var(--ems-radius-sm);
  background: var(--ems-panel);
  font-size: 0.84rem;
}
.ems-message--success { border-left-color: var(--ems-green); }
.ems-message--error { border-left-color: var(--ems-red); }
.ems-message--warning { border-left-color: var(--ems-amber); }
/* ---------------------------------------------------------- charts */
/* Apex injects its own surface; keep it transparent so the card shows through. */
.ems-page .apexcharts-canvas,
.ems-page .apexcharts-svg { background: transparent !important; }
.ems-page .apexcharts-tooltip {
  border: 1px solid var(--ems-border) !important;
  background: var(--ems-panel) !important;
  color: var(--ems-text) !important;          /* the box is always the panel colour, so the text follows it */
  box-shadow: var(--ems-lift) !important;
  font-family: inherit !important;
}
.ems-page .apexcharts-tooltip-title,
.ems-page .apexcharts-tooltip-text,
.ems-page .apexcharts-tooltip-text-y-value,
.ems-page .apexcharts-tooltip-text-y-label { color: var(--ems-text) !important; }
.ems-page .apexcharts-tooltip-title {
  border-bottom: 1px solid var(--ems-hairline) !important;
  background: transparent !important;
  font-weight: 650 !important;
}
.ems-page .apexcharts-menu {
  border: 1px solid var(--ems-border) !important;
  background: var(--ems-panel) !important;
}
/* ------------------------------------------------------ responsive */
@media (max-width: 991px) {
  .ems-page__header { flex-direction: column; gap: 14px; }
  .ems-page__header h1 { font-size: 1.35rem; }
  .ems-toolbar { gap: 8px; }
}
/* ------------------------------------------------- collapsible card */
.ems-card--collapsible > .card-header {
  cursor: pointer;
  user-select: none;
  transition: background 0.14s ease;
}
.ems-card--collapsible > .card-header:hover { background: rgba(255, 255, 255, 0.02); }
.ems-card--collapsible > .card-header:focus-visible {
  outline: 2px solid var(--ems-border-hot);
  outline-offset: -2px;
}
.ems-collapse-caret {
  margin-left: auto;
  font-size: 1rem;
  color: var(--ems-muted);
  transition: transform 0.18s ease;
}
.ems-card--collapsible.is-collapsed .ems-collapse-caret { transform: rotate(180deg); }
.ems-card--collapsible.is-collapsed > .card-body { display: none; }
.ems-card--collapsible.is-collapsed > .card-header { border-bottom: 0; }
@media (prefers-reduced-motion: reduce) {
  .ems-collapse-caret { transition: none; }
}
/* ---------------------------------------------------------- table pager */
.ems-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ems-rule);
}
.ems-pager__count {
  font-size: 0.76rem;
  color: var(--ems-muted);
  font-variant-numeric: tabular-nums;
}
.ems-pager--single { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--ems-rule); }
.ems-pager__controls { display: inline-flex; align-items: center; gap: 6px; }
.ems-pager__btn {
  display: inline-flex;
  align-items: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  justify-content: center;
  border: 1px solid var(--ems-border);
  border-radius: var(--ems-radius-sm);
  background: var(--ems-panel);
  color: var(--ems-text);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .14s ease, color .14s ease;
}
.ems-pager__btn:hover { border-color: var(--ems-border-hot); color: var(--ems-text-strong); }
/* Disabled controls stay in place so the row does not reflow at the ends. */
.ems-pager__btn.is-disabled { opacity: .35; pointer-events: none; }
.ems-pager__page {
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ems-text-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* ==================================================================== */
/*  Brand finish                                                        */
/* ==================================================================== */
/* The page header rule carries a short gold lead-in, so the brand reads at
   the top of every screen without a second logo. */
.ems-page__header {
  position: relative;
}
.ems-page__header::after { display: none; }
.ems-page__eyebrow {
  color: var(--ems-gold-bright);
  opacity: 0.95;
}
.ems-page__status {
  border-color: var(--ems-border);
  background: var(--ems-panel);
}
.ems-page .ems-card > .card-header {
  background: transparent;
}
.ems-page .ems-card > .card-header h5 i {
  color: var(--ems-gold-bright);
}
.ems-page table.ems-table thead th {
  background: var(--ems-surf-3);
  border-bottom-color: var(--ems-border);
}
.ems-form-actions .btn-primary,
.ems-toolbar .btn-primary {
  background: var(--da-primary);
  color: #fff;
  border: 1px solid var(--da-primary);
}
.ems-form-actions .btn-primary:hover,
.ems-toolbar .btn-primary:hover {
  background: var(--da-primary-dark);
  border-color: var(--da-primary-dark);
  filter: none;
}
.ems-pager__btn:hover {
  border-color: rgba(4, 169, 245, 0.5);
  color: var(--ems-gold-bright);
}
/* Focus is gold everywhere, so keyboard users get one consistent signal. */
.ems-field input:focus,
.ems-field select:focus,
.ems-field textarea:focus,
.ems-toolbar input:focus {
  border-color: var(--ems-gold);
  box-shadow: 0 0 0 3px var(--ems-glow);
  outline: none;
}
.pcoded-header,
.pcoded-header.navbar-expand-lg {
  background: var(--ems-surf-1) !important;
  border-bottom: none !important;
  box-shadow: 0 1px 20px 0 rgba(69, 90, 100, 0.08);
}
.pcoded-header .navbar-nav > li > a,
.pcoded-header a {
  color: var(--ems-text) !important;
}
.pcoded-header a:hover { color: var(--da-primary) !important; }
.ems-page code,
.ems-page kbd {
  color: var(--da-primary);
  background: rgba(4, 169, 245, 0.08);
  border: 1px solid rgba(4, 169, 245, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.86em;
}
.ems-page a {
  color: var(--da-primary);
}
.ems-page a:hover { color: var(--da-primary-dark); }
/* Links that are already buttons or nav keep their own colour. */
.ems-page a.btn,
.ems-page a.ems-pager__btn { color: inherit; }
/* ==================================================================== */
/*  Sign-in                                                             */
/* ==================================================================== */
/*  Stock Datta Able auth page; the card is white with the usual shadow.   */
.ems-auth > .auth-content > .card {
  background: #fff !important;
  border: none;
  border-radius: 5px;
  box-shadow: 0 1px 20px 0 rgba(69, 90, 100, 0.08);
  overflow: hidden;
  position: relative;
}
.ems-auth__brand { margin-bottom: 18px; }
.ems-auth__brand img {
  display: block;
  margin: 0 auto;
  height: 64px;
  width: auto;
  max-width: 200px;
  max-height: 64px;
  object-fit: contain;
}
.ems-auth__title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 600;
  color: #111;
}
.ems-auth__sub {
  margin: 4px 0 26px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
}
.ems-auth .btn-primary {
  width: 100%;
  padding: 11px 18px;
  font-weight: 600;
}
.ems-auth .text-danger { font-size: 0.82rem; }
/* ==================================================================== */
/*  Sidebar: contrast and hierarchy                                     */
/* ==================================================================== */
/*  Two problems fixed here.                                            */
/*                                                                      */
/*  1. Labels were the pale sage #a9b7d0 -- a decorative tint borrowed  */
/*     as a reading colour. Against the deep green rail it measured     */
/*     5.5:1, which passes AA but reads washed out at 13px. The menu is */
/*     the one surface a user scans dozens of times a session, so it    */
/*     takes the off-white (11:1) and a slightly heavier weight.        */
/*                                                                      */
/*  2. The indent step was 8px. A top-level row's text started at 52px  */
/*     (icon + padding) and its children at 60px, so the hierarchy was  */
/*     effectively invisible -- a submenu looked like a sibling. The    */
/*     steps below are 22px with a guide rail, which is the smallest    */
/*     step that still reads as nesting at this type size.              */
.pcoded-navbar .pcoded-inner-navbar li > a {
  color: var(--ems-menu-text) !important;
  font-weight: 500;
}
.pcoded-navbar .pcoded-inner-navbar > li.pcoded-menu-caption > label {
  opacity: 1;
}
/* Level 2 -------------------------------------------------------------- */
.pcoded-navbar .pcoded-inner-navbar .pcoded-submenu > li > a {
  position: relative;
  padding-left: 74px !important;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.86) !important;
}
/* A short tick at the start of each child, aligned to the guide rail, so
   the eye has something to follow down the group rather than relying on
   white space alone. */
.pcoded-navbar .pcoded-inner-navbar .pcoded-submenu > li > a::after {
  content: "";
  position: absolute;
  left: 52px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(4, 169, 245, 0.38);
}
/* Level 3 -------------------------------------------------------------- */
.pcoded-navbar .pcoded-inner-navbar .pcoded-submenu .pcoded-submenu > li > a {
  padding-left: 96px !important;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.72) !important;
}
.pcoded-navbar .pcoded-inner-navbar .pcoded-submenu .pcoded-submenu > li > a::after {
  left: 74px;
}
/* The guide rail runs the height of an open group, replacing the flat
   inset shadow the submenu had before. */
.pcoded-navbar .pcoded-submenu {
  position: relative;
  box-shadow: none;
}
.pcoded-navbar .pcoded-submenu::before { display: none; }
.pcoded-navbar .pcoded-submenu .pcoded-submenu::before { left: 73px; }
.pcoded-navbar .pcoded-inner-navbar .pcoded-submenu > li > a:hover {
  color: var(--brand-off-white) !important;
}
.pcoded-navbar .pcoded-submenu li.active > a {
  color: var(--da-menu-active) !important;
  font-weight: 600;
}
.pcoded-navbar .pcoded-submenu li.active > a::after { display: none; }
/* The stock theme also draws a 5px dot at x=35 on every submenu row. With the
   guide rail and tick above, that is a third marker for the same thing and it
   sits outside the rail, which breaks the alignment the rail establishes. */
.pcoded-navbar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li > a:before {
  display: inline-block;
}
/* ==================================================================== */
/*  Footer build stamp + release notes                                  */
/* ==================================================================== */
.ems-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding: 14px 2px 6px;
  border-top: 1px solid var(--ems-rule);
  font-size: 0.74rem;
  color: var(--ems-muted);
}
.ems-footer__org { opacity: 0.7; }
.ems-footer__version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--ems-border);
  border-radius: 999px;
  background: var(--ems-panel);
  color: var(--ems-muted) !important;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.ems-footer__version:hover {
  color: var(--ems-gold-bright) !important;
  border-color: rgba(4, 169, 245, 0.5);
}
.ems-footer__version i { font-size: 12px; }
/* --- release notes ---------------------------------------------------- */
.ems-releases {
  position: relative;
  margin: 8px 0 0;
  padding: 0 0 0 26px;
  list-style: none;
}
/* One spine down the whole list: releases read as a sequence, and the spine
   is what makes "newest first" obvious without a label on every row. */
.ems-releases::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--ems-border);
}
.ems-release {
  position: relative;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--ems-border);
  border-radius: 4px;
  background: var(--ems-panel);
}
.ems-release--current {
  border-color: rgba(4, 169, 245, 0.38);
  background: rgba(4, 169, 245, 0.06);
}
.ems-release__marker {
  position: absolute;
  left: -26px;
  top: 22px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--ems-panel);
  background: var(--ems-border-hot);
}
.ems-release--current .ems-release__marker {
  background: var(--ems-gold-bright);
  box-shadow: 0 0 10px rgba(4, 169, 245, 0.55);
}
.ems-release__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.ems-release__version {
  font-family: var(--ems-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--ems-gold-bright);
  letter-spacing: 0.02em;
}
.ems-release__date {
  margin-left: auto;
  font-size: 0.74rem;
  color: var(--ems-muted);
}
.ems-release__title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ems-text-strong);
}
.ems-release__notes {
  margin: 0;
  padding-left: 18px;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--ems-text);
}
.ems-release__notes li { margin-bottom: 3px; }
.ems-release__notes li::marker { color: var(--ems-border-hot); }
.ems-prose p { font-size: 0.84rem; line-height: 1.6; color: var(--ems-text); }
.ems-prose p:last-child { margin-bottom: 0; }
/* Account menu under the gear: who you are, as what, then the actions. */
.ems-account-menu .pro-head { display: flex; align-items: center; gap: 10px; }
.ems-account-menu__who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ems-account-menu__who strong { color: var(--brand-off-white); font-weight: 600; }
.ems-account-menu__who small { color: var(--ems-muted); font-size: 0.72rem; }
.ems-account-menu .pro-body .dropdown-item i { width: 18px; margin-right: 6px; color: var(--brand-light-gold); }
.ems-password-page .ems-field input { width: 100%; }
/* Header dropdowns (gear, language): dark.css paints every .dropdown-item
   #adb7be with !important, a pale grey that reads as disabled on the deep
   green menu. Override at higher specificity, also with !important, with
   the brand's text colour, and give the menu the brand surfaces. */
.pcoded-header .dropdown .profile-notification {
  background: var(--brand-deep-green) !important;
  border: 1px solid var(--brand-forest);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.pcoded-header .dropdown .profile-notification .pro-head {
  background: var(--brand-forest) !important;
  color: var(--brand-off-white) !important;
}
.pcoded-header .dropdown .profile-notification .pro-head .dud-logout { color: var(--brand-off-white) !important; }
.pcoded-header .dropdown .profile-notification .pro-body li a,
.pcoded-header .dropdown .profile-notification .pro-body .dropdown-item,
.pcoded-header .dropdown .profile-notification .dropdown-item {
  color: var(--brand-off-white) !important;
  font-weight: 500;
  opacity: 1;
}
.pcoded-header .dropdown .profile-notification .pro-body li a:hover,
.pcoded-header .dropdown .profile-notification .pro-body li:hover > a,
.pcoded-header .dropdown .profile-notification .dropdown-item:hover,
.pcoded-header .dropdown .profile-notification .dropdown-item:focus {
  color: var(--brand-off-white) !important;
  background: rgba(4, 169, 245, 0.16) !important;      /* gold tint */
}
.pcoded-header .dropdown .profile-notification .pro-body li a i,
.pcoded-header .dropdown .profile-notification .dropdown-item i { color: var(--brand-light-gold) !important; }
.pcoded-header .dropdown.drp-user.show:before { color: var(--brand-forest) !important; }
/* Sign-in image captcha: input and image side by side; the image is a
   button because clicking it is how you get a new one. */
.ems-captcha { display: flex; gap: 10px; align-items: stretch; }
.ems-captcha .ems-captcha__input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }
.ems-captcha__img {
  flex: 0 0 auto; padding: 0; border: 1px solid var(--brand-forest); border-radius: 8px;
  background: #373a3c; overflow: hidden; cursor: pointer; line-height: 0;
}
.ems-captcha__img img { display: block; width: 150px; height: 49px; }
.ems-captcha__img:hover { border-color: var(--brand-light-gold); }
.ems-captcha__img:focus-visible { outline: 2px solid var(--brand-light-gold); outline-offset: 2px; }
/* ==================================================================== */
/*  Datta Able retheme (2026-10-20): outline-light buttons sit on white  */
/*  cards now, so they take a neutral grey outline instead of white.     */
/* ==================================================================== */
.pcoded-content .btn-outline-light,
.ems-page .btn-outline-light {
  color: var(--ems-text);
  border-color: var(--ems-border);
  background: var(--ems-panel);
}
.pcoded-content .btn-outline-light:hover,
.ems-page .btn-outline-light:hover,
.pcoded-content .btn-outline-light:focus,
.ems-page .btn-outline-light:focus {
  color: var(--ems-text-strong);
  background: var(--ems-surf-3);
  border-color: var(--ems-border);
}
.pcoded-content .btn-outline-light.disabled,
.pcoded-content .btn-outline-light:disabled {
  color: var(--ems-muted);
  background: var(--ems-panel);
}
/* ==================================================================== */
/*  Sign-in: live energy-network background (static/assets/js/ems-auth-fx.js) */
/* ==================================================================== */
.ems-auth--fx { background: #03060c; }
.ems-auth__fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
.ems-auth--fx > .auth-content { position: relative; z-index: 2; }
@property --ems-auth-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
/* Rotating light around the card. */
.ems-auth--fx > .auth-content::before {
  content: "";
  position: absolute;
  inset: 12px;               /* .auth-content has 15px padding; 3px of light shows round the card */
  border-radius: 8px;
  background: conic-gradient(from var(--ems-auth-angle),
    rgba(29, 196, 233, 0) 0deg, rgba(29, 196, 233, 0.95) 50deg, rgba(4, 169, 245, 0) 110deg,
    rgba(4, 169, 245, 0) 180deg, rgba(244, 194, 43, 0.85) 230deg, rgba(244, 194, 43, 0) 290deg);
  animation: ems-auth-spin 6s linear infinite;
  z-index: -1;
  filter: drop-shadow(0 0 12px rgba(29, 196, 233, 0.45));
}
.ems-auth--fx > .auth-content > .card {
  background: rgba(8, 17, 31, 0.86) !important;   /* dark glass over the network */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(4, 169, 245, 0.18);
  margin-bottom: 0;
}
.ems-auth--fx .ems-auth__title { color: #e8f4ff; letter-spacing: 0.02em; }
.ems-auth--fx .ems-auth__sub { color: rgba(169, 199, 230, 0.75); }
.ems-auth--fx label.text-muted { color: rgba(169, 199, 230, 0.8) !important; }
.ems-auth--fx .form-control {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(29, 196, 233, 0.28) !important;
  color: #e8f4ff !important;
}
.ems-auth--fx .form-control::placeholder { color: rgba(169, 199, 230, 0.55); }
.ems-auth--fx .form-control:focus {
  border-color: #1dc4e9 !important;
  box-shadow: 0 0 0 3px rgba(29, 196, 233, 0.18), 0 0 18px rgba(29, 196, 233, 0.25) !important;
}
.ems-auth--fx .form-control:-webkit-autofill {
  -webkit-text-fill-color: #e8f4ff;
  -webkit-box-shadow: 0 0 0 1000px #0c1a2e inset;
}
.ems-auth--fx .btn-primary {
  background: linear-gradient(90deg, #04a9f5, #1dc4e9);
  border: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 22px rgba(4, 169, 245, 0.35);
}
.ems-auth--fx .btn-primary:hover { filter: brightness(1.08); }
.ems-auth__hud {
  position: fixed;
  z-index: 1;
  font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(214, 240, 255, 0.85);
  text-shadow: 0 0 8px rgba(29, 196, 233, 0.6);
  pointer-events: none;
  white-space: nowrap;
}
.ems-auth__hud--tl { top: 22px; left: 26px; }
.ems-auth__hud--br { bottom: 20px; right: 26px; }
.ems-auth__dim { color: rgba(169, 183, 208, 0.6); text-shadow: none; }
.ems-auth__pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #1de9b6;
  box-shadow: 0 0 0 0 rgba(29, 233, 182, 0.7);
  animation: ems-auth-pulse 1.8s ease-out infinite;
  vertical-align: 1px;
}
@media (max-width: 575px) {
  .ems-auth__hud--tl .ems-auth__dim { display: none; }
  .ems-auth__hud { font-size: 0.64rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ems-auth--fx > .auth-content::before,
  .ems-auth__pulse { animation: none; }
}
/* ==================================================================== */
/*  Mobile / tablet header toggles (< 992px)                            */
/* ==================================================================== */
/*  The template draws the hamburger bars in #fff for its dark header.     */
/*  On the light Datta header they were white on white: invisible on        */
/*  phones and iPads. Follow the text colour instead (dark in light mode,   */
/*  light in dark mode). The sidebar's own toggle keeps its colour.         */
.pcoded-header .mobile-menu span,
.pcoded-header .mobile-menu span::before,
.pcoded-header .mobile-menu span::after {
  background-color: var(--ems-text) !important;
}
/* Open state: the middle bar disappears so the two others form an X. */
.pcoded-header .mobile-menu.on span { background-color: transparent !important; }
.pcoded-header .mobile-menu,
.pcoded-header .mobile-menu i { color: var(--ems-text) !important; }
/* ==================================================================== */
/*  Data Completeness (/ems/monitoring/data-completeness/)             */
/* ==================================================================== */
/*  One fixed categorical slot per feed, validated with the dataviz      */
/*  palette check: light against #fff, dark against #323437.            */
:root {
  --dc-grid: #2a78d6; --dc-load: #eb6834; --dc-bess: #1baf7a; --dc-chp: #eda100; --dc-solar: #e87ba4;
}
html[data-ems-theme="dark"] {
  --dc-grid: #3987e5; --dc-load: #d95926; --dc-bess: #199e70; --dc-chp: #c98500; --dc-solar: #d55181;
}
/* View-only accounts (2026-11-05): a quiet notice, and POST forms greyed out. */
.ems-readonly-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px; padding: 10px 14px;
  background: var(--ems-panel, #fff); color: var(--ems-text, #373a3c);
  border-left: 3px solid var(--da-primary, #04a9f5);
  box-shadow: 0 1px 20px rgba(69, 90, 100, .08); font-size: 13px;
}
.ems-readonly-banner .feather { color: var(--da-primary, #04a9f5); font-size: 16px; }
form.ems-is-readonly button:disabled,
form.ems-is-readonly .btn:disabled { cursor: not-allowed; opacity: .45; }

@keyframes ems-auth-pulse {
  0% { box-shadow: 0 0 0 0 rgba(29, 233, 182, 0.7); }
  100% { box-shadow: 0 0 0 10px rgba(29, 233, 182, 0); }
}

@keyframes ems-auth-spin { to { --ems-auth-angle: 360deg; } }

@keyframes ems-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* ==================================================================== */
/*  JANAF additions                                                     */
/* ==================================================================== */
/* A value the EMS does not have: "no data", "To be provided", "never".
   Muted so it never reads like a measured figure. */
.ems-text-muted { color: var(--ems-muted) !important; font-weight: 500; }

.ems-subhead {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ems-muted);
}

.ems-card > .card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Sign-in: horizontal logo. Its lettering is black, so on a dark surface the
   white-lettered copy is shown instead; only one of the two is ever visible.
   The animated sign-in card is dark in both themes. */
.ems-auth__wordmark { margin: 4px auto 18px; }
.ems-auth__wordmark img { display: block; width: 100%; max-width: 240px; height: auto; margin: 0 auto; }
.ems-auth__wordmark--dark { display: none !important; }
html[data-ems-theme="dark"] .ems-auth__wordmark--light:not(:only-child),
.ems-auth--fx .ems-auth__wordmark--light:not(:only-child) { display: none !important; }
html[data-ems-theme="dark"] .ems-auth__wordmark--dark,
.ems-auth--fx .ems-auth__wordmark--dark { display: block !important; }

/* Tables inside cards scroll sideways rather than spill past the card edge. */
.ems-card .table-responsive { margin: 0; }
.ems-page table.ems-table tbody td.ems-cell-wrap { white-space: normal; min-width: 160px; }
/* .ems-table carries a 760px floor for wide data tables; a compact table sits
   in a half-width column and must fit it instead. */
.ems-table.ems-table--compact { min-width: 0; }
/* The switch's hidden checkbox is absolutely positioned; without a positioned
   scroll container it escapes the clip and widens the whole page. */
.ems-table-wrap { position: relative; }
/* .ems-field inputs are monospaced for figures; names and contact details
   read better in the body font. */
.ems-field input.ems-input--prose { font-family: inherit; }

/* --- from CHIMERA: status badges, scrolling table, chart surface --- */
.ems-badge--active {
  border-color: rgba(29, 233, 182, 0.38);
  background: rgba(29, 233, 182, 0.10);
  color: var(--ems-green);
}

.ems-badge--info {
  border-color: rgba(4, 169, 245, 0.38);
  background: rgba(4, 169, 245, 0.10);
  color: var(--ems-cyan);
}

.ems-badge--warning {
  border-color: rgba(244, 194, 43, 0.55);
  background: rgba(244, 194, 43, 0.14);
  color: var(--ems-amber);
}

.ems-scroll-y { max-height: 520px; overflow-y: auto; }

.ems-scroll-y::-webkit-scrollbar { width: 9px; height: 9px; }
.ems-scroll-y::-webkit-scrollbar-track { background: transparent; }
.ems-scroll-y::-webkit-scrollbar-thumb {
  background: var(--ems-border);
  border-radius: 5px;
}
.ems-scroll-y::-webkit-scrollbar-thumb:hover { background: var(--ems-border-hot); }
/* Status lives in the badge's tint and border; its words stay in text ink,
   because the status hues (#1de9b6 especially) are unreadable as text on white. */
.ems-badge--active, .ems-badge--info, .ems-badge--warning { color: var(--ems-text-strong); }
.ems-text-warning { color: var(--ems-amber); }

/* Market Data */
.ems-market-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.ems-market-toolbar__date { display: flex; gap: 6px; align-items: center; }
.ems-market-toolbar__date input { width: auto; }
.ems-market-toolbar__pull { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.ems-chart { min-height: 300px; }
.ems-market-table > summary { cursor: pointer; list-style: none; }
.ems-market-table > summary::-webkit-details-marker { display: none; }
.ems-market-table > summary h5::after { content: " \25BE"; color: var(--ems-muted); }
.ems-market-table:not([open]) > summary { border-bottom: 0; }
@media (max-width: 575px) { .ems-market-toolbar__pull { margin-left: 0; } }

/* --- from CHIMERA: row states --- */
.ems-table .ems-row-highlight > td { background: rgba(4, 169, 245, 0.06); }
.ems-table .ems-row-muted > td { opacity: 0.6; }

/* Plan / Ancillary Capacity */
.ems-site-tabs { margin-bottom: 18px; gap: 6px; }
.ems-site-tabs .nav-link { border: 1px solid var(--ems-border); color: var(--ems-text); }
.ems-site-tabs .nav-link.active { background: var(--da-primary); border-color: var(--da-primary); color: #fff; }
.ems-chart--small { min-height: 220px; }
.ems-plan-legend { margin-left: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ems-muted); }
.ems-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: middle; }
.ems-swatch--discharge { background: var(--ems-chart-sell); }
.ems-swatch--charge { background: var(--ems-chart-charge); }
.ems-inline-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.ems-inline-upload input[type="file"] { width: auto; flex: 1 1 220px; }
.ems-send-form { margin-top: 12px; }
.ems-product + .ems-product { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--ems-border); }
.ems-limits-form { margin-top: 18px; }
.ems-limits-form > summary { cursor: pointer; }
.ems-limits-form .ems-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.ems-limits-form input, .ems-limits-form select { font-family: inherit; }
/* The template paints .nav-pills as a white card; the site switch is a control, not a card. */
.ems-page .nav-pills.ems-site-tabs { background: transparent; box-shadow: none; padding: 0; }
.ems-swatch--forecast { background: var(--ems-amber); }
.ems-swatch--actual { background: var(--ems-green); }
/* Alarm severity: icon + word + tint, never colour alone. */
.ems-sev { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-weight: 600;
           border: 1px solid var(--ems-border); color: var(--ems-text-strong); white-space: nowrap; }
.ems-sev--info { background: rgba(4, 169, 245, 0.10); }
.ems-sev--warning { background: rgba(244, 194, 43, 0.18); border-color: rgba(244, 194, 43, 0.55); }
.ems-sev--critical, .ems-sev--emergency { background: rgba(244, 66, 54, 0.14); border-color: rgba(244, 66, 54, 0.5); }
.ems-sev i { font-size: 13px; }
.ems-field textarea { font-family: inherit !important; }

/* Data Completeness lanes: one cell per quarter hour. Missing cells are hatched,
   so arrived/missing does not rest on colour alone. */
.ems-lanes { display: flex; flex-direction: column; gap: 8px; }
.ems-lane { display: grid; grid-template-columns: 170px 1fr 70px; gap: 12px; align-items: center; }
.ems-lane__cells { display: grid; grid-template-columns: repeat(var(--cells), 1fr); gap: 1px; min-height: 22px; }
.ems-lane__cells--off { display: flex; align-items: center; color: var(--ems-muted); font-size: 0.8rem;
                        border: 1px dashed var(--ems-border); border-radius: 4px; padding: 0 10px; }
.ems-lane__pct { text-align: right; font-variant-numeric: tabular-nums; }
.ems-cell { display: block; height: 22px; border-radius: 1px;
            background: repeating-linear-gradient(135deg, var(--ems-ovl-10) 0 2px, transparent 2px 5px);
            border: 1px solid var(--ems-border); }
.ems-cell--ok { background: var(--ems-green); border-color: var(--ems-green); }
.ems-cell--legend { display: inline-block; width: 12px; height: 12px; vertical-align: middle; margin: 0 4px 0 10px; }
.ems-lane--axis .ems-lane__cells { min-height: 0; }
.ems-axis-tick { font-size: 0.68rem; color: var(--ems-muted); white-space: nowrap; overflow: visible; }
@media (max-width: 767px) {
  .ems-lane { grid-template-columns: 1fr 60px; }
  .ems-lane__name { grid-column: 1 / -1; }
}

/* Power flow: lines carry state, never colour alone (dashed = no data, thin = idle). */
.ems-flow { width: 100%; height: auto; max-height: 420px; }
.ems-flow__bus { stroke: var(--ems-text-strong); stroke-width: 4; }
.ems-flow__line { stroke-width: 3; }
.ems-flow__line--out, .ems-flow__line--in { stroke: var(--da-primary); }
.ems-flow__line--idle { stroke: var(--ems-muted); stroke-width: 2; }
.ems-flow__line--none { stroke: var(--ems-muted); stroke-width: 2; stroke-dasharray: 6 5; }
.ems-flow__arrow { fill: var(--da-primary); }
.ems-flow__node { fill: var(--ems-panel); stroke: var(--ems-border); stroke-width: 1.5; }
.ems-flow__name { fill: var(--ems-text-strong); font-weight: 600; font-size: 14px; }
.ems-flow__value { fill: var(--ems-text); font-size: 13px; font-variant-numeric: tabular-nums; }
.ems-flow__caption { fill: var(--ems-muted); font-size: 12px; }

/* Control arming band: the loudest thing on SCADA when armed. */
.ems-arming { margin-top: 16px; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--ems-border); }
.ems-arming__head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ems-arming--armed { border-color: rgba(244, 194, 43, 0.8); background: rgba(244, 194, 43, 0.14); }
.ems-arming--disarmed { background: var(--ems-ovl-03); }
.ems-arming--locked { background: var(--ems-ovl-03); border-style: dashed; }
.ems-arming__form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
@media (max-width: 767px) { .ems-arming__form { grid-template-columns: 1fr; } }

/* Price heatmap: one sequential hue, light -> dark = cheap -> dear. Negative
   prices sit outside the scale (amber, hatched) because they mean something
   different (paid to consume), not "very cheap". Dark mode has its own steps. */
:root {
  --hm-1: #e7f3fc; --hm-2: #c3e2f8; --hm-3: #96cbf2; --hm-4: #62afe8; --hm-5: #3590d6; --hm-6: #1a6fb3; --hm-7: #0d4f85;
}
html[data-ems-theme="dark"] {
  --hm-1: #10273a; --hm-2: #143a57; --hm-3: #1a5079; --hm-4: #22699d; --hm-5: #3486c0; --hm-6: #5ea6d8; --hm-7: #9ccbee;
}
.ems-hm { display: flex; flex-direction: column; gap: 1px; overflow-x: auto; }
.ems-hm__row { display: grid; grid-template-columns: 92px minmax(480px, 1fr) 46px 52px; gap: 8px; align-items: center; }
.ems-hm__cells { display: grid; grid-template-columns: repeat(96, 1fr); gap: 0; }
.ems-hm__axis .ems-hm__cells { grid-template-columns: repeat(24, 1fr); }
.ems-hm__day { font-size: 0.74rem; color: var(--ems-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ems-hm__hour, .ems-hm__stat { font-size: 0.68rem; color: var(--ems-muted); text-align: right; font-variant-numeric: tabular-nums; }
.ems-hm__axis .ems-hm__hour { text-align: left; }
.hm-cell { display: block; height: 14px; }
.ems-hm-legend .hm-cell { display: inline-block; width: 12px; height: 12px; vertical-align: middle; margin-right: 3px; border-radius: 2px; }
.ems-hm-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.7rem; color: var(--ems-muted); font-weight: 400;
                 text-transform: none; letter-spacing: 0; }
.hm-1 { background: var(--hm-1); } .hm-2 { background: var(--hm-2); } .hm-3 { background: var(--hm-3); }
.hm-4 { background: var(--hm-4); } .hm-5 { background: var(--hm-5); } .hm-6 { background: var(--hm-6); }
.hm-7 { background: var(--hm-7); }
.hm-neg { background: repeating-linear-gradient(135deg, var(--ems-amber) 0 3px, rgba(244, 194, 43, 0.45) 3px 6px); }
.hm-gap { background: repeating-linear-gradient(135deg, var(--ems-ovl-10) 0 2px, transparent 2px 5px); }
.hm-none { background: transparent; }

/* Overview */
.ems-overview__clock { text-align: right; font-variant-numeric: tabular-nums; }
.ems-overview__clock span { display: block; font-size: 2rem; font-weight: 600; color: var(--ems-text-strong); letter-spacing: 0.02em; }
.ems-overview__clock small { color: var(--ems-muted); }
.ems-kpi .ems-stat__label i { color: var(--da-primary); margin-right: 4px; }
.ems-kpi .ems-stat__value { font-size: 2rem; font-weight: 600; color: var(--ems-text-strong); line-height: 1.2; }
.ems-kpi .ems-stat__value .ems-stat__unit { font-size: 0.8rem; font-weight: 400; }
.ems-kpi__sub { font-size: 0.76rem; color: var(--ems-muted); }
.ems-kpi--alert { box-shadow: inset 4px 0 0 var(--ems-amber); }
.ems-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ems-chips--wrap { justify-content: flex-start; }
.ems-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem;
            border: 1px solid var(--ems-border); color: var(--ems-muted); white-space: nowrap; }
.ems-chip--ok { color: var(--ems-text-strong); border-color: rgba(29, 233, 182, 0.6); background: rgba(29, 233, 182, 0.10); }
.ems-chip--warn { color: var(--ems-text-strong); border-color: rgba(244, 194, 43, 0.7); background: rgba(244, 194, 43, 0.14); }
.ems-site-card__grid { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; }
.ems-soc { text-align: center; }
.ems-soc__ring { --soc: 0; width: 104px; height: 104px; border-radius: 50%; margin: 0 auto 4px; display: grid; place-items: center;
                 background: conic-gradient(var(--ems-green) calc(var(--soc) * 1%), var(--ems-ovl-10) 0); }
.ems-soc__ring span { width: 82px; height: 82px; border-radius: 50%; background: var(--ems-panel); display: grid; place-items: center;
                      font-size: 1.4rem; font-weight: 600; color: var(--ems-text-strong); }
.ems-soc__ring small { font-size: 0.7rem; }
.ems-spark { min-height: 70px; margin-top: 8px; }
.ems-swatch--today { background: var(--ems-chart-grey); }
.ems-swatch--tomorrow { background: var(--ems-cyan); }
@media (max-width: 575px) { .ems-site-card__grid { grid-template-columns: 1fr; } .ems-overview__clock { text-align: left; } }

/* Plan: reason tooltip and replay */
.ems-tip { padding: 8px 10px; max-width: 360px; white-space: normal; font-size: 0.78rem; }
.ems-tip span { color: var(--ems-muted); }
.ems-tip p { margin: 6px 0 0; line-height: 1.35; }
.ems-replay__controls { display: flex; gap: 12px; align-items: center; }
.ems-replay__controls input[type="range"] { flex: 1; accent-color: var(--da-primary); }
.ems-replay__caption { margin: 10px 0 4px; }

/* Power flow: moving dashes along live lines, in the direction of flow. */
@keyframes ems-flow-dash { to { stroke-dashoffset: -28; } }
.ems-flow__line--out, .ems-flow__line--in { stroke-dasharray: 10 4; animation: ems-flow-dash 1.1s linear infinite; }
.ems-flow__line--in { animation-direction: reverse; }
@media (prefers-reduced-motion: reduce) {
  .ems-flow__line--out, .ems-flow__line--in { animation: none; stroke-dasharray: none; }
}
.ems-bt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.ems-bt-grid[hidden] { display: none; }
.ems-bt-grid input { font-family: inherit !important; }
.ems-swatch--cloud { background: var(--ems-chart-grey); }
.ems-swatch--low { background: var(--ems-chart-blue); }
.ems-swatch--mid { background: var(--ems-cyan); }
.ems-swatch--high { background: var(--brand-mist); }
.ems-swatch--ghi { background: var(--ems-amber); }
.ems-swatch--dni { background: var(--ems-green); }
.ems-swatch--dhi { background: var(--ems-cyan); }
.ems-attribution { font-style: italic; }

/* Forecasts: day-at-a-glance card */
.ems-chart--weather { min-height: 260px; }
.ems-glance__hero { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.ems-glance__sky, .ems-glance__pv { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 10px;
  border: 1px solid var(--ems-border); background: var(--ems-ovl-03); }
.ems-glance__pv { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  background: linear-gradient(135deg, rgba(244, 194, 43, 0.16), rgba(244, 194, 43, 0.02)); border-color: rgba(244, 194, 43, 0.45); }
.ems-glance__sky-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; flex: 0 0 64px;
  color: #fff; background: radial-gradient(circle at 30% 30%, #9aa8b6, #5d6b7a); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.ems-glance__sky--clear .ems-glance__sky-icon { background: radial-gradient(circle at 30% 30%, #ffe08a, #f4a62b); }
.ems-glance__sky--partly .ems-glance__sky-icon { background: radial-gradient(circle at 30% 30%, #9fd4f7, #3b8fd0); }
.ems-glance__sky-word { font-size: 1.35rem; font-weight: 600; color: var(--ems-text-strong); }
.ems-glance__sky-sub { font-size: 0.78rem; color: var(--ems-muted); }
.ems-glance__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ems-muted); font-weight: 600; }
.ems-glance__label i { color: var(--ems-amber); margin-right: 4px; }
.ems-glance__big { font-size: 2.4rem; font-weight: 700; line-height: 1.1; color: var(--ems-text-strong); font-variant-numeric: tabular-nums; }
.ems-glance__big span { font-size: 1rem; font-weight: 500; color: var(--ems-muted); }

.ems-glance__tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.ems-glance__tile { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; border: 1px solid var(--ems-border);
  background: var(--ems-panel); }
.ems-glance__tile small { display: block; font-size: 0.7rem; color: var(--ems-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ems-glance__tile strong { display: block; font-size: 1.15rem; color: var(--ems-text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ems-glance__tile em { font-style: normal; font-size: 0.75rem; font-weight: 500; color: var(--ems-muted); }
.ems-glance__icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: 0 0 38px; }
.ems-glance__icon--sun { background: rgba(244, 194, 43, 0.18); color: #c98a00; }
.ems-glance__icon--cloud { background: rgba(116, 136, 146, 0.18); color: #5d6b7a; }
.ems-glance__icon--temp { background: rgba(244, 106, 54, 0.15); color: #e0602a; }
.ems-glance__icon--wind { background: rgba(91, 155, 213, 0.18); color: #3b7fc0; }
.ems-glance__icon--water { background: rgba(4, 169, 245, 0.15); color: #0b8fd0; }
html[data-ems-theme="dark"] .ems-glance__icon--sun { color: #f4c22b; }
html[data-ems-theme="dark"] .ems-glance__icon--cloud { color: #b6c3cf; }
html[data-ems-theme="dark"] .ems-glance__icon--temp { color: #ff8a5c; }
html[data-ems-theme="dark"] .ems-glance__icon--wind { color: #8ec0ee; }
html[data-ems-theme="dark"] .ems-glance__icon--water { color: #5cc8ff; }

/* Issue timeline */
.ems-issue-line { list-style: none; margin: 10px 0 6px; padding: 0 0 0 4px; border-left: 2px solid var(--ems-border); }
.ems-issue { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 6px 0 6px 18px; }
.ems-issue__dot { position: absolute; left: -9px; top: 12px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ems-panel); border: 2px solid var(--ems-muted); }
.ems-issue--latest .ems-issue__dot { border-color: var(--ems-green); background: var(--ems-green); box-shadow: 0 0 0 4px rgba(29, 233, 182, 0.18); }
.ems-issue__time { font-weight: 600; color: var(--ems-text-strong); font-variant-numeric: tabular-nums; }
.ems-issue__time i { color: var(--ems-muted); }
.ems-issue__meta { color: var(--ems-muted); font-size: 0.8rem; }
.ems-issue__value { font-variant-numeric: tabular-nums; }
.ems-weather-notes { margin: -6px 0 18px; padding: 0 4px; }

@media (max-width: 1399px) { .ems-glance__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .ems-glance__hero { grid-template-columns: 1fr; }
  .ems-glance__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
