/* ==========================================================================
   oDesk Design System - Modern Cyber Engineering Dark Aesthetic
   ========================================================================== */

:root {
  /* Surfaces & Backgrounds */
  --bg-canvas: #0b0f19;
  --bg-surface: #131b2e;
  --bg-surface-hover: #19233c;
  --bg-elevated: #1e293b;
  --bg-input: #0f172a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  /* Brand Accents */
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-glow: rgba(99, 102, 241, 0.25);
  --cyan-glow: #06b6d4;

  /* Protocol Distinct Accents */
  --anydesk-red: #ef4444;
  --anydesk-bg: rgba(239, 68, 68, 0.12);
  --anydesk-border: rgba(239, 68, 68, 0.35);
  --anydesk-glow: rgba(239, 68, 68, 0.25);

  --rustdesk-blue: #0ea5e9;
  --rustdesk-bg: rgba(14, 165, 233, 0.12);
  --rustdesk-border: rgba(14, 165, 233, 0.35);
  --rustdesk-glow: rgba(14, 165, 233, 0.25);

  /* Status Colors */
  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.12);
  --status-warning: #f59e0b;
  --status-danger: #f43f5e;
  --status-danger-bg: rgba(244, 63, 94, 0.12);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Typography */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;

  /* Shadows & Glassmorphism */
  --glass-bg: rgba(15, 23, 42, 0.78);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glow */
.ambient-glow {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   Navigation Bar (Glassmorphism)
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--brand-primary), var(--cyan-glow));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 14px var(--brand-glow);
}

.brand-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  user-select: none;
  cursor: default;
}

.user-badge:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

/* ==========================================================================
   Buttons & Controls
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), #4338ca);
  color: white;
  box-shadow: 0 4px 14px var(--brand-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7174f7, var(--brand-primary));
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: var(--status-danger);
  color: white;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.785rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Tooltip for Icon & Nav Buttons */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(-3px);
  background: rgba(15, 23, 42, 0.96);
  color: var(--text-primary);
  font-size: 0.725rem;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1), transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  backdrop-filter: blur(6px);
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent rgba(15, 23, 42, 0.96) transparent;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.btn-delete-ep:hover {
  background: var(--status-danger-bg) !important;
  color: var(--status-danger) !important;
  border-color: rgba(244, 63, 94, 0.4) !important;
}

.btn-edit-ep:hover {
  color: var(--primary) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

/* ==========================================================================
   Login View (Hero Card)
   ========================================================================== */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--anydesk-red), var(--brand-primary), var(--rustdesk-blue));
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

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

.form-row {
  display: flex;
  gap: 1rem;
}

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

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.form-control.mono {
  font-family: var(--font-mono);
}

/* Protocol Selector Segmented Control */
.segmented-control {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.segmented-control label {
  flex: 1;
  text-align: center;
  padding: 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.segmented-control input[type="radio"] {
  display: none;
}

.segmented-control input[type="radio"]:checked + label {
  background: var(--brand-primary);
  color: white;
  box-shadow: 0 2px 8px var(--brand-glow);
}

.checkbox-container {
  transition: var(--transition);
}

.checkbox-container:hover span {
  color: var(--text-primary);
}

/* Alert Notification */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-danger {
  background: var(--status-danger-bg);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fca5a5;
}

.ftp-summary-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.ftp-summary-badge strong {
  color: var(--cyan-glow);
}

/* ==========================================================================
   Dashboard Main View
   ========================================================================== */
.main-container {
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Controls Bar (Search & Filter) */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.6rem 0.85rem 0.6rem 2.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.filter-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* Filter Badges (Pills) - Styled to Match Card Protocol Badges */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  line-height: 1.25;
  box-sizing: border-box;
}

.pill:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

/* 全部協定 (未選中 vs 激活選中) */
.pill:not(.pill-anydesk):not(.pill-rustdesk).active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 2px 10px var(--brand-glow);
}

/* AnyDesk Badge (完全契合卡片 .protocol-badge.anydesk 風格) */
.pill.pill-anydesk {
  background: var(--anydesk-bg);
  color: var(--anydesk-red);
  border: 1px solid var(--anydesk-border);
}

.pill.pill-anydesk:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ff5b5b;
}

.pill.pill-anydesk.active {
  background: var(--anydesk-red);
  color: #ffffff;
  border-color: var(--anydesk-red);
  box-shadow: 0 3px 12px var(--anydesk-glow);
}

/* RustDesk Badge (完全契合卡片 .protocol-badge.rustdesk 風格) */
.pill.pill-rustdesk {
  background: var(--rustdesk-bg);
  color: var(--rustdesk-blue);
  border: 1px solid var(--rustdesk-border);
}

.pill.pill-rustdesk:hover {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(14, 165, 233, 0.6);
  color: #38bdf8;
}

.pill.pill-rustdesk.active {
  background: var(--rustdesk-blue);
  color: #ffffff;
  border-color: var(--rustdesk-blue);
  box-shadow: 0 3px 12px var(--rustdesk-glow);
}

/* View Mode Switcher (Controls Bar) */
.view-mode-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.view-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.view-btn.active {
  background: var(--brand-primary);
  color: white;
  box-shadow: 0 1px 6px var(--brand-glow);
}

.view-btn svg {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .view-btn .view-label {
    display: none;
  }
  .view-btn {
    padding: 0.4rem 0.5rem;
  }
}

/* ==========================================================================
   Directory & Breadcrumb Navigation Bar (Single Sleek Row)
   ========================================================================== */
.directory-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 1.15rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 25;
}

.directory-path-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.directory-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.breadcrumb-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.breadcrumb-chip:hover {
  background: var(--bg-surface-hover);
  color: var(--cyan-glow);
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

.breadcrumb-chip.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--brand-primary);
  color: #c7d2fe;
  font-weight: 600;
}

.breadcrumb-current {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--cyan-glow);
  font-size: 0.825rem;
  font-weight: 600;
}

/* Breadcrumb Dropdown Caret & Menu (Option A) */
.breadcrumb-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.breadcrumb-arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0 1px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.breadcrumb-arrow-btn svg {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.breadcrumb-arrow-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
  color: var(--cyan-glow);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.breadcrumb-arrow-btn.open {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
  box-shadow: 0 0 14px var(--brand-glow);
}

.breadcrumb-arrow-btn.open svg {
  transform: rotate(180deg);
}

.breadcrumb-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 250px;
  max-width: 380px;
  max-height: 350px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  z-index: 150;
  display: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.35rem 0;
}

.breadcrumb-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.breadcrumb-dropdown-menu.show {
  display: block;
  animation: dropDownMenu 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.breadcrumb-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.52rem 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.825rem;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.breadcrumb-dropdown-item:hover {
  background: var(--bg-surface-hover);
  color: white;
}

.breadcrumb-dropdown-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--cyan-glow);
  font-weight: 600;
}

.breadcrumb-dropdown-item .item-main {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-branch-guide {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.6;
  margin-right: 2px;
  user-select: none;
  flex-shrink: 0;
}

.tree-folder-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.breadcrumb-dropdown-item.depth-0 {
  font-weight: 600;
}

.breadcrumb-dropdown-item.depth-1 {
  font-size: 0.81rem;
}

.breadcrumb-dropdown-item.depth-2 {
  font-size: 0.785rem;
}

.breadcrumb-dropdown-item .item-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  flex-shrink: 0;
}

.directory-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.directory-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Card-level breadcrumb tag */
.breadcrumb-node {
  color: var(--cyan-glow);
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  transition: var(--transition);
}

.breadcrumb-node:hover {
  background: rgba(6, 182, 212, 0.15);
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 0.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ==========================================================================
   Endpoint Views (Grid, List, Compact)
   ========================================================================== */
.endpoints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.endpoints-grid.view-card {
  display: grid;
  grid-template-columns: repeat(var(--card-columns, 3), minmax(0, 1fr));
  gap: 1.25rem;
}

/* ==========================================================================
   List View Layout (.endpoints-grid.view-list) - Strict Tabular Column Alignment
   ========================================================================== */
.endpoints-grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.endpoint-list-header {
  display: grid;
  grid-template-columns: 280px 340px 1fr 85px;
  align-items: center;
  gap: 1.25rem;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.15rem;
  user-select: none;
}

.endpoint-list-header .list-th-actions {
  text-align: right;
  padding-right: 0.25rem;
}

.endpoint-list-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  display: grid;
  grid-template-columns: 280px 340px 1fr 85px;
  align-items: center;
  gap: 1.25rem;
  min-height: 56px;
  transition: var(--transition);
  position: relative;
  overflow: visible;
}

.endpoint-list-row:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  transform: translateX(2px);
}

.endpoint-list-row.protocol-anydesk {
  border-left: 3px solid var(--anydesk-red);
}

.endpoint-list-row.protocol-rustdesk {
  border-left: 3px solid var(--rustdesk-blue);
}

.list-col-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.list-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.list-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-col-creds {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  justify-content: center;
}

.list-cred-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  max-width: 100%;
}

.list-cred-item.anydesk-item {
  border-color: rgba(239, 68, 68, 0.3);
}

.list-cred-item.rustdesk-item {
  border-color: rgba(14, 165, 233, 0.3);
}

.list-cred-item.btn-launch-panel {
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.list-cred-item.anydesk-item.btn-launch-panel:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--anydesk-red);
  box-shadow: 0 2px 8px var(--anydesk-glow);
  transform: translateY(-1px);
}

.list-cred-item.rustdesk-item.btn-launch-panel:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--rustdesk-blue);
  box-shadow: 0 2px 8px var(--rustdesk-glow);
  transform: translateY(-1px);
}

.list-launch-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  opacity: 0.65;
  transition: var(--transition);
  flex-shrink: 0;
}

.list-launch-tag.anydesk {
  color: var(--anydesk-red);
}

.list-launch-tag.rustdesk {
  color: var(--rustdesk-blue);
}

.list-cred-item.btn-launch-panel:hover .list-launch-tag {
  opacity: 1;
  transform: scale(1.15);
}

.list-cred-item.anydesk-item.btn-launch-panel:hover .list-launch-tag.anydesk {
  background: var(--anydesk-red);
  color: #ffffff;
}

.list-cred-item.rustdesk-item.btn-launch-panel:hover .list-launch-tag.rustdesk {
  background: var(--rustdesk-blue);
  color: #ffffff;
}

.list-col-note {
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.list-col-note.list-note-empty {
  opacity: 0.35;
  color: var(--text-muted);
}

.list-col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

@media (max-width: 1100px) {
  .endpoint-list-header,
  .endpoint-list-row {
    grid-template-columns: 240px 320px 1fr 85px;
    gap: 0.85rem;
  }
}

@media (max-width: 960px) {
  .endpoint-list-header .list-th-note,
  .endpoint-list-row .list-col-note {
    display: none;
  }
  .endpoint-list-header,
  .endpoint-list-row {
    grid-template-columns: 220px 320px 85px;
    gap: 0.85rem;
  }
}

@media (max-width: 768px) {
  .endpoint-list-header {
    display: none;
  }
  .endpoint-list-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .list-col-actions {
    justify-content: flex-end;
  }
}

/* ==========================================================================
   Compact / Small Icon View Layout (.endpoints-grid.view-compact)
   ========================================================================== */
@property --card-columns {
  syntax: '<integer>';
  inherits: true;
  initial-value: 3;
}

@property --compact-columns {
  syntax: '<integer>';
  inherits: true;
  initial-value: 6;
}

:root {
  --card-columns: 3;
  --compact-columns: 6;
}

.endpoints-grid.view-compact {
  display: grid;
  grid-template-columns: repeat(var(--compact-columns, 6), minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 960px) {
  .endpoints-grid.view-compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .endpoints-grid.view-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 660px) {
  .endpoints-grid.view-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .endpoints-grid.view-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 320px) {
  .endpoints-grid.view-compact {
    grid-template-columns: 1fr;
  }
}

.endpoint-compact-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  position: relative;
  transition: var(--transition);
  cursor: default;
  user-select: none;
  min-height: 125px;
}

.endpoint-compact-tile:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.tile-header-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0 0.15rem;
  font-size: 0.7rem;
  min-height: 18px;
}

.tile-breadcrumb {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-align: left;
  display: flex;
  align-items: center;
}

.tile-breadcrumb .card-breadcrumb {
  margin-top: 0;
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.tile-breadcrumb .breadcrumb-node {
  padding: 0 2px;
  font-size: 0.68rem;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-breadcrumb .breadcrumb-sep {
  margin: 0 2px;
  font-size: 0.65rem;
}

.tile-action-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.endpoint-compact-tile:hover .tile-action-btns {
  opacity: 1;
}

.tile-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 3px;
  color: var(--text-secondary);
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.tile-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.tile-action-btn.btn-delete:hover {
  background: var(--status-danger);
}

.tile-icon-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.2rem 0;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  user-select: none;
}

.endpoint-compact-tile.protocol-anydesk .tile-icon-avatar {
  color: var(--anydesk-red);
  background: var(--anydesk-bg);
  border: 1px solid var(--anydesk-border);
}

.endpoint-compact-tile.protocol-rustdesk .tile-icon-avatar {
  color: var(--rustdesk-blue);
  background: var(--rustdesk-bg);
  border: 1px solid var(--rustdesk-border);
}

.tile-icon-avatar:hover {
  transform: scale(1.15) translateY(-1px);
}

.endpoint-compact-tile.protocol-anydesk .tile-icon-avatar:hover {
  box-shadow: 0 0 10px var(--anydesk-glow);
  filter: brightness(1.2);
}

.endpoint-compact-tile.protocol-rustdesk .tile-icon-avatar:hover {
  box-shadow: 0 0 10px var(--rustdesk-glow);
  filter: brightness(1.2);
}

.tile-name {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.tile-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-launch-row {
  width: 100%;
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  height: 24px;
}

.tile-launch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  height: 100%;
  user-select: none;
  padding: 0;
}

.tile-launch-btn.anydesk {
  background: transparent;
  color: var(--anydesk-red);
  border: 1px solid var(--anydesk-red);
}

.tile-launch-btn.anydesk:hover {
  background: var(--anydesk-red);
  color: #ffffff;
  border-color: var(--anydesk-red);
  box-shadow: 0 2px 8px var(--anydesk-glow);
  transform: translateY(-1px);
}

.tile-launch-btn.rustdesk {
  background: transparent;
  color: var(--rustdesk-blue);
  border: 1px solid var(--rustdesk-blue);
}

.tile-launch-btn.rustdesk:hover {
  background: var(--rustdesk-blue);
  color: #ffffff;
  border-color: var(--rustdesk-blue);
  box-shadow: 0 2px 8px var(--rustdesk-glow);
  transform: translateY(-1px);
}

.tile-launch-placeholder {
  height: 100%;
  visibility: hidden;
}

.endpoint-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.endpoint-card:hover {
  transform: translateY(-2px);
  background: var(--bg-surface-hover);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.endpoint-card.protocol-anydesk:hover {
  border-color: var(--anydesk-border);
  box-shadow: 0 8px 24px var(--anydesk-glow);
}

.endpoint-card.protocol-rustdesk:hover {
  border-color: var(--rustdesk-border);
  box-shadow: 0 8px 24px var(--rustdesk-glow);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-title-group {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-group-badge {
  display: inline-block;
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Protocol Badge */
.protocol-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.725rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  min-width: 26px;
  line-height: 1.2;
  flex-shrink: 0;
}

.protocol-badge.anydesk {
  background: var(--anydesk-bg);
  color: var(--anydesk-red);
  border: 1px solid var(--anydesk-border);
}

.protocol-badge.rustdesk {
  background: var(--rustdesk-bg);
  color: var(--rustdesk-blue);
  border: 1px solid var(--rustdesk-border);
}

/* Card Credential Row */
.card-details {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.detail-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.detail-val-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.copy-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.copy-btn.copied {
  color: var(--status-success);
  animation: pulseScale 0.3s ease;
}

@keyframes pulseScale {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-badge {
  font-size: 0.725rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.card-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Card Protocol Credential Blocks */
.proto-block {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.35rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.proto-block:last-child {
  margin-bottom: 0;
}

.proto-block.anydesk-block {
  border-left: 2px solid rgba(239, 68, 68, 0.25);
}

.proto-block.rustdesk-block {
  border-left: 2px solid rgba(14, 165, 233, 0.25);
}

.proto-block.btn-launch-panel {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.proto-block.btn-launch-panel:hover {
  transform: translateY(-2px);
}

.proto-block.anydesk-block.btn-launch-panel:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 4px 14px var(--anydesk-glow);
}

.proto-block.rustdesk-block.btn-launch-panel:hover {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 4px 14px var(--rustdesk-glow);
}

.proto-block.is-last-active {
  border-left-width: 5px !important;
}

.proto-block.anydesk-block.is-last-active {
  border-left-color: var(--anydesk-red) !important;
  background: rgba(239, 68, 68, 0.05);
}

.proto-block.rustdesk-block.is-last-active {
  border-left-color: var(--rustdesk-blue) !important;
  background: rgba(14, 165, 233, 0.05);
}

.proto-block-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-height: 22px;
}

.proto-header-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow: hidden;
}

.proto-brand-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1.2;
}

.proto-brand-badge.anydesk {
  background: rgba(239, 68, 68, 0.15);
  color: var(--anydesk-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.proto-brand-badge.rustdesk {
  background: rgba(14, 165, 233, 0.15);
  color: var(--rustdesk-blue);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.proto-id-text {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proto-block-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  min-height: 20px;
}

.proto-launch-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
}

.proto-launch-tag.anydesk {
  background: rgba(239, 68, 68, 0.15);
  color: var(--anydesk-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.proto-launch-tag.rustdesk {
  background: rgba(14, 165, 233, 0.15);
  color: var(--rustdesk-blue);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.proto-block.btn-launch-panel:hover .proto-launch-tag.anydesk {
  background: var(--anydesk-red);
  color: #ffffff;
}

.proto-block.btn-launch-panel:hover .proto-launch-tag.rustdesk {
  background: var(--rustdesk-blue);
  color: #ffffff;
}

/* Card Footer Row (Tags + Actions) */
.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-subtle);
  min-height: 30px;
}

.card-tags-area {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.card-action-tip {
  font-size: 0.72rem;
  color: var(--text-muted);
  user-select: none;
  letter-spacing: 0.02em;
}

.card-action-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.split-btn-group {
  flex: 1;
  display: flex;
  position: relative;
}

.split-btn-main {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  font-weight: 600;
  min-width: 0;
}

.split-btn-dropdown-toggle {
  padding: 0 0.55rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  left: auto;
  min-width: 100%;
  width: max-content;
  max-width: 260px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  z-index: 100;
  display: none;
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dropdown-menu.show {
  display: block;
  animation: dropUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-surface-hover);
}

.dropdown-item.active {
  background: rgba(99, 102, 241, 0.15);
  font-weight: 600;
}

.dropdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dropdown-dot.anydesk {
  background: var(--anydesk-red);
  box-shadow: 0 0 6px var(--anydesk-glow);
}

.dropdown-dot.rustdesk {
  background: var(--rustdesk-blue);
  box-shadow: 0 0 6px var(--rustdesk-glow);
}

.btn-launch {
  font-weight: 600;
}

.btn-launch.anydesk {
  background: linear-gradient(135deg, var(--anydesk-red), #b91c1c);
  color: white;
  box-shadow: 0 4px 14px var(--anydesk-glow);
}

.btn-launch.anydesk:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.btn-launch.rustdesk {
  background: linear-gradient(135deg, var(--rustdesk-blue), #0369a1);
  color: white;
  box-shadow: 0 4px 14px var(--rustdesk-glow);
}

.btn-launch.rustdesk:hover {
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
  transform: translateY(-1px);
}

/* Modal Protocol Grid & Compact Card Box */
.modal-proto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 580px) {
  .modal-proto-grid {
    grid-template-columns: 1fr;
  }
}

.modal-proto-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-proto-box.anydesk-box {
  border-top: 3px solid var(--anydesk-red);
}

.modal-proto-box.rustdesk-box {
  border-top: 3px solid var(--rustdesk-blue);
}

/* Modal Compact Layout */
.modal-box.modal-compact {
  max-width: 660px;
}

.modal-compact .modal-body {
  padding: 1.1rem 1.35rem;
  gap: 0.65rem;
}

.modal-compact .modal-header {
  padding: 0.85rem 1.35rem;
}

.modal-compact .modal-footer {
  padding: 0.75rem 1.35rem;
}

.modal-compact .form-group {
  margin-bottom: 0.2rem;
}

.modal-compact .form-label {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.modal-compact .form-control {
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
}


/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.15);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  animation: slideUp 0.25s ease forwards;
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}

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

/* Breadcrumb Path on Card */
.card-breadcrumb {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.breadcrumb-node {
  color: #a5b4fc;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 3px;
  padding: 1px 4px;
}

.breadcrumb-node:hover {
  background: rgba(99, 102, 241, 0.2);
  color: white;
}

.breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.6;
}

/* Export Modal Option Boxes */
.export-option-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: var(--transition);
}

.export-option-box:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
}

.export-option-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

/* ==========================================================================
   Shortcut Import Modal & Preview
   ========================================================================== */
.import-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  transition: var(--transition);
  cursor: pointer;
}

.import-dropzone:hover,
.import-dropzone.dragover {
  border-color: var(--brand-primary);
  background: rgba(99, 102, 241, 0.08);
}

.import-dropzone.compact {
  padding: 0.75rem 1.1rem;
  border-width: 1.5px;
  background: rgba(99, 102, 241, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  text-align: left;
}

.import-dropzone.compact .dropzone-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.import-dropzone.compact .dropzone-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 0 !important;
  flex-shrink: 0;
}

.import-dropzone.compact .dropzone-title {
  font-size: 0.875rem !important;
  margin-bottom: 0.15rem !important;
}

.import-dropzone.compact .dropzone-subtitle {
  font-size: 0.75rem !important;
  margin-bottom: 0 !important;
}

.import-dropzone.compact .dropzone-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.import-summary-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
}

.import-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.import-table-wrapper {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
}

.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.import-table th {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
  white-space: nowrap;
}

.import-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.import-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-status-new {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status-merge {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.badge-status-update {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status-identical {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-proto-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

.badge-proto-mini.anydesk {
  background: var(--anydesk-bg);
  color: var(--anydesk-red);
  border: 1px solid var(--anydesk-border);
}

.badge-proto-mini.rustdesk {
  background: var(--rustdesk-bg);
  color: var(--rustdesk-blue);
  border: 1px solid var(--rustdesk-border);
}

/* ==========================================================================
   16. Local Helper Component Styles
   ========================================================================== */

.btn-helper-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-helper-status:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-helper-status.online {
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
}

.btn-helper-status.online:hover {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.btn-helper-status.offline {
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.helper-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
  transition: var(--transition);
}

.btn-helper-status.online .helper-status-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.helper-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
}

.helper-status-card.online {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}

.helper-status-card.offline {
  background: rgba(244, 63, 94, 0.06);
  border-color: rgba(244, 63, 94, 0.25);
}

.helper-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.helper-status-dot.large {
  width: 12px;
  height: 12px;
}

.helper-status-card.online .helper-status-dot.large {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.helper-status-card.offline .helper-status-dot.large {
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
}

.helper-status-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-primary);
}

.helper-status-card.online .helper-status-title {
  color: #34d399;
}

.helper-status-card.offline .helper-status-title {
  color: #fb7185;
}

.helper-status-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.helper-clients-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.helper-client-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.helper-client-tag {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  min-width: 65px;
  text-align: center;
}

.helper-client-tag.anydesk {
  background: var(--anydesk-bg);
  color: var(--anydesk-red);
  border: 1px solid var(--anydesk-border);
}

.helper-client-tag.rustdesk {
  background: var(--rustdesk-bg);
  color: var(--rustdesk-blue);
  border: 1px solid var(--rustdesk-border);
}

.helper-client-path {
  font-size: 0.775rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.helper-guide-box {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}


