@font-face {
  font-family: 'PnPFont';
  font-style: normal;
  src: local(''),
        url('./dots_all_for_now.ttf') format('truetype'), /* Safari, Android, iOS */
}

.background {
  width: 100%;
  height: 100%;
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  overflow: hidden;
}

.background .grid-lines {
  --s: 120px;  /* control the size of the grid */
  --n: 5;     /* control the granularity */
  --t: 2px;   /* the thickness */
  --g: 10px;  /* the gap between dashes */
  --r: 120deg;  /* rotation variable */
  
  --c:#556270 25%,#0000 0;
  background: 
    conic-gradient(at var(--g) var(--t),var(--c))
     calc((var(--s)/var(--n) - var(--g) + var(--t))/2) 0/
     calc(var(--s)/var(--n)) var(--s),
    conic-gradient(from 180deg at var(--t) var(--g),var(--c))
     0 calc((var(--s)/var(--n) - var(--g) + var(--t))/2)/
     var(--s) calc(var(--s)/var(--n));
  transform: rotate(var(--r));
  width: calc(round(down,100%,var(--s)) + var(--t));
  height: calc(4*var(--s) + var(--t));
  position: absolute;
  margin: 0 0;
  z-index: -1;
  left: -300px;
  top: -100px;
}
.background .circle {
  position: absolute;
  border-radius: 50%; /* Ensure it's a circle */
  z-index: -1;
  display: solid;
  justify-content: center;
  background-color: #ffffff00; /* Optional: Set a background color */
  margin: 40% 0 0 20%;
}

.circle.small {
  width: 300px;
  height: 300px;
  border: 2px dashed #556270;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.circle.medium {
  width: 600px;
  height: 600px;
  border: 2px solid #556270;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.circle.large {
  width: 800px;
  height: 800px;
  border: 2px dashed #556270;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}



.background .shape {
  height: 200px;
  width: 200px;
  position: absolute;
  border-radius: 50%;
}

.shape:first-child {
  background: #f29b07;
  left: -60px;
  top: 10px;
}

.shape:nth-child(2) {
  background: #0542a1;
  right: -30px;
  bottom: -80px;
}

.chart-container {
  background: rgba(255, 255, 255, 0.085);
  border-radius: 15px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 30px 25px;
  margin-top: 20px;
  min-height: 450px;
}
/* ===== Scrollbar CSS ===== */
  /* Firefox */
  * {
    scrollbar-width: thin;
    scrollbar-color: #ffffff #000000;
  }
  /* Chrome, Edge, and Safari */
  *::-webkit-scrollbar {
    width: 15px;
  }
  *::-webkit-scrollbar-track {
    background: #000000;
  }
  *::-webkit-scrollbar-thumb {
    background-color: #ffffff;
    border-radius: 10px;
    border: 2px solid #ffffff;
  }
/*   /===== Scrollbar CSS ===== */


*,
*::before,
*::after {
  box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
  :root {
    scroll-behavior: smooth;
  }
}

:root {
  --font-size-sm: 12px;
  --font-size-md: 14px;
  --font-size-lg: 18px;
  --font-size-xl: 26px;
}

body {
	font-family: 'PnPFont',sans-serif;
  background-attachment: fixed;
  background: linear-gradient(135deg, #613d0b 0%, #202020 30%,  #202020 50%, #102050 100%);
	background-repeat: no-repeat;
	-webkit-background-size: cover;
	background-size: cover;
	color: #fff;
	background-position: center;
	margin: 0;
	padding: 0;
  font-size: var(--font-size-md);
  position: relative;
  min-height: 100vh;
}
h6, .h6, h5, .h5, h4, .h4, h3, .h3, h2, .h2, h1, .h1 {
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.2;
}
p {
  margin-top: 0;
  margin-bottom: 1rem;
}
ol,
ul,
dl {
  margin-top: 0;
  margin-bottom: 1rem;
}
label {
  display: inline-block;
}
input,
button,
select,
optgroup,
textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}
button,
select {
  text-transform: none;
}
.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}
.row.g-0 {
  margin-left: 0;
  margin-right: 0;
}
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -10px;
  margin-left: -10px;
}
.row.g-0 > * {
  padding-right: 0;
  padding-left: 0;
}
.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: 10px;
  padding-left: 10px;
}
.col {
  flex: 1 0 0%;
}
.col-auto {
  flex: 0 0 auto;
  width: auto;
}
.col-1 {
  flex: 0 0 auto;
  width: 8.33333333%;
}
.col-2 {
  flex: 0 0 auto;
  width: 16.66666667%;
}
.col-3 {
  flex: 0 0 auto;
  width: 25%;
}
.col-4 {
  flex: 0 0 auto;
  width: 33.33333333%;
}
.col-5 {
  flex: 0 0 auto;
  width: 41.66666667%;
}
.col-6 {
  flex: 0 0 auto;
  width: 50%;
}
.col-7 {
  flex: 0 0 auto;
  width: 58.33333333%;
}
.col-8 {
  flex: 0 0 auto;
  width: 66.66666667%;
}
.col-9 {
  flex: 0 0 auto;
  width: 75%;
}
.col-10 {
  flex: 0 0 auto;
  width: 83.33333333%;
}
.col-11 {
  flex: 0 0 auto;
  width: 91.66666667%;
}
.col-12 {
  flex: 0 0 auto;
  width: 100%;
}
.h-100 {
  height: 100%;
}
.w-100 {
  width: 100%;
}

.justify-content-start {
  justify-content: flex-start;
}
.justify-content-end {
  justify-content: flex-end;
}
.justify-content-center {
  justify-content: center;
}
.align-items-start {
  align-items: flex-start;
}
.align-items-end {
  align-items: flex-end;
}
.align-items-center {
  align-items: center;
}
.align-self-start {
  align-self: flex-start;
}
.align-self-end {
  align-self: flex-end;
}
.align-self-center {
  align-self: center;
}
.order-first {
  order: -1;
}
.order-last {
  order: 6;
}
.m-0 {
  margin: 0;
}
.mb-1 {
  margin-bottom: 10px;
}
.mb-2 {
  margin-bottom: 15px;
}
.mb-3 {
  margin-bottom: 20px;
}
.mb-4 {
  margin-bottom: 25px;
}
.mb-5 {
  margin-bottom: 30px;
}

.loginLogoCol {
	display: flex;
	align-items: center;
	justify-content: center;
  border-radius: 4px;
  padding: 20px 0;
}
 .loginLogoCol img {
  	width: 200px;
  }

.loginColBg {
	border-radius: 4px;
	background-color: rgba(0,0,0,0.28);
}
.loginCol {
	padding: 70px 20px;
	margin: 0 auto;
	max-width: 520px;
}
.btn {
	display: inline-block;
	line-height: 1.5;
	color: #212529;
	text-align: center;
	text-decoration: none;
	vertical-align: middle;
	cursor: pointer;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	background-color: transparent;
	border: 1px solid transparent;
	padding: 10px 30px;
	font-size: 18px;
	border-radius: 0.25rem;
  border-color: #ffffff;
	-webkit-transition: all 300ms ease-in-out 0s;
	-o-transition: all 300ms ease-in-out 0s;
	transition: all 300ms ease-in-out 0s;
	min-width: 180px;
  margin-top: 15px;
}
.btnLight {
  background-color: #585858;
  color: #ffffff;
}
.btnOrange {
  background: linear-gradient(135deg, #f29b07, #e08800);
  border: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.btnOrange:hover { filter: brightness(1.08); }
.btn:disabled,
.btn[disabled] {
  background: #5f5f5f !important;
  border-color: #5f5f5f !important;
  color: rgba(255,255,255,0.55) !important;
  cursor: not-allowed;
  opacity: .62 !important;
  filter: none !important;
  box-shadow: none !important;
}
.btnBlue {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  border: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.btnBlue:hover { filter: brightness(1.08); }

#wizard_save_btn,
#monitoring_save_btn,
#monitoring_test_btn,
#credentials_btn,
#uploadbtn,
#aws_config_btn,
#login-btn {
  background: linear-gradient(135deg, #f29b07, #e08800);
  border: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.headerTitle {
  font-size: 24px;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
  white-space: nowrap;
}

.inputFld {
	display: block;
	height: 50px;
	width: 100%;
	background-color: transparent;
	border-radius: 4px;
	padding: 5px 20px;
	color: #ffffff;
	font-size: 18px;
	border: 1px solid #fff;
}
.inputFld:focus {
	outline: none;
}
.loginCol .inputFld {
	margin-top: 25px;
	margin-bottom: 25px;
}
::placeholder{
  color: #fff;
}
.btnLight:hover{
  opacity: 0.8;
}
.text-center {
  text-align: center;
  font-size: 20px;
}
.textEnd {
  text-align: right;
}
.textStart {
  text-align: left;
}
.lgTitle {
  font-size: 34px;
}
.lgAdvise {
  font-size: 18px;
}

.mh-row {
	min-height: calc(100vh - 100px);
}

.footerCol {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0 0 30px;
  overflow: hidden;
  text-align: right;
}
.footerContent {
  display: inline-block;
  text-align: left;
}
.footerLineText {
	position: relative;
	display: block;
}
.footerText .fText2 {
	position: absolute;
	left: 0;
	top: 0;
	z-index: -1;
}
.footerCol::before {
  content: "";
  position: absolute;
  background: #f02525;
  background: -moz-linear-gradient(left,  #ffffff 0%, #fbc0c0 15%, #f02525 63%, #ed0000 83%, #ffffff 100%);
  background: -webkit-linear-gradient(left,  #ffffff 0%,#fbc0c0 15%,#f02525 63%,#ed0000 83%,#ffffff 100%);
  background: linear-gradient(to right,  #ffffff 0%,#fbc0c0 15%,#f02525 63%,#ed0000 83%,#ffffff 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=1 );
  left: 0;
  right: 0;
  top: 8px;
  height: 4px;
}
.footerText img {
	display: block;
}
.footerLineText > img {
	display: block;
	padding-top: 15px;
}

.headerCol {
	position: relative;
	z-index: 999;
	border-bottom: 2px solid rgba(255,255,255,0.1);
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 40px rgba(8, 7, 16, 0.35);
}
ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}
.tabNavTrigger > li {
	display: inline-block;
	vertical-align: middle;
}
.tabNavTrigger button {
	background-color: transparent;
	border: none;
	color: #fff;
	padding: 0 0 2px;
	font-size: 20px;
	cursor: pointer;
}
.tabNavTrigger button.active {
	border-bottom: 1px solid rgba(255,255,255,0.8);
}
.logout-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.logout-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
.tabNavTrigger > li {
	display: inline-block;
	vertical-align: middle;
  position: relative;
}
.tabNavTrigger > li + li {
	padding-left: 50px;
}
.tabNavTrigger > li + li::before {
	content: "|";
	position: absolute;
	left: 23px;
}

.tabNavTriggerWiFi > li {
	display: inline-block;
	vertical-align: middle;
}
.tabNavTriggerWiFi button {
	background-color: transparent;
	border: none;
	color: #fff;
	padding: 0 0 2px;
	font-size: 20px;
	cursor: pointer;
}
.tabNavTriggerWiFi button.active {
	border-bottom: 1px solid rgba(255,255,255,0.8);
}
.tabNavTriggerWiFi > li {
	display: inline-block;
	vertical-align: middle;
  position: relative;
}
.tabNavTriggerWiFi > li + li {
	padding-left: 50px;
}
.tabNavTriggerWiFi > li + li::before {
	content: "|";
	position: absolute;
	left: 23px;
}

/* ------------------------------------------------- */
.arrow_bt {
	height: 20px;
	width: 25px;
	display: inline-block;
	cursor: pointer;
	background-color: transparent;
	border: none;
}
.arrow {
	border: solid rgb(0, 0, 0);
	border-width: 0 2px 2px 0;
	display: inline-block;
	padding: 4px;
}
.right {
  transform: rotate(-45deg);
}
.left {
  transform: rotate(135deg);
}
.Loading {
	position: relative;
	display: inline-block;
	width: 100%;
	height: 2px;
	border-radius: 4px;
	background-color: #D6D6D6;
}
.Loading:after {
  content: '';
  position: absolute;
  left: 0;
  height: 100%;
  border-radius: 4px;
  width: var(--width, 0%);
  background-color: #000;
}
.Loading::before {
	content: "";
	position: absolute;
	left: var(--width);
	width: 10px;
	height: 10px;
	border-radius: 10px;
	background-color: #000;
	top: 50%;
	-webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
	display: inline-block;
}
/*  */
.cardCol {
	padding: 20px 25px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.5);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 2px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
	color: #ffffff;
	height: 100%;
  font-size: 16px;
}
.dcStatus::before {
	content: "Deactivated";
}
.dcActive .dcStatus::before {
	content: "Activated";
}
.statusCol {
	color: #000;
	font-size: 20px;
}
.cardLbl {
  font-size: 20px;
  display: block;
}
.cardContent {
  display: inline-block;
  text-align: center;
}

.switch {
	position: relative;
	display: inline-block;
	width: 60px;
	height: 32px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switchTriggerStyle {
  position: absolute;
  cursor: pointer;
  display: block;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border-radius: 30px;
}
.slider::before, .switchCol input + span::before, .switchTriggerStyle::before {
	position: absolute;
	content: "";
	height: 24px;
	width: 24px;
	left: 4px;
	bottom: 4px;
	background-color: #fff;
	-webkit-transition: .4s;
	transition: .4s;
	border-radius: 30px;
}
.switchCol input:checked + span {
  background-color: #48b04f;
}
.switchCol .lockSwitch input:checked + span {
	background-color: red;
}
.switchCol input:focus + span {
  box-shadow: 0 0 1px #ccc;
}
.switchCol input:checked + span:before {
  -webkit-transform: translateX(28px);
  -ms-transform: translateX(28px);
  transform: translateX(28px);
}

/* Switch styles for wizard modals */
.switch input:checked + .switchTriggerStyle {
  background-color: #48b04f;
}
.switch input:focus + .switchTriggerStyle {
  box-shadow: 0 0 1px #ccc;
}
.switch input:checked + .switchTriggerStyle::before {
  -webkit-transform: translateX(28px);
  -ms-transform: translateX(28px);
  transform: translateX(28px);
}

.cardIconCol {
	height: 70px;
}
.cardIconCol img {
	max-height: 100%;
  max-width: 100%;
  -o-object-fit: contain;
  object-fit: contain;
}
.cardIconCol + .cardContentCol {
	padding-top: 20px;
}
.cardContentCol .cardLbl {
	padding-bottom: 15px;
}
.pageContent {
  position: relative;
  z-index: 2; /* Higher z-index to place it above the background shapes */
  margin-top: 20px;
}
.centerlogging.pageContent {
  display: flex;
  align-items: center;
  min-height: 100vh;
}
.chargingTimeCol {
  display: flex;
  align-items: center;
  height: 100%;
}
.chargingTime {
  width: 100%;
}
.chargingTimeCol .cardIconCol + .cardContentCol {
	padding-top: 30px;
}
.fadeLbl {
  opacity: 0.3;
}

.navTrigger {
	border: none;
	width: 22px;
	height: 20px;
	display: inline-block;
	position: relative;
	z-index: 5;
}
.navTrigger:hover {
}
.navTrigger .icon-bar {
  width: 22px;
  height: 2px;
  transition: all 0.2s;
  background-color: #fff;
  display: block;
}
.icon-bar.middle-bar {
	margin: 4px 0;
}
.activeNav .navTrigger .middle-bar {
  opacity: 0;
}
.activeNav .navTrigger .top-bar {
  transform: rotate(45deg);
  transform-origin: 10% 10%;
}
.activeNav .navTrigger .bottom-bar {
  transform: rotate(-45deg);
  transform-origin: 10% 90%;
}
.navTrigger.collapsed .top-bar {
  transform: rotate(0);
}
.navTrigger.collapsed .middle-bar {
  opacity: 1;
}
.navTrigger.collapsed .bottom-bar {
  transform: rotate(0);
}

.navBackdrop {
	position: fixed;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	z-index: 998;
	-webkit-transition: all 300ms ease-in-out 0s;
	-o-transition: all 300ms ease-in-out 0s;
	transition: all 300ms ease-in-out 0s;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	background-color: rgba(0,0,0,0.8);
}

.selectStyle {
	width: 100%;
	border: 1px solid #7F7F7F;
	padding: 10px 30px 10px 10px;
	background-color: transparent;
	border-radius: 4px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	-webkit-background-size: 12px auto;
  background-size: 12px auto;
	background-repeat: no-repeat;
	background-position: right 10px center;
  font-size: 16px;
}
.switch.smSwitch {
	width: 50px;
	height: 25px;
}
.switchCol .switch.smSwitch input + span::before {
	height: 18px;
	width: 18px;
}
.switchCol .smSwitch input:checked + span::before {
	-webkit-transform: translateX(24px);
	-ms-transform: translateX(24px);
	transform: translateX(24px);
}
.powerFldCol {
	position: relative;
	color: #000;
}
.voltFldCol {
	position: relative;
	color: #000;
}
.editIcon {
	position: absolute;
	right: 10px;
	width: 18px;
	display: block;
	top: 50%;
	-webkit-transform: translateY(-50%);
	-ms-transform: translateY(-50%);
	transform: translateY(-50%);
	cursor: pointer;
	z-index: 1;
}
img {
  max-width: 100%;
}
.powerFldCol input[type="text"] {
	width: 100%;
	border-radius: 4px;
	border: 1px solid #7F7F7F;
	padding: 10px 85px 10px 10px;
  font-size: 16px;
}
.powerFldCol input[type="text"]:focus {
	outline: none;
}
.powerFldCol::after {
	content: "kWh";
	position: absolute;
	right: 40px;
	top: 50%;
	-webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 16px;
}
.voltFldCol input[type="text"] {
	width: 100%;
	border-radius: 4px;
	border: 1px solid #7F7F7F;
	padding: 10px 85px 10px 10px;
  font-size: 16px;
}
.voltFldCol input[type="text"]:focus {
	outline: none;
}
.voltFldCol::after {
	content: "V";
	position: absolute;
	right: 40px;
	top: 50%;
	-webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 16px;
}
.switch.chargingPlayPause {
	width: 30px;
	cursor: pointer;
}
.playPauseIcon {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	background-position: center;
	background-size: contain;
}
.switch.chargingPlayPause input:checked + span {
}
.cardStyle2 {
	background: rgba(0, 0, 0, 0.5);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	padding: 20px;
	box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
	border: 2px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
}
.logview {
	font-size: 18px;
	line-height: 1.5;
	max-height: 250px;
	overflow-y: auto;
	margin-bottom: 15px;
	word-break: break-all;
	padding-right: 10px;
}

.slidecontainer {
	width: 100%;
	margin-top: 15px;
	position: relative;
	z-index: 2;
}
.rangeSlider {
  -webkit-appearance: none;
  width: 100%;
  height: 2px;
  border-radius: 5px;
  background: rgba(0,0,0,0.2);
  outline: none;
  opacity: 1;
  -webkit-transition: .2s;
  transition: opacity .2s;
}
.rangeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  border: none;
}
.rangeSlider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  border: none;
}
.rFilled {
  position: absolute;
  display: inline-block;
  height: 2px;
  background-color: #000;
  z-index: -1;
}
.disableIntensity .slidecontainer {
	pointer-events: none;
}
.disableIntensity .progressCol {
	opacity: 0.4;
}
.logoCol {
	display: flex;
	align-items: center;
	gap: 15px;
  min-width: 0;
}
.logoCol #header_img {
	width: 80px;
}
.headerStatusWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin: 0;
}
.headerNavWrap {
  display: flex;
  align-items: center;
}
.headerStatusCol {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  margin-bottom: 0;
}
.globalRefreshBtn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.globalRefreshBtn img {
  width: 16px;
  height: 16px;
  opacity: 0.9;
}
.globalRefreshBtn:hover:not([disabled]) {
  border-color: #fb8343;
  box-shadow: 0 0 10px rgba(251, 131, 67, 0.4);
}
.globalRefreshBtn[disabled] {
  opacity: 0.55;
  cursor: wait;
}
.headerMiniLoader {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  height: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.38);
  color: #f2f2f2;
  font-size: 12px;
  max-width: 180px;
  white-space: nowrap;
}
#header-mini-text {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.headerMiniLoader.error {
  border-color: rgba(255, 99, 132, 0.7);
  color: #ffb5c6;
}
.miniSpinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fb8343;
  border-radius: 50%;
  animation: spinMiniLoader 0.9s linear infinite;
  flex: 0 0 auto;
}
@keyframes spinMiniLoader {
  to { transform: rotate(360deg); }
}
.menuLoadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 16, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menuLoadingCard {
  min-width: 280px;
  max-width: 90vw;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.55);
  border-radius: 14px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.menuLoadingSpinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fb8343;
  border-radius: 50%;
  animation: spinMiniLoader 0.9s linear infinite;
}
.menuLoadingText {
  color: #f5f5f5;
  text-align: center;
  font-size: 14px;
}
#printlog.btn {
	min-width: 100px;
}

.balCardMain {
	/* margin: 0 20px; */
}
.balanceCard {
	width: 100px;
	text-align: center;
	background-color: #fff;
	color: #333;
	padding: 10px 5px;
	border-radius: 5px;
	margin: 0 auto;
	position: relative;
}
.balanceCardContent {
	font-size: 16px;
}
.balanceCardContent a {
	color: inherit;
  text-decoration: none;
}
.batteryIcon {
	position: absolute;
	left: 100%;
	width: 20px;
	top: 0;
}
.balanceCardIcon img {
	width: 50px;
}
.balanceCardIcon + .balanceCardContent {
	padding-top: 5px;
}
.balTopSpace {
  padding-top: 20px;
}
.balanceCardMain {
	position: relative;
}
.balanceCardMain::before {
	content: "";
	position: absolute;
	left: 15%;
	right: 15%;
	top: 50px;
	bottom: 65px;
	border: 2px dashed;
	border-radius: 5px;
}



.switch.swithWithText {
	display: inline-block;
	width: auto;
	color: #333;
	background-color: #fff;
	padding: 11px 80px 10px 10px;
	height: auto;
	border-radius: 4px;
  cursor: pointer;
}
.switch.smSwitch.swithWithText .switchTriggerStyle {
	width: 50px;
	height: 25px;
	right: 15px;
	left: auto;
	top: 50%;
  -webkit-transform:  translateY(-50%);
  -ms-transform:  translateY(-50%);
  transform:  translateY(-50%);
}
#chargingTrigger .cText {
  text-align: center;
  min-width: 100px;
}
.switchText::before {
	content: "Comming soon...";
	text-align: center;
	min-width: 100px;
	display: inline-block;
}
#balancingon:checked ~ .switchText::before {
  content: "Be patient!!!";
}
.switchText {
	padding: 3px 0;
	display: inline-block;
}
.balanceBtnCol {
	text-align: center;
}

.maxWdFormCol {
  margin: 0 auto;
}
.loginFormCol {
  margin: 0 auto;
  padding: 20px;
  max-width: 450px;

}
.fldStyle {
	width: 100%;
	border-radius: 4px;
  background-color: #333;
	border: 1px solid #ffffff;
	padding: 10px 50px 10px 10px;
	font-size: 20px;
  color: #ffffff;
  font-family: 'PnPFont', sans-serif !important;
}
.fldStyle option {
  font-family: 'PnPFont', sans-serif !important;
  background-color: #333;
  color: #ffffff;
}
select.fldStyle option {
  font-family: 'PnPFont', sans-serif !important;
}
.fldStyle::placeholder{
  color: #7f7f7fa6;
}
.fldStyle:focus {
  outline: none;
}

/* Custom Select Dropdown */
.custom-select {
  position: relative;
  width: 100%;
  font-family: 'PnPFont', sans-serif;
}

.custom-select-trigger {
  width: 100%;
  padding: 10px;
  background-color: #333;
  border: 1px solid #ffffff;
  border-radius: 4px;
  color: #ffffff;
  font-size: 20px;
  font-family: 'PnPFont', sans-serif;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.custom-select-trigger:after {
  content: '▼';
  font-size: 12px;
  color: #ffffff;
}

.custom-select.open .custom-select-trigger:after {
  content: '▲';
}

.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #2a2a2a;
  border: 1px solid #555;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
}

.custom-select.open .custom-select-options {
  display: block;
}

.custom-select-option {
  padding: 12px 10px;
  color: #ffffff;
  font-size: 20px;
  font-family: 'PnPFont', sans-serif;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover {
  background-color: #444;
}

.custom-select-option.selected {
  background-color: #555;
  font-weight: bold;
}
.cardCol.h-auto {
	height: auto;
}
.maxWdFormCol .cardCol {
	padding: 30px;
}
.loginFormCol .cardCol {
	padding: 30px;
	max-width: none;
}

.localUpgradingCol label {
	border: 1px solid #bfbfbf;
  background-color: rgba(0, 0, 0, 0.22);
	border-radius: 8px;
	text-align: center;
	padding: 15px 15px;
	width: 100%;
	cursor: pointer;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 145px;
}
.fInputCol {
	display: block;
	width: 100%;
}
#newFileName {
	padding: 12px 0 0;
	text-overflow: ellipsis;
	overflow: hidden;
	display: block;
	white-space: nowrap;
  font-size: 19px;
}
.fileIcon {
	width: 70px;
}
.refreshIcon {
	width: 24px;
	height: 24px;
	margin-left: 15px;
	cursor: pointer;
	transition: all 0.3s ease;
	opacity: 1;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
.refreshIcon:hover:not([disabled]) {
	transform: translateY(-2px) scale(1.1);
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) brightness(1.15);
}
.refreshIcon[disabled] {
	cursor: not-allowed;
	opacity: 0.4;
	filter: grayscale(100%);
}
.exportIcon {
	width: 24px;
	height: 24px;
	margin-left: 10px;
	cursor: pointer;
	transition: all 0.3s ease;
	opacity: 1;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
.exportIcon:hover:not([disabled]) {
	transform: translateY(-2px) scale(1.1);
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) brightness(1.15);
}
.exportIcon[disabled] {
	cursor: not-allowed;
	opacity: 0.4;
	filter: grayscale(100%);
}
.downloadCSVIcon {
	background: none;
	border: none;
	font-size: 28px;
	cursor: pointer;
	margin-left: 10px;
	padding: 0;
	transition: all 0.3s ease;
	opacity: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 35px;
	height: 35px;
}
.downloadCSVIcon:hover:not(:disabled) {
	transform: scale(1.1);
	filter: brightness(1.2);
}
.downloadCSVIcon:disabled {
	cursor: not-allowed;
	opacity: 0.4;
}
.statsHeader {
	display: flex;
	align-items: center;
	justify-content:stretch;
  margin: 0 0 20px;
}
.container_device {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

#main_view .container_device {
  margin-top: 30px;
}

#stats-form,
#custom-stats-form,
#history-form {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
  padding: 30px;
}
.localUpgradingCol label input[type="file"] {
	opacity: 0;
	position: absolute;

}

/* media start */




@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
  .col-sm {
    flex: 1 0 0%;
  }
  .col-sm-auto {
    flex: 0 0 auto;
    width: auto;
  }
  .col-sm-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }
  .col-sm-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }
  .col-sm-3 {
    flex: 0 0 auto;
    width: 25%;
  }
  .col-sm-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }
  .col-sm-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }
  .col-sm-6 {
    flex: 0 0 auto;
    width: 50%;
  }
  .col-sm-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }
  .col-sm-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }
  .col-sm-9 {
    flex: 0 0 auto;
    width: 75%;
  }
  .col-sm-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }
  .col-sm-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }
  .col-sm-12 {
    flex: 0 0 auto;
    width: 100%;
  }
}
@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }

  .col-md {
    flex: 1 0 0%;
  }
  .col-md-auto {
    flex: 0 0 auto;
    width: auto;
  }
  .col-md-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }
  .col-md-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }
  .col-md-3 {
    flex: 0 0 auto;
    width: 25%;
  }
  .col-md-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }
  .col-md-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }
  .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }
  .col-md-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }
  .col-md-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }
  .col-md-9 {
    flex: 0 0 auto;
    width: 75%;
  }
  .col-md-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }
  .col-md-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }
  .col-md-12 {
    flex: 0 0 auto;
    width: 100%;
  }
}
@media (min-width: 992px) {
  .headerCol .row.align-items-center {
    flex-wrap: nowrap;
  }
.headerLogoWrap {
    flex: 0 0 auto;
    max-width: none;
    margin-right: 12px;
  }
  .tabNavTrigger {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
  }
  .tabNavTrigger > li + li {
    padding-left: 34px;
  }
  .tabNavTrigger > li + li::before {
    left: 15px;
  }
  .container {
    max-width: 960px;
  }
  .headerStatusWrap {
    flex: 0 0 auto;
    margin: 0;
  }
  .headerNavWrap {
    flex: 1 1 0;
    justify-content: flex-end;
  }
  .navTrigger {
    display: none;
  }
  .col-lg {
    flex: 1 0 0%;
  }
  .col-lg-auto {
    flex: 0 0 auto;
    width: auto;
  }
  .col-lg-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }
  .col-lg-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }
  .col-lg-3 {
    flex: 0 0 auto;
    width: 25%;
  }
  .col-lg-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }
  .col-lg-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }
  .col-lg-6 {
    flex: 0 0 auto;
    width: 50%;
  }
  .col-lg-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }
  .col-lg-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }
  .col-lg-9 {
    flex: 0 0 auto;
    width: 75%;
  }
  .col-lg-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }
  .col-lg-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }
  .col-lg-12 {
    flex: 0 0 auto;
    width: 100%;
  }

}
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
  .col-xl {
    flex: 1 0 0%;
  }
  .col-xl-auto {
    flex: 0 0 auto;
    width: auto;
  }
  .col-xl-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }
  .col-xl-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }
  .col-xl-3 {
    flex: 0 0 auto;
    width: 25%;
  }
  .col-xl-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }
  .col-xl-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }
  .col-xl-6 {
    flex: 0 0 auto;
    width: 50%;
  }
  .col-xl-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }
  .col-xl-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }
  .col-xl-9 {
    flex: 0 0 auto;
    width: 75%;
  }
  .col-xl-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }
  .col-xl-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }
  .col-xl-12 {
    flex: 0 0 auto;
    width: 100%;
  }

  .lgRightSpace {
    padding-right: 10px;
  }
  .lgLeftSpace {
    padding-left: 10px;
  }
}
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  .col-xxl {
    flex: 1 0 0%;
  }
  .col-xxl-auto {
    flex: 0 0 auto;
    width: auto;
  }
  .col-xxl-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
  }
  .col-xxl-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
  }
  .col-xxl-3 {
    flex: 0 0 auto;
    width: 25%;
  }
  .col-xxl-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
  }
  .col-xxl-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
  }
  .col-xxl-6 {
    flex: 0 0 auto;
    width: 50%;
  }
  .col-xxl-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
  }
  .col-xxl-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
  }
  .col-xxl-9 {
    flex: 0 0 auto;
    width: 75%;
  }
  .col-xxl-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }
  .col-xxl-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
  }
  .col-xxl-12 {
    flex: 0 0 auto;
    width: 100%;
  }
}

@media (max-width:1399px) {
  .cardCol {
  	padding: 20px 15px;
  }
}
@media (max-width:991px) {
  .navColMain {
    z-index: 1000;
  	position: fixed;
   	left: 0;
   	top: 0;
   	height: 100vh;
   	padding: 25px 20px;
   	width: 230px;
    overflow-y: auto;
     -webkit-transform: translateX(-100%);
     -ms-transform: translateX(-100%);
     transform: translateX(-100%);
     -webkit-transition: all 300ms ease-in-out 0s;
     -o-transition: all 300ms ease-in-out 0s;
     transition: all 300ms ease-in-out 0s;
  }
  .navColMain::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-right: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
    z-index: -1;
  }
  .activeNav .navColMain {
    -webkit-transform: translateX(0);
    -ms-transform: translateX(0);
    transform: translateX(0);
  }
  .navColMain .tabNavTrigger {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .navColMain .tabNavTrigger > li {
    display: block;
    width: 100%;
  }
  .activeNav .navBackdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: initial;
  }
  .tabNavTrigger > li + li {
  	padding-left: 0;
  	padding-top: 0;
  }
  .tabNavTrigger button {
  	text-align: left;
   	font-size: var(--font-size-lg);
    min-width: 100px;
  }
  .tabNavTrigger .logout-btn {
    min-width: 0;
    width: 36px;
    height: 36px;
  }
  .tabNavTrigger > li + li::before {
    display: none;
  }

  .tabNavTriggerWiFi > li + li {
  	padding-left: 50px;
  }
  .tabNavTriggerWiFi button {
  	text-align: left;
  }
  .tabNavTriggerWiFi > li + li::before {
    content: "|";
    position: absolute;
    left: 23px;
  }

  .headerCol {
  	padding: 15px 0;
  }
  .logoCol #header_img {
  	width: 100px;
  }
  .headerStatusCol {
    min-width: 0;
    margin-bottom: 0;
    margin-right: 0;
  }
  .headerMiniLoader {
    max-width: 44vw;
    font-size: 11px;
    padding: 5px 8px;
  }
  .headerStatusWrap { margin: 0; }

  .loginCol {
  	padding: 40px 20px;
  	max-width: 400px;
  }
  .inputFld {
  	height: 50px;
  	padding: 5px 20px;
  	font-size: var(--font-size-lg);
  }
  .btn {
  	padding: 12px 30px;
  	font-size: var(--font-size-lg);
   	min-width: 160px;
  }
  .loginLogoCol img {
  	width: 120px;
  }
  .fileUploadCol {
  	padding-top: 35px;
  }
}


@media (max-width:767px) {
  .headerStatusWrap {
    width: 100%;
    justify-content: flex-start;
    margin: 8px 0 0;
    order: 3;
  }
  .headerNavWrap {
    margin-left: auto;
  }
  .headerStatusCol {
    width: auto;
    justify-content: flex-start;
    margin: 0;
  }
  .headerMiniLoader {
    max-width: 70vw;
  }
  .loginCol {
  	padding: 10px 0px 40px;
  }
  .loginLogoCol {
  	padding: 30px 0 10px;
  }
  .loginLogoCol img {
  	width: 120px;
  }
  .loginCol .inputFld {
  	margin-top: 20px;
  	margin-bottom: 20px;
  }
  .tabNavTriggerWiFi > li + li {
  	padding-left: 50px;
  }
  .tabNavTriggerWiFi button {
  	text-align: left;
  }
  .tabNavTriggerWiFi > li + li::before {
    content: "|";
    position: absolute;
    left: 23px;;
  }
}


@media (max-width:575px) {
  .cardCol {
  	padding: 20px 15px;
  	border-radius: 5px;
  }
  .statusCol {
  	font-size: var(--font-size-lg);
  }
  .cardLbl {
  	font-size: var(--font-size-md);
  }
  .cardIconCol + .cardContentCol {
  	padding-top: 15px;
  }
  .cardContentCol .cardLbl {
  	padding-bottom: 10px;
  }
  .chargingTimeCol .cardIconCol + .cardContentCol {
  	padding-top: 20px;
  }
  .switch {
  	width: 50px;
  	height: 28px;
  }
  .slider::before, .switchCol input + span::before, .switchTriggerStyle::before {
  	height: 20px;
  	width: 20px;
  }
  .switchCol input:checked + span::before,
  .switch input:checked + .switchTriggerStyle::before {
  	-webkit-transform: translateX(22px);
  	-ms-transform: translateX(22px);
  	transform: translateX(22px);
  }
  .footerText {
  	width: 180px;
  }
  .footerCol::before {
  	top: 7px;
  	height: 3px;
  }
  .cardStyle2 {
  	padding: 14px;
  }
  .btn {
  	padding: 10px 20px;
  	font-size: var(--font-size-md);
  }
  .mb-4 {
  	margin-bottom: 20px;
  }
  .switch.swithWithText {
  	font-size: var(--font-size-md);
  }
  .balanceCardMain::before {
    opacity: 0;
  }
  .balTopSpace {
  	padding-top: 5px;
  }
  .maxWdFormCol .cardCol {
  	padding: 20px;
  }
  .tabNavTriggerWiFi > li + li {
  	padding-left: 50px;
  }
  .tabNavTriggerWiFi button {
  	text-align: left;
  }
  .tabNavTriggerWiFi > li + li::before {
    content: "|";
    position: absolute;
    left: 23px;
  }
}

@media (max-width:400px) {
  .balanceCard {
  	width: 80px;
  }
  .balanceCard {
  	width: 70px;
  }
  .cardStyle2 {
  	padding: 10px;
  }
  .maxWdFormCol .cardCol {
  	padding: 15px;
  }
  .tabNavTriggerWiFi > li + li {
  	padding-left: 50px;
  }
  .tabNavTriggerWiFi button {
  	text-align: left;
  }
  .tabNavTriggerWiFi > li + li::before {
    content: "|";
    position: absolute;
    left: 23px;
  }
}

/* History Modal Styles */
.history-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  z-index: 9999;
  overflow-y: auto;
  backdrop-filter: blur(5px);
}

.history-modal-content {
  position: relative;
  max-width: 1400px;
  margin: 40px auto;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.historyDetailLoading {
  position: absolute;
  top: 90px;
  left: 30px;
  right: 30px;
  bottom: 30px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.48);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.history-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-modal-close::before,
.history-modal-close::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.history-modal-close::before {
  transform: rotate(45deg);
}

.history-modal-close::after {
  transform: rotate(-45deg);
}

.history-modal-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.history-modal-title {
  color: white;
  margin-bottom: 30px;
  text-align: center;
  font-size: 24px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.history-modal-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.history-chart-container {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
}

.history-chart-title {
  color: white;
  margin-bottom: 15px;
  font-size: 18px;
}

.history-chart-canvas {
  height: 400px;
  position: relative;
}

.history-custom-detail-container {
  margin-top: 22px;
}

.history-custom-chart-canvas {
  height: 320px;
  position: relative;
  margin: 4px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.energy-summary-container {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
}

.energy-summary-title {
  color: white;
  margin-bottom: 20px;
  font-size: 18px;
}

.energy-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.energy-card {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
  transition: transform 0.2s;
}

.energy-card:hover {
  transform: translateY(-2px);
}

.energy-card-solar {
  border-color: rgba(250, 187, 28, 0.28);
  border-left: 4px solid #FABB1C;
}

.energy-card-grid {
  border-color: rgba(255, 99, 132, 0.28);
  border-left: 4px solid #FF6384;
}

.energy-card-consumption {
  border-color: rgba(57, 255, 20, 0.28);
  border-left: 4px solid #39FF14;
}

.energy-card-self {
  border-color: rgba(153, 102, 255, 0.28);
  border-left: 4px solid #9966FF;
}

.energy-card-ev {
  border-color: rgba(255, 255, 255, 0.22);
  border-left: 4px solid #FFFFFF;
}

.energy-card-evsoc {
  border-color: rgba(88, 166, 255, 0.28);
  border-left: 4px solid #58A6FF;
}

.energy-card-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin-bottom: 5px;
}

.energy-card-value {
  font-size: 32px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.energy-card-value.solar { color: #FABB1C; }
.energy-card-value.grid { color: #FF6384; }
.energy-card-value.consumption { color: #39FF14; }
.energy-card-value.self { color: #9966FF; }
.energy-card-value.ev { color: #FFFFFF; }
.energy-card-value.evsoc { color: #58A6FF; }

.energy-card-sublabel {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  margin-top: 5px;
}

@media (max-width: 1200px) {
  .history-modal-grid {
    grid-template-columns: 1fr;
  }
}

.history-modal-header {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 20px;
}

.history-modal-nav-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.history-modal-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.history-modal-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .history-modal-header {
    align-items: flex-end;
    padding-top: 14px;
  }

  .history-modal-nav-btn {
    margin-top: 14px;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.password-field-container {
  position: relative;
}

.password-field-container input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: bold;
}

.password-toggle:hover {
  color: rgba(255, 255, 255, 0.9);
}


/* Main view styles */
#main_view {
  display: block;
}

#settings_view,
#installers_view {
  display: none;
}

.installer-inner-panel {
  padding: 22px;
  background: rgba(255, 255, 255, 0.085);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Refresh icon cursor */
.refreshIcon {
  cursor: pointer;
}

/* Chart time buttons initial opacity */
/* Chart time buttons initial opacity */
#minutebtn,
#hourbtn,
#daybtn,
#customMinuteBtn,
#customHourBtn,
#customDayBtn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: var(--font-size-sm);
  opacity: 0.72;
  transition: all 0.25s ease;
}

#minutebtn:hover,
#hourbtn:hover,
#daybtn:hover,
#customMinuteBtn:hover,
#customHourBtn:hover,
#customDayBtn:hover {
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.18);
}

#minutebtn.active,
#hourbtn.active,
#daybtn.active,
#customMinuteBtn.active,
#customHourBtn.active,
#customDayBtn.active {
  background: linear-gradient(135deg, #f29b07, #e08800);
  border-color: transparent;
  color: #fff;
  opacity: 1;
  box-shadow: 0 12px 24px rgba(242, 155, 7, 0.22);
}

/* Pagination controls */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

#page-info {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

.pagination-btn {
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* History table styles */
.table-container {
  margin-top: 20px;
  overflow-x: auto;
  padding: 18px;
  background: rgba(255, 255, 255, 0.085);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#history-table {
  width: 100%;
  border-collapse: collapse;
  color: white;
}

#history-table thead tr {
  background-color: rgba(255, 255, 255, 0.1);
}

#history-table th {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#history-table th:first-child {
  text-align: left;
}

#history-table th:not(:first-child) {
  text-align: center;
}

#history-table tbody tr td {
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

#history-table tbody tr {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#history-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  #stats-form,
  #custom-stats-form {
    padding-left: 16px;
    padding-right: 16px;
  }

  #stats-form .chart-container,
  #custom-stats-form .chart-container {
    padding-left: 8px;
    padding-right: 8px;
  }

  .statsHeader {
    gap: 6px;
  }

  .statsHeader > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  .statsHeader .refreshIcon,
  .statsHeader .exportIcon {
    margin-left: 0;
    flex: 0 0 auto;
  }

  .pagination-controls {
    margin-left: 6px;
    gap: 6px;
  }

  .pagination-controls #page-info {
    font-size: 9px;
    line-height: 1.15;
  }

  #history-table th {
    font-size: 10px;
    line-height: 1.15;
    padding: 10px 8px;
  }

  #history-table tbody tr td {
    font-size: 10px;
    line-height: 1.15;
    padding: 10px 8px;
  }
}

/* Modal title */
.history-modal-title {
  margin: 0;
}

/* Settings section styles */
#logger-mode-section {
  display: block;
}

#bridge-mode-section,
#sniffer-mode-section {
  display: none;
}

/* Connection diagram */
.connection-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  flex-wrap: wrap;
  gap: 15px;
}

/* Mobile responsive layout */
@media (max-width: 768px) {
  .connection-diagram {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
    padding: 15px;
  }

  /* First row: ModbusSlave - RS485 - First Horus */
  .connection-diagram > :nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  
  .connection-diagram > :nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  
  .connection-diagram > :nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }

  /* Second row: WiFi (centered across all columns) */
  .connection-diagram > :nth-child(4) {
    grid-column: 1 / 4;
    grid-row: 2;
    justify-self: center;
  }

  /* Third row: Second Horus - RS485 - Meter */
  .connection-diagram > :nth-child(5) {
    grid-column: 1;
    grid-row: 3;
  }
  
  .connection-diagram > :nth-child(6) {
    grid-column: 2;
    grid-row: 3;
  }
  
  .connection-diagram > :nth-child(7) {
    grid-column: 3;
    grid-row: 3;
  }

  .diagram-device img,
  .diagram-modbus-slave img {
    max-width: 70px;
    max-height: 70px;
  }

  .diagram-connection {
    padding: 0 5px;
  }
}

.diagram-modbus-slave,
.diagram-device {
  flex: 0 0 auto;
  text-align: center;
  position: relative;
  min-width: 100px;
}

.diagram-modbus-slave img,
.diagram-device img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
}

.configured-device-image {
  filter: drop-shadow(0 0 10px #00ff00) drop-shadow(0 0 20px #00ff00) drop-shadow(0 0 30px #00ff00);
}

.diagram-modbus-slave p,
.diagram-device p {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: bold;
  font-size: 12px;
}

.configured-device {
  color: #00ff00 !important;
  text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00, 0 0 30px #00ff00, 0 0 40px #00ff00;
  font-weight: bold;
}

.settings-icon {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 22px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 10;
}

.settings-icon:hover {
  background: rgba(0, 255, 0, 0.8);
  transform: rotate(90deg);
}

.diagram-rs485,
.diagram-connection {
  flex: 0 0 120px;
  text-align: center;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.rs485-label,
.connection-label {
  color: #FF9800;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  margin: 0;
  text-transform: uppercase;
}

.wifi-label {
  color: #4a9eff !important;
}

.rs485-progress,
.connection-progress {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 152, 0, 0.2);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.rs485-progress-bar,
.connection-progress-bar {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  transition: background 0.3s ease;
}

.connection-status {
  font-size: 11px;
  color: #00ff00;
  font-weight: bold;
}

.wifi-status {
  font-size: 10px;
  font-style: italic;
}

/* Parameters checkboxes container */
.params-container {
  display: flex;
  gap: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.param-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: bold;
}

#label-solar {
  color: #FFD700;
}

#label-grid {
  color: #FF5252;
}

#label-battery {
  color: #FFB6C1;
}

#label-bridge-in-grid {
  color: #FF5252;
  font-weight: bold;
}

#label-bridge-out-grid {
  color: #FF5252;
  font-weight: bold;
}

.param-checkbox {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

#param-solar {
  accent-color: #FFD700;
}

#param-grid {
  accent-color: #FF5252;
}

#param-battery {
  accent-color: #FFB6C1;
}

#param-bridge-in-grid {
  accent-color: #FF5252;
}

#param-bridge-out-grid {
  accent-color: #FF5252;
}

/* Response labels */
#settings_resp,
#network_resp,
#credentials_resp {
  margin-top: 10px;
  display: block;
}

/* Placeholder text styles */
.placeholder-text {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 40px;
}

/* Network section */
/* File upload */
#selected-file-name {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-style: italic;
}

#upload-progress-container {
  display: none;
  margin-top: 20px;
}

.upload-status {
  text-align: center;
  margin-bottom: 10px;
}

.progress-bar-container {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  height: 30px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.upload-bytes {
  text-align: center;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* Credentials alert */
#credentials_alert {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

/* IP display styling */
.ip-display {
  color: #4CAF50;
}

/* Network content - initially hidden */
#network-content {
  color: white;
  display: none;
}

/* Config sections - initially hidden */
#sim-config,
#ap-config {
  display: none;
}

/* WiFi config initially visible */
#wifi-config {
  display: block;
}

/* Network mode select */
#network-mode {
  width: 100%;
  padding: 10px;
}

/* File input minimal size */
.custom-file-input {
  width: 10px;
  padding: 0;
}

/* Remove all inline styles - add missing classes */
.table-container {
  margin-top: 20px;
  overflow-x: auto;
  padding: 18px;
  background: rgba(255, 255, 255, 0.085);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#history-table {
  width: 100%;
  border-collapse: collapse;
  color: white;
}

#history-table thead tr {
  background-color: rgba(255, 255, 255, 0.1);
}

#history-table th {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#history-table th:first-child {
  text-align: left;
}

#history-table th:not(:first-child) {
  text-align: center;
}

#history-table tbody tr td {
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.history-modal-title {
  margin: 0;
}

#logger-mode-section {
  display: block;
}

#bridge-mode-section,
#sniffer-mode-section {
  display: none;
}

.placeholder-text {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 40px;
}

#selected-file-name {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-style: italic;
}

/* ========== WIZARD CONFIGURATION STYLES ========== */

.wizard-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.085);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.device-placeholder {
  width: 120px;
  height: 120px;
  border: 3px dashed rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.02);
}

.device-placeholder:hover {
  border-color: #FF9800;
  background: rgba(255, 152, 0, 0.1);
  transform: scale(1.05);
}

.plus-icon {
  font-size: 48px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.device-placeholder:hover .plus-icon {
  color: #FF9800;
}

.device-placeholder-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  text-align: center;
  margin: 0;
}

.device-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  padding: 15px;
  min-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.device-selected-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.device-remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #dc3545;
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.device-remove-btn::before,
.device-remove-btn::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.device-remove-btn::before {
  transform: rotate(45deg);
}

.device-remove-btn::after {
  transform: rotate(-45deg);
}

.device-remove-btn:hover {
  background: #c82333;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.6);
}

.device-selected p {
  color: white;
  font-size: 14px;
  margin: 5px 0;
  font-weight: 500;
}

.device-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  width: 100%;
  padding: 0;
}

.device-info-line {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  margin: 0;
  font-weight: 400;
  line-height: 1.6;
  white-space: nowrap;
}

.device-info-line:first-child {
  font-weight: 600;
  font-size: 14px;
  color: #4a9eff;
  margin-bottom: 4px;
}

.horus-wifi-icon {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.horus-wifi-icon:hover {
  transform: scale(1.2);
}

.horus-wifi-icon img {
  width: 28px;
  height: 28px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.wizard-form img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 10px;
}

.wizard-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  position: relative;
}

.connection-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin-bottom: 5px;
  font-weight: 500;
  text-transform: uppercase;
}

.connection-progress {
  width: 100px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.connection-progress-bar {
  height: 100%;
  width: 40%;
  border-radius: 10px;
  position: relative;
  transition: background 0.3s ease;
}

/* Estado: Conectado (Verde) */
.connection-progress-bar.active {
  background: linear-gradient(90deg, #28a745, #20c997, #28a745);
  background-size: 200% 100%;
  animation: flowactive 2s ease-in-out infinite;
}

/* Estado: Esperando (Amarillo/Naranja) */
.connection-progress-bar.waiting {
  background: linear-gradient(90deg, #ffc107, #ff9800, #ffc107);
  background-size: 200% 100%;
  animation: flowwaiting 2s ease-in-out infinite;
}

/* Estado: Error (Rojo) */
.connection-progress-bar.error {
  background: #ff0019;
  animation: errorpulse 1s ease-in-out infinite;
  width: 100%;
}

/* Estado: Detenido (Rojo oscuro) */
.connection-progress-bar.stopped {
  background: #ff0019;
  animation: none;
  width: 100%;
}

@keyframes flowactive {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(150%);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes flowwaiting {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(150%);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes errorpulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Device Modal Styles */
.device-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  overflow-y: auto;
  backdrop-filter: blur(5px);
}

.device-modal-content {
  position: relative;
  max-width: 600px;
  max-height: calc(100vh - 80px);
  margin: 40px auto;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto;
}

.device-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-modal-close::before,
.device-modal-close::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.device-modal-close::before {
  transform: rotate(45deg);
}

.device-modal-close::after {
  transform: rotate(-45deg);
}

.device-modal-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.device-modal-title {
  color: white;
  font-size: 24px;
  margin: 0 0 25px 0;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.connection-type-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  justify-content: center;
}

.connection-type-btn {
  flex: 1;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.connection-type-btn:hover {
  background: rgba(255, 152, 0, 0.2);
  border-color: #FF9800;
  color: white;
}

.connection-type-btn.active {
  background: rgba(255, 152, 0, 0.3);
  border-color: #FF9800;
  color: #FF9800;
  font-weight: 600;
}

.device-selection-section {
  margin-top: 20px;
}

.device-search-input {
  width: 100%;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: white;
  font-size: 14px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.device-search-input:focus {
  outline: none;
  border-color: #FF9800;
  background: rgba(0, 0, 0, 0.45);
}

.device-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.device-item:hover {
  background: rgba(255, 152, 0, 0.2);
  border-color: #FF9800;
  transform: translateX(5px);
}

.device-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
}

.device-item span {
  color: white;
  font-size: 16px;
  font-weight: 500;
}

/* WiFi Configuration Form */
.wifi-config-form,
.can-config-form,
.ap-config-form {
  padding: 20px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.switch-label {
  color: white;
  font-size: 14px;
  font-weight: 500;
}
.switch-sub-label {
  color: rgba(255,255,255,0.6);
  font-weight: 400;
  margin-left: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .wizard-diagram {
    flex-direction: column;
    gap: 20px;
    padding: 30px 15px;
  }

  .wizard-form {
    width: 100%;
    max-width: 300px;
  }

  .wizard-form img {
    width: 100px;
    height: 100px;
  }

  .device-placeholder,
  .device-selected {
    width: 100%;
    max-width: 280px;
  }

  .connection-progress {
    width: 100%;
    max-width: 200px;
    height: 6px;
  }

  .device-modal-content {
    width: 95%;
    padding: 20px;
    margin: 20px auto;
  }

  .connection-type-selector {
    flex-direction: column;
  }
  
  .horus-wifi-icon {
    top: 20px;
    right: 40px;
    width: 24px;
    height: 24px;
  }
  
  .horus-wifi-icon img {
    width: 24px;
    height: 24px;
  }
}

/* Monitoring Parameters Settings Styles */
.modbus-queries-section {
  margin-bottom: 20px;
}

.modbus-queries-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.modbus-queries-title {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.btn-add-query {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid white;
  color: white;
  font-size: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: relative;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.btn-add-query::before,
.btn-add-query::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.btn-add-query::after {
  transform: rotate(90deg);
}

.btn-add-query:hover {
  background: #0f9f71;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.6);
}

.btn-add-query:disabled {
  background: rgba(100, 100, 100, 0.5);
  border-color: white;
  cursor: not-allowed;
  transform: none;
}

.modbus-queries-table tbody tr {
  transition: background 0.3s ease;
}

.query-number {
  text-align: center;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.query-actions {
  text-align: center;
}

.btn-remove-query {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dc3545;
  border: 2px solid white;
  color: white;
  font-size: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: relative;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.btn-remove-query::before,
.btn-remove-query::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.btn-remove-query::before {
  transform: rotate(45deg);
}

.btn-remove-query::after {
  transform: rotate(-45deg);
}

.btn-remove-query:hover {
  background: #c82333;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.6);
}

.modbus-queries-section,
.monitoring-params-section {
  padding: 22px;
  background: rgba(255, 255, 255, 0.085);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.monitoring-separator {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  margin: 30px 0;
}

.monitoring-params-section {
  margin-bottom: 20px;
}

.monitored-params-title {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 15px 0;
}

.monitoring-params-table {
  overflow-x: auto;
}

.params-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.params-table thead {
  background: rgba(0, 0, 0, 0.18);
}

.params-table th {
  color: white;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.params-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
}

.params-table tbody tr:last-child td {
  border-bottom: none;
}

.params-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.param-name {
  font-weight: normal;
  color: #4a9eff;
  font-size: 14px;
}

.param-value {
  font-weight: 600;
  color: #10b981;
  font-size: 14px;
  text-align: center;
}

.param-input,
.param-select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: white;
  font-size: 13px;
  transition: all 0.3s ease;
}

.param-input:focus,
.param-select:focus {
  outline: none;
  border-color: #f59e0b;
  background: rgba(0, 0, 0, 0.4);
}

.param-input:hover,
.param-select:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.param-select option {
  background: #2a2a2a;
  color: white;
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Monitoring buttons spacing */
.monitoring-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

#monitoring_test_btn,
#monitoring_save_btn {
  margin: 0;
  min-width: 0;
  padding: 8px 18px;
  font-size: var(--font-size-md);
}

#monitoring_resp {
  flex-basis: 100%;
}

/* Responsive adjustments for monitoring settings */
@media (max-width: 768px) {
  .modbus-queries-title {
    font-size: var(--font-size-md);
  }
  
  .btn-add-query {
    width: 24px;
    height: 24px;
  }
  
  .btn-remove-query {
    width: 24px;
    height: 24px;
  }

  .params-table {
    font-size: var(--font-size-sm);
  }

  .params-table th,
  .params-table td {
    padding: 8px;
  }

  .param-input,
  .param-select {
    font-size: var(--font-size-sm);
    padding: 6px 8px;
  }
}

@media (max-width: 560px) {
  #settings_view .cardCol {
    padding: 16px 12px;
  }

  #settings_view .modbus-queries-section,
  #settings_view .monitoring-params-section {
    padding: 14px 10px;
  }

  #settings_view .monitoring-separator {
    margin: 20px 0;
  }

  #settings_view .modbus-queries-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  #settings_view .modbus-queries-title,
  #settings_view .monitored-params-title {
    font-size: var(--font-size-sm);
  }

  #settings_view .btn-add-query {
    width: 24px;
    height: 24px;
  }

  #settings_view .btn-remove-query {
    width: 24px;
    height: 24px;
  }

  #settings_view .btn-add-query::before,
  #settings_view .btn-add-query::after,
  #settings_view .btn-remove-query::before,
  #settings_view .btn-remove-query::after {
    width: 10px;
  }

  #settings_view .params-table {
    table-layout: fixed;
    width: 100%;
  }

  #settings_view .params-table th,
  #settings_view .params-table td {
    font-size: 11px;
    line-height: 1.15;
    padding: 5px 3px;
    overflow-wrap: anywhere;
  }

  #settings_view .param-name,
  #settings_view .param-value,
  #settings_view .param-input,
  #settings_view .param-select,
  #settings_view .query-number {
    font-size: 11px;
  }

  #settings_view .param-input,
  #settings_view .param-select {
    min-width: 0;
    padding: 3px 4px;
  }

  #settings_view .col-narrow {
    width: 34px;
  }

  #settings_view .col-action {
    width: 42px;
  }

  #settings_view .wizard-diagram {
    padding: 20px 10px;
    gap: 14px;
  }

  #settings_view .wizard-form {
    max-width: 240px;
  }

  #settings_view .wizard-form img,
  #settings_view .device-placeholder {
    width: 88px;
    height: 88px;
  }

  #settings_view .device-selected {
    max-width: 240px;
    padding: 10px;
  }

  #settings_view .device-placeholder-text,
  #settings_view .connection-label,
  #settings_view .device-info-line,
  #settings_view .device-selected p {
    font-size: var(--font-size-sm);
  }

  #settings_view .plus-icon {
    font-size: 34px;
    margin-bottom: 6px;
  }

  #settings_view .monitoring-actions {
    gap: 10px;
  }

  #monitoring_test_btn,
  #monitoring_save_btn {
    padding: 7px 14px;
    font-size: var(--font-size-sm);
  }
}

/* Energy Diagram Styles */
.energy-diagram-container {
  width: 100%;
  padding: 30px;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
}

.energy-diagram-title {
  color: white;
  text-align: center;
  font-size: 26px;
  margin-bottom: 30px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Installation Devices Map Styles */
.devices-map-container {
  width: 100%;
  padding: 30px;
  margin-top: 30px;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 40px rgba(8, 7, 16, 0.6);
}

#device_view .devices-map-container {
  margin-top: 0;
}

.devices-map-title {
  color: white;
  text-align: center;
  font-size: 26px;
  margin-bottom: 30px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  justify-items: center;
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.085);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.device-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  min-width: 0;
  width: 100%;
  max-width: 360px;
}

.device-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.5);
}

.device-image-wrapper {
  position: relative;
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.device-main-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.device-info {
  text-align: center;
  width: 100%;
}

.device-name {
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 3px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.device-ip {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.device-status {
  color: #10b981;
  font-weight: bold;
}

.device-link-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid rgba(39, 174, 255, 0.65);
  border-radius: 999px;
  color: #27aeff;
  background: rgba(39, 174, 255, 0.14);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.device-link-badge.is-offline {
  border-color: rgba(148, 163, 184, 0.55);
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}

@media (max-width: 560px) {
  .devices-grid {
    grid-template-columns: 1fr;
    padding: 15px;
  }
}

.energy-diagram {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 4 / 3; /* Mantiene proporción en todos los tamaños */
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.085);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: visible; /* Permite etiquetas fuera del contenedor */
}

.energy-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 20;
  cursor: pointer;
  overflow: visible;
}

/* Power glow animations */
@keyframes power-glow {
  0%, 100% {
    filter: drop-shadow(0 0 calc(var(--glow-size, 15) * 0.5px) var(--glow-color));
  }
  50% {
    filter: drop-shadow(0 0 calc(var(--glow-size, 15) * 2px) var(--glow-color));
  }
}

/* Power glow for individual images */
.energy-item img.glowing {
  animation: power-glow 6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  will-change: filter;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.energy-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: filter 0.3s ease, transform 0.25s ease;
}

/* Positioning for each component - Usando % para mantener proporciones */
.house-item {
  width: 75%; /* 600px de 800px = 75% */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  z-index: 3;
}

.solar-item {
  width: 35%; /* 280px de 800px = 35% */
  top: 17%;
  left: 37%;
  transform: translateX(-50%);
  transform-origin: center center;
  z-index: 25;
}

.battery-item {
  width:12.5%; /* 100px de 800px = 12.5% */
  top: 60%;
  left: 24.1%;
  transform-origin: center center;
  z-index: 25;
}

.ev-item {
  width: 5.90%; /* 30px de 800px = 3.75% */
  top: 58%;
  right: 43%;
  transform-origin: center center;
  z-index: 25;
}

.grid-item {
  width: 5%; /* 40px de 800px = 5% */
  bottom: 36%;
  left: 71%;
  transform-origin: center center;
  z-index: 25;
}

.inverter-item {
  width: 5.5%; /* 44px de 800px = 5.5% */
  top: 48%;
  left: 31.5%;
  transform: translateX(-50%);
  transform-origin: center center;
  z-index: 15;
}

.connection-box-item {
  width: 2.75%; /* 70px de 800px = 8.75% */
  top: 41.5%;
  left: 64%;
  transform: translateX(-50%);
  z-index: 25;
}

/* Energy Flow Lines (CSS Loading Bar) */
.energy-flow-line {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  border-radius: 3px;
  overflow: hidden;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 10px,
    rgba(255, 255, 255, 0.15) 15px,
    rgba(255, 255, 255, 0.45) 20px,
    rgba(255, 255, 255, 0.55) 25px,
    rgba(255, 255, 255, 0.45) 30px,
    rgba(255, 255, 255, 0.15) 35px,
    transparent 40px
  );
  background-size: 40px 100%;
  animation: loading-flow 2s linear infinite;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}

@keyframes loading-flow {
  0% {
    background-position: 0px 0;
  }
  100% {
    background-position: 40px 0;
  }
}

.solar-to-inverter-line {
  top: 39%;
  left: 32%;
  height: 3px;
  width: 15%;
  transform: translateX(-50%) rotate(89deg);
}

.inverter-to-house-line-1 {
  top: 47.5%;
  left: 47.5%;
  height: 3px;
  width: 28.3%;
  transform: translateX(-50%) rotate(343deg);
}

.inverter-to-house-line-2 {
  top: 43.2%;
  left: 62.5%;
  height: 3px;
  width:4.2%;
  transform: translateX(-50%) rotate(20deg);
}

.inverter-to-battery-line {
  top: 60%;
  left: 32.2%;
  height: 3px;
  width: 7%;
  transform: translateX(-50%) rotate(90deg);
}

.ev-to-house-line-1 {
  top: 62%;
  left: 60%;
  height: 3px;
  width: 7%;
  transform: translateX(-50%) rotate(200deg);
}

.ev-to-house-line-2 {
  top: 53.9%;
  left: 63.7%;
  height: 3px;
  width:15%;
  transform: translateX(-50%) rotate(94deg);
}

.grid-to-house-line-1{
  top: 49.3%;
  left: 73.2%;
  height: 3px;
  width: 9.5%;
  transform: translateX(-50%) rotate(272deg);
}

.grid-to-house-line-2 {
  top: 45%;
  left: 66%;
  height: 3px;
  width:4.2%;
  transform: translateX(-50%) rotate(200deg);
}

.grid-to-house-line-3 {
  top: 44.6%;
  left: 70.5%;
  height: 3px;
  width: 6.7%;
  transform: translateX(-50%) rotate(162deg);
}

/* Hide lines when disabled */
.energy-flow-line.disabled {
  opacity: 0.2;
  animation: none !important;
}

/* Reverse animation direction */
.energy-flow-line.reverse {
  animation-direction: reverse;
}

/* Base style for all diagram labels */
.diagram-label {
  position: absolute;
  background: rgba(100, 100, 100, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.25s ease;
  z-index: 100;
  pointer-events: auto;
  min-width: 82px;
  text-align: center;
  cursor: pointer;
}

.solar-item:hover img,
.solar-item:has(#solar-power:hover) img {
  transform: scale(1.08);
}

.solar-item:hover #solar-power,
.solar-item:has(#solar-power:hover) #solar-power {
  transform: translateX(-50%) scale(1.08);
}

.battery-item:hover img,
.battery-item:has(.diagram-label:hover) img {
  transform: scale(1.1);
}

.battery-item:hover #battery-power,
.battery-item:has(#battery-power:hover) #battery-power {
  transform: translateX(-50%) scale(1.1);
}

.battery-item:hover #battery-soc,
.battery-item:has(#battery-soc:hover) #battery-soc {
  transform: translateX(-50%) scale(1.1);
}

.ev-item:hover img,
.ev-item:has(.diagram-label:hover) img,
.grid-item:hover img,
.grid-item:has(#grid-power:hover) img {
  transform: scale(1.12);
}

.ev-item:hover #ev-power,
.ev-item:has(#ev-power:hover) #ev-power,
.ev-item:hover #ev-soc,
.ev-item:has(#ev-soc:hover) #ev-soc,
.grid-item:hover #grid-power,
.grid-item:has(#grid-power:hover) #grid-power {
  transform: translateX(-50%) scale(1.12);
}

.inverter-item:hover img {
  transform: scale(1.12);
}

.connection-box-item:hover img,
.connection-box-item:has(#house-power:hover) img {
  transform: scale(1.15);
}

.connection-box-item:hover #house-power,
.connection-box-item:has(#house-power:hover) #house-power {
  transform: translateX(-50%) scale(1.15);
}

/* Individual label positions - Puedes ajustar cada una independientemente */

/* Solar Power Label */
#solar-power {
  top: -80%;
  left: 0%;
  transform: translateX(-50%);
  color: rgb(250, 187, 28);
  border-color: rgba(250, 187, 28, 0.35);
}

/* Battery Power Label */
#battery-power {
  top: 10%;
  left: -50%;
  transform: translateX(-50%);
  margin-top: 8px;
  color: rgb(75, 192, 192);
  border-color: rgba(75, 192, 192, 0.35);
}

/* Battery SOC Label */
#battery-soc {
  top: -42%;
  left: -58%;
  transform: translateX(-50%);
  color: rgb(153, 102, 255);
  border-color: rgba(153, 102, 255, 0.35);
}

/* Grid Power Label */
#grid-power {
  bottom: 150%;
  left: 200%;
  transform: translateX(-50%);
  color: rgb(255, 99, 132);
  border-color: rgba(255, 99, 132, 0.35);
}

/* house Power Label */
#house-power {
  bottom: 170%;
  left: 70%;
  transform: translateX(-50%);
  color: rgb(57, 255, 20);
  border-color: rgba(57, 255, 20, 0.35);
}

/* EV Charger Power Label */
#ev-power {
  top: 76%;
  left: 180%;
  transform: translateX(-50%);
  margin-top: 8px;
  color: rgb(255, 255, 255);
  border-color: rgba(255, 255, 255, 0.25);
}

/* EV Charger SOC Label */
#ev-soc {
  top: -24%;
  left: 180%;
  transform: translateX(-50%);
  color: rgb(88, 166, 255);
  border-color: rgba(88, 166, 255, 0.35);
}


/* Responsive design - Mantiene proporciones exactas */
@media (max-width: 768px) {
  .energy-diagram-container {
    padding: 20px;
  }
  
  .energy-diagram-title {
    font-size: var(--font-size-lg);
    margin-bottom: 20px;
  }
  
  /* Las imágenes mantienen sus posiciones relativas automáticamente */
  /* Solo ajustamos tamaños de texto */
  
  .diagram-label {
    font-size: var(--font-size-sm);
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  .energy-diagram-container {
    padding: 15px;
  }
  
  .energy-diagram-title {
    font-size: var(--font-size-lg);
  }
  
  .diagram-label {
    font-size: var(--font-size-sm);
    padding: 5px 8px;
  }
}

/* ── Utility classes ── */
.hidden { display: none; }

.col-narrow { width: 60px; }
.col-action { width: 80px; }

/* ── AWS IoT layout ── */
.aws-subtitle {
  font-size: 1rem;
  opacity: 0.8;
}

.aws-certs-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.aws-cert-item {
  flex: 1;
  min-width: 160px;
}

.aws-save-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 140px;
  padding-top: 24px;
}

.installer-log-panel {
  margin-top: 22px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(129, 212, 250, 0.24);
  background: linear-gradient(145deg, rgba(3, 16, 31, 0.84), rgba(5, 30, 45, 0.68));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 18px 45px rgba(0,0,0,0.22);
}

.installer-log-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.installer-log-head h4 {
  margin: 0;
  color: #d9f6ff;
  letter-spacing: 0.02em;
}

.installer-log-head small {
  color: rgba(217, 246, 255, 0.62);
}

.installer-log-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.installer-log-actions .btn {
  padding: 8px 14px;
  min-width: 82px;
}

.installer-log-view {
  height: 320px;
  overflow-y: auto;
  border-radius: 12px;
  padding: 12px;
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    rgba(0, 7, 14, 0.88);
  background-size: 100% 28px;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #d8ecf5;
}

.installer-log-row {
  display: grid;
  grid-template-columns: 70px 24px 105px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  min-height: 20px;
  white-space: pre-wrap;
  word-break: break-word;
}

.installer-log-time {
  color: rgba(216, 236, 245, 0.48);
}

.installer-log-level {
  font-weight: 700;
  text-align: center;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
}

.installer-log-tag {
  color: rgba(216, 236, 245, 0.68);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.installer-log-row.error .installer-log-level,
.installer-log-row.error .installer-log-msg {
  color: #ff6b6b;
}

.installer-log-row.warn .installer-log-level,
.installer-log-row.warn .installer-log-msg {
  color: #ffd166;
}

.installer-log-row.info .installer-log-level {
  color: #80d8ff;
}

.installer-log-row.debug .installer-log-level,
.installer-log-row.verbose .installer-log-level {
  color: #b8c0ff;
}

.installer-log-empty {
  color: rgba(216, 236, 245, 0.55);
  text-align: center;
  padding: 36px 0;
}

.installer-log-empty.error {
  color: #ff6b6b;
}

@media (max-width: 950px) and (orientation: landscape) {
  #installers_view .fileUploadCol {
    padding-top: 16px;
  }

  #installers_view .cardCol {
    padding: 16px 18px;
  }

  #installers_view .installer-inner-panel {
    padding: 16px;
  }

  #installers_view .aws-certs-row {
    gap: 10px;
  }

  #installers_view .aws-cert-item {
    min-width: 120px;
  }

  #installers_view .localUpgradingCol label {
    min-height: 92px;
    padding: 10px;
  }

  #installers_view .fileIcon {
    width: 52px;
    height: 52px;
  }

  #installers_view .aws-save-col {
    flex-basis: 100%;
    min-width: 0;
    padding-top: 8px;
    justify-content: center;
  }

  #installers_view #aws_config_btn {
    min-width: 0;
    padding: 8px 18px;
  }

  .installer-log-head {
    align-items: flex-start;
  }

  .installer-log-row {
    grid-template-columns: 55px 22px 78px minmax(0, 1fr);
  }

  .installer-log-view {
    height: 240px;
    font-size: 11px;
  }
}

.lgTitle,
.headerTitle,
.history-modal-title,
.device-modal-title,
.energy-card-value,
.plus-icon,
.downloadCSVIcon,
.settings-icon {
  font-size: var(--font-size-xl);
}

.btn,
.inputFld,
.text-center,
.lgAdvise,
.tabNavTrigger button,
.tabNavTriggerWiFi button,
.statusCol,
.cardLbl,
.logview,
.fldStyle,
.custom-select-trigger,
.custom-select-option,
#newFileName,
.statsHeader,
.cardCol > h3,
.installer-inner-panel > h3,
.energy-diagram-title,
.devices-map-title,
.history-chart-title,
.energy-summary-title {
  font-size: var(--font-size-lg);
}

.cardCol,
.selectStyle,
.balanceCardContent,
.powerFldCol input[type="text"],
.powerFldCol::after,
.voltFldCol input[type="text"],
.voltFldCol::after,
.history-modal-nav-btn,
.password-toggle,
#page-info,
.pagination-btn,
.diagram-label,
#selected-file-name,
.progress-bar,
#credentials_alert,
.device-selected p,
.device-info-line,
.connection-type-btn,
.device-search-input,
.switch-label,
.modbus-queries-title,
.monitored-params-title,
.params-table th,
.param-name,
.param-value,
.param-input,
.param-select,
.aws-subtitle {
  font-size: var(--font-size-md);
}

.energy-card-label,
.energy-card-sublabel,
.diagram-modbus-slave p,
.diagram-device p,
.rs485-label,
.connection-label,
.connection-status,
.wifi-status,
.device-placeholder-text,
.device-name,
.device-ip,
.params-table,
.custom-select-trigger:after {
  font-size: var(--font-size-sm);
}

/* ─── Stats Variables editor + Mesh Variables table ─── */
.stats-vars-help { color: #888; font-size: 0.85em; margin: 4px 0 12px; }
.stats-vars-section { margin: 14px 0 6px; color: #ccc; font-size: 0.95em; }
.stats-vars-row { background: #1f1f1f; padding: 10px; border-radius: 6px; margin-bottom: 8px; }
.stats-vars-row-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.stats-vars-row-header strong { flex: 1; }
.stats-vars-unit-fixed { background: #333; padding: 2px 8px; border-radius: 4px; font-size: 0.85em; font-weight: 600; }
.stats-vars-name { flex: 1; padding: 4px 6px; background: #2a2a2a; border: 1px solid #444; color: #eee; border-radius: 3px; }
.stats-vars-unit { padding: 3px 7px; background: #2a2a2a; border: 1px solid #444; color: #eee; border-radius: 4px; font-size: 0.85em; font-weight: 600; }
.stats-vars-remove { background: #602020; color: #fff; border: none; border-radius: 3px; cursor: pointer; padding: 2px 8px; }
.stats-vars-empty { color: #666; font-style: italic; font-size: 0.85em; }
.stats-vars-actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.stats-vars-status { font-size: 0.85em; }
.stats-vars-status.success { color: #5cb85c; }
.stats-vars-status.error { color: #d9534f; }
.settings-vref-logic-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.settings-vref-logic-actions .stats-vars-help {
  margin: 0;
}
.logic-ref-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.logic-ref-remove {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(210,40,40,0.22);
  color: #ff7474;
  font-weight: 900;
  line-height: 22px;
  cursor: pointer;
}
.logic-ref-remove:hover {
  background: rgba(210,40,40,0.45);
  color: #fff;
}
.stats-vars-sources { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stats-vars-chips { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 26px; }
.stats-vars-value {
  font-weight: 700; color: #f29b07; font-size: 1em;
  min-width: 60px; text-align: right;
}
.btn-sm { padding: 4px 12px; font-size: 0.85em; min-width: 0; margin-top: 0; }

.logic-vars-row {
  border: 1px solid rgba(22,121,216,0.24);
  background: linear-gradient(135deg, rgba(22,121,216,0.10), rgba(31,31,31,0.96));
}
.logic-term-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.logic-stat-modal-content {
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#logic-stat-form {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.logic-stat-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.logic-stat-grid {
  grid-template-columns: minmax(160px, 1fr) 110px 150px;
}
.logic-stat-grid label {
  min-width: 0;
}
.logic-stat-preview {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid rgba(22,121,216,0.26);
  background: rgba(22,121,216,0.10);
  color: #dbeeff;
  font-weight: 800;
}
.logic-terms-head strong,
.logic-terms-head small {
  display: block;
}
.logic-terms-head small {
  color: rgba(255,255,255,0.52);
  font-size: .75rem;
}
.logic-terms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.logic-term-row {
  display: grid;
  grid-template-columns: 92px minmax(160px, 1fr) 96px 32px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
}
.logic-term-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: rgba(255,255,255,0.6);
  font-size: .72rem;
  font-weight: 800;
}
.logic-term-source {
  min-height: 34px;
}
.logic-terms-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.logic-terms-empty {
  padding: 12px;
  border: 1px dashed rgba(255,255,255,0.16);
  border-radius: 12px;
}

/* Source chips (used in editor + modal) */
.source-chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 12px;
  border: 1px solid; font-size: 0.85em; font-weight: 600;
}
.source-chip-plus { color: #888; margin: 0 2px; font-weight: 700; }
.source-chip-removable { display: inline-flex; align-items: center; cursor: pointer; }
.source-chip-x { margin-left: 4px; color: #d9534f; font-weight: 700; }

/* Mesh variables table device chip */
.mesh-device-chip {
  display: inline-block;
  padding: 2px 8px; border-radius: 10px;
  border: 1px solid; font-size: 0.8em; font-weight: 600;
}

#mesh-vars-table, .mesh-vars-table { width: 100%; border-collapse: collapse; }
#mesh-vars-table th, #mesh-vars-table td,
.mesh-vars-table th, .mesh-vars-table td { padding: 6px 10px; border-bottom: 1px solid #2a2a2a; text-align: left; font-size: 0.9em; }
#mesh-vars-table th, .mesh-vars-table th { background: #1f1f1f; }

/* Source picker modal */
.source-picker-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 10500;
  align-items: center; justify-content: center;
}
.source-picker-modal.open { display: flex; }
.source-picker-content {
  background: #181818; color: #eee;
  width: 92%; max-width: 640px; max-height: 86vh;
  border-radius: 10px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.source-picker-close {
  position: absolute; top: 10px; right: 12px;
  background: transparent; border: none; color: #888;
  font-size: 1.4em; cursor: pointer; width: 28px; height: 28px;
}
.source-picker-close:before { content: '×'; }
.source-picker-title { margin: 0; font-size: 1.1em; }
.source-picker-unit-badge { background: #333; padding: 2px 8px; border-radius: 4px; font-size: 0.8em; margin-left: 6px; }
.source-picker-selected {
  min-height: 36px; padding: 8px;
  background: #111; border: 1px dashed #333; border-radius: 6px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.source-picker-search {
  width: 100%; padding: 8px 10px; box-sizing: border-box;
  background: #2a2a2a; color: #eee; border: 1px solid #444; border-radius: 5px;
}
.source-picker-body {
  flex: 1; overflow-y: auto; min-height: 200px;
  display: flex; flex-direction: column; gap: 6px;
  padding-right: 4px;
}
.source-picker-group { border: 1px solid #333; border-radius: 6px; overflow: hidden; }
.source-picker-group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; cursor: pointer; user-select: none; font-weight: 600;
}
.source-picker-group-arrow { width: 12px; }
.source-picker-group-name { flex: 1; }
.source-picker-group-count { font-size: 0.8em; opacity: 0.7; }
.source-picker-group-body { background: #161616; max-height: 220px; overflow-y: auto; }
.source-picker-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 14px; cursor: pointer; border-top: 1px solid #222;
}
.source-picker-item:hover { background: #232323; }
.source-picker-item.selected { font-weight: 600; }
.source-picker-item-value { font-size: 0.85em; opacity: 0.8; }
.source-picker-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ===== Settings (Clients/Servers) ===== */
.settings-tabs { display:flex; gap:8px; margin-bottom:16px; }
.settings-tab-btn { background:transparent; border:1px solid #444; color:#aaa; padding:8px 18px; border-radius:6px 6px 0 0; cursor:pointer; font-weight:600; }
.settings-tab-btn.active { background:#1a1a1a; border-color:#ff8800; color:#ff8800; }
.settings-tab-pane.hidden { display:none; }
.settings-subtabs { display:flex; gap:6px; margin-bottom:12px; }
.settings-subtab-btn { background:transparent; border:1px solid #333; color:#aaa; padding:6px 14px; border-radius:4px; cursor:pointer; font-size:13px; }
.settings-subtab-btn.active { background:#222; border-color:#ff8800; color:#ff8800; }
.settings-subtab-pane.hidden { display:none; }
.settings-section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; gap:8px; flex-wrap:wrap; }
.settings-section-header h3 { margin:0; }
.settings-add-btn { background:#ff8800 !important; color:#fff !important; border:none !important; padding:6px 14px !important; font-size:13px !important; }
.settings-add-btn.btnBlue { background:linear-gradient(135deg, #2196F3, #1976D2) !important; }
.settings-save-btn { background:#ff8800 !important; color:#fff !important; border:none !important; padding:6px 14px !important; font-size:13px !important; margin-left:6px; }
.settings-inline-label { color:#bbb; font-size:13px; margin-right:12px; }
.settings-inline-input { background:#111; color:#fff; border:1px solid #333; border-radius:4px; padding:4px 8px; width:70px; margin-left:4px; }
.settings-queries-list { display:flex; flex-direction:column; gap:8px; }
.settings-empty { color:#777; font-style:italic; }
.settings-query-row { display:flex; align-items:center; gap:12px; background:#161616; border:1px solid #2a2a2a; border-radius:6px; padding:10px 14px; }
.sqr-icon { background:#ff8800; color:#fff; font-weight:700; font-size:11px; padding:6px 8px; border-radius:4px; min-width:42px; text-align:center; }
.sqr-icon.http { background:#ff8800; }
.sqr-icon.action { background:#2196F3; }
.sqr-main { flex:1; min-width:0; }
.sqr-title { color:#fff; font-weight:600; font-size:14px; }
.sqr-sub { color:#888; font-weight:400; font-size:12px; margin-left:6px; }
.sqr-chips { margin-top:4px; display:flex; flex-wrap:wrap; gap:4px; }
.settings-chip { background:#222; color:#ff8800; padding:2px 8px; border-radius:10px; font-size:11px; }
.settings-chip small { color:#888; margin-left:3px; }
.sqr-actions { display:flex; gap:6px; }
.sqr-actions .btn { padding:5px 12px !important; font-size:12px !important; }
.settings-map-table { width:100%; border-collapse:collapse; font-size:13px; }
.settings-map-table th { background:#1a1a1a; color:#ff8800; padding:8px 6px; text-align:left; font-weight:600; border-bottom:1px solid #333; }
.settings-map-table td { padding:6px; border-bottom:1px solid #222; }
.settings-cell-input { background:#111; color:#fff; border:1px solid #333; border-radius:3px; padding:4px 6px; font-size:12px; width:100%; box-sizing:border-box; }
.btn-row-del { background:#5a1a1a; color:#fff; border:none; border-radius:3px; width:24px; height:24px; cursor:pointer; font-weight:700; }
.btn-row-del:hover { background:#aa2222; }
.server-map-table-wrapper { max-height:480px; overflow-y:auto; border:1px solid #222; border-radius:4px; }
.settings-endpoint-hint { color:#888; font-size:12px; margin-top:8px; }
.settings-endpoint-hint code { background:#111; padding:2px 6px; border-radius:3px; color:#ff8800; }
.settings-resp { display:block; margin-top:8px; color:#ff8800; font-size:13px; min-height:18px; }
.settings-modal-wide { max-width:900px !important; width:90% !important; }
.settings-form-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:10px; margin-bottom:12px; }
.settings-form-grid label { display:flex; flex-direction:column; color:#bbb; font-size:12px; gap:3px; }
.settings-form-grid label.hidden { display:none; }
.ref-core-row { background:#1a1410; }
.ref-core-row td { color:#ffaa44 !important; font-weight:500; }
.settings-section-actions { justify-content:center; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
/* ===== Settings extras ===== */
.settings-tab-pane, .settings-subtab-pane { background:transparent; padding:0; }
.settings-tab-pane > .devices-map-container,
.settings-subtab-pane > .devices-map-container { margin-top:20px; }
.settings-source-btn { background:#111; border:1px solid #333; color:#ff8800; border-radius:4px; padding:4px 8px; cursor:pointer; font-size:12px; width:100%; text-align:left; }
.settings-source-btn:hover { border-color:#ff8800; }
.src-cell { cursor:pointer; }
.src-cell:hover { background:#1a1a1a; }
.settings-source-add-btn { background:transparent; border:1px dashed #555; color:#ff8800; border-radius:50%; width:24px; height:24px; line-height:1; padding:0; cursor:pointer; font-size:16px; font-weight:700; }
.settings-source-add-btn:hover { border-color:#ff8800; background:#ff880020; }
.settings-source-picker-cell { display:flex; align-items:center; gap:8px; min-height:34px; padding:4px 8px; background:#111; border:1px solid #333; border-radius:4px; cursor:pointer; }
.settings-source-picker-cell:hover { border-color:#ff8800; }
.settings-srcp-body { max-height:50vh; overflow-y:auto; margin:10px 0; }
.settings-srcp-group { margin-bottom:6px; border-radius:4px; overflow:hidden; }
.settings-srcp-group-header { display:flex; justify-content:space-between; padding:8px 12px; cursor:pointer; font-weight:600; }
.settings-srcp-group-count { background:rgba(0,0,0,0.4); border-radius:10px; padding:0 8px; font-size:11px; }
.settings-srcp-items { background:#0a0a0a; padding:4px; }
.settings-srcp-item { background:#161616; padding:8px 10px; margin:3px 0; border-radius:3px; cursor:pointer; display:flex; justify-content:space-between; color:#fff; font-size:13px; }
.settings-srcp-item:hover { background:#222; }
.settings-srcp-item.selected { background:#ff880033; color:#ff8800; }
.settings-srcp-item-unit { color:#888; font-size:11px; }
.settings-srcp-empty { color:#777; text-align:center; padding:20px; }
/* ===== Energy Flow tile popup ============================================ */
.energy-tile-popup {
  position: absolute;
  display: none;
  z-index: 9999;
  min-width: 220px;
  max-width: 320px;
  background: rgba(20,20,24,0.96);
  color: #eaeaea;
  border: 1px solid #ff8a3d;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 10px 12px;
  font-size: 13px;
}
.energy-tile-popup .etp-core + .etp-core { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #444; }
.energy-tile-popup .etp-core-title { font-weight: 600; color: #ff8a3d; margin-bottom: 6px; }
.energy-tile-popup .etp-list { list-style: none; margin: 0; padding: 0; }
.energy-tile-popup .etp-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 3px 0;
}
.energy-tile-popup .etp-val { font-variant-numeric: tabular-nums; color: #fff; }
.energy-tile-popup .etp-empty { color: #999; font-style: italic; font-size: 12px; }
.energy-tile-popup .etp-subitem {
  color: #8e9299;
  font-size: 11px;
  margin: -1px 0 5px 2px;
  list-style: none;
}
.energy-tile-popup .etp-total {
  display: flex;
  justify-content: flex-end;
  color: #39ff14;
  font-weight: 700;
  margin-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 6px;
  list-style: none;
}
.energy-tile-popup .etp-formula-chip {
  background: rgba(57,255,20,0.14);
  color: #39ff14;
  border-color: rgba(57,255,20,0.55);
}
.energy-tile-popup .etp-grid-chip {
  background: rgba(255,99,132,0.14);
  color: #ff6384;
  border-color: rgba(255,99,132,0.55);
}

/* ===== Settings · Network cards ============================================ */
.net-cards-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}
.net-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.net-card-body { padding: 4px 2px; }
.net-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

/* Input con botón superpuesto a la derecha (icono dentro del input) */
.net-input-wrap { position: relative; display: block; }
.net-input-with-btn { padding-right: 42px !important; width: 100%; box-sizing: border-box; }
.net-input-icon-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  height: 28px;
  min-width: 32px;
  padding: 0 8px;
  background: transparent;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.net-input-icon-btn:hover { background: rgba(255,255,255,0.12); }

.net-hint { color: #aaa; font-size: 11px; display: block; margin-top: 4px; }

/* WiFi scan results list */
.net-wifi-list {
  margin-top: 6px;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
}
.net-wifi-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #fff;
  font-size: 13px;
  gap: 8px;
}
.net-wifi-item:last-child { border-bottom: none; }
.net-wifi-item:hover { background: rgba(255,255,255,0.08); }
.net-wifi-item.selected { background: rgba(255,136,0,0.18); }
.net-wifi-item .nw-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-wifi-item .nw-meta { color: #aaa; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.net-wifi-item .nw-lock { font-size: 12px; color: #ffd9a8; }
.net-wifi-empty { padding: 10px; color: #aaa; font-size: 12px; text-align: center; }

.net-reboot-prompt {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: rgba(255, 136, 0, 0.12);
  border: 1px solid #ff8800;
  border-radius: 6px;
  color: #ffd9a8;
}
.net-reboot-prompt.hidden { display: none; }

/* Sliders activos en azul (en lugar del verde por defecto) en cards de red */
.net-card .switchCol input:checked + span,
.net-card .switch input:checked + .switchTriggerStyle,
.switch-row .switch input:checked + .switchTriggerStyle,
.switch-row .switchCol input:checked + span {
  background-color: #2196F3;
}

/* ===== Responsive · Settings, Stats vars y Network cards (vertical mobile) === */
@media (max-width: 768px) {
  /* Network cards: WiFi y AP en filas separadas en vertical */
  .net-cards-row { flex-direction: column; }
  .net-card { width: 100%; }

  /* Save / acciones de los cards de red: que no se salgan */
  .net-card-actions { flex-wrap: wrap; gap: 8px; }
  .net-card-actions .btn { flex: 1 1 auto; min-width: 0; }
  .net-card-actions .net-resp,
  .net-card-actions small { flex: 1 1 100%; text-align: center; }

  /* Stats vars: cabecera de cada variable apilada para que ni unidad ni × se salgan */
  .stats-vars-row-header { flex-wrap: wrap; row-gap: 6px; }
  .stats-vars-name { flex: 1 1 100%; min-width: 0; }
  .stats-vars-value { flex: 1 1 auto; text-align: left; min-width: 0; }
  .stats-vars-unit,
  .stats-vars-unit-fixed { flex: 0 0 auto; }
  .stats-vars-remove { flex: 0 0 auto; margin-left: auto; }
  .stats-vars-sources { flex-wrap: wrap; }
  .stats-vars-sources .btn { flex: 1 1 100%; }

  /* Modbus / HTTP query rows: stack vertical, chips no overflow */
  .settings-query-row { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .sqr-icon { flex: 0 0 auto; }
  .sqr-main { flex: 1 1 100%; min-width: 0; order: 3; }
  .sqr-title { white-space: normal; word-break: break-word; font-size: 13px; }
  .sqr-sub { display: block; margin-left: 0; margin-top: 2px; font-size: 11px; }
  .sqr-actions { flex: 1 1 auto; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .sqr-actions .btn { padding: 4px 8px !important; font-size: 11px !important; flex: 0 1 auto; min-width: 0; }

  /* Section headers: que el botón Add no empuje fuera del card */
  .settings-section-header { flex-direction: column; align-items: stretch; }
  .settings-section-header .btn { width: 100%; margin-left: 0 !important; }
  .settings-section-actions { flex-direction: column; }
  .settings-section-actions .btn { width: 100%; }

  .stats-vars-actions { flex-wrap: wrap; row-gap: 8px; margin-top: 16px; }
  .stats-vars-actions .btn { flex: 1 1 calc(50% - 4px); margin: 0; }
  .stats-vars-actions .stats-vars-status { flex: 1 1 100%; text-align: center; }
  .logic-stat-grid,
  .logic-term-row {
    grid-template-columns: 1fr;
  }
  .logic-term-source {
    width: 100%;
  }
}

/* === Mesh Actions + Program Schedules === */
.action-cards-container {
  display: block;
  padding: 12px 0;
}
.force-insertions-shell {
  width: 100%;
}
.force-insertions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.force-insertions-head h3 {
  margin: 0;
  color: rgba(255,255,255,0.92);
  font-size: 1rem;
  letter-spacing: .02em;
}
.force-insertions-add {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(22,121,216,0.7);
  border-radius: 999px;
  background: rgba(22,121,216,0.16);
  color: #8fc9ff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.force-insertions-add:hover {
  background: rgba(22,121,216,0.28);
  color: #fff;
}
.force-insertions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.force-insertions-empty {
  width: 100%;
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 14px;
  color: rgba(255,255,255,0.52);
  background: rgba(255,255,255,0.035);
  font-size: .86rem;
}
.force-insertion-picker {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
}
.force-picker-option {
  cursor: pointer;
}
.program-watch-results.force-insertion-results {
  max-height: min(42vh, 260px);
  overflow-y: auto !important;
  padding: 0 4px 22px 0;
  scroll-padding-bottom: 24px;
  box-sizing: border-box;
}
.force-insertion-results .source-picker-group-body {
  max-height: none;
  overflow: visible;
  padding-bottom: 12px;
}
.force-insertion-results .source-picker-item:last-child {
  margin-bottom: 12px;
}
@media (max-width: 640px) {
  .action-card {
    width: 100%;
  }
}
.action-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.action-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.action-card-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.force-widget-remove {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(239,68,68,0.14);
  color: #ff6b6b;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}
.force-widget-remove:hover {
  background: rgba(239,68,68,0.28);
  color: #fff;
}
.action-card-state {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
}
.action-card-state.is-on  { background: #f80; color: #16110a; }
.action-card-state.is-off { background: #888; color: #fff; }
.action-card-state.is-unknown { background: #444; color: #ccc; }
.action-card-state.is-value { background: rgba(255,255,255,0.12); color: #f2f2f2; }
.action-card-state.is-editing { background: #1679d8; color: #fff; }
.action-card-state.is-applying { background: #f80; color: #16110a; }
.action-card.is-pending { outline: 1px dashed #f80; }
.action-card.is-pending .action-card-state::after { content: ' …'; opacity: 0.7; }
.action-card.is-editing {
  outline: 1px solid #1679d8;
  background: rgba(22,121,216,0.16);
}
.action-card.is-missing {
  border-style: dashed;
  opacity: .75;
}
.action-card-buttons { display: flex; gap: 8px; }
.action-card-buttons .btn { flex: 1; }
.action-card .switch input:checked + .switchTriggerStyle {
  background-color: #f80;
}
.action-variable-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.action-variable-range {
  width: 100%;
  accent-color: #1679d8;
}
.action-range-limits {
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,0.46);
  font-size: 0.72em;
  line-height: 1.1;
}

.settings-help-inline {
  font-size: 0.85em;
  font-weight: normal;
  opacity: 0.7;
  margin-left: 8px;
}
.settings-field-label {
  display: block;
  margin: 8px 0 2px;
  font-size: 0.9em;
}
.settings-inline-input.wide {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
}
.schedule-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 6px 0 8px;
}
.schedule-days label { font-size: 0.9em; }

.program-scheduler-shell {
  width: 100%;
}
.program-schedules-actions .btnBlue {
  background: #1679d8;
  border-color: #1679d8;
  color: #fff;
}
.program-schedules-actions .btnBlue:disabled {
  background: #5f5f5f !important;
  border-color: #5f5f5f !important;
  color: rgba(255,255,255,0.55) !important;
  opacity: .62 !important;
  cursor: not-allowed;
}
.program-profile-row .btnBlue {
  background: #1679d8;
  border: 1px solid #1679d8;
  color: #fff;
}
.program-profile-row .btnBlue:hover {
  background: #2196f3;
}
.program-profile-row .program-block-days {
  margin-top: 0;
}
.program-profile-row {
  border: none;
}
.program-profile-row .stats-vars-remove {
  background: #602020;
}
.program-profile-row .stats-vars-value {
  color: #1679d8;
}
.program-profile-row .stats-vars-remove:hover,
.program-action-line .stats-vars-remove:hover,
.program-block-delete:hover {
  background: #d33737;
  color: #fff;
}
.program-profile-title {
  font-weight: 800;
}
.program-profile-description-row {
  align-items: center;
}
.program-profile-description {
  flex: 2;
  min-width: 220px;
  color: rgba(255,255,255,0.62);
  font-size: 0.9em;
  line-height: 1.25;
}
.alarm-report-variable {
  min-width: 190px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.program-profile-days {
  display: flex;
  align-items: center;
}
.program-profile-days .program-block-days {
  margin: 0;
}
.program-scheduler {
  --program-blue: #1679d8;
  --program-orange: #ff8800;
  --program-ink: rgba(255,255,255,0.92);
  --program-muted: rgba(255,255,255,0.58);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.program-scheduler-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.program-scheduler-head h4 {
  margin: 0 0 3px;
  color: var(--program-ink);
  font-size: 1.05rem;
}
.program-scheduler-head p {
  margin: 0;
  color: var(--program-muted);
  font-size: 0.86rem;
}
.program-action-palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 10px;
}
.program-action-empty {
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 18px;
  color: var(--program-muted);
  background: rgba(255,255,255,0.04);
}
.program-action-chip {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  min-height: 86px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(22,121,216,0.22), rgba(6,16,31,0.68));
  color: var(--program-ink);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  overflow: hidden;
}
.program-action-chip strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.15;
}
.program-action-chip small {
  grid-column: 2;
  color: var(--program-muted);
  font-size: 0.72rem;
}
.program-action-chip:hover,
.program-action-chip.is-open {
  transform: scale(1.045);
  min-height: 156px;
  border-color: rgba(255,136,0,0.75);
  box-shadow: 0 14px 34px rgba(0,0,0,0.28);
}
.program-insert-list {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .18s ease, opacity .18s ease, margin-top .18s ease;
}
.program-action-chip:hover .program-insert-list,
.program-action-chip.is-open .program-insert-list,
.program-action-chip:focus-within .program-insert-list {
  max-height: 178px;
  opacity: 1;
  margin-top: 10px;
  overflow-y: auto;
}

@media (hover: none), (pointer: coarse) {
  .program-action-chip:hover {
    transform: none;
    min-height: 86px;
    border-color: rgba(255,255,255,0.14);
    box-shadow: none;
  }
  .program-action-chip:hover .program-insert-list {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    overflow: hidden;
  }
  .program-action-chip.is-open {
    transform: scale(1.035);
    min-height: 156px;
    border-color: rgba(255,136,0,0.75);
    box-shadow: 0 14px 34px rgba(0,0,0,0.28);
  }
  .program-action-chip.is-open .program-insert-list {
    max-height: 178px;
    opacity: 1;
    margin-top: 10px;
    overflow-y: auto;
  }
}
.program-insert-option {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 5px;
  background: rgba(255,255,255,0.035);
  text-align: left;
  cursor: pointer;
}
.program-insert-option:hover {
  border-color: var(--insert-color);
  background: color-mix(in srgb, var(--insert-color) 16%, transparent);
}
.program-insert-option.disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.65);
}
.program-insert-option.disabled:hover {
  border-color: transparent;
  background: rgba(255,255,255,0.035);
}
.program-insert-option .source-chip {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.program-insert-empty {
  padding: 8px 10px;
  border-radius: 12px;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
  font-size: .76rem;
}
.program-action-toggle {
  border-color: rgba(255,136,0,0.42);
  background: linear-gradient(145deg, rgba(255,136,0,0.32), rgba(58,35,8,0.72));
}
.program-action-toggle:hover {
  border-color: rgba(255,136,0,0.82);
  background: linear-gradient(145deg, rgba(255,136,0,0.45), rgba(82,45,7,0.74));
}
.program-switch-ico {
  grid-row: 1 / span 2;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #666;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}
.program-switch-ico span {
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s ease;
}
.program-action-toggle:hover .program-switch-ico {
  background: var(--program-orange);
}
.program-action-toggle:hover .program-switch-ico span {
  transform: translateX(20px);
}
.program-switch-ico.off {
  background: #666;
}
.program-switch-ico.on {
  background: var(--program-orange);
}
.program-switch-ico.on span {
  transform: translateX(20px);
}
.program-action-pid {
  border-color: rgba(22,121,216,0.58);
  background: linear-gradient(145deg, rgba(22,121,216,0.34), rgba(5,20,40,0.76));
  box-shadow: inset 0 0 0 1px rgba(86,178,255,0.28);
}
.program-action-pid:hover {
  border-color: rgba(86,178,255,0.9);
  background: linear-gradient(145deg, rgba(22,121,216,0.48), rgba(5,24,52,0.82));
  box-shadow: inset 0 0 0 1px rgba(86,178,255,0.62), 0 14px 34px rgba(0,0,0,0.28);
}
.program-mini-slider {
  grid-row: 1 / span 2;
  height: 8px;
  width: 48px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  overflow: hidden;
  align-self: center;
}
.program-mini-slider span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--program-blue);
}
.program-action-pid:hover .program-mini-slider span {
  animation: programPidSweep 1.25s ease-in-out both;
}
.program-block-icon .program-mini-slider span,
.program-action-config-hero .program-mini-slider span {
  width: 50%;
  animation: none;
}
@keyframes programPidSweep {
  0% { width: 0; }
  34% { width: 100%; }
  58% { width: 50%; }
  82% { width: 100%; }
  100% { width: 0; }
}
.program-day-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(48px, 1fr));
  gap: 7px;
}
.program-day-tabs button {
  border: 0;
  border-radius: 12px;
  padding: 9px 8px;
  color: white;
  background: rgba(22,121,216,0.78);
  cursor: pointer;
  font-weight: 700;
  transition: transform .16s ease, background .16s ease;
}
.program-day-tabs .day-mobile {
  display: none;
}
.program-day-tabs button:hover {
  transform: translateY(-1px);
}
.program-day-tabs button.active {
  background: var(--program-orange);
}
.program-day-tabs button.disabled,
.program-day-tabs button:disabled {
  background: #4b4b4b;
  color: rgba(255,255,255,0.36);
  cursor: not-allowed;
  transform: none;
}
.program-day-tabs button.active.disabled,
.program-day-tabs button.active:disabled {
  background: #5b5b5b;
  color: rgba(255,255,255,0.48);
}
.program-timeline-wrap {
  border-radius: 20px;
  background: rgba(2,10,22,0.45);
  border: 1px solid rgba(255,255,255,0.11);
  padding: 10px;
  overflow: hidden;
  box-sizing: border-box;
}
.program-timeline-axis {
  position: relative;
  height: 22px;
  min-width: 0;
  width: 100%;
}
.program-timeline-axis span {
  position: absolute;
  transform: translateX(-50%);
  color: var(--program-muted);
  font-size: 0.72rem;
}
.program-timeline-axis span.is-last {
  transform: translateX(-100%);
}
.program-sun-band {
  height: 10px;
  min-width: 0;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(22,121,216,0.95) 0%,
    rgba(22,121,216,0.95) 22.92%,
    rgba(255,136,0,0.9) 31.25%,
    rgba(255,184,58,0.98) 56.25%,
    rgba(255,136,0,0.95) 80.21%,
    rgba(22,121,216,0.95) 90.63%,
    rgba(22,121,216,0.95) 100%);
  box-shadow: 0 0 18px rgba(255,136,0,0.12);
}
.program-action-timeline .program-sun-band {
  background: linear-gradient(90deg,
    rgba(22,121,216,0.95) 0%,
    rgba(22,121,216,0.95) 22.92%,
    rgba(255,136,0,0.88) 31.25%,
    rgba(255,184,58,0.98) 56.25%,
    rgba(255,136,0,0.88) 80.21%,
    rgba(22,121,216,0.95) 90.63%,
    rgba(22,121,216,0.95) 100%);
}
.program-timeline-body {
  position: relative;
  min-width: 0;
  width: 100%;
  margin-top: 4px;
  border-radius: 16px;
  user-select: none;
  touch-action: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.055) 0 1px, transparent 1px calc(100% / 24)),
    rgba(255,255,255,0.025);
}
.program-timeline-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--program-muted);
  font-size: 0.86rem;
}
.program-schedule-block {
  position: absolute;
  min-width: 74px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 0;
  color: white;
  cursor: pointer;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
  transition: transform .15s ease, filter .15s ease;
}
.program-timeline-wrap.is-editor .program-schedule-block {
  cursor: grab;
  min-width: 0;
}
.program-timeline-wrap.is-editor .program-schedule-block:active {
  cursor: grabbing;
}
.program-schedule-block:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}
.program-schedule-block.toggle {
  border: 1px solid rgba(255,136,0,0.45);
  background: linear-gradient(145deg, rgba(255,136,0,0.38), rgba(58,35,8,0.78));
}
.program-schedule-block.pid {
  border: 1px solid rgba(22,121,216,0.62);
  background: linear-gradient(145deg, rgba(22,121,216,0.46), rgba(5,20,40,0.84));
}
.program-schedule-block.disabled {
  opacity: 0.42;
}
.program-schedule-block strong,
.program-schedule-block small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.program-schedule-block strong {
  font-size: 0.78rem;
  padding: 10px 38px 0 0;
}
.program-schedule-block small {
  font-size: 0.66rem;
  opacity: 0.72;
}
.program-block-kind {
  position: absolute;
  right: 8px;
  top: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.program-block-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.program-block-icon .program-switch-ico,
.program-block-icon .program-mini-slider {
  grid-row: auto;
  transform: scale(.82);
}
.program-block-gear {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.34);
  color: #fff;
  font-size: 0.82rem;
  line-height: 22px;
  z-index: 4;
}
.program-block-gear:hover {
  background: rgba(255,255,255,0.22);
}
.program-block-time {
  position: absolute;
  top: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.34);
  color: rgba(255,255,255,0.86);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 15px;
  pointer-events: none;
}
.program-block-time-start {
  left: 28px;
}
.program-block-time-end {
  right: 30px;
}
.program-block-days {
  display: flex;
  gap: 4px;
  margin-top: 3px;
}
.program-block-days span {
  opacity: .35;
  font-size: .68rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
}
.program-block-days span.is-on {
  opacity: 1;
  color: #9fd1ff;
  background: rgba(22,121,216,0.18);
}
.program-block-days span.is-empty {
  color: rgba(255,255,255,0.38);
}
.program-block-delete {
  position: absolute;
  left: 6px;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.38);
  color: #fff;
  font-size: 0.82rem;
  line-height: 18px;
  text-align: center;
  z-index: 3;
}
.program-block-resize {
  position: absolute;
  right: 0;
  top: 0;
  width: 50%;
  height: 100%;
  display: none;
  cursor: ew-resize;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12));
  z-index: 2;
}
.program-timeline-wrap.is-editor .program-schedule-block:hover .program-block-delete,
.program-timeline-wrap.is-editor .program-schedule-block:hover .program-block-resize,
.program-timeline-wrap.is-editor .program-schedule-block.is-open .program-block-delete,
.program-timeline-wrap.is-editor .program-schedule-block.is-open .program-block-resize,
.program-timeline-wrap.is-editor .program-schedule-block.is-open .program-block-gear,
.program-timeline-wrap.is-editor .program-schedule-block:hover .program-block-gear {
  display: flex;
}
.program-drag-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 14px rgba(255,255,255,0.7);
  pointer-events: none;
  z-index: 5;
}
.program-drag-marker span {
  position: absolute;
  top: 50%;
  left: 7px;
  transform: translateY(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,0.68);
  color: #fff;
  font-size: 0.68rem;
  white-space: nowrap;
}
.program-drag-marker.is-end span {
  left: auto;
  right: 7px;
}
.program-scheduler-summary .program-scheduler-head {
  margin-bottom: 2px;
}
.program-schedule-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.program-schedule-card {
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 18px;
  padding: 14px;
  min-height: 104px;
  text-align: left;
  color: white;
  cursor: pointer;
  background: linear-gradient(145deg, rgba(255,136,0,0.23), rgba(4,13,25,0.72));
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.program-schedule-card.pid {
  background: linear-gradient(145deg, rgba(22,121,216,0.28), rgba(4,13,25,0.72));
}
.program-schedule-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,136,0,0.72);
  box-shadow: 0 16px 38px rgba(0,0,0,0.25);
}
.program-schedule-card-type {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.78);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.program-schedule-card strong,
.program-schedule-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.program-schedule-card strong {
  font-size: 1rem;
}
.program-schedule-card small {
  margin: 4px 0 8px;
  color: rgba(255,255,255,0.58);
  font-size: 0.76rem;
}
.program-editor {
  --program-blue: #1679d8;
  --program-orange: #ff8800;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.program-action-add-palette {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}
.program-actions-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.program-video-editor {
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
}
.program-timeline-header {
  margin-bottom: 4px;
  padding: 6px 10px;
}
.program-action-line {
  display: block;
  align-items: center;
  border: 0;
  border-radius: 12px;
  padding: 1px 0;
  background: transparent;
}
.program-action-line.is-toggle {
  background: transparent;
}
.program-action-line.is-pid {
  background: transparent;
}
.program-action-line-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 120px 34px;
  gap: 10px;
  align-items: center;
}
.program-action-line-head .program-switch-ico,
.program-action-line-head .program-mini-slider {
  grid-row: auto;
}
.program-target-input {
  min-width: 0;
}
.program-action-mesh-var {
  display: block;
  margin: 7px 0 8px 62px;
  color: rgba(255,255,255,0.48);
  font-size: .72rem;
}
.program-action-config-body {
  --program-blue: #1679d8;
  --program-orange: #ff8800;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
#program-action-config-modal .device-modal-content {
  width: min(94vw, 760px);
  max-height: calc(100dvh - 24px);
  margin: 12px auto;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
#program-schedule-modal .device-modal-content {
  max-height: calc(100dvh - 24px);
  margin: 12px auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#program-action-config-form,
#program-schedule-form {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
#program-action-config-form::-webkit-scrollbar,
#program-schedule-form::-webkit-scrollbar,
.program-watch-results::-webkit-scrollbar,
.program-conditions-table::-webkit-scrollbar {
  width: 8px;
}
#program-action-config-form::-webkit-scrollbar-thumb,
#program-schedule-form::-webkit-scrollbar-thumb,
.program-watch-results::-webkit-scrollbar-thumb,
.program-conditions-table::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.22);
  border-radius: 999px;
}
#program-action-config-modal .device-modal-actions,
#program-schedule-modal .device-modal-actions {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.18));
}
#program-action-config-modal .device-modal-title,
#program-schedule-modal .device-modal-title {
  flex: 0 0 auto;
}
.program-action-config-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
}
.program-action-config-hero strong,
.program-action-config-hero small {
  display: block;
}
.program-action-config-hero small {
  color: rgba(255,255,255,0.55);
  font-size: .78rem;
}
.program-action-config-body.is-toggle .program-action-config-hero {
  border: 1px solid rgba(255,136,0,0.28);
}
.program-action-config-body.is-pid .program-action-config-hero {
  border: 1px solid rgba(22,121,216,0.34);
}
.program-action-config-toggle {
  width: 58px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 5px;
  background: rgba(0,0,0,0.22);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.program-action-config-toggle .program-switch-ico {
  grid-row: auto;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
}
.program-action-config-toggle:hover {
  border-color: rgba(255,136,0,0.72);
}
.program-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}
.program-config-grid.is-watchdog {
  grid-template-columns: minmax(190px, 1fr) minmax(120px, .45fr) minmax(130px, .55fr);
}
.program-config-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.program-config-grid label > span {
  color: rgba(255,255,255,0.72);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.program-config-grid label > span small {
  margin-left: 8px;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
}
.program-config-grid small,
.program-config-note {
  margin: 0;
  color: rgba(255,255,255,0.48);
  font-size: .68rem;
}
.program-watch-field {
  min-width: 0;
}
.program-watch-picker {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.program-target-picker {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.program-target-selected {
  width: 100%;
  cursor: pointer;
  color: inherit;
}
.program-target-selected:hover {
  border-color: #ff4d4d;
  background: rgba(255,77,77,0.08);
}
.program-pid-params {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(22,121,216,0.24);
  background: rgba(255,255,255,0.035);
}
.program-pid-param-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 10px;
}
.program-pid-param-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: rgba(255,255,255,0.72);
  font-size: .72rem;
  font-weight: 800;
}
.program-action-config-body .fldStyle {
  min-height: 28px;
  height: 28px;
  padding: 3px 8px;
  border-radius: 9px;
  font-size: .76rem;
  line-height: 1.1;
}
.program-action-config-body select.fldStyle {
  padding-right: 22px;
}
.program-watch-selected {
  min-height: 32px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px;
  border: 1px dashed rgba(255,255,255,0.16);
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  min-width: 0;
}
.program-watch-results {
  max-height: min(32vh, 260px);
  min-height: 92px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 6px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.program-watch-group {
  border-radius: 12px;
  overflow: visible;
}
.program-watch-results .source-picker-group-body {
  max-height: none;
  overflow: visible;
}
.program-watch-item {
  cursor: pointer;
}
.program-watch-item:hover {
  background: rgba(255,255,255,0.06);
}
.program-watch-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 6px;
  background: rgba(255,255,255,0.035);
  color: rgba(255,255,255,0.78);
  cursor: pointer;
}
.program-watch-option:hover,
.program-watch-option.selected {
  border-color: var(--insert-color);
  background: color-mix(in srgb, var(--insert-color) 16%, transparent);
}
.program-watch-option .source-chip {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.program-watch-value {
  flex: 0 0 auto;
  color: rgba(255,255,255,0.48);
  font-size: .72rem;
}
.program-conditions-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,136,0,0.2);
  background: rgba(255,255,255,0.035);
}
.program-conditions-head strong,
.program-conditions-head small {
  display: block;
}
.program-conditions-head strong {
  color: rgba(255,255,255,0.88);
}
.program-conditions-head small {
  color: rgba(255,255,255,0.48);
  font-size: .72rem;
}
.program-conditions-empty {
  padding: 10px;
  border: 1px dashed rgba(255,255,255,0.16);
  border-radius: 12px;
  color: rgba(255,255,255,0.5);
  font-size: .78rem;
}
.program-conditions-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(30vh, 280px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.program-condition-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 56px 96px 28px;
  gap: 6px;
  align-items: center;
}
.program-condition-row.is-pid {
  grid-template-columns: minmax(160px, 1fr) 56px 86px 104px 28px;
}
.alarm-condition-row {
  grid-template-columns: 84px 1fr minmax(150px, 220px) 34px;
}
.program-condition-source {
  min-width: 0;
  overflow: hidden;
}
.program-condition-source .source-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.program-condition-remove {
  height: 28px;
  padding: 0 8px;
}
.alarm-variable-picker {
  margin-top: 14px;
}
.alarm-code-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #aaa;
  font-size: 0.82em;
}
.alarm-code-label input {
  min-width: 76px;
}
.alarm-add-condition {
  margin-top: 10px;
}
.program-pid-scale-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.52);
  font-size: .72rem;
  font-weight: 800;
}
.program-pid-scale-label input {
  width: 58px;
}
.program-pid-scale {
  text-align: center;
}
.program-action-timeline {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 12px;
}
.program-action-timeline .program-schedule-block {
  height: 30px;
}
.program-editor-top {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.11);
}
.program-name-input {
  width: 100%;
  font-size: 1.25rem;
  font-weight: 800;
}
.program-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.program-enabled-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: rgba(255,255,255,0.78);
}
.program-editor-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(22,121,216,0.12);
  color: rgba(255,255,255,0.72);
}
.program-editor-meta small {
  color: rgba(255,255,255,0.5);
}
.program-editor-time-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
}
.program-editor-time-row label {
  color: rgba(255,255,255,0.72);
  font-size: 0.86rem;
}
.program-json-preview {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 10px 12px;
  color: rgba(255,255,255,0.76);
  background: rgba(0,0,0,0.28);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .program-timeline-axis {
    display: none;
  }
  .program-action-palette {
    grid-template-columns: 1fr;
  }
  .program-day-tabs {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }
  .program-day-tabs button {
    padding: 8px 0;
    min-width: 0;
    font-size: .78rem;
    border-radius: 10px;
  }
  .program-day-tabs .day-full {
    display: none;
  }
  .program-day-tabs .day-mobile {
    display: inline;
  }
  .program-editor-grid,
  .program-editor-time-row,
  .program-config-grid,
  .program-config-grid.is-watchdog,
  .program-pid-param-grid,
  .program-condition-row,
  .program-action-add-palette,
  .program-action-line-head {
    grid-template-columns: 1fr;
  }
  .program-action-mesh-var { margin-left: 0; }
}

@media (hover: none), (pointer: coarse) {
  .program-timeline-wrap.is-editor .program-schedule-block:hover .program-block-delete,
  .program-timeline-wrap.is-editor .program-schedule-block:hover .program-block-resize,
  .program-timeline-wrap.is-editor .program-schedule-block:hover .program-block-gear {
    display: none;
  }
  .program-timeline-wrap.is-editor .program-schedule-block.is-open .program-block-delete,
  .program-timeline-wrap.is-editor .program-schedule-block.is-open .program-block-resize,
  .program-timeline-wrap.is-editor .program-schedule-block.is-open .program-block-gear {
    display: flex;
  }
}

@media (min-width: 721px) and (max-width: 920px) {
  #program-action-config-modal .device-modal-content {
    width: 96vw;
    padding: 14px;
  }
  .program-action-config-hero {
    align-items: flex-start;
  }
  .program-condition-row {
    grid-template-columns: 56px minmax(76px, 1fr) 28px;
  }
  .program-condition-row.is-pid {
    grid-template-columns: 56px minmax(76px, 1fr) 104px 28px;
  }
  .program-condition-source {
    grid-column: 1 / -1;
  }
  .program-pid-param-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .program-action-config-hero {
    flex-direction: column;
  }
  .program-condition-row,
  .program-condition-row.is-pid {
    grid-template-columns: 1fr;
  }
  .program-condition-source {
    grid-column: auto;
  }
  .program-condition-remove {
    width: 100%;
  }
  .program-pid-scale-label input {
    flex: 1;
    width: auto;
  }
}

/* Keep Force Insertions compact while making the full result list scrollable. */
#force-insertion-results.program-watch-results.force-insertion-results {
  display: block !important;
  max-height: 260px !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  min-height: 0 !important;
  padding: 0 8px 30px 0 !important;
  box-sizing: border-box !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
#force-insertion-results .source-picker-group {
  overflow: visible !important;
}
#force-insertion-results .source-picker-group-body {
  display: block !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: 18px !important;
}
#force-insertion-results .source-picker-item:last-child {
  margin-bottom: 18px !important;
}
