/* ==========================================
   MCP REGISTRY CONTROL CENTER STYLESHEET
   ========================================== */

/* Design Tokens & Variables */
:root {
  --font-sans: 'Gotham', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Corporate Color Palette - Object Systems International */
  --bg-main: #141416;
  --bg-card: rgba(30, 30, 34, 0.65);
  --bg-card-hover: rgba(38, 38, 44, 0.85);
  --border-color: rgba(191, 210, 215, 0.1);
  --border-color-hover: rgba(228, 29, 47, 0.45);
  
  --primary-purple: #6C2E6F;
  --primary-red: #E41D2F;
  --primary-blue: #BFD2D7;
  
  --primary-gradient: linear-gradient(81.2deg, var(--primary-purple) 14.73%, var(--primary-red) 109.33%);
  --primary: var(--primary-purple);
  --primary-hover: var(--primary-red);
  --primary-glow: rgba(108, 46, 111, 0.25);
  
  --text-main: #BFD2D7;
  --text-muted: #8ca3a8;
  --text-light: #ffffff;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --danger: var(--primary-red);
  --danger-glow: rgba(228, 29, 47, 0.2);
  --danger-hover: #b91523;

  --sidebar-w: 260px;
  --header-h: 70px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  /* Shadow & Glow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(108, 46, 111, 0.35);
  --glass-bg: rgba(26, 26, 28, 0.92);
  --glass-blur: blur(16px);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 5% 5%, rgba(108, 46, 111, 0.12) 0px, transparent 45%),
    radial-gradient(at 95% 95%, rgba(228, 29, 47, 0.06) 0px, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-light);
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: #f472b6;
}

/* ==========================================
   LAYOUT: Header
   ========================================== */
.app-header {
  height: var(--header-h);
  background: rgba(10, 13, 22, 0.7);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-container {
  width: 44px;
  height: 44px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(108, 46, 111, 0.4);
  padding: 6px;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.sub-logo {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

/* Connection Status Badge */
.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

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

/* Status States */
.status-checking {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}
.status-checking .status-dot {
  background: var(--text-muted);
  animation: pulse-dot 1.5s infinite;
}

.status-online {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--success);
}
.status-online .status-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-offline {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}
.status-offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

/* ==========================================
   COMPONENTS: Buttons
   ========================================== */
.primary-btn, .secondary-btn, .danger-btn, .icon-btn, .tiny-btn {
  font-family: var(--font-sans);
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.primary-btn {
  background: var(--primary-gradient);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 10px 18px;
  font-size: 0.9rem;
}
.primary-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(228, 29, 47, 0.35);
}
.primary-btn:active {
  transform: translateY(0);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 18px;
  font-size: 0.9rem;
}
.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.2);
}

.danger-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 10px 18px;
  font-size: 0.9rem;
}
.danger-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger-hover);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.2);
  transform: rotate(20deg);
}

.tiny-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}
.tiny-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
}

/* ==========================================
   LAYOUT: Dashboard Container
   ========================================== */
.dashboard-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 60px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Warning Banner Alert */
.alert-banner {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  align-items: flex-start;
  animation: slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.warning-banner {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}
.warning-banner code {
  background: rgba(245, 158, 11, 0.15);
  color: #fef08a;
}
.alert-icon {
  font-size: 1.4rem;
  line-height: 1;
  padding-top: 2px;
}
.alert-content h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.alert-content p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Overview Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  backdrop-filter: var(--glass-blur);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.icon-servers {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
}
.icon-remotes {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}
.icon-packages {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 4px;
}

/* ==========================================
   CONTROLS: Search & Filters
   ========================================== */
.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 300px;
}

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

#search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 16px 12px 46px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

#search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-card-hover);
}

.filter-group {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.filter-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  color: var(--text-light);
}

.filter-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  box-shadow: var(--shadow-sm);
}

/* ==========================================
   LAYOUT: Servers Grid & Cards
   ========================================== */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 230px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: var(--glass-blur);
}

.server-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: background 0.3s ease;
}

.server-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

.server-card.type-remote:hover::before,
.server-card.type-package:hover::before {
  background: linear-gradient(90deg, var(--primary-purple), var(--primary-red));
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.card-title-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subname {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-primary {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-blue {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.card-body {
  margin-bottom: 20px;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.card-conn-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 75%;
}

.card-conn-info i {
  flex-shrink: 0;
}

.card-conn-info span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-action {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.server-card:hover .card-action {
  color: var(--text-light);
}

/* ==========================================
   COMPONENTS: Loading, Error & Empty States
   ========================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  backdrop-filter: var(--glass-blur);
  min-height: 300px;
}

.loader {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.empty-icon, .error-icon {
  font-size: 3.5rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.error-icon {
  color: var(--danger);
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 400px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

/* ==========================================
   LAYOUT: Footer
   ========================================== */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: rgba(10, 13, 22, 0.5);
  padding: 24px 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-container code {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

/* ==========================================
   COMPONENTS: Modals
   ========================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 14, 0.8);
  backdrop-filter: blur(8px);
  z-index: 990;
  animation: fade-in 0.25s ease-out;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  max-height: 90vh;
  width: 90%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.modal-lg {
  max-width: 800px;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

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

.modal-header h3 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-modal-btn:hover {
  color: var(--text-light);
}

.modal-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-light);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(255, 255, 255, 0.01);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* ==========================================
   FORMS & INPUTS
   ========================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
}

.required {
  color: var(--danger);
  margin-left: 2px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.form-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 10px;
  animation: fade-in 0.3s ease-out;
}

.form-section h4 {
  font-size: 0.9rem;
  margin-bottom: 14px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Password Visibility Toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 44px;
}

.visibility-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px;
}
.visibility-btn:hover {
  color: var(--text-light);
}

/* Radio Cards Connection Picker */
.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 4px;
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.radio-label:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.15);
}

.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: all 0.2s;
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
  border-color: var(--primary);
  background: var(--primary);
}

.radio-custom::after {
  content: '';
  position: absolute;
  display: none;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
  display: block;
}

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

.radio-text strong {
  font-size: 0.85rem;
  color: var(--text-light);
}

.radio-text small {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.radio-label input[type="radio"]:checked ~ .radio-text strong {
  color: var(--primary);
}

/* Status Info Box */
.status-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 20px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 6px 0;
}

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

.status-row span {
  color: var(--text-muted);
}

/* ==========================================
   DETAILS VIEW LAYOUT
   ========================================== */
.details-top {
  margin-bottom: 24px;
}

.details-top h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
  word-break: break-all;
}

.details-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.details-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 24px;
  align-items: stretch;
}

.details-info-pane h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.meta-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-val {
  font-size: 0.8rem;
}

.mt-4 {
  margin-top: 24px;
}

.conn-pane-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.85rem;
}

.conn-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conn-field:not(:last-child) {
  margin-bottom: 12px;
}

.conn-field span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.conn-field strong {
  color: var(--text-light);
  word-break: break-all;
  font-family: var(--font-sans);
}

.conn-field code {
  color: #a855f7;
  word-break: break-all;
}

.details-code-pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(5, 7, 14, 0.8);
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.details-code-pane pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  flex: 1;
  max-height: 320px;
}

.code-view {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #38bdf8;
  white-space: pre-wrap;
  word-break: break-all;
  background: transparent !important;
  padding: 0 !important;
}

/* ==========================================
   COMPONENTS: Toast Notifications
   ========================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1100;
  pointer-events: none;
}

.toast {
  background: rgba(22, 28, 45, 0.95);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  transform: translateY(20px);
  opacity: 0;
  backdrop-filter: var(--glass-blur);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

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

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

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

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

.toast i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-content {
  font-size: 0.85rem;
  line-height: 1.4;
  flex: 1;
}

.toast.dismissing {
  transform: translateY(-20px);
  opacity: 0;
}

/* ==========================================
   ANIMATIONS & KEYFRAMES
   ========================================== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slide-down {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-row-inner {
    grid-template-columns: 1fr;
  }
  .radio-group {
    grid-template-columns: 1fr;
  }
  .footer-container {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
