@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Surface Colors */
  --bg-page: #0a0d12;
  --bg-card: #12161f;
  --bg-card-hover: #181d28;
  --bg-card-muted: #1a202c;
  --bg-input: #07090d;

  /* Border Colors */
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #8b9bb4;
  --text-dim: #54627a;

  /* Accents & Badges */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Layout */
  --max-width: 1040px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.25);
}

*::-webkit-scrollbar {
  width: 6px;
  height: 5px;
}

*::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  display: block;
  width: 100%;
  min-height: 100vh;
}

/* ========================================================================= */
/* Navbar                                                                    */
/* ========================================================================= */
.navbar {
  height: 60px;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}

.brand-badge {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-card-muted);
  border-radius: 999px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
}

.account-btn {
  background: transparent;
  border: none;
  cursor: pointer;
}

.avatar-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-muted);
  border: 1px solid var(--border-light);
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ========================================================================= */
/* Layout & Typography                                                       */
/* ========================================================================= */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.text-muted {
  color: var(--text-muted);
  font-size: 13px;
}

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

.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: #fff;
  font-size: 13px;
  width: 220px;
  outline: none;
}
.search-input:focus {
  border-color: var(--border-focus);
}

/* ========================================================================= */
/* Buttons                                                                   */
/* ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn:disabled,
.disabled-offline {
  opacity: 0.38 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(40%);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-card-muted);
  border-color: var(--border-light);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text-main);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.2);
}
.btn-warning:hover {
  background: var(--warning);
  color: #fff;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

/* ========================================================================= */
/* Device Grid & Cards                                                       */
/* ========================================================================= */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.device-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.device-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.badge-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-online {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}
.badge-offline {
  background: rgba(139, 155, 180, 0.12);
  color: var(--text-muted);
}

.stats-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg-card-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-val {
  font-weight: 600;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========================================================================= */
/* Full Page Device View                                                     */
/* ========================================================================= */
.detail-header {
  margin-bottom: 20px;
}

.device-detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.device-tabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.device-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.device-tab:hover {
  color: var(--text-main);
}

.device-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Video Card & Controls */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.video-viewport {
  width: 100%;
  height: 440px;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-viewport video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.video-live-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Stream Toolbar & Intercom */
.stream-toolbar {
  padding: 12px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-zoom-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zoom-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.zoom-range {
  width: 90px;
  accent-color: var(--primary);
  cursor: pointer;
}

.intercom-bar {
  padding: 12px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.intercom-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.intercom-input:focus {
  border-color: var(--border-focus);
}

.actions-section {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.actions-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.helper-text {
  font-size: 12px;
  color: var(--text-muted);
}

.speak-input-row {
  display: flex;
  gap: 8px;
}

.speak-input-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.speak-input-row input:focus {
  border-color: var(--border-focus);
}

/* Health & Sensor Cards */
.cards-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
}

.info-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip-trigger {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-card-muted);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}

.info-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.info-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.spec-row:last-child {
  border-bottom: none;
}

.location-display, .code-box {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* Terminal */
.terminal-card {
  background: #000;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
}

.terminal-header {
  padding: 8px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

.terminal-output {
  padding: 14px;
  height: 180px;
  overflow-y: auto;
  font-size: 12px;
  color: #38bdf8;
  line-height: 1.5;
  white-space: pre-wrap;
}

.terminal-input-bar {
  display: flex;
  border-top: 1px solid var(--border-light);
  background: #050608;
}

.terminal-input-bar span {
  padding: 8px 12px;
  color: var(--primary);
}

.terminal-input-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

/* ========================================================================= */
/* Clips & Alerts                                                            */
/* ========================================================================= */
.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.clip-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease;
}

.clip-card:hover {
  border-color: var(--primary);
}

.clip-thumb {
  height: 120px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.clip-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.clip-info {
  padding: 12px;
}

.clip-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.alerts-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-row {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.15s ease;
}

.alert-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover);
}

.alert-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.alert-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.alert-device-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.alert-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  background: var(--bg-card-muted);
  border-radius: 4px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
}

.alert-tag-power { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.alert-tag-restored { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.alert-tag-sound { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.alert-tag-thermal { background: rgba(249, 115, 22, 0.15); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.35); }
.alert-tag-tripwire { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.35); }
.alert-tag-motion { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }

.alert-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-main);
}

.alert-msg {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-word;
}

.alert-right {
  text-align: right;
  flex-shrink: 0;
}

.alert-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.alert-date {
  font-size: 11px;
  margin-top: 2px;
}

/* Pagination Bars */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-page-nav,
.page-btn {
  background: var(--bg-card-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-page-nav:hover:not(:disabled),
.page-btn:hover:not(.active) {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-page-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: transparent;
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sensor-logs-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-card-muted);
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 8px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ========================================================================= */
/* Modals & Dialogs                                                          */
/* ========================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
}

.qr-container {
  background: #fff;
  padding: 14px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 14px;
}

.pairing-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--primary);
  margin-bottom: 4px;
}

/* Account & Billing */
.account-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-section-divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

.feature-box {
  background: var(--bg-card-muted);
  padding: 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.interval-picker {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.interval-opt {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
}

.interval-opt.active {
  background: var(--bg-card-muted);
  color: #fff;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.plan-card {
  background: var(--bg-card-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.plan-card.featured {
  border-color: var(--primary);
}

.plan-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
}

.plan-price {
  font-size: 22px;
  font-weight: 700;
  margin: 6px 0;
}

.plan-price span {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.plan-bullets {
  list-style: none;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 14px;
  flex: 1;
}

.clip-viewport {
  width: 100%;
  height: 320px;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.clip-viewport video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ========================================================================= */
/* Location Spatial Telemetry, Layers & Map Styling                         */
/* ========================================================================= */
.location-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.location-metric-card {
  background: var(--bg-card-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.location-metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.location-metric-val-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.location-metric-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.location-subhint {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

.btn-micro {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-muted);
  padding: 2px 4px;
  cursor: pointer;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-micro:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(14, 165, 233, 0.1);
}

.map-controls-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 12px 0 10px 0;
  flex-wrap: wrap;
}

.map-toolbar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.map-tile-picker,
.map-overlays-group,
.map-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-layer-btn,
.map-toggle-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.map-layer-btn:hover,
.map-toggle-btn:hover {
  color: #fff;
  border-color: var(--border-medium);
}

.map-layer-btn.active,
.map-toggle-btn.active {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--primary);
  color: #38bdf8;
  font-weight: 600;
}

.osm-map-styled {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #0f172a;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* OpenStreetMap Dark Reverse-Filter Trick (Inverts only map tiles; zoom controls, markers, popups & overlays remain untouched) */
#osm-map.dark-osm-tiles .leaflet-tile-pane {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Pulsating Animated GPS Marker */
.gps-custom-marker-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gps-marker-dot {
  width: 12px;
  height: 12px;
  background: #0ea5e9;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.8);
  position: relative;
  z-index: 2;
}

.gps-pulse-ring {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid #38bdf8;
  border-radius: 50%;
  animation: gpsPulseAnim 2s infinite ease-out;
  z-index: 1;
}

@keyframes gpsPulseAnim {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.map-stats-footbar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 11px;
}

.map-stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========================================================================= */
/* Screen Display Mode Selector Bar & Visual Bridge                          */
/* ========================================================================= */
.screen-mode-tabs-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.screen-mode-tab-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--transition-fast);
  text-align: center;
}

.screen-mode-tab-btn:hover {
  background: var(--bg-card-muted);
  color: #fff;
  border-color: var(--border-medium);
}

.screen-mode-tab-btn.active {
  background: rgba(14, 165, 233, 0.12);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.25);
}

.mode-btn-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mode-btn-badge {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 500;
}

.screen-mode-tab-btn.active .mode-btn-badge {
  color: #38bdf8;
}

.screen-mode-active-bridge {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-main);
}

.bridge-pulse {
  color: var(--primary);
  font-size: 14px;
  animation: bridgePulse 1.5s infinite;
}

@keyframes bridgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.bridge-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ========================================================================= */
/* Consumer Infrared (IR) Blaster Controls                                   */
/* ========================================================================= */
.ir-appliance-picker {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.45) rgba(0, 0, 0, 0.3);
}

.ir-appliance-picker::-webkit-scrollbar {
  height: 5px;
}

.ir-appliance-picker::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.ir-appliance-picker::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 4px;
  transition: background 0.15s ease;
}

.ir-appliance-picker::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.ir-appliance-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.ir-appliance-btn:hover {
  color: #fff;
  border-color: var(--border-medium);
}

.ir-appliance-btn.active {
  background: rgba(244, 63, 94, 0.15);
  border-color: #f43f5e;
  color: #fb7185;
  font-weight: 600;
}

.ir-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}

.btn-ir-key {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 12px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-fast);
}

.btn-ir-key:hover {
  background: var(--bg-card-muted);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.btn-ir-key:active {
  transform: translateY(1px);
  background: rgba(244, 63, 94, 0.2);
}

.btn-ir-power {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

.btn-ir-mute {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.ir-ac-status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  max-width: 440px;
  margin: 0 auto;
}

/* ========================================================================= */
/* Terminal Full Page & Controls Upgrade                                     */
/* ========================================================================= */
.terminal-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-conn-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #22c55e;
}

/* Full Page Terminal State */
.terminal-window.terminal-fullscreen-active {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  border-radius: 0 !important;
  margin: 0 !important;
  z-index: 999999 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #030712 !important;
}

.terminal-window.terminal-fullscreen-active .terminal-body {
  flex: 1 1 auto !important;
  height: calc(100vh - 110px) !important;
  max-height: unset !important;
}

/* ========================================================================= */
/* Comprehensive Multi-Device & Mobile Responsiveness                        */
/* ========================================================================= */
@media (max-width: 1024px) {
  .main-content {
    padding: 20px 16px;
  }

  .studio-layout {
    gap: 16px;
  }

  .studio-sidebar {
    width: 210px;
    min-width: 210px;
  }
}

@media (max-width: 768px) {
  /* Navbar on Mobile */
  .navbar {
    height: auto;
    min-height: 54px;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-brand {
    gap: 8px;
  }

  .nav-links {
    margin-left: 0;
    gap: 4px;
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .nav-link {
    font-size: 12px;
    padding: 6px 10px;
    white-space: nowrap;
  }

  /* Full-Page Studio on Mobile */
  .studio-layout {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .studio-sidebar {
    width: 100%;
    min-width: unset;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
    gap: 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    scrollbar-width: none;
  }

  .studio-sidebar::-webkit-scrollbar {
    display: none;
  }

  .studio-nav-section {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-shrink: 0;
  }

  .studio-nav-header {
    display: none;
  }

  .device-tab {
    padding: 8px 12px;
    min-height: 38px;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 12px;
  }

  .studio-tab-hint {
    display: none;
  }

  .studio-content {
    width: 100%;
    min-width: 0;
  }

  /* Grid Layouts to 1 column on Mobile */
  .cards-grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .device-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .screen-controls-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .location-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .map-controls-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .map-actions-group {
    margin-left: 0;
    justify-content: space-between;
  }

  .map-stats-footbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .map-stat-chip {
    margin-left: 0 !important;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-actions,
  .alerts-header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Modals on Mobile */
  .modal-card {
    max-width: 95vw !important;
    margin: 10px auto;
    padding: 16px;
  }

  .plans-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .location-metrics-grid {
    grid-template-columns: 1fr;
  }

  .screen-mode-tabs-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .ir-keypad-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .btn-ir-key {
    padding: 10px 4px;
    font-size: 11px;
  }
}


.clip-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

/* Auth View */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-box {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 28px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.auth-title {
  font-size: 16px;
  font-weight: 700;
}

.auth-tabs-bar {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 20px;
}

.auth-tab-btn {
  flex: 1;
  padding: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
}

.auth-tab-btn.active {
  background: var(--bg-card);
  color: #fff;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  outline: none;
}
.form-group input:focus {
  border-color: var(--border-focus);
}

/* Fancy Sensors Grid with Icons */
.sensors-fancy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.sensor-fancy-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: all 0.15s ease;
}

.sensor-fancy-card:hover {
  border-color: var(--primary);
}

.sensor-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.sensor-fancy-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sensor-fancy-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

/* Complete Details Grid */
.details-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.device-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.device-tab svg {
  flex-shrink: 0;
}

/* ==========================================================================
   Real-Time IoT Sensor Telemetry & Logging Console
   ========================================================================== */

.sensor-stream-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.sensor-stream-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
}

.sensor-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
  transition: all 0.2s ease;
}

.sensor-live-dot.live {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  animation: sensorPulseDot 1.4s ease-in-out infinite;
}

@keyframes sensorPulseDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.sensor-stream-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sensor-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sensor-control-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sensor-select-compact {
  background: var(--bg-card-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
}

.sensor-select-compact:focus {
  border-color: var(--primary);
}

.sensor-sparkline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 14px;
}

.sensor-sparkline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.sensor-sparkline-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

.sensor-sparkline-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
}

.sensor-sparkline-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sensor-canvas-container {
  width: 100%;
  height: 110px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
  position: relative;
}

.sensor-canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.sensor-logs-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-top: 14px;
  overflow: hidden;
}

.sensor-logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card-muted);
  border-bottom: 1px solid var(--border-light);
}

.sensor-logs-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sensor-logs-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

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

.sensor-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.sensor-checkbox-label input[type="checkbox"],
.custom-checkbox-input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  margin: 0;
  transition: all 0.15s ease-in-out;
  flex-shrink: 0;
  position: relative;
}

.sensor-checkbox-label input[type="checkbox"]:hover,
.custom-checkbox-input:hover {
  border-color: #475569;
  background: #1a2232;
}

.sensor-checkbox-label input[type="checkbox"]:focus-visible,
.custom-checkbox-input:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.sensor-checkbox-label input[type="checkbox"]:checked,
.custom-checkbox-input:checked {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.sensor-checkbox-label input[type="checkbox"]:checked::after,
.custom-checkbox-input:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
  display: block;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
}

.sensor-logs-table-wrapper {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: auto;
}

.sensor-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
}

.sensor-logs-table thead {
  position: sticky;
  top: 0;
  background: var(--bg-card-muted);
  border-bottom: 1px solid var(--border-light);
  z-index: 1;
}

/* Universal Custom Styled Dropdowns */
select,
.custom-select,
.form-input select,
select.form-input,
.sensor-select-compact,
.sensor-select-styled {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg-card-muted);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 13px 13px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 32px 6px 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

select:hover,
select.form-input:hover,
.sensor-select-styled:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background-color: var(--bg-card);
}

select:focus,
select.form-input:focus,
.sensor-select-styled:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

select option {
  background-color: #1e293b;
  color: #f8fafc;
  padding: 8px;
}

/* Custom Styled File Picker & Upload Zone */
.file-picker-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 12px 0;
  transition: all 0.15s ease;
  position: relative;
  flex-wrap: wrap;
}

.file-picker-card:hover,
.file-picker-card.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.hidden-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.file-picker-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 220px;
}

.file-picker-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-picker-filename {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker-filename.has-file {
  color: #38bdf8;
}

.file-picker-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-icon-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 4px;
}
.btn-icon-clear:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.file-picker-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sensor Category Groups */
.sensor-group-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 14px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sensor-group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* Enhanced Sensor Card Elements */
.sensor-fancy-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: all 0.15s ease;
}

.sensor-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sensor-badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  width: fit-content;
}

.sensor-status-quiet { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.sensor-status-normal { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.sensor-status-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.sensor-status-alert { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.sensor-status-muted { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Sensor Visual Meter Bar */
.sensor-meter-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.sensor-meter-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.meter-sound {
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 70%, #ef4444 100%);
}

.meter-light {
  background: linear-gradient(90deg, #3b82f6 0%, #f59e0b 50%, #fbbf24 100%);
}

.sensor-sub-val {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

.sensor-logs-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.sensor-logs-table td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  white-space: nowrap;
}

.sensor-logs-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.sensor-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sensor-pill-sound { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.sensor-pill-light { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.sensor-pill-pressure { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.sensor-pill-orientation { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.sensor-pill-motion { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.sensor-pill-proximity { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }
.sensor-pill-steps { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }

.sensor-delta-up { color: #f87171; font-weight: 600; }
.sensor-delta-down { color: #34d399; font-weight: 600; }
.sensor-delta-same { color: var(--text-muted); }

.sensor-card-pulse {
  animation: sensorCardFlash 0.6s ease;
}

@keyframes sensorCardFlash {
  0% { border-color: var(--primary); }
  100% { border-color: var(--border-light); }
}

/* ==========================================================================
   Full-Page Device Studio Sidebar Navigation Layout
   ========================================================================== */

.studio-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-top: 14px;
}

.studio-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-nav-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-nav-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding: 4px 8px;
  margin-bottom: 2px;
}

.studio-sidebar .device-tab {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.studio-sidebar .device-tab:hover {
  background: var(--bg-card-muted);
  color: var(--text-main);
}

.studio-sidebar .device-tab.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.3);
  font-weight: 700;
}

.studio-tab-hint {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
}

.studio-content {
  flex: 1;
  min-width: 0;
}

/* ==========================================================================
   Custom Floating Toast Notification System
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99999;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 290px;
  max-width: 420px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  font-size: 12.5px;
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}

@keyframes toastSlideIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-info { border-left: 4px solid var(--primary); }
.toast-info .toast-icon { color: var(--primary); }

.toast-success { border-left: 4px solid var(--accent); }
.toast-success .toast-icon { color: var(--accent); }

.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-error { border-left: 4px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }

.toast-message {
  flex: 1;
  line-height: 1.4;
  font-weight: 500;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
  border-radius: 3px;
}
.toast-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Storefront Electronic LED Signboard (Shop Entrance Ticker)
   ========================================================================== */

.led-shop-signboard-container {
  background: #09090b;
  border: 4px solid #27272a;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 14px 0;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 4px 14px rgba(0,0,0,0.6);
}

.led-shop-signboard-bezel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #71717a;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.led-shop-signboard-screen {
  background-color: #050505;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 15%, transparent 16%);
  background-size: 6px 6px;
  border: 1px solid #18181b;
  border-radius: 4px;
  height: 90px;
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
}

.led-shop-signboard-ticker {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0.14em;
  white-space: nowrap;
  text-transform: uppercase;
  text-shadow: 0 0 10px currentColor, 0 0 25px currentColor, 0 0 45px currentColor;
  display: inline-block;
  will-change: transform;
  transition: color 0.2s ease, font-size 0.2s ease, text-shadow 0.2s ease;
}

@keyframes ledMarqueeScroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.screen-input-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.screen-input-bar input {
  flex: 1;
}

/* Styled Text Fields & Selects for Screen Control */
.screen-input-styled {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: #f8fafc;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.screen-input-styled:hover {
  border-color: #3b465c;
}

.screen-input-styled:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.screen-input-styled::placeholder {
  color: #64748b;
}

.screen-select-styled {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: #f8fafc;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.screen-select-styled:hover {
  border-color: #3b465c;
}

.screen-select-styled:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.screen-select-styled option {
  background: #0f1523;
  color: #f8fafc;
}

.screen-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.screen-control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.screen-control-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Screen Mode Selector Tabs Bar */
.screen-mode-tabs-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.screen-mode-tab-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.screen-mode-tab-btn:hover {
  background: #182234;
  color: #fff;
  border-color: #3b465c;
}

.screen-mode-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

/* Upload Progress Bar */
.upload-progress-wrap {
  width: 100%;
}

.tts-preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tts-preset-chip:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-color: var(--primary);
}

/* ==========================================================================
   Full Normal Command Terminal (Authentic Sleek Linux/macOS Shell)
   ========================================================================== */

.terminal-window {
  background: #070a10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 440px;
  height: 520px;
  box-shadow: 0 12px 36px -6px rgba(0, 0, 0, 0.7), 0 4px 16px rgba(0, 0, 0, 0.5);
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', monospace;
  position: relative;
}

.terminal-titlebar {
  background: linear-gradient(180deg, #131825 0%, #0d121c 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  flex-shrink: 0;
}

.terminal-traffic-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 65px;
}

.traffic-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  position: relative;
  transition: transform 0.15s ease, opacity 0.15s ease;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.4);
}
.traffic-dot:hover {
  transform: scale(1.12);
}
.dot-red {
  background: #ff5f56;
  border: 1px solid #e0443e;
}
.dot-yellow {
  background: #ffbd2e;
  border: 1px solid #dea123;
}
.dot-green {
  background: #27c93f;
  border: 1px solid #1aab29;
}

.terminal-title-center {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-shell-icon {
  color: #38bdf8;
  flex-shrink: 0;
}

.terminal-title-text {
  color: #cbd5e1;
  font-weight: 600;
}

.term-shell-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.terminal-title-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  justify-content: flex-end;
}

.btn-term-action {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-term-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.15);
}

.terminal-quick-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #0a0e18;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}

.terminal-quick-pills::-webkit-scrollbar {
  display: none;
}

.terminal-quick-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
  margin-right: 4px;
  flex-shrink: 0;
}

.terminal-pill-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #93c5fd;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 3px 9px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.terminal-pill-btn:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  color: #ffffff;
  transform: translateY(-1px);
}

.terminal-pill-btn:active {
  transform: scale(0.96);
}

.terminal-body {
  flex: 1;
  padding: 14px 16px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: #cbd5e1;
  background: #070a10;
  cursor: text;
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.term-line {
  margin-bottom: 12px;
}

.term-prompt-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 4px;
  font-weight: 600;
  margin-bottom: 4px;
}

.term-user { color: #34d399; font-weight: 700; }
.term-at { color: #64748b; margin: 0 1px; }
.term-host { color: #38bdf8; font-weight: 600; }
.term-colon { color: #64748b; }
.term-path { color: #fbbf24; font-weight: 600; }
.term-symbol { color: #a855f7; margin-left: 3px; margin-right: 4px; font-weight: 700; }
.term-dollar { color: #a855f7; margin-right: 4px; font-weight: 700; }
.term-cmd { color: #ffffff; font-weight: 700; margin-left: 2px; }

.term-meta-time {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
  padding-left: 10px;
}

.term-out-stdout {
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  margin: 2px 0 0 0;
  padding: 0;
}

.term-out-stderr {
  color: #f87171;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  margin: 2px 0 0 0;
  padding: 0;
}

.term-exit-status {
  margin-top: 4px;
}

.term-exit-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 3px;
}

.term-running-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-style: italic;
  font-size: 11.5px;
  margin-top: 2px;
}

.term-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: termSpin 0.8s linear infinite;
}

@keyframes termSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0d121d;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.terminal-input-row:focus-within {
  background: #101624;
  border-top-color: rgba(56, 189, 248, 0.4);
}

.term-prompt-label {
  display: inline-flex;
  align-items: baseline;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.term-input-field-wrap {
  flex: 1;
  min-width: 60px;
  display: flex;
  align-items: center;
}

.terminal-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 500;
  caret-color: #38bdf8;
  padding: 2px 0;
}

.terminal-input::placeholder {
  color: rgba(148, 163, 184, 0.35);
  font-size: 11.5px;
}

.btn-term-run {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 4px;
  color: #60a5fa;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-term-run:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-term-run:active {
  transform: scale(0.96);
}

.term-kbd {
  display: inline-block;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
  line-height: 1;
  color: inherit;
}

/* ==========================================================================
   Camera Pro Controls Tray (Focus, Anti-Banding, Bitrate)
   ========================================================================== */
.camera-pro-tray {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-light);
  padding: 10px 16px;
  animation: traySlideDown 0.2s ease-out;
}

@keyframes traySlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pro-control-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.pro-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-control-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.btn-group-segmented {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.btn-segment {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-segment:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-segment.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.35);
}

/* ==========================================================================
   User Action & Audit Logs View
   ========================================================================== */
.logs-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.logs-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 260px;
}

.logs-search-wrapper svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.logs-search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 34px;
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.logs-search-input:focus {
  border-color: var(--primary);
}

.logs-filters-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logs-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.logs-table th {
  background: var(--bg-card-muted);
  padding: 10px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
}

.logs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.logs-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.log-cell-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.log-cell-action code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.log-cell-device .device-cell-name {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.log-cell-details {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cbd5e1;
}

.source-tag {
  font-size: 10.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

/* Category Badges */
.badge-cat-camera { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-cat-hardware { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-cat-screen { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-cat-network { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-cat-storage { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }
.badge-cat-scheduler { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-cat-integrations { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-cat-general { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Status Pills */
.status-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-pill-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-pill-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.status-pill-error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.status-pill-neutral {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}




/* ==========================================================================
   Forwarding Hub: Sub-Tabs, Visual Cards, Tooltips & Endpoint Switcher
   ========================================================================== */
.hub-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px;
  flex-wrap: wrap;
}

.hub-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.hub-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.hub-tab-btn.active {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  font-weight: 700;
}

.hub-tab-content {
  animation: hubTabFade 0.18s ease-out;
}

@keyframes hubTabFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hub-visual-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}

.hub-visual-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.hub-visual-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hub-visual-body {
  flex: 1;
  min-width: 0;
}

.hub-visual-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.hub-visual-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.hub-visual-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Floating Help Tooltip */
.hub-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.hub-help-icon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  user-select: none;
  transition: all 0.15s ease;
  line-height: 1;
}

.hub-help-icon:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--primary);
  color: #93c5fd;
}

.hub-tooltip-text {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  padding: 8px 11px;
  border-radius: 6px;
  width: 230px;
  max-width: 80vw;
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 999;
  text-align: left;
}

.hub-tooltip-wrap:hover .hub-tooltip-text {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Hub Matrix Table */
.hub-matrix-table tr {
  transition: background 0.15s ease;
}

.hub-matrix-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Endpoint Sub-Switcher */
.hub-endpoint-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-endpoint-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hub-endpoint-pill:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.25);
}

.hub-endpoint-pill.active {
  background: rgba(59, 130, 246, 0.14);
  border-color: var(--primary);
  color: #60a5fa;
  font-weight: 700;
}

.hub-endpoint-card {
  animation: hubTabFade 0.18s ease-out;
}

/* ==========================================================================
   Live Audio-Only Stream Waveform Visualizer
   ========================================================================== */
.audio-waveform-container {
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.audio-waveform-canvas {
  display: block;
  width: 100%;
  height: 110px;
}

.audio-waveform-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.6);
  color: var(--text-muted);
  font-size: 12px;
  pointer-events: none;
}

/* ==========================================================================
   Pagination Number Buttons (Glowing Active, Frosted Hover)
   ========================================================================== */
.btn-page-num {
  background: var(--bg-card-muted);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-page-num:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-page-num.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.55), 0 0 3px rgba(59, 130, 246, 0.7);
  transform: translateY(-1px);
}

.btn-page-nav {
  background: var(--bg-card-muted);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-page-nav:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-page-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: transparent;
}

/* ==========================================================================
   Universal Custom Select & Dropdown Styling (Global Override)
   ========================================================================== */
select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: var(--bg-card-muted) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 14px 14px !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-main) !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 7px 34px 7px 12px !important;
  cursor: pointer !important;
  outline: none !important;
  transition: all 0.15s ease !important;
}

select:hover {
  border-color: rgba(255, 255, 255, 0.3) !important;
  background-color: var(--bg-card) !important;
}

select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}

select option {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  padding: 8px !important;
}

select:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}
