/* ============================================================================
   Bifrost KVM - Modern Dark Theme
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

/* ============================================================================
   App Container
   ============================================================================ */

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================================
   Header
   ============================================================================ */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 48px;
  min-height: 48px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid #334155;
  -webkit-app-region: drag;
  user-select: none;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
}

.header-left {
  gap: 10px;
  flex: 1;
}

.header-center {
  flex: 1;
  justify-content: center;
}

.header-right {
  flex: 1;
  justify-content: flex-end;
}

.app-icon {
  width: 24px;
  height: 24px;
}

.app-icon svg {
  width: 100%;
  height: 100%;
  color: #38bdf8;
}

.app-name {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 16px;
  font-size: 12px;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.indicator-dot.connected {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.indicator-text {
  color: #94a3b8;
}

.window-controls {
  display: flex;
  gap: 8px;
  -webkit-app-region: no-drag;
}

.window-button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.window-button.maximize-btn {
  font-size: 22px;
  padding-bottom: 4px;
}

.window-button:hover {
  background: #334155;
  color: #e5e7eb;
}

.close-btn:hover {
  background: #ef4444;
  color: white;
}

/* ============================================================================
   Main Content
   ============================================================================ */

.main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ============================================================================
   Screens
   ============================================================================ */

.screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen.hidden {
  display: none;
}

.screen-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  min-height: 64px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.screen-toolbar h2 {
  font-size: 18px;
  font-weight: 600;
  color: #e5e7eb;
  margin: 0;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  -webkit-app-region: no-drag;
}

.screen-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen-content.centered {
  align-items: center;
  justify-content: center;
}

.screen-content.scrollable {
  overflow-y: auto;
  gap: 20px;
}

.screen-content.scrollable::-webkit-scrollbar {
  width: 8px;
}

.screen-content.scrollable::-webkit-scrollbar-track {
  background: #1e293b;
}

.screen-content.scrollable::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

/* ============================================================================
   Footer
   ============================================================================ */

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  height: 32px;
  min-height: 32px;
  background: #1e293b;
  border-top: 1px solid #334155;
}

.footer-text {
  font-size: 11px;
  color: #64748b;
}

/* ============================================================================
   Login Screen
   ============================================================================ */

.login-container {
  text-align: center;
  padding: 40px;
}

.login-logo {
  margin-bottom: 24px;
}

.bifrost-logo-large {
  width: 120px;
  height: 120px;
  color: #38bdf8;
}

.login-title {
  font-size: 32px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.login-subtitle {
  color: #94a3b8;
  margin-bottom: 32px;
  font-size: 14px;
}

.remember-me-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  color: #94a3b8;
  font-size: 14px;
  margin-top: 20px;
  user-select: none;
}

.remember-me-label input[type="checkbox"] {
  display: none;
}

.remember-me-check {
  width: 18px;
  height: 18px;
  border: 2px solid #475569;
  border-radius: 4px;
  background: transparent;
  position: relative;
  transition: all 0.15s ease;
}

.remember-me-label:hover .remember-me-check {
  border-color: #64748b;
}

.remember-me-label input[type="checkbox"]:checked + .remember-me-check {
  background: #3b82f6;
  border-color: #3b82f6;
}

.remember-me-label input[type="checkbox"]:checked + .remember-me-check::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.login-footer {
  margin-top: 24px;
  font-size: 12px;
  color: #64748b;
}

/* ============================================================================
   User Info
   ============================================================================ */

.user-info {
  padding: 12px 24px;
  background: rgba(59, 130, 246, 0.1);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info:empty {
  display: none;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

/* ============================================================================
   Bifrost List
   ============================================================================ */

.bifrost-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.bifrost-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bifrost-item:hover {
  background: #334155;
  border-color: #3b82f6;
  transform: translateX(4px);
}

.bifrost-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

.bifrost-icon svg {
  width: 100%;
  height: 100%;
  color: #ffffff;
}

.bifrost-info {
  flex: 1;
}

.bifrost-name {
  font-size: 16px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 4px;
}

.bifrost-serial {
  font-size: 13px;
  color: #64748b;
  font-family: 'Consolas', 'Monaco', monospace;
}

.bifrost-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
}

.bifrost-status.online {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.bifrost-status.online .status-dot {
  background: #22c55e;
}

.bifrost-status.in-session {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

.bifrost-status.in-session .status-dot {
  background: #fb923c;
}

.bifrost-status.idle {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.bifrost-arrow {
  font-size: 24px;
  color: #64748b;
  font-weight: 300;
}

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px;
  color: #94a3b8;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #334155;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty List */
.empty-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  text-align: center;
}

.empty-list-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.empty-list h3 {
  font-size: 18px;
  font-weight: 600;
  color: #e5e7eb;
}

.empty-list p {
  font-size: 14px;
  color: #94a3b8;
}

/* ============================================================================
   Connecting Overlay
   ============================================================================ */

.connecting-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  color: #94a3b8;
  text-align: center;
}

.connecting-overlay p {
  margin: 0;
  font-size: 14px;
}

.connecting-hint {
  font-size: 12px !important;
  color: #64748b;
}

.connecting-overlay .btn {
  margin-top: 16px;
}

/* ============================================================================
   Connected Info Bar
   ============================================================================ */

.connected-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(34, 197, 94, 0.1);
  border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.conn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conn-icon svg {
  width: 100%;
  height: 100%;
  color: #22c55e;
}

.conn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conn-label {
  font-size: 12px;
  color: #64748b;
}

.conn-value {
  font-size: 14px;
  font-weight: 600;
  color: #22c55e;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-app-region: no-drag;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #334155;
  color: #e5e7eb;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
}

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
}

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

.btn-icon {
  font-size: 16px;
}

/* ============================================================================
   Session Toolbar
   ============================================================================ */

.session-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  min-height: 52px;
  gap: 16px;
  position: relative;
  z-index: 100;
  -webkit-app-region: no-drag;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.toolbar-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #334155;
  color: #94a3b8;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  -webkit-app-region: no-drag;
}

.toolbar-btn-labeled {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  font-size: 13px;
}

.toolbar-btn-labeled span {
  white-space: nowrap;
}

.toolbar-btn:hover {
  background: #475569;
  color: #e5e7eb;
}

.toolbar-btn.active {
  background: #3b82f6;
  color: white;
}

.toolbar-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.toolbar-btn:disabled:hover {
  background: #334155;
  color: #94a3b8;
}

/* Session Tabs */
.session-tabs {
  display: flex;
  gap: 4px;
  background: #0f172a;
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: #1e293b;
  color: #e5e7eb;
}

.tab-btn.active {
  background: #3b82f6;
  color: white;
}

/* Device Info */
.device-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 8px;
}

.device-name {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

.device-version {
  font-size: 11px;
  color: #64748b;
}

.firmware-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.firmware-update-badge {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  animation: firmware-pulse 2s ease-in-out infinite;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.firmware-update-badge.visible {
  display: flex;
}

.firmware-update-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.5);
  animation: none;
}

.firmware-update-badge svg {
  transform: rotate(-90deg);
}

@keyframes firmware-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }
}

.battery-indicator, .network-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #334155;
  border-radius: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.battery-indicator svg, .network-indicator svg {
  color: #22c55e;
}

/* Signal Strength Bars */
.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  margin-left: 4px;
}

.signal-bar {
  width: 3px;
  background: #475569;
  border-radius: 1px;
  transition: background 0.2s ease;
}

.signal-bar[data-bar="1"] { height: 4px; }
.signal-bar[data-bar="2"] { height: 7px; }
.signal-bar[data-bar="3"] { height: 10px; }
.signal-bar[data-bar="4"] { height: 14px; }

.signal-bar.active {
  background: #22c55e;
}

.signal-bar.weak {
  background: #f59e0b;
}

.signal-bar.very-weak {
  background: #ef4444;
}

/* Shortcuts Dropdown */
.shortcuts-dropdown {
  position: relative;
}

.shortcuts-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  min-width: 200px;
  z-index: 100;
  display: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.shortcuts-menu.visible {
  display: block;
}

.shortcuts-section {
  margin-bottom: 12px;
}

.shortcuts-section:last-child {
  margin-bottom: 0;
}

.shortcuts-title {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.shortcut-btn {
  display: block;
  width: 100%;
  padding: 6px 10px;
  margin-bottom: 4px;
  border: none;
  background: #0f172a;
  color: #94a3b8;
  font-size: 12px;
  text-align: left;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shortcut-btn:hover {
  background: #334155;
  color: #e5e7eb;
}

/* ============================================================================
   Session Content
   ============================================================================ */

.session-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative; /* For absolute positioned slide panels */
}

/* Footer */
/* Settings Panel */
.settings-panel {
  width: 280px;
  background: #1e293b;
  border-right: 1px solid #334155;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.settings-panel.visible {
  display: flex;
}

/* Right Slide Panels */
.slide-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #1e293b;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s ease, visibility 0.25s;
  pointer-events: none;
  visibility: hidden;
}

.slide-panel-right {
  right: 0;
  width: 320px;
  border-left: 1px solid #334155;
  transform: translateX(100%);
  z-index: 100;
}

.slide-panel-right.visible {
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
  z-index: 101;
}

.slide-panel-narrow {
  width: 280px;
}

.slide-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #334155;
}

.slide-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
  margin: 0;
}

.slide-panel-back {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.slide-panel-back:hover {
  background: #334155;
  color: #e5e7eb;
}

.slide-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.slide-panel-footer {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #334155;
  justify-content: flex-end;
}

.slide-panel-footer-stack {
  flex-direction: column;
}

.slide-panel-footer-stack .btn {
  width: 100%;
}

.panel-form .form-group {
  margin-bottom: 16px;
}

.panel-form .form-group:last-child {
  margin-bottom: 0;
}

/* FTP Status Card */
.ftp-status-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #0f172a;
  border-radius: 8px;
  margin-bottom: 20px;
}

.ftp-status-card.enabled {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.ftp-status-icon {
  color: #64748b;
  flex-shrink: 0;
}

.ftp-status-card.enabled .ftp-status-icon {
  color: #22c55e;
}

.ftp-status-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ftp-status-label {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.ftp-status-hint {
  font-size: 12px;
  color: #64748b;
}

/* FTP Connection Info */
.ftp-connection-info {
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 16px;
}

.connection-info-header {
  padding: 10px 12px;
  background: #1e293b;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.connection-info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #1e293b;
}

.connection-info-row:last-child {
  border-bottom: none;
}

.connection-info-label {
  font-size: 13px;
  color: #94a3b8;
}

.connection-info-value {
  font-size: 13px;
  color: #e5e7eb;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* Input with button */
.input-with-button {
  display: flex;
  gap: 0;
}

.input-with-button input {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: #334155;
  border: 1px solid #475569;
  border-left: none;
  border-radius: 0 6px 6px 0;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.input-icon-btn:hover {
  background: #475569;
  color: #e5e7eb;
}

/* Delete Panel */
.delete-warning-panel {
  text-align: center;
  padding: 24px 0;
}

.delete-warning-icon {
  color: #f59e0b;
  margin-bottom: 16px;
}

.delete-warning-icon.folder-icon-large {
  color: #f59e0b;
}

.delete-warning-text {
  font-size: 15px;
  color: #e5e7eb;
  margin-bottom: 8px;
}

.delete-folder-info {
  font-size: 14px;
  color: #94a3b8;
  background: #1e293b;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  text-align: left;
  line-height: 1.6;
}

.delete-folder-info strong {
  color: #cbd5e1;
}

.delete-warning-hint {
  font-size: 13px;
  color: #64748b;
}

/* ZIP Upload Panel */
.zip-upload-panel {
  text-align: center;
  padding: 24px 0;
}

.zip-upload-icon {
  color: #3b82f6;
  margin-bottom: 16px;
}

.zip-upload-text {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.zip-upload-filename {
  font-size: 16px;
  font-weight: 600;
  color: #e5e7eb;
  background: #0f172a;
  padding: 8px 16px;
  border-radius: 6px;
  margin: 12px 0;
  word-break: break-all;
}

.zip-upload-hint {
  font-size: 13px;
  color: #64748b;
  margin-top: 12px;
}

/* FTP Toolbar Status Indicator */
.ftp-btn-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ftp-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #22c55e;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.status-dot-green {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

/* Block button style */
.btn-block {
  width: 100%;
  justify-content: center;
}

.settings-header {
  padding: 16px;
  border-bottom: 1px solid #334155;
}

.settings-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.settings-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.setting-item:hover {
  background: #334155;
}

.setting-icon {
  font-size: 16px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setting-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.setting-label {
  flex: 1;
}

.setting-item.setting-toggle {
  cursor: default;
}

.setting-item.setting-select {
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

.setting-item.setting-select select {
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #e5e7eb;
  font-size: 12px;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #475569;
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider,
.toggle-switch input:checked + .toggle-slider {
  background-color: #3b82f6;
}

.toggle input:checked + .toggle-slider:before,
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.toggle input:disabled + .toggle-slider,
.toggle-switch input:disabled + .toggle-slider {
  background: #555;
  cursor: not-allowed;
}

/* ============================================================================
   Tab Panels
   ============================================================================ */

.tab-panels {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0; /* Important: allows flex item to shrink */
}

.tab-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.tab-panel.active {
  display: flex;
}

/* Video Container */
.video-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
  overflow: hidden;
}

#remoteVideo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: default;
  /* Sharpen upscaled video */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  /* Subtle contrast boost to appear sharper */
  filter: contrast(1.03) saturate(1.05);
}

.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #94a3b8;
}

.video-loading.hidden {
  display: none;
}

/* No Signal Overlay */
.no-signal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.no-signal-content {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

.no-signal-icon {
  width: 64px;
  height: 64px;
  color: #ef4444;
  margin-bottom: 20px;
}

.no-signal-title {
  font-size: 20px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0 0 12px 0;
}

.no-signal-text {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.no-signal-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.no-signal-help-btn:hover {
  background: #2563eb;
}

.no-signal-help-btn svg {
  flex-shrink: 0;
}

/* Terminal */
.terminal-toolbar, .ssh-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  flex-wrap: wrap;
}

.terminal-toolbar label, .ssh-toolbar label {
  font-size: 13px;
  color: #94a3b8;
}

.terminal-toolbar select, .ssh-toolbar select {
  padding: 6px 12px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #e5e7eb;
  font-size: 13px;
}

.terminal-container, .ssh-container {
  flex: 1;
  background: #000;
  overflow: hidden;
  padding: 8px;
  position: relative;
  min-height: 0; /* Important: allows flex item to shrink */
}

.terminal-container .xterm,
.ssh-container .xterm {
  height: 100%;
  max-height: 100%;
}

.terminal-container .xterm-viewport,
.ssh-container .xterm-viewport {
  overflow-y: auto !important;
}

.terminal-container .xterm-screen,
.ssh-container .xterm-screen {
  max-height: 100%;
}

/* xterm.js core styles - required for proper rendering */
.xterm {
  cursor: text;
  position: relative;
  user-select: none;
  -ms-user-select: none;
  -webkit-user-select: none;
}

.xterm.focus,
.xterm:focus {
  outline: none;
}

.xterm .xterm-helpers {
  position: absolute;
  top: 0;
  z-index: 5;
}

.xterm .xterm-helper-textarea {
  padding: 0;
  border: 0;
  margin: 0;
  position: absolute;
  opacity: 0;
  left: -9999em;
  top: 0;
  width: 0;
  height: 0;
  z-index: -5;
  white-space: nowrap;
  overflow: hidden;
  resize: none;
}

.xterm .composition-view {
  background: #000;
  color: #fff;
  display: none;
  position: absolute;
  white-space: nowrap;
  z-index: 1;
}

.xterm .composition-view.active {
  display: block;
}

.xterm .xterm-viewport {
  background-color: #000;
  overflow-y: scroll;
  cursor: default;
  position: absolute;
  right: 0;
  left: 0;
  top: 0;
  bottom: 0;
}

.xterm .xterm-screen {
  position: relative;
}

.xterm .xterm-screen canvas {
  position: absolute;
  left: 0;
  top: 0;
}

.xterm .xterm-scroll-area {
  visibility: hidden;
}

.xterm-char-measure-element {
  display: inline-block;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: -9999em;
  line-height: normal;
}

.xterm.enable-mouse-events {
  cursor: default;
}

.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
  cursor: pointer;
}

.xterm.column-select.focus {
  cursor: crosshair;
}

.xterm .xterm-accessibility,
.xterm .xterm-message {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 10;
  color: transparent;
}

.xterm .live-region {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.xterm-dim {
  opacity: 0.5;
}

.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }

.xterm-strikethrough {
  text-decoration: line-through;
}

.xterm-screen .xterm-decoration-container .xterm-decoration {
  z-index: 6;
  position: absolute;
}

.xterm-decoration-overview-ruler {
  z-index: 7;
  position: absolute;
  top: 0;
  right: 0;
  pointer-events: none;
}

.xterm-decoration-top {
  z-index: 2;
  position: relative;
}

/* IP input group for SSH */
.ip-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ip-octet {
  width: 50px;
  padding: 8px;
  text-align: center;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #e5e7eb;
  font-size: 14px;
}

.ip-input-group span {
  color: #64748b;
  font-size: 16px;
}

/* ============================================================================
   Modals
   ============================================================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 0;
}

.modal-content {
  position: relative;
  z-index: 1;
  background: #1e293b;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 90%;
  max-width: 400px;
  border: 1px solid #334155;
}

.modal-content.modal-wide {
  max-width: 500px;
}

.modal-content.modal-small {
  max-width: 350px;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #f1f5f9;
}

.modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.modal-body {
  padding: 20px;
  color: #f1f5f9;
}

.modal-description {
  color: #94a3b8;
  font-size: 14px;
  margin: 0 0 16px 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #334155;
}

/* Modal Overlay (centered modals) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
  display: none;
}

/* Relay Confirmation Modal */
.relay-modal {
  background: #1e293b;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 90%;
  padding: 32px;
  text-align: center;
  border: 1px solid #334155;
}

.relay-modal-icon {
  color: #f59e0b;
  margin-bottom: 16px;
}

.relay-modal-icon.reset-video-icon {
  color: #3b82f6;
}

.relay-modal-title {
  margin: 0 0 16px 0;
  font-size: 20px;
  font-weight: 600;
  color: #f1f5f9;
}

.relay-modal-text {
  color: #e5e7eb;
  font-size: 14px;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.relay-modal-text strong {
  color: #f59e0b;
}

.relay-modal-hint {
  color: #94a3b8;
  font-size: 13px;
  margin: 0 0 24px 0;
}

.relay-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.relay-modal-buttons .btn {
  min-width: 120px;
}

.btn-warning {
  background: #f59e0b;
  color: #000;
  border: none;
}

.btn-warning:hover {
  background: #d97706;
}

/* OTP Input */
.otp-input-container {
  margin-bottom: 12px;
}

.otp-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 24px;
  font-family: 'Consolas', 'Monaco', monospace;
  text-align: center;
  letter-spacing: 8px;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 8px;
  color: #7dd3fc;
  outline: none;
  transition: border-color 0.15s ease;
}

.otp-input:focus {
  border-color: #38bdf8;
}

.otp-hint {
  color: #64748b;
  font-size: 12px;
  margin: 0;
  font-style: italic;
}

/* WiFi Password Modal */
.wifi-password-container {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.wifi-password-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 16px;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 8px;
  color: #e2e8f0;
  outline: none;
  transition: border-color 0.15s ease;
}

.wifi-password-input:focus {
  border-color: #38bdf8;
}

.wifi-password-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wifi-password-toggle:hover {
  background: #334155;
  color: #e2e8f0;
}

.wifi-password-toggle.showing {
  color: #3b82f6;
  border-color: #3b82f6;
}

/* Firmware Update Modal */
.firmware-version-info {
  background: #0f172a;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

.version-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.version-row:not(:last-child) {
  border-bottom: 1px solid #334155;
}

.version-label {
  color: #94a3b8;
  font-size: 14px;
}

.version-value {
  font-weight: 600;
  color: #e2e8f0;
  font-family: 'Monaco', 'Menlo', monospace;
}

.version-value.version-new {
  color: #22c55e;
}

.firmware-warning {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  padding: 16px;
  color: #fbbf24;
  font-size: 13px;
  line-height: 1.5;
}

.firmware-warning strong {
  color: #fcd34d;
}

/* Network Priority */
.priority-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.priority-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #0f172a;
  border-radius: 6px;
  cursor: move;
}

.drag-handle {
  color: #64748b;
  font-size: 16px;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group input:focus {
  border-color: #3b82f6;
}

.toggle-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================================================
   Toast Notifications
   ============================================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #1e293b;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border-left: 4px solid #22c55e;
  min-width: 300px;
  animation: slideIn 0.3s ease;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast-icon {
  font-size: 18px;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: #e5e7eb;
}

.toast-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.toast-close:hover {
  color: #e5e7eb;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================================================
   Loading States
   ============================================================================ */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #94a3b8;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #334155;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.hidden {
  display: none !important;
}

/* ============================================================================
   Storage Panel
   ============================================================================ */

#storagePanel {
  display: none;
  flex-direction: column;
  height: 100%;
}

#storagePanel.active {
  display: flex;
}

.storage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  gap: 12px;
}

.storage-toolbar-left,
.storage-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn-icon svg {
  width: 18px;
  height: 18px;
}

/* Storage Content */
.storage-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: #0f172a;
}

/* Drag & Drop Zone */
.storage-dropzone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(59, 130, 246, 0.15);
  border: 3px dashed #3b82f6;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.storage-dropzone.active {
  display: flex;
}

.dropzone-content {
  text-align: center;
  color: #3b82f6;
}

.dropzone-content svg {
  margin-bottom: 16px;
  opacity: 0.8;
}

.dropzone-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.dropzone-content p {
  font-size: 14px;
  opacity: 0.8;
}

/* File Browser */
.file-browser {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* File List Header */
.file-list-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-header-check {
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-header-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #3b82f6;
}

.sortable-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.sortable-header:hover {
  color: #e5e7eb;
}

.sortable-header .sort-icon {
  display: none;
  opacity: 0.5;
}

.sortable-header:hover .sort-icon.sort-desc {
  display: block;
  opacity: 0.4;
}

.sortable-header.active .sort-icon {
  display: none;
}

.sortable-header.active.asc .sort-icon.sort-asc {
  display: block;
  opacity: 1;
}

.sortable-header.active.desc .sort-icon.sort-desc {
  display: block;
  opacity: 1;
}

.file-header-name {
  flex: 1;
}

.file-header-size {
  width: 100px;
  text-align: right;
  justify-content: flex-end;
}

/* File List */
.file-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.file-list::-webkit-scrollbar {
  width: 8px;
}

.file-list::-webkit-scrollbar-track {
  background: #1e293b;
}

.file-list::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

/* File Item */
.file-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid transparent;
  user-select: none;
}

.file-item:hover {
  background: rgba(59, 130, 246, 0.15);
}

.file-item:active {
  background: rgba(59, 130, 246, 0.25);
}

.file-item.selected {
  background: rgba(59, 130, 246, 0.2);
  border-bottom-color: rgba(59, 130, 246, 0.3);
}

.file-item.selected:hover {
  background: rgba(59, 130, 246, 0.25);
}

.file-item-check {
  width: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.file-item-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3b82f6;
}

.file-item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: #64748b;
}

.file-item-icon svg {
  width: 24px;
  height: 24px;
}

.file-item-name {
  flex: 1;
  font-size: 14px;
  color: #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-folder {
  color: #64748b;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.file-item-folder .folder-icon {
  width: 14px;
  height: 14px;
  color: #f59e0b;
  flex-shrink: 0;
}

.file-item-size {
  width: 100px;
  text-align: right;
  font-size: 13px;
  color: #64748b;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* Folder Row (expandable) */
.folder-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid #1e293b;
  background: #1a2536;
}

.folder-row:hover {
  background: #243044;
}

.folder-row.selected {
  background: #1e3a5f;
}

.folder-row.selected:hover {
  background: #234872;
}

.folder-row-check {
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-row-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #3b82f6;
}

.folder-row-toggle {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: transform 0.2s ease;
}

.folder-row-toggle svg {
  width: 16px;
  height: 16px;
}

.folder-row.expanded .folder-row-toggle {
  transform: rotate(90deg);
}

.folder-row-icon {
  color: #f59e0b;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.folder-row-icon svg {
  width: 24px;
  height: 24px;
}

.folder-row-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #e5e7eb;
}

.folder-row-count {
  font-size: 12px;
  color: #64748b;
  background: #334155;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Indented file items inside folders */
.file-item.in-folder {
  padding-left: 52px;
  background: #0d1420;
}

.file-item.in-folder:hover {
  background: #162030;
}

.folder-files {
  display: none;
}

.folder-files.expanded {
  display: block;
}

/* Empty State */
.file-list-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  padding: 48px;
  text-align: center;
}

.file-list-empty svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.file-list-empty h3 {
  font-size: 18px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
}

.file-list-empty p {
  font-size: 14px;
}

/* Storage Info Bar */
.storage-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #1e293b;
  border-top: 1px solid #334155;
  font-size: 13px;
  color: #94a3b8;
}

.storage-space {
  display: flex;
  align-items: center;
  gap: 8px;
}

.storage-space svg {
  color: #64748b;
}

.storage-selected {
  color: #3b82f6;
  font-weight: 500;
}

/* Transfer Panel */
.transfer-panel {
  background: #1e293b;
  border-top: 1px solid #334155;
  padding: 16px;
}

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

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

.transfer-title {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.transfer-details {
  font-size: 12px;
  color: #64748b;
}

.transfer-progress {
  height: 6px;
  background: #334155;
  border-radius: 3px;
  overflow: hidden;
}

.transfer-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.transfer-queue {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
}

/* FTP Modal Specific Styles */
.ftp-status {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #0f172a;
  border-radius: 8px;
  border: 1px solid #334155;
}

.ftp-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ftp-status-indicator .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
}

.ftp-status-indicator.active .status-dot {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.ftp-status-indicator .status-text {
  font-size: 14px;
  color: #94a3b8;
  font-weight: 500;
}

.ftp-status-indicator.active .status-text {
  color: #22c55e;
}

.input-with-toggle {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-toggle input {
  flex: 1;
  padding-right: 44px;
}

.input-toggle {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.input-toggle:hover {
  color: #e5e7eb;
}

.ftp-connection-info {
  margin-top: 20px;
  padding: 16px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
}

.connection-info-header {
  font-size: 12px;
  font-weight: 600;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.connection-info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.connection-info-row .info-label {
  color: #94a3b8;
}

.connection-info-row .info-value {
  color: #e5e7eb;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* Delete Modal */
.delete-warning {
  text-align: center;
  padding: 16px 0;
}

.delete-warning svg {
  color: #f59e0b;
  margin-bottom: 16px;
}

.delete-warning p {
  font-size: 15px;
  color: #e5e7eb;
  margin: 0;
}

.delete-warning .delete-hint {
  font-size: 13px;
  color: #64748b;
  margin-top: 8px;
}

/* ZIP Upload Modal */
.zip-prompt {
  text-align: center;
  padding: 16px 0;
}

.zip-prompt .zip-icon {
  color: #3b82f6;
  margin-bottom: 16px;
}

.zip-prompt p {
  font-size: 14px;
  color: #94a3b8;
  margin: 0;
}

.zip-prompt .zip-filename {
  font-size: 16px;
  font-weight: 600;
  color: #e5e7eb;
  margin: 12px 0;
  padding: 8px 16px;
  background: #0f172a;
  border-radius: 6px;
  font-family: 'Consolas', 'Monaco', monospace;
  word-break: break-all;
}

.zip-prompt .zip-hint {
  margin-top: 16px;
  font-size: 13px;
  color: #64748b;
}

.zip-modal-footer {
  flex-wrap: wrap;
  gap: 8px;
}

.zip-modal-footer .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.zip-modal-footer .btn svg {
  flex-shrink: 0;
}

/* Button Small Variant */
.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* Disabled state for buttons */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================================
   Connection Info Modal
   ============================================================================ */

.connection-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #3b82f6;
  border: none;
  border-radius: 50%;
  color: white;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s ease;
  -webkit-app-region: no-drag;
}

.connection-info-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.connection-info-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.connection-info-content {
  background: #1e293b;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #334155;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 450px;
  width: 90%;
}

.connection-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #334155;
}

.connection-info-title {
  font-size: 18px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}

.connection-info-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #64748b;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.connection-info-close:hover {
  color: #f1f5f9;
  background: #334155;
}

.connection-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #0f172a;
  border-radius: 8px;
}

.stat-label {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value.good {
  color: #22c55e;
}

.stat-value.warning {
  color: #f59e0b;
}

.stat-value.error {
  color: #ef4444;
}

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

.status-indicator.green {
  background: #22c55e;
}

.status-indicator.yellow {
  background: #f59e0b;
}

.status-indicator.red {
  background: #ef4444;
}

.status-indicator.gray {
  background: #64748b;
}

.refresh-stats-btn {
  width: 100%;
  margin-top: 16px;
  padding: 10px 16px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.refresh-stats-btn:hover {
  background: #2563eb;
}

/* Info Button (small i buttons) */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #475569;
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.info-btn:hover {
  background: #64748b;
  transform: scale(1.1);
}

/* Info Popup */
.info-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1100;
}

.info-popup-content {
  background: #1e293b;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #334155;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.info-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #334155;
}

.info-popup-title {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}

.info-popup-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #64748b;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.info-popup-close:hover {
  color: #f1f5f9;
  background: #334155;
}

.info-popup-text {
  line-height: 1.6;
  color: #cbd5e1;
  font-size: 14px;
}

.info-popup-text h4 {
  font-weight: 600;
  margin: 20px 0 8px 0;
  color: #f1f5f9;
  font-size: 14px;
}

.info-popup-text h4:first-child {
  margin-top: 0;
}

.info-popup-text p {
  margin-bottom: 12px;
}

.info-popup-text strong {
  color: #f1f5f9;
}

/* ============================================================================
   ON-SCREEN KEYBOARD
   ============================================================================ */

.keyboard-toggle-btn {
  background: #334155;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.keyboard-toggle-btn:hover {
  background: #475569;
}

.keyboard-toggle-btn.active {
  background: #3b82f6;
  color: white;
}

.keyboard-toggle-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Virtual Keyboard Container */
.virtual-keyboard {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(248, 249, 250, 0.97);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  z-index: 10000;
  max-width: 98vw;
  user-select: none;
  -webkit-app-region: no-drag;
}

.keyboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 6px;
}

.keyboard-layout-name {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.keyboard-layout-btn {
  background: #e2e8f0;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  -webkit-app-region: no-drag;
}

.keyboard-layout-btn:hover {
  background: #cbd5e1;
}

.keyboard-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #64748b;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  -webkit-app-region: no-drag;
}

.keyboard-close-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.keyboard-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.keyboard-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.kb-key {
  min-width: 48px;
  height: 46px;
  padding: 0 10px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  box-shadow: 0 2px 0 #b8bcc4;
  -webkit-app-region: no-drag;
}

.kb-key:hover {
  background: #f3f4f6;
}

.kb-key:active {
  background: #e5e7eb;
  box-shadow: 0 1px 0 #b8bcc4;
  transform: translateY(1px);
}

.kb-key.active {
  background: #3b82f6;
  color: white;
  border-color: #2563eb;
  box-shadow: 0 2px 0 #1d4ed8;
}

.kb-key.kb-wide-1-5 { min-width: 75px; }
.kb-key.kb-wide-1-75 { min-width: 88px; }
.kb-key.kb-wide-2 { min-width: 98px; }
.kb-key.kb-wide-2-25 { min-width: 110px; }
.kb-key.kb-space { min-width: 320px; }

/* Special key styling */
.kb-key.kb-special {
  background: #e2e8f0;
  font-size: 12px;
}

.kb-key.kb-special:hover {
  background: #cbd5e1;
}

.kb-key.kb-fn {
  font-size: 12px;
  min-width: 44px;
}

.kb-key.kb-delete {
  background: #fee2e2;
  border-color: #fca5a5;
}

.kb-key.kb-delete:hover {
  background: #fecaca;
}

/* Arrow keys */
.kb-key.kb-arrow {
  min-width: 44px;
  font-size: 16px;
}

/* Layout selector dropdown */
.keyboard-layout-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  margin-bottom: 8px;
  z-index: 1001;
  min-width: 150px;
}

.keyboard-layout-option {
  display: block;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  transition: background 0.2s ease;
}

.keyboard-layout-option:hover {
  background: #f1f5f9;
}

.keyboard-layout-option.active {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
}

/* ============================================================================
   Mode Switcher (KVM/Tunnel toggle)
   ============================================================================ */
.app-name-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-switcher {
  position: relative;
}

.mode-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-app-region: no-drag;
}

.mode-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.mode-label {
  font-weight: 500;
}

.mode-arrow {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s;
}

.mode-switcher-btn.open .mode-arrow {
  transform: rotate(180deg);
}

.mode-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px;
  min-width: 140px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.mode-option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.mode-option.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.mode-option .mode-icon {
  font-size: 14px;
}

/* Tunnel mode session screen - will be shown/hidden based on mode */
.kvm-session-content {
  display: block;
}

.kvm-session-content.hidden-mode {
  display: none;
}



/* ============================================================================
   Tunnel Session Content Styles
   ============================================================================ */

.tunnel-session-content {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  flex: 1;
  background: #0f172a;
  overflow-y: auto;
}

.tunnel-session-content.active {
  display: flex;
}

.tunnel-header {
  padding: 16px 20px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tunnel-connected-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tunnel-icon {
  font-size: 28px;
}

.tunnel-info {
  flex: 1;
}

.tunnel-title {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
}

.tunnel-serial {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

.tunnel-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 13px;
  color: #94a3b8;
}

.tunnel-version {
  color: #64748b;
  font-family: monospace;
}

.tunnel-battery,
.tunnel-network {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tunnel-battery-icon,
.tunnel-network-icon {
  font-size: 14px;
}

.tunnel-battery.charging .tunnel-battery-icon {
  color: #4ade80;
}

#tunnelBatteryPercent,
#tunnelNetworkType {
  color: #e2e8f0;
}

.tunnel-feature-nav {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  justify-content: center;
}

.feature-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.feature-nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.feature-nav-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.feature-icon {
  font-size: 14px;
}

.tunnel-feature-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.tunnel-feature-panel {
  display: none;
  max-width: 800px;
  width: 100%;
}

.tunnel-feature-panel.active {
  display: block;
}

.feature-card {
  background: #1e293b;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.feature-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.feature-card-icon {
  font-size: 20px;
}

.feature-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  flex: 1;
}

.feature-card-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.feature-card-status.active {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.feature-card-description {
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 16px;
}

.feature-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.form-input,
.form-select {
  padding: 10px 12px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #3b82f6;
}

.form-select {
  cursor: pointer;
}

.sftp-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sftp-mass-storage-toggle {
  margin-left: auto;
}

.sftp-mass-storage-warning {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 13px;
  margin-top: 12px;
}

.sftp-mass-storage-warning.visible {
  display: flex;
}

.warning-icon {
  font-size: 16px;
}

.active-forwards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.no-forwards-message {
  color: #64748b;
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.port-forward-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0f172a;
  border-radius: 8px;
}

.port-forward-info {
  font-size: 13px;
  color: #e2e8f0;
}

.port-forward-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.port-forward-remove:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* KVM Session Content visibility */
.kvm-session-content {
  display: contents;
}

.kvm-session-content.hidden-mode {
  display: none !important;
}

.kvm-session-content.hidden-mode > * {
  display: none !important;
}


/* ============================================================================
   Tunnel Mode - Hide KVM Toolbar
   ============================================================================ */

/* When in tunnel mode, hide the KVM-specific toolbar */
.tunnel-session-content.active ~ .kvm-session-content .session-toolbar,
.tunnel-session-content.active + .kvm-session-content .session-toolbar {
  display: none !important;
}

/* Alternative: Use body class approach */
body.tunnel-mode .session-toolbar {
  display: none !important;
}

/* ============================================================================
   Additional Tunnel Card Styles
   ============================================================================ */

.tunnel-address {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 12px 0;
}

.tunnel-address code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  color: #60a5fa;
}

.copy-btn-small {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.copy-btn-small:hover {
  opacity: 1;
}

.usb-tunnel-hint,
.serial-tunnel-hint,
.sftp-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 12px;
  line-height: 1.5;
}

.usb-tunnel-hint a,
.serial-tunnel-hint a,
.sftp-hint a {
  color: #60a5fa;
  text-decoration: none;
}

.usb-tunnel-hint a:hover,
.serial-tunnel-hint a:hover,
.sftp-hint a:hover {
  text-decoration: underline;
}

.serial-config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.serial-tunnel-actions,
.usb-tunnel-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.sftp-connection-info {
  background: #0f172a;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}

.sftp-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.sftp-info-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sftp-label {
  font-size: 12px;
  color: #94a3b8;
  width: 80px;
}

.sftp-info-row code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  color: #60a5fa;
}

.presets-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.presets-label {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.presets-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.empty-state {
  text-align: center;
  padding: 24px;
  color: #64748b;
}

.empty-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.empty-hint {
  font-size: 12px;
  color: #475569;
  margin-top: 4px;
}

.toggle-label-text {
  font-size: 13px;
  color: #94a3b8;
  margin-right: 8px;
}

.sftp-mass-storage-toggle {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.sftp-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================================
   Connecting Screen - Mode Selection
   ============================================================================ */

.connecting-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 20px;
}

.connecting-status {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.connecting-status p {
  margin: 12px 0 4px;
  color: #e2e8f0;
}

.connecting-hint {
  font-size: 13px;
  color: #64748b;
}

.mode-selection {
  text-align: center;
  margin: 16px 0 32px;
  padding: 24px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 16px;
  position: relative;
  z-index: 10;
}

.mode-selection h3 {
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 20px;
}

.mode-selection-hint {
  font-size: 13px;
  color: #64748b;
  margin-top: 16px;
}

.mode-options {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.mode-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 32px;
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 180px;
}

.mode-option-btn:hover {
  background: #334155;
  border-color: rgba(59, 130, 246, 0.3);
}

.mode-option-btn.selected {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
}

.mode-option-icon {
  font-size: 32px;
}

.mode-option-label {
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
}

.mode-option-desc {
  font-size: 12px;
  color: #64748b;
  max-width: 150px;
  line-height: 1.4;
}

/* Virtual Network Unavailable State */
.vnet-unavailable {
  color: #f59e0b;
}

/* Virtual Network control buttons */
#startVnBtn,
#stopVnBtn {
  align-self: flex-start;
  width: auto;
}

.vnet-hint {
  font-size: 12px;
  color: #64748b;
  display: block;
  margin-top: 4px;
}

/* Forward Item Styles */
.forward-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #0f172a;
  border-radius: 8px;
  margin-bottom: 8px;
}

.forward-icon {
  font-size: 16px;
}

.forward-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
}

.forward-local {
  color: #60a5fa;
}

.forward-arrow {
  color: #64748b;
}

.forward-remote {
  color: #94a3b8;
}

.forward-remove-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.forward-remove-btn:hover {
  opacity: 1;
}

/* Virtual Network Mappings */
.vnet-mappings {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vnet-add-mapping h4,
.vnet-mappings-section h4 {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 12px;
}

.vnet-mappings-section {
  margin-top: 20px;
}

.vnet-mapping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #0f172a;
  border-radius: 8px;
  margin-bottom: 8px;
}

.mapping-icon {
  font-size: 16px;
}

.mapping-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
}

.mapping-virtual {
  color: #10b981;
}

.mapping-arrow {
  color: #64748b;
}

.mapping-remote {
  color: #94a3b8;
}

.mapping-remove-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.mapping-remove-btn:hover {
  opacity: 1;
}

/* SFTP Modal styles */
.sftp-form .form-group {
  margin-bottom: 16px;
}

.sftp-form .form-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.sftp-modal-hint {
  font-size: 13px;
  color: #94a3b8;
  background: rgba(59, 130, 246, 0.1);
  padding: 10px;
  border-radius: 6px;
  margin-top: 12px;
}

/* Network Config Modal */
.modal-content.modal-large {
  max-width: 900px;
  width: 95%;
}

.netcfg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.netcfg-section {
  background: #0f172a;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #334155;
}

.netcfg-section h4 {
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #334155;
}

.netcfg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: #f1f5f9;
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f1f5f9;
  font-size: 14px;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.modal-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.modal-input:disabled {
  background: #0f172a;
  color: #64748b;
}

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