/* =========================================================
   Design Tokens
   ========================================================= */
:root {
  --bg-main: #ffffff;
  --bg-soft: #f6f8fb;
  --accent: #d0e5fd;
  --text-main: #000000;
  --dot: #000000;
  --success: #2ea043;
  --warn: #d29922;
  --muted: #8b949e;
  --radius: 0.5rem;
}

/* =========================================================
   Base / Reset
   ========================================================= */
body {
  font-family:
    Open Sans,
    Arial,
    sans-serif;
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.6;
  color: #333;
  margin: 0;
  background: var(--bg-main);
  height: 100vh;
  display: flex;
  justify-content: center;
}

/* =========================================================
   Layout
   ========================================================= */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  align-items: flex-end;
}

.content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.bg-wrapper {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #ffffff 0%, var(--bg-soft) 100%);
  position: absolute;
  z-index: -1;
  overflow-x: clip;
}

/* =========================================================
   Branding
   ========================================================= */
.logo {
  width: 8rem;
  margin-left: 20px;
  text-align: center;
}

.brand-subtitle {
  font-size: 12px;
  margin-top: 12px;
  text-transform: uppercase;
}

/* =========================================================
   Decorative Background Elements
   ========================================================= */
.curve {
  position: absolute;
  width: 150%;
  height: 120%;
  border-radius: 50%;
  background: #f3f6fa;
  top: -30%;
  left: -20%;
}

.dots {
  position: absolute;
  top: 120px;
  left: 24px;
  display: grid;
  grid-template-columns: repeat(4, 6px);
  gap: 10px 14px;
}
.dots span {
  width: 4px;
  height: 4px;
  background: var(--dot);
  border-radius: 50%;
  opacity: 0.6;
}

.diagonal {
  position: absolute;
  right: -40px;
  top: 260px;
  width: 260px;
  height: 260px;
  border-radius: 130px;
  opacity: 0.7;
  animation: float 10s infinite ease-in-out alternate;
  background: repeating-linear-gradient(
    45deg,
    #dfe6ef,
    #dfe6ef 2px,
    transparent 2px,
    transparent 8px
  );
}

.bg-shape {
  position: absolute;
  right: -10%;
  top: -33%;
  height: 110%;
  animation: float 10s infinite ease-in-out alternate;
}

.bg-dots,
.bg-dashed {
  position: absolute;
}

.bg-dots {
  left: -150px;
  top: 10%;
  z-index: 1;
}

.bg-dashed {
  bottom: 16%;
  animation: float 10s infinite ease-in-out alternate;
}

.bg-curve {
  position: absolute;
  bottom: -50%;
}

/* =========================================================
   Loader
   ========================================================= */
.loader {
  width: 32px;
  height: 32px;
  margin: auto;
  border: 3px solid #e0e0e0;
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* =========================================================
   Table Styles
   ========================================================= */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: #e8edf8;
}

th,
td {
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

td[id*="support"] {
  padding: 0;
}

th {
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid rgba(173, 206, 255, 0.3);
}

tbody tr {
  background: transparent;
  transition: background 110ms ease;
  cursor: pointer;
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

tbody tr:hover {
  background: rgb(209 231 254 / 30%);
}

tbody tr.active,
tbody tr.active:hover {
  background: rgb(62 119 192 / 90%);
}

td.status-cell {
  height: 46px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.sort-icon::after {
  content: "↕";
  font-size: 10px;
  margin-left: 6px;
  opacity: 0.3;
}

th.sort-asc .sort-icon::after {
  content: "↑";
  opacity: 1;
}

th.sort-desc .sort-icon::after {
  content: "↓";
  opacity: 1;
}
/* =========================================================
   Serial Grouping Rows
   ========================================================= */
.serial-header-row {
  background: #fbfcfd;
}

.serial-header-row + .serial-child-row {
  border-top: 1px solid rgb(208 228 255);
}

.serial-header-row ~ .serial-child-row:last-of-type {
  border-top: 1px dashed rgb(208 228 255);
}

.serial-child-row:not(:has(+ .serial-child-row)) {
  border-bottom: 1px dashed rgb(208 228 255);
}

.serial-header-row:has(+ .serial-child-row) {
  background-color: #f5f7fa;
  border-bottom: 1px solid #d0e5fd;
}

/* =========================================================
   Backdrop
   ========================================================= */
.backdrop {
  position: fixed;
  inset: 0;
  display: none;
  background: rgb(0 7 18 / 20%);
  z-index: 1000;
  animation: fadeIn 350ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
/* =========================================================
   CARDS & GRADIENT VARIANTS
   ========================================================= */
.card {
  backdrop-filter: blur(4px);
}

.card-header .material-symbols-outlined {
  font-size: 48px;
}
.card-actions {
  padding: 0 var(--bs-card-spacer-x);
}
.card .list-group {
  overflow: scroll;
  max-height: 350px;
  border-radius: var(--radius);
  border: 1px solid #f1f3f4 !important;
}
.card .list-group-item {
  border-left-width: 0;
  border-right-width: 0;
  display: flex;
}
.card .list-group-item:first-child {
  border-top: 0;
}
.card .list-group-item:last-child {
  border-bottom: 0;
}
/* =========================================================
   Side Panel
   ========================================================= */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  z-index: 9999;
}

.panel.open {
  transform: translateX(0);
}

.panel.open + .backdrop {
  display: block;
}

.panel-header {
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(
    135deg,
    rgba(26, 26, 26, 1) 0%,
    rgba(0, 0, 0, 1) 30%,
    #e7eaf3 30%,
    #e8edf8 30%,
    #f9fafc 99%
  );
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  /*text-transform: uppercase;*/
  display: flex;
  gap: 5px;
  align-items: center;
}

.panel-body {
  min-height: calc(100% - 180px);
}

.panel-content {
  height: 100vh;
  overflow: auto;
}

.panel-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
  gap: 16px;
}

/* =========================================================
   Support / Data Boxes
   ========================================================= */
.support-data-box {
  flex: 1;
  min-height: 220px;
  max-height: 420px;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid #e7e8ec;
  overflow: auto;
  scroll-behavior: smooth;
}

#panelJson {
  font-size: 11px;
  line-height: 1.4;
  white-space: pre;
}

/* =========================================================
   Forms
   ========================================================= */
.form-control {
  padding: 7px 10px;
  font-size: 12px;
}

.form-control:focus {
  outline: none;
  box-shadow: 0 0 0 0.5px #000;
}

/* =========================================================
   Utility / Effects
   ========================================================= */
.fs-7 {
  font-size: 0.775rem !important;
}
.contrast-1 {
  filter: contrast(1.5);
}
.material-symbols-outlined {
  vertical-align: -0.325em;
}
.material-symbols-outlined {
  visibility: hidden;
}
.fonts-loaded .material-symbols-outlined {
  visibility: visible;
}
/* Gradient helpers */
.bg-gradient-info {
  background: linear-gradient(
    135deg,
    rgb(0 168 255) 0%,
    rgb(0 168 255) 200px,
    #e7eaf3 200px,
    #e8edf8 200px,
    #f9fafc 100%
  );
}
.bg-gradient-success {
  background: linear-gradient(
    135deg,
    rgb(23 195 123) 0%,
    rgb(23 195 123) 200px,
    #e7eaf3 200px,
    #e8edf8 200px,
    #f9fafc 100%
  );
}
.bg-gradient-warning {
  background: linear-gradient(
    135deg,
    rgb(254 146 0) 0%,
    rgb(254 146 0) 200px,
    #e7eaf3 200px,
    #e8edf8 200px,
    #f9fafc 100%
  );
}
.bg-gradient-danger {
  background: linear-gradient(
    135deg,
    rgb(224 0 4) 0%,
    rgb(224 0 4) 200px,
    #e7eaf3 200px,
    #e8edf8 200px,
    #f9fafc 100%
  );
}

/* =========================================================
   Fade Border Effect
   ========================================================= */
.fade-border::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    to right,
    rgba(201, 226, 255, 0.9),
    rgba(0, 180, 255, 0) 20%,
    rgba(0, 180, 255, 0) 30%,
    rgb(208 229 255)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.fade-border::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    to right,
    rgba(236, 248, 255, 0.8),
    rgba(0, 200, 255, 0),
    rgba(201, 226, 255, 0.8)
  );
  filter: blur(2px);
  opacity: 0.9;
  z-index: -1;
}

.fade-border table {
  z-index: 1;
  overflow: clip;
  border-radius: 7px;
}

/* =========================================================
   Search Helpers
   ========================================================= */
#clearSearchResultsIcon {
  opacity: 0;
  transition: opacity 0.15s ease;
}

#clearSearchResultsIcon:not([hidden]) {
  opacity: 1;
}

/* =========================================================
   Animations
   ========================================================= */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(20px, -40px) scale(1.04);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeOpacity {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.fade-animation {
  animation: fadeOpacity 0.6s ease;
}
/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 840px) {
  .panel-header {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  th:nth-child(6),
  td:nth-child(6) {
    display: none;
  }

  .panel-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }

  .header {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .panel-header {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
}

/* =========================================================
   ================= Live Control Center ===================
   ========================================================= */

/* ───────── APP LAYOUT ───────── */
.app {
  display: grid;
  height: 100%;
  width: 100%;
  z-index: 1;
}
.app-three-columns {
  grid-template-columns: 350px 1fr 390px;
}
/* ───────── SIDEBAR ───────── */
.sidebar {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.sidebar h2 {
  font-size: 16px;
  margin: 10px 0 0;
}
.navbar-brand {
  max-width: 90px;
  height: auto;
}
.channel {
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  background: rgb(248 248 248);
  margin-bottom: 4px;
  transition: background 0.35s ease;
  align-items: center;
}

.channel:hover,
.channel:active {
  background: rgb(208 230 253);
}

.channel.active {
  background: rgb(208 230 253);
}

.channel-meta,
.meta {
  font-size: 12px;
  color: var(--muted);
}
.channel-meta {
  position: absolute;
}

/* ───────── AVATAR STATUS DOT (device "checking" indicator) ───────── */
.avatar {
  position: relative;
}

.avatar-status {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  border: 2px solid #fff;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0 0 0 / 6%);
}

.avatar-xs-status {
  width: 9px;
  height: 9px;
  border-width: 2px;
}

/* Green – active / healthy */
.avatar-status-success {
  background: #28a745;
}
/* Amber – degraded */
.avatar-status-warning {
  background: #f0ad4e;
}
/* Red – stale / offline */
.avatar-status-danger {
  background: #dc3545;
}
/* Grey – never seen */
.avatar-status-secondary {
  background: #999;
}
/* ───────── CHAT AREA ───────── */
.chat {
  background: #fff;
  border-bottom-right-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
  box-shadow:
    0 0 2px 0 rgba(145 158 171 / 20%),
    4px 20px 24px -4px rgba(145 158 171 / 12%);
}

.chat-meta {
  display: flex;
  align-items: center;
}

.live-control {
  display: flex;
  flex-direction: column;
  position: relative;
  /*overflow: auto;*/
  height: 100vh;
}

.control-stream {
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: var(--radius);
  margin-bottom: 15px;
  box-shadow:
    0 0 2px 0 rgba(145 158 171 / 20%),
    0 12px 24px -4px rgba(145 158 171 / 12%);
  /* Let the control-stream share remaining height but not push past sidebar.kit */
  flex: 1 1 0;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.control-stream .stream {
  flex: 1 1 auto;
  overflow-y: auto;
  height: 100%;
  min-height: 0;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.app-header {
  padding: 10px 15px;
  border-bottom: 1px solid #e4e6ea;
  display: flex;
  font-weight: 300;
  justify-content: space-between;
  align-items: center;
  background: #fcfcfc;
}

.header-serial {
  display: flex;
  justify-content: space-between;
  align-items: center;
  filter: none;
}

.header-serial .material-symbols-outlined {
  font-size: 50px;
}

.agents {
  font-size: 15px;
  color: #5d9dec;
}

/* ───────── MESSAGES ───────── */
.messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  /*min-height: 260px; !*27.8vh*!*/
  flex-direction: column;
  /*height: calc(100% - 118px);*/
  height: calc(50vh - 210px);
  gap: 10px;
  border-bottom-right-radius: 10px;
  border-bottom-left-radius: 10px;
}

.msg {
  max-width: 70%;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  line-height: 24px;
  gap: 10px;
}

.macro {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.support {
  background: var(--accent);
  align-self: flex-end;
}
.macros {
  background: rgba(40, 208, 127, 0.8);
  color: #fff;
}
.user {
  background: #f8f8f8;
}
.device {
  background: #111;
  font-family: monospace;
  font-size: 13px;
}

.system {
  align-self: center;
  font-size: 12px;
  color: var(--muted);
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 15px;
}

.devices {
  overflow-y: scroll;
  border-radius: var(--radius);
  padding: 0;
  backdrop-filter: blur(4px);
  height: 100%;
  width: 100%;
  margin-right: 0;
  margin-left: 0;
}

/* ───────── TWO-COLUMNS ───────── */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 12px;
  align-items: center;
  gap: 5px;
}
/* ───────── TWO-ROWS ───────── */
.two-rows {
  display: grid;
  grid-template-rows: 1fr 1fr;
  font-size: 14px;
  gap: 5px;
  font-weight: 300;
}
/* ───────── STREAM ───────── */
.stream {
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #7ee787;
  background: #1a1a1a;
  height: 100%;
  min-height: 0;
  padding: 1rem;
  overflow: auto;
  scroll-behavior: smooth;
}

.stream strong {
  color: #ffdb59;
}

.stream-entry {
  padding: 10px 0px;
  border-bottom: 1px solid #4e4e4e;
  font-size: 13px;
}

.stream-header {
  margin-bottom: 6px;
  color: #bbb;
  font-size: 12px;
}

.stream-header .tag {
  color: #ffc107;
  font-weight: 600;
  margin-right: 6px;
}

.stream-header .time {
  opacity: 0.6;
  margin-left: 6px;
}

.cmd-line {
  display: block;
  gap: 10px;
  color: #6fb4ff;
}
/*.cmd-step { color: #6c757d; }*/
.cmd-command {
  color: #fff;
}

.cmd-response.ok {
  color: #7ee787;
}
.cmd-response.error {
  color: #ff6b6b;
}

.response-status.ok {
  color: #7ee787;
  margin-bottom: 6px;
}

.response-status.error {
  color: #f44336;
  font-weight: 600;
}

.response-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 10px 0;
  border: 1px solid #8c98a4;
  padding: 10px;
}

.kv-key {
  color: #9aa0a6;
  white-space: nowrap;
}
.kv-value {
  font-family: monospace;
  color: #e8eaed;
  word-break: break-all;
}
.response-raw {
  font-family: monospace;
  opacity: 0.8;
}

/* ───────── FILES ───────── */
.files-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  background: #fff;
  border-bottom-right-radius: 10px;
  border-bottom-left-radius: 10px;
  height: calc(100% - 113px);
  box-shadow:
    0 0 2px 0 rgba(145 158 171 / 20%),
    0 12px 24px -4px rgba(145 158 171 / 12%);
}

.files-panel-columns {
  display: grid;
  grid-template-columns: 1fr 200px 100px;
}

.file-updated .file-updated-icon {
  color: #65aaf9;
}

/* ───────── STATUS / ICONS ───────── */

.live-Icon,
.support-Icon {
  transition:
    color 0.25s ease,
    transform 0.25s ease,
    filter 0.25s ease;
  border-radius: 50%;
}

.live-Icon.live-active {
  color: #00cb5c;
  animation: livePulse 0.8s cubic-bezier(0, 0, 0, 1.07);
  filter: drop-shadow(0 0 8px rgba(0, 255, 132, 0.6));
}

.support-Icon.live-active {
  color: #6fb4ff;
  animation: SupportPulse 0.8s cubic-bezier(0, 0, 0, 1.07);
  filter: drop-shadow(0 0 8px rgba(111, 180, 255, 0.6));
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 199, 111, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(40, 199, 111, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 199, 111, 0);
  }
}

@keyframes SupportPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(111, 180, 255, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(111, 180, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(111, 180, 255, 0);
  }
}

/* ───────── SCROLLBARS ───────── */
.scrollbar::-webkit-scrollbar {
  width: 4px;
}
.scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.scrollbar::-webkit-scrollbar-thumb {
  background-color: #e8eaf3;
  border-radius: var(--radius);
  transition: background-color 0.2s ease;
}
.scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: #e8eaf3;
}
.scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #e8eaf3 transparent;
}

/* ───────── NOTIFICATIONS ───────── */
.notify {
  position: relative;
  background: #5d9cec;
  gap: 5px;
  color: #fff;
  padding: 8px;
  border-radius: var(--radius);
  font-size: 12px;
  display: flex;
  align-content: center;
  align-items: center;
  min-height: 55px;
}

.notify .notify-bell {
  font-size: 24px;
  display: inline-block;
  transform-origin: top center;
  cursor: pointer;
}

.notify.ring .notify-bell {
  animation: bell-ring 0.9s ease-in-out;
}

.notify-bell.muted {
  color: #fff;
}

/* Hiding text */
.notify-bell.muted::before {
  content: "notifications_off";
}

.notify-bell.muted {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

/* hide the original text visually */
.notify-bell.muted {
  position: relative;
  color: transparent;
}

.notify-bell.muted::before {
  position: absolute;
  inset: 0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notify-bell.muted::before {
  animation: bellOff 0.25s ease;
}

@keyframes bellOff {
  from {
    transform: scale(1.2);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes bell-ring {
  0% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(15deg);
  }
  20% {
    transform: rotate(-15deg);
  }
  30% {
    transform: rotate(12deg);
  }
  40% {
    transform: rotate(-12deg);
  }
  50% {
    transform: rotate(8deg);
  }
  60% {
    transform: rotate(-8deg);
  }
  70% {
    transform: rotate(4deg);
  }
  80% {
    transform: rotate(-4deg);
  }
  100% {
    transform: rotate(0);
  }
}

/* ───────── TAB CONTENT ───────── */

.control-tabs {
  display: flex;
  background:
    radial-gradient(circle at 10% 20%, #fff 0, transparent 55%),
    radial-gradient(circle at 90% 0%, #f4f6fa 0, transparent 50%),
    radial-gradient(circle at 80% 80%, #f5f5f5 0, transparent 55%),
    linear-gradient(43deg, #f8f8f8, #f4f6fa);
  border-top-right-radius: 10px;
  border-top-left-radius: 10px;
}

.control-tabs .tab {
  flex: 1;
  padding: 10px;
  gap: 5px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-weight: 300;
  display: flex;
  align-content: center;
  align-items: center;
  justify-content: center;
}

.control-tabs .tab.active {
  border-bottom: 2px solid #71a8ef;
  color: #000;
}

.tab-content {
  display: none;
  flex: 1;
}
.tab-content.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.control-tabs .tab.d-none + .tab {
  justify-content: start;
  border-bottom: 1px solid #e9eaee;
  background: #fff;
  font-weight: 600;
  font-size: 16px;
  padding: 12px;
  color: #000;
}
.control-tabs .tab.d-none + .tab .material-symbols-outlined {
  display: none;
}
/* =========================================================
   LIVE CONTROL CHAT INPUT & MENTIONS
   ========================================================= */

/* Wrapper should behave like the original input element */
.chat-input-wrapper {
  position: relative;
  flex: 1 1 auto;
  display: flex;
}

/* Input fills wrapper width so the bar is full-length as before */
.chat-input-wrapper > #chatInput {
  width: 100%;
}

/* Dropdown for @mention suggestions (overlay only, does not affect input styling) */
.mention-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%; /* appear just above the input; use top: 100% to show below if preferred */
  margin-bottom: 4px;
  z-index: 1000;

  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0px 0px 25px -15px rgba(0, 0, 0, 0.45);
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.8rem;
}

/* Individual option rows */
.mention-suggestion-item {
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.mention-suggestion-item.active,
.mention-suggestion-item:hover {
  background-color: rgb(208 231 253 / 60%);
}

.mention-suggestion-name {
  font-weight: 500;
  color: #000;
}

.mention-suggestion-email {
  font-size: 0.7rem;
  color: #6d6d6d;
}

/*    dropdown-menu   */
.input-group .dropdown-menu {
  top: 100%;
}
.sort-dir-icon {
  transition: transform 0.15s ease;
}

.sort-devices-btn[data-sort-dir="asc"] .sort-dir-icon {
  transform: rotate(360deg);
}
.devices-sort-menu .dropdown-item {
  position: relative;
  display: inline-block;
}
.dropdown-item.active::after {
  display: block;
}

/* =========================================================
   Gateway Management
   ========================================================= */

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay .modal-dialog {
  pointer-events: auto;
}

/* Gateway cards in sidebar */
.gateway-card {
  border: 1px solid var(--border, #e0e0e0);
  transition: background 0.15s;
}
.gateway-card:hover {
  background: var(--bg-soft, #f6f8fb);
}

/* Claim code inputs focus state */
.claim-code-char:focus {
  border-color: #0d6efd !important;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
  outline: none;
}
