:root {
  /* Harmony admin theme */
  --hrs-font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --hrs-font-size-base: 0.875rem;
  --hrs-font-size-sm: 0.8125rem;
  --hrs-font-size-xs: 0.75rem;
  --hrs-font-size-lg: 1rem;
  --hrs-font-size-xl: 1.35rem;
  --hrs-font-size-2xl: 1.65rem;
  --hrs-primary: #0091ea;
  --hrs-primary-600: #0079c7;
  --hrs-bg: #f4f6f8;
  --hrs-surface: #ffffff;
  --hrs-text: #0f172a;
  --hrs-muted: #64748b;
  --hrs-border: #e5e7eb;
  --hrs-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  --hrs-shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.08);
  --hrs-radius: 14px;

  /* Bootstrap overrides (used by many components automatically) */
  --bs-primary: var(--hrs-primary);
  --bs-primary-rgb: 0, 145, 234;
  --bs-body-color: var(--hrs-text);
  --bs-body-bg: var(--hrs-bg);
  --bs-border-color: var(--hrs-border);
  --bs-link-color: var(--hrs-primary);
  --bs-link-hover-color: var(--hrs-primary-600);
}
.body-background {
  background: var(--hrs-bg);
}

.stripe {
  border-bottom: 1px solid var(--hrs-border);
  min-height: 72px;
  height: 72px;
  background-color: var(--hrs-surface);
  box-shadow: var(--hrs-shadow-sm) !important;
  flex-shrink: 0;
}

/* Default cards in admin content match hrs-card when not explicitly legacy */
.service-template .card:not(.devices-card):not(.room-card-scaled) {
  background: var(--hrs-surface);
  border: 1px solid var(--hrs-border);
  border-radius: var(--hrs-radius);
  box-shadow: var(--hrs-shadow-sm);
}

.btn-primary {
  --bs-btn-bg: var(--hrs-primary);
  --bs-btn-border-color: var(--hrs-primary);
  --bs-btn-hover-bg: var(--hrs-primary-600);
  --bs-btn-hover-border-color: var(--hrs-primary-600);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  --bs-btn-active-bg: var(--hrs-primary-600);
  --bs-btn-active-border-color: var(--hrs-primary-600);
}

.btn-delete {
  color: #fff;
  background-color: var(--bs-red);
  border-color: var(--bs-red);
}

.btn-delete:hover {
  color: #fff;
  background-color: #e41529;
  border-color: #e41529;
}

.btn-light {
  color: #000;
  background-color: #f8f9fa;
  border-color: #f8f9fa;
}

.btn-light:hover {
  color: #000;
  background-color: #dbdfe4;
  border-color: #dbdfe4;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group-up {
  margin-top: 1rem;
}

.devices-card {
  min-width: 125px;
  max-width: 300px;
  width: 194px;
  background: radial-gradient(#cdf0ff 32%, #dff4ff 98%), var(--bs-white);
  box-shadow: 10px 10px 14px #aaaaaa;
  display: inline-block;
  margin-right: 10px;
  margin-bottom: 10px;
}

.devices-paragraph {
  width: 160px;
  background-color: #eaecef;
  border: 1px solid rgb(205, 212, 218);
  border-radius: .25rem;
  text-align: center;
  margin: auto auto 10px auto;
}

.devices-card:hover {
  visibility: visible;
  opacity: 1;
  transition: opacity 600ms, visibility 600ms;
}

.card-color {
  background: #ffffff;
  border-radius: 0 0 0.8rem 0.8rem;
  color: #000000;
}

.header {
  padding: 7px 15px;
  margin-bottom: 0;
}

.header-color {
  background: #f8f8f8;
  color: #0091ea;
  border: 1px solid #e3e5ec;
  border-radius: 0.8rem;
}

.modal-header-color {
  background: #f8f8f8;
  color: #0091ea;
  border: 1px solid #e3e5ec;
}

.unit-info-right {
  color: #000000;
  margin-right: 15px;
  font-size: var(--hrs-font-size-xl, 1.35rem);
  font-weight: 600 !important;
  display: inherit;
}

/* Header notification center */
.header-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 15px;
}

.header-tools .unit-info-right {
  margin-right: 0;
}

.notification-center {
  position: relative;
  z-index: 1030;
}

.notification-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #334155;
  background: transparent;
  box-shadow: none;
  transition: color .2s ease;
}

.notification-trigger:hover,
.notification-trigger:focus-visible,
.notification-center.is-open .notification-trigger {
  color: var(--hrs-primary);
  box-shadow: none;
  transform: none;
}

.notification-trigger svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #ef4444;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.notification-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

.notification-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e8edf3;
  background: linear-gradient(145deg, #f8fafc, #eff6ff);
}

.notification-popover__header strong {
  display: block;
  color: #0f172a;
  font-size: .95rem;
}

.notification-popover__eyebrow {
  display: block;
  margin-bottom: 2px;
  color: #64748b;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notification-popover__count {
  padding: 4px 8px;
  border-radius: 999px;
  color: #0369a1;
  background: #e0f2fe;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}

.notification-list {
  max-height: min(390px, calc(100vh - 130px));
  overflow-y: auto;
  padding: 6px;
}

.notification-list__empty {
  margin: 0;
  padding: 24px 12px;
  color: #64748b;
  font-size: .78rem;
  text-align: center;
}

.notification-list__empty--error { color: #b91c1c; }

.notification-popover__footer {
  display: block;
  padding: 11px 16px;
  border-top: 1px solid #e8edf3;
  color: var(--hrs-primary);
  background: #f8fafc;
  font-size: .76rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.notification-popover__footer:hover { background: #eff6ff; }

.notification-item {
  --notification-color: #0284c7;
  display: flex;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.notification-item + .notification-item {
  border-top: 1px solid #f1f5f9;
}

.notification-item:hover {
  background: #f8fafc;
}

.notification-item--danger { --notification-color: #dc2626; }
.notification-item--warning { --notification-color: #f59e0b; }
.notification-item--cold { --notification-color: #2563eb; }

.notification-item__indicator {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--notification-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--notification-color) 14%, transparent);
}

.notification-item__content {
  min-width: 0;
  flex: 1;
}

.notification-item__heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}

.notification-item__heading strong {
  color: #1e293b;
  font-size: .78rem;
}

.notification-item__heading time {
  color: #94a3b8;
  font-size: .64rem;
  white-space: nowrap;
}

.notification-item p {
  margin: 0;
  color: #64748b;
  font-size: .72rem;
  line-height: 1.4;
}

.device-row--inactive > * {
  color: #94a3b8 !important;
  background-color: #f8fafc !important;
}

.device-row--inactive .device-active-toggle { opacity: 1; }

.temperature-plan-row--inactive > * {
  color: #94a3b8 !important;
  background-color: #f8fafc !important;
}

.temperature-plan-row--inactive .temperature-plan-active-toggle { opacity: 1; }

@media (max-width: 575.98px) {
  .header-tools {
    margin-right: 12px;
  }

  .header-tools .unit-info-right {
    font-size: 1rem;
  }

  .notification-popover {
    position: fixed;
    top: 76px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

.page-info-left {
  color: #0d47a1;
  margin-left: 2rem;
  font-size: var(--hrs-font-size-xl, 1.35rem);
  font-weight: 600 !important;
  display: inherit;
  transition: margin 50ms;
}

.page-heading {
  color: var(--hrs-text);
  font-size: var(--hrs-font-size-xl, 1.35rem);
  font-weight: 600 !important;
  display: inline-block;
  border-bottom: 2px solid rgba(0, 145, 234, 0.35);
  transform: translateY(3px);
}

.page-info-left.collapsed {
  margin-left: 3.75rem;
}

@media only screen and (max-width:600px) {
  .page-info-left {
    display: none;
  }
}

@media only screen and (max-width:600px) {
  .stripe {
    justify-content: flex-end !important;
  }
}

@media only screen and (min-width:992px) {
  .service-template {
    padding-right: 3rem !important;
    padding-left: 3rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

@media only screen and (min-width:992px) {
  .service-template-small {
    padding-top: 0.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

.second-title {
  display: none;
}

/* Shared list toolbar used by Devices, Temperature plans and Accounts. */
.admin-list-card {
  margin-bottom: 24px;
  border-radius: 12px;
  background: #fff;
}

.admin-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0 .5rem;
}

.admin-list-toolbar__title {
  display: flex;
  align-items: center;
  min-width: 0;
}

.admin-list-toolbar__title h4 {
  margin: 0 .5rem 0 0;
  color: #2196f3;
  font-size: 1.4rem;
  font-weight: 700;
}

.admin-list-add {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  color: #2196f3;
  background: transparent;
}

.admin-list-add svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  transition: color .15s ease, transform .15s ease;
}

.admin-list-add:hover svg,
.admin-list-add:focus-visible svg {
  color: #0d6efd;
  transform: scale(1.08);
}

.admin-list-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  color: #6c757d;
  font-size: .9rem;
}

.admin-list-search input {
  width: 180px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: #f1f3f5;
}

.admin-list-card .table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-list-card .table thead tr {
  color: #6c757d;
  background: #f8f9fa;
  font-size: .85rem;
}

.admin-list-card .table thead th {
  padding-top: .7rem;
  padding-bottom: .7rem;
  border-bottom: 2px solid #dee2e6;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-list-card .table tbody {
  font-size: .95rem;
  font-weight: 500;
}

.admin-list-card .table tbody tr:hover {
  background: rgba(248, 249, 250, .9);
}

@media (max-width: 575.98px) {
  .admin-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-list-search input {
    flex: 1;
    width: auto;
    min-width: 0;
  }
}

/* Button theme is defined above (Harmony theme overrides) */

@media only screen and (max-width:768px) {
  .devices-card {
    min-width: 125px;
    max-width: 300px;
    width: 250px;
    text-align: center;
    background: radial-gradient(#cdf0ff 32%, #dff4ff 98%), var(--bs-white);
    box-shadow: 10px 10px 14px #aaaaaa;
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 10px;
  }
}

@media only screen and (max-width:992px) {
  .section-heading {
    padding-right: 1rem !important;
    padding-left: 1rem !important;
    margin-bottom: 15px;
  }
}

@media only screen and (max-width:600px) {
  .second-title {
    display: inline-block;
  }
}

.progress {
  --bs-progress-height: 2rem;
  --bs-progress-font-size: 0.75rem;
  --bs-progress-bg: #e9ecef;
  --bs-progress-border-radius: 0.375rem;
  --bs-progress-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
  --bs-progress-bar-color: #000000;
  --bs-progress-bar-bg: #ffc85b;
  --bs-progress-bar-transition: width 0.6s ease;
  display: flex;
  height: var(--bs-progress-height);
  overflow: hidden;
  font-size: var(--bs-progress-font-size);
  background-color: var(--bs-progress-bg);
  border-radius: var(--bs-progress-border-radius);
}

.progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: var(--bs-progress-bar-color);
  font-size: large;
  text-align: center;
  white-space: nowrap;
  background-color: var(--bs-progress-bar-bg);
  transition: var(--bs-progress-bar-transition);
}

.btn.disabled, .btn:disabled, fieldset:disabled .btn {
  color: #000000;
  pointer-events: none;
  background-color: #ffa900;
  border-color: #ffa900;
  opacity: var(--bs-btn-disabled-opacity);
}

.schedule-table {
  table-layout: fixed;
  word-wrap: break-word;
}

#table-scheduler .schedule-event {
  background-color: #62b2e3 !important;
  cursor: pointer;
}

#table-scheduler td.schedule-event {
  border-top: none !important;
  border-bottom: none !important;
  border-width: 0 !important;
  border-style: none;
}

.hidden {
  display: none;
}

/* .color-palette {
  width: 50px;
  height: 50px;
  padding: 0;
  border: none;
  outline: none;
} */

#colorValue {
  font-weight: bold;
}

#loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(255, 255, 255);
  border-radius: var(--bs-modal-border-radius);
  z-index: 1050;
  display: none;
  justify-content: center;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  cursor: default;
}

#loading-overlay-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  text-align: center;
}

.content-center {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#loading-overlay-content .spinner-grow {
  color: #0091ea;
}

#loading-overlay-content p {
  font-size: 20px;
}

#loading-overlay-content #pair-cancel {
  margin-bottom: 20px;
}

.inactive {
  pointer-events: none;
  opacity: 0.4;
}

.section-expand {
  min-height: 110vh;
}

.dropdown-arrow {
  margin-right: 14px;
  margin-top: 5px;
}

.table-name {
  color: #0091ea;
  margin-right: 1rem;
  font-size: 20px;
  font-weight: 600 !important;
  margin-bottom: 0;
  padding-bottom: 0;
}

.table-hover {
  cursor: pointer;
}

.plus-icon {
  color: #8e9b9e;
  cursor: pointer;
}

.plus-icon:hover {
  color: #0091ea;
}

.table-header {
  --bs-table-bg: #f4f4f5;
}

.status-dot {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.true {
  background-color: #32CD32;
}

.status-dot.false {
  background-color: red;
}

.nav-menu-in-page {
  cursor: pointer;
}

.nav-menu-in-page.active {
  color: var(--bs-secondary-text-emphasis)!important;
}

.notifyjs-corner {
  z-index: 9999 !important;
  /*left: 50% !important;*/
  /*transform: translateX(-50%);*/
}

table[name="defaultTable"] tbody td:nth-child(1) {
  padding-right: 18px;
}

table[name="defaultTable-2"] tbody td:nth-child(2) {
  padding-right: 18px;
}

.readonly-gray[readonly] {
  background-color: #e9ecef;
  opacity: 1;
}

.select-readonly {
  pointer-events: none;
  background-color: #e9ecef;
}

.select-all, .row-checkbox {
  margin-bottom: 0.3rem !important;
  vertical-align: middle!important;
}

.toggle-password {
  user-select: none;
  cursor: pointer;
}


.input-with-icon {
  position: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.input-with-icon input {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  padding-right: 2rem;
}

.input-icon {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #6c757d;
  pointer-events: all;
  user-select: none;
}

.input-icon:hover {
  color: #0091ea;
}

/* =========================
   Modern admin primitives
   ========================= */

.hrs-page {
  padding-top: 18px;
  padding-bottom: 28px;
}

.hrs-card {
  background: var(--hrs-surface);
  border: 1px solid var(--hrs-border);
  border-radius: var(--hrs-radius);
  box-shadow: var(--hrs-shadow-sm);
}

.hrs-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--hrs-border);
  padding: 14px 16px;
}

.hrs-card .card-body {
  padding: 16px;
}

.hrs-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--hrs-text);
  margin: 0;
}

.hrs-subtitle {
  font-size: 13px;
  color: var(--hrs-muted);
  margin: 0;
}

.table.hrs-table thead th {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid var(--hrs-border);
}

.table.hrs-table tbody td {
  vertical-align: middle;
}

.btn-hrs-outline {
  --bs-btn-color: var(--hrs-primary);
  --bs-btn-border-color: rgba(0,145,234,.35);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--hrs-primary);
  --bs-btn-hover-border-color: var(--hrs-primary);
}

/* =========================
   Floating "Add" button
   ========================= */

.fixed-add-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1030;
}

.fixed-add-button .btn-circle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  box-shadow: var(--hrs-shadow-sm, 0 4px 12px rgba(0, 0, 0, .18));
  transition: transform .15s ease, box-shadow .15s ease;
}

.fixed-add-button .btn-circle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
}

.fixed-add-button .btn-circle img {
  display: block;
  /* Render the (blue) plus SVG as black on the blue button */
  filter: brightness(0);
}

.fixed-add-button .add-text {
  font-weight: 600;
  line-height: 1;
}

@media (max-width: 575.98px) {
  .fixed-add-button {
    right: 16px;
    bottom: 16px;
  }

  /* Collapse to a round icon-only button on small screens */
  .fixed-add-button .btn-circle {
    padding: 12px;
    border-radius: 50% !important;
  }

  .fixed-add-button .add-text {
    display: none;
  }
}
