/* ==========================================================================
   VLP Surveillance Management - Modern Design System & Styles
   ========================================================================== */

:root {
  color-scheme: dark;
  --primary: #1e88e5;
  --primary-hover: #1976d2;
  --primary-light: rgba(30, 136, 229, 0.15);
  --primary-border: #2998ff;
  
  --bg-main: #080d14;
  --bg-card: #111c27;
  --bg-card-hover: #172636;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --border-color: #24374b;
  --border-light: #1a2938;
  
  /* Status Colors */
  --status-new: #2998ff;
  --status-commissioning: #f59e0b;
  --status-ready: #10b981;
  --status-installing: #ea580c;
  --status-installed: #059669;
  --status-maintenance: #dc2626;
  --status-awaiting-power: #8b5cf6;
  --status-canceled: #64748b;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.55), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.65), 0 8px 12px -6px rgba(0, 0, 0, 0.5);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-full: 9999px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
  background: #0f172a;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.navbar-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.45rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.navbar-brand i {
  color: #60a5fa;
  font-size: 1.4rem;
}

/* Mobile Navigation Components (Hidden on Desktop by Default) */
.mobile-nav-toggle,
.mobile-nav-backdrop,
.mobile-nav-drawer-header,
.mobile-drawer-user-section {
  display: none;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.navbar-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.navbar-link:hover, .navbar-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-badge .admin-tag {
  background: #8b5cf6;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.btn-logout {
  color: #f87171;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   Layout Containers & Headers
   ========================================================================== */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.page-subtitle {
  font-size: 0.80rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  line-height: 1.25;
}

.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
  background: #fff;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-main);
  border-color: #cbd5e1;
}

.btn-success {
  background: #10b981;
  color: #fff;
}
.btn-success:hover {
  background: #059669;
}

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

.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-purple {
  background: #8b5cf6;
  color: #fff;
}
.btn-purple:hover {
  background: #7c3aed;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================================
   Search & Filter Toolbar
   ========================================================================== */
.toolbar {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

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

.search-box input {
  width: 100%;
  padding: 0.6rem 2.5rem 0.6rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.search-box input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

.search-box .clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  text-decoration: none;
  cursor: pointer;
}

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

.filter-select {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   Status Badges & Chips
   ========================================================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  line-height: 1.2;
}

.status-badge.status-new { background-color: var(--status-new); }
.status-badge.status-commissioning { background-color: var(--status-commissioning); }
.status-badge.status-ready-to-install { background-color: var(--status-ready); }
.status-badge.status-installing { background-color: var(--status-installing); }
.status-badge.status-installed { background-color: var(--status-installed); }
.status-badge.status-on-maintenance { background-color: var(--status-maintenance); }
.status-badge.status-awaiting-power { background-color: var(--status-awaiting-power); }
.status-badge.status-canceled { background-color: var(--status-canceled); }

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #f1f5f9;
  color: #475569;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.725rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Interactive Data Chips */
.data-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.data-chip:hover {
  background: #dbeafe;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.data-chip i {
  font-size: 0.75rem;
}

/* ==========================================================================
   Sites Grid & Cards
   ========================================================================== */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.25rem;
}

/* Generic Card Component */
.card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.site-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.site-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.site-title-area {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.site-checkbox {
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
  accent-color: var(--primary);
}

.site-name-btn {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s;
}

.site-name-btn:hover {
  color: var(--primary);
}

.site-menu-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-menu-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.85rem;
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.site-menu-btn:hover,
.site-menu-btn.is-active {
  color: #ffffff !important;
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25) !important;
  transform: translateY(-1px);
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.22), 0 4px 10px -2px rgba(15, 23, 42, 0.12);
  min-width: 195px;
  max-width: 290px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  z-index: 999999 !important;
  padding: 0.4rem 0;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.52rem 1rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: #1e293b;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.dropdown-item i {
  width: 18px;
  text-align: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dropdown-item.danger {
  color: #ef4444;
}
.dropdown-item.danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

/* Site Details Metadata */
.site-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.site-address-line {
  font-size: 0.825rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

/* Hardware summary pills */
.hardware-strip {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.75rem;
  font-size: 0.775rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hw-label {
  color: var(--text-muted);
  font-weight: 500;
}

.hw-val {
  font-family: monospace;
  font-weight: 600;
  color: #1e293b;
}

/* Notes callout inside card */
.card-notes {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
  color: #78350f;
  margin-bottom: 0.75rem;
  max-height: 85px;
  overflow-y: auto;
}

.card-notes .note-line {
  margin-bottom: 0.25rem;
}

.card-notes .note-line:last-child {
  margin-bottom: 0;
}

.site-card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
}

.card-action-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Badges for counts */
.count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.count-badge:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

/* Bulk Selection Sticky Floating Bar */
.bulk-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
  display: none;
  align-items: center;
  gap: 1rem;
  z-index: 900;
  font-size: 0.875rem;
}

.bulk-bar.show {
  display: flex;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
/* ==========================================================================
   Section-Themed Form Cards (Dark Navy Command Center with Distinct Section Tints)
   ========================================================================== */
.form-card {
  background: #111c27;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.form-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.form-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.form-section-title i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 0.75rem;
  flex-shrink: 0;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.18);
}

/* Dark Navy inputs inside section cards */
.form-card .form-control {
  background: #0b141e;
  border: 1px solid #293e54;
  color: #f1f5f9;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.form-card .form-control:focus {
  background: #0d1824;
  border-color: #2998ff;
  box-shadow: 0 0 0 2px rgba(41, 152, 255, 0.22);
}

/* 1. General Information & Status (Deep Navy Azure) */
.form-card.form-card-general,
#siteForm > .form-card:nth-of-type(1) {
  background: #101f33;
  border: 1px solid #1e3a5f;
  border-left: 4px solid #3b82f6;
}
.form-card.form-card-general .form-section-title,
#siteForm > .form-card:nth-of-type(1) .form-section-title {
  color: #93c5fd;
  border-bottom-color: rgba(59, 130, 246, 0.2);
}
.form-card.form-card-general .form-section-title i,
#siteForm > .form-card:nth-of-type(1) .form-section-title i {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.2);
}

/* 2. Location & GPS Coordinates (Deep Teal / Seafoam) */
.form-card.form-card-location,
#siteForm > .form-card:nth-of-type(2) {
  background: #0d2226;
  border: 1px solid #164e56;
  border-left: 4px solid #14b8a6;
}
.form-card.form-card-location .form-section-title,
#siteForm > .form-card:nth-of-type(2) .form-section-title {
  color: #5eead4;
  border-bottom-color: rgba(20, 184, 166, 0.2);
}
.form-card.form-card-location .form-section-title i,
#siteForm > .form-card:nth-of-type(2) .form-section-title i {
  color: #2dd4bf;
  background: rgba(20, 184, 166, 0.2);
}

/* 3. Modem & VLP Processing Unit (Deep Indigo / Violet) */
.form-card.form-card-hardware,
#siteForm > .form-card:nth-of-type(3) {
  background: #161830;
  border: 1px solid #2d3263;
  border-left: 4px solid #6366f1;
}
.form-card.form-card-hardware .form-section-title,
#siteForm > .form-card:nth-of-type(3) .form-section-title {
  color: #a5b4fc;
  border-bottom-color: rgba(99, 102, 241, 0.2);
}
.form-card.form-card-hardware .form-section-title i,
#siteForm > .form-card:nth-of-type(3) .form-section-title i {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.2);
}

/* 4. Site Access Credentials (Deep Amber / Bronze) */
.form-card.form-card-credentials,
#siteForm > .form-card:nth-of-type(4) {
  background: #211a10;
  border: 1px solid #4d3816;
  border-left: 4px solid #f59e0b;
}
.form-card.form-card-credentials .form-section-title,
#siteForm > .form-card:nth-of-type(4) .form-section-title {
  color: #fcd34d;
  border-bottom-color: rgba(245, 158, 11, 0.2);
}
.form-card.form-card-credentials .form-section-title i,
#siteForm > .form-card:nth-of-type(4) .form-section-title i {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.2);
}

/* 5. Attached Hardware & Connected Devices (Deep Emerald) */
.form-card.form-card-devices,
#siteForm > .form-card:nth-of-type(5) {
  background: #0e211a;
  border: 1px solid #194734;
  border-left: 4px solid #10b981;
}
.form-card.form-card-devices .form-section-title,
#siteForm > .form-card:nth-of-type(5) .form-section-title {
  color: #6ee7b7;
  border-bottom-color: rgba(16, 185, 129, 0.2);
}
.form-card.form-card-devices .form-section-title i,
#siteForm > .form-card:nth-of-type(5) .form-section-title i {
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
}

/* 6. Legacy Camera Channels (Deep Steel Slate) */
.form-card.form-card-cameras,
#siteForm > .form-card:nth-of-type(6) {
  background: #121b26;
  border: 1px solid #25374c;
  border-left: 4px solid #64748b;
}
.form-card.form-card-cameras .form-section-title,
#siteForm > .form-card:nth-of-type(6) .form-section-title {
  color: #cbd5e1;
  border-bottom-color: rgba(148, 163, 184, 0.18);
}
.form-card.form-card-cameras .form-section-title i,
#siteForm > .form-card:nth-of-type(6) .form-section-title i {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.18);
}
.form-card.form-card-cameras .camera-card,
#siteForm > .form-card:nth-of-type(6) .camera-card {
  background: #0d1620;
  border: 1px solid #24374b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.55rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.form-group label {
  font-size: 0.775rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0;
}

.form-control {
  width: 100%;
  padding: 0.25rem 0.55rem;
  height: 30px;
  border: 1px solid #293e54;
  border-radius: 5px;
  font-size: 0.8125rem;
  color: #f1f5f9;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
  background: #0b141e;
  box-sizing: border-box;
}

.form-control::placeholder {
  color: #47586b;
  font-weight: 400;
  font-style: italic;
  font-size: 0.75rem;
  opacity: 1;
}

.form-control:focus::placeholder {
  color: #334354;
}

select.form-control {
  height: 30px;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

.form-control:focus {
  border-color: #2998ff;
  box-shadow: 0 0 0 2px rgba(41, 152, 255, 0.22);
}

textarea.form-control {
  min-height: 55px;
  height: auto;
  resize: vertical;
}

/* Camera channel group card */
.camera-card {
  background: #0d1620;
  border: 1px solid #24374b;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
}

.camera-card-title {
  font-size: 0.80rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.show {
  display: flex;
}

.modal-window {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

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

.modal-body {
  padding: 1.5rem;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
}

/* Leaflet Map in Modal */
#modalMapContainer {
  height: 420px;
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

/* Map route callout */
.route-distance-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Flash alerts */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Auto-save notification pill */
.autosave-indicator {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #1e293b;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.autosave-indicator.active {
  display: flex;
}

/* Live Duplicate Detection & Real-time Field Auto-save UI */
.field-feedback-container {
  margin-top: 0.35rem;
}

.field-duplicate-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.4;
  animation: fadeIn 0.2s ease-in-out;
}

.field-duplicate-alert i {
  color: #dc2626;
  font-size: 1rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.field-duplicate-alert a {
  color: #7f1d1d;
  font-weight: 700;
  text-decoration: underline;
}

.field-valid-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #16a34a;
  font-size: 0.775rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.form-control.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fffaf0 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-control.is-valid {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15) !important;
}

.autosave-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  transition: all 0.25s ease;
}

.autosave-pill.saving {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.autosave-pill.saved {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.autosave-pill.error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.autosave-pill.warning {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fef08a;
}

.autosave-badge-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

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

/* Responsive tweaks */
@media (max-width: 768px) {
  .site-grid {
    grid-template-columns: 1fr;
  }
  .navbar-container {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.65rem 1rem !important;
  }
}

/* ==========================================================================
   Professional Zebra Sites Table with Interactive Sub-Row Toolbar
   ========================================================================== */

.sites-table-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  overflow-x: auto;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.sites-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  color: #1e293b;
  text-align: left;
}

.sites-table thead th {
  background: #0f172a;
  color: #f8fafc;
  padding: 0.42rem 0.5rem;
  font-weight: 700;
  font-size: 0.685rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-bottom: 2px solid #334155;
  user-select: none;
}

.sites-table thead th.text-center {
  text-align: center;
}

/* Zebra Striping per site tbody */
.site-row-group:nth-child(odd) .site-main-row td {
  background-color: #ffffff;
}

.site-row-group:nth-child(even) .site-main-row td {
  background-color: #f1f5f9;
}

/* Normal Row Hover State (Noticeable subtle hover tint) */
.site-row-group:not(.is-expanded):hover .site-main-row td {
  background-color: #e2e8f0 !important;
}

/* Unified 4px Blue Accent Stripe on left edge on subtle hover */
.site-row-group:not(.is-expanded):hover .site-main-row td:first-child {
  box-shadow: inset 4px 0 0 #2563eb;
}

/* Site Name enhanced depth and clarity on hover */
.site-row-group:hover .site-name-text {
  color: #2563eb;
}

/* Quick Menu Button subtle lift on hover */
.site-row-group:hover .site-menu-btn {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

/* ==========================================================================
   Sticky Actions Column - Ensures 3-Dots Menu is ALWAYS Visible on Page 1 & All Pages
   ========================================================================== */
.sites-table thead th.site-actions-col {
  position: sticky;
  right: 0;
  z-index: 25;
  background-color: #0f172a !important;
  box-shadow: -3px 0 6px -2px rgba(0, 0, 0, 0.25);
}

.sites-table .site-main-row td.site-actions-col {
  position: sticky;
  right: 0;
  z-index: 15;
  box-shadow: -3px 0 6px -2px rgba(0, 0, 0, 0.08);
}

.site-row-group:nth-child(odd) .site-main-row td.site-actions-col {
  background-color: #ffffff;
}

.site-row-group:nth-child(even) .site-main-row td.site-actions-col {
  background-color: #f1f5f9;
}

.site-row-group:not(.is-expanded):hover .site-main-row td.site-actions-col {
  background-color: #e2e8f0 !important;
}

.site-main-row {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

/* Bold, darker line that cleanly separates each row in the list */
.site-main-row td {
  padding: 0.38rem 0.55rem;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 2px solid #64748b !important; /* Bold Slate-500 horizontal separator */
}

/* Monospace formatting for technical values */
.mono-val {
  font-family: 'JetBrains Mono', monospace, Consolas, sans-serif;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
}

/* Click-to-Copy Interactive Cell */
.copyable-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.2;
}

.copyable-cell:hover {
  background-color: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.copyable-cell:hover .copy-hint {
  opacity: 1;
}

.copy-hint {
  font-size: 0.7rem;
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Specific cell styles */
.site-main-col {
  width: 74%;
  min-width: 480px;
  padding: 0.38rem 0.6rem !important;
}

.site-primary-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem; /* Generous, clean spacing between frameless data items */
  line-height: 1.3;
}

/* Full site name (Never truncated or cut with dots) */
.site-name-text {
  font-size: 0.90rem;
  font-weight: 700;
  color: #0f172a;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  word-break: break-word;
  transition: color 0.15s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.site-name-text:hover {
  color: #2563eb;
  text-decoration: underline;
}

.btn-site-ext-link {
  color: #64748b;
  padding: 0.12rem 0.28rem;
  border-radius: 4px;
  font-size: 0.72rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.btn-site-ext-link:hover {
  color: #2563eb;
  background: #e0e7ff;
}

/* ==========================================================================
   Clean Frameless Inline Data (NO frames, NO boxes, NO pills around each item)
   ========================================================================== */
.inline-data-text {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0 0.15rem !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  line-height: 1.25;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.inline-data-text:hover {
  text-decoration: underline;
}

.inline-data-text .copy-hint {
  font-size: 0.60rem;
  opacity: 0;
  transition: opacity 0.15s ease;
  margin-left: 0.15rem;
  color: #3b82f6;
}

.inline-data-text:hover .copy-hint {
  opacity: 1;
}

/* 1. Devices: Clean icon + bold number (NO frame) */
.text-devices {
  color: #4338ca;
}
.text-devices i {
  color: #6366f1;
  font-size: 0.74rem;
}
.text-devices:hover {
  color: #312e81;
}

/* 2. Status: Clean text + colored dot (NO frame) */
.text-status {
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.text-status .status-dot {
  font-size: 0.42rem;
}
.text-status.status-new {
  color: #2563eb;
}
.text-status.status-awaiting-power {
  color: #7c3aed;
}

/* 3. Site Type: Clean icon + text (NO frame) */
.text-type {
  color: #334155;
}
.text-type i {
  color: #64748b;
  font-size: 0.70rem;
}
.text-type:hover {
  color: #0f172a;
}

/* 4. Modem IP: Clean icon + blue monospace IP (NO frame) */
.text-ip {
  color: #1d4ed8;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.78rem;
}
.text-ip i {
  color: #3b82f6;
  font-size: 0.70rem;
}
.text-ip:hover {
  color: #1e3a8a;
}

/* 5. Coordinates: LAT / LON (NO frame) */
.text-coord {
  color: #334155;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
}
.text-coord .coord-prefix {
  font-size: 0.64rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.04em;
}
.text-coord:hover {
  color: #0f172a;
}

.text-empty {
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: default;
}

/* Secondary Meta Row */
.site-secondary-row {
  font-size: 0.70rem;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.2;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.right-click-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #2563eb;
  font-weight: 700;
  font-size: 0.675rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.right-click-indicator:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

.ip-badge {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 600;
}

.coord-badge {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.map-location-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 0.14rem 0.48rem;
  border-radius: var(--radius-sm);
  font-size: 0.725rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.map-location-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.hq-distance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.14rem 0.48rem;
  border-radius: var(--radius-full);
  font-size: 0.70rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hq-distance-badge:hover {
  background: #fde68a;
  border-color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* ==========================================================================
   Expanded Details Section (Reveals on Right-Click)
   Dramatic Visual Separation, Framed Elevation & Distinct High-Contrast Styling
   ========================================================================== */
.site-sub-row {
  display: none;
}

.site-row-group.is-expanded .site-sub-row {
  display: table-row;
}

/* Elevate the active row group above adjacent rows */
.site-row-group.is-expanded {
  position: relative;
  z-index: 30;
}

/* Main Row when expanded: High-contrast rich sky-blue background with thick dark blue boundary */
.site-row-group.is-expanded .site-main-row td {
  background-color: #dbeafe !important;
  border-top: 3px solid #1e40af !important;
  border-bottom: 2px dashed #3b82f6 !important;
  color: #0f172a !important;
}

.site-row-group.is-expanded .site-main-row td.site-actions-col {
  background-color: #dbeafe !important;
}

.site-row-group.is-expanded .site-main-row td:first-child {
  border-left: 6px solid #1e40af !important;
  border-top-left-radius: 8px;
}

.site-row-group.is-expanded .site-main-row td:last-child {
  border-right: 3px solid #1e40af !important;
  border-top-right-radius: 8px;
}

/* Sub-row when expanded: High-contrast distinct background with heavy framing border */
.site-row-group.is-expanded .site-sub-row td {
  background-color: #eff6ff !important;
  border-left: 6px solid #1e40af !important;
  border-right: 3px solid #1e40af !important;
  border-bottom: 4px solid #1e40af !important;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  padding: 0;
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.28), 0 8px 16px -4px rgba(30, 64, 175, 0.2);
}

/* Prominent Top Banner in Expanded Details */
.sub-expanded-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  color: #ffffff;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  margin-bottom: 0.65rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  width: 100%;
  box-sizing: border-box;
}

.sub-banner-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.sub-banner-badge {
  background: #2563eb;
  color: #ffffff;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.sub-banner-sitename {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.01em;
}

.sub-banner-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  color: #93c5fd;
}

.btn-sub-collapse {
  background: #334155;
  border: 1px solid #475569;
  color: #f8fafc;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
}

.btn-sub-collapse:hover {
  background: #ef4444;
  border-color: #dc2626;
  color: #ffffff;
}

/* Interior drawer layout */
.sub-row-content {
  padding: 0.75rem 1rem 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem 0.85rem;
  flex-wrap: wrap;
  background: #eff6ff;
}

/* Individual Tool Cards inside Drawer (White card on sky-blue background) */
.sub-tool-section {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sub-tool-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

/* Port Checker Widget */
.port-check-form {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #ffffff;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
}

.port-input {
  width: 56px;
  padding: 0.12rem 0.25rem;
  height: 23px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
}

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

.port-quick-pill {
  padding: 0.1rem 0.3rem;
  font-size: 0.68rem;
  height: 21px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  cursor: pointer;
  color: #475569;
  transition: all 0.1s ease;
}

.port-quick-pill:hover, .port-quick-pill.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.btn-test-port {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  height: 22px;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-test-port:hover {
  background: #059669;
}

.btn-test-port:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Port Result Status Badges */
.port-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.port-status-badge.testing {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.port-status-badge.online {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.port-status-badge.offline {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.port-open-link {
  color: #166534;
  text-decoration: underline;
  margin-left: 0.25rem;
  font-weight: 800;
}

/* Sub-Row Hardware Chips */
.sub-chips-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.sub-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.25;
}

.sub-chip:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}

.sub-chip strong {
  color: #0f172a;
}

.site-row-group.is-expanded .sub-chip {
  border-color: #93c5fd;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}

.site-row-group.is-expanded .port-check-form {
  border-color: #93c5fd;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

.sub-shortcuts-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.sub-shortcut-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.25;
}

.sub-shortcut-btn:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* ==========================================================================
   Clickable HQ Distance Badge & Pagination Bar
   ========================================================================== */

.hq-distance-badge.clickable {
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.hq-distance-badge.clickable:hover {
  background: #fde68a;
  border-color: #f59e0b;
  color: #78350f;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(245, 158, 11, 0.25);
}

/* Modern Pagination Bar */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.85rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.pagination-info {
  font-size: 0.785rem;
  color: #64748b;
}

.pagination-info strong {
  color: #0f172a;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.per-page-select {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.785rem;
  color: #64748b;
}

.per-page-select select {
  padding: 0.2rem 0.45rem;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  outline: none;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 0.4rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
  user-select: none;
}

.page-btn:hover:not(.disabled):not(.active) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.page-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 700;
}

.page-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f8fafc;
  pointer-events: none;
}

/* ==========================================================================
   Admin Configuration & Settings Hub
   ========================================================================== */
.admin-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 992px) {
  .admin-settings-grid {
    grid-template-columns: 1fr;
  }
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.admin-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hq-preview-map {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

.callout-tip {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  line-height: 1.45;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  margin-top: 1rem;
}

/* ==========================================================================
   Enterprise Command Toolbar & Joined Segmented Sort Deck
   ========================================================================== */
.enterprise-command-bar {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.command-row-primary {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.search-box-serious {
  position: relative;
  flex: 2;
  min-width: 270px;
}

.search-box-serious input {
  width: 100%;
  height: 32px;
  padding: 0.3rem 2rem 0.3rem 2.2rem;
  font-size: 0.8125rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  transition: all 0.15s ease;
  outline: none;
  box-sizing: border-box;
}

.search-box-serious input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.search-icon-serious {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.8rem;
  pointer-events: none;
}

.search-clear-serious {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.search-clear-serious:hover {
  color: #ef4444;
}

.primary-filters {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.select-serious {
  height: 32px;
  padding: 0 1.8rem 0 0.65rem;
  font-size: 0.785rem;
  font-family: inherit;
  font-weight: 500;
  color: #1e293b;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.4rem center;
  background-repeat: no-repeat;
  background-size: 1em 1em;
  box-sizing: border-box;
}

.select-serious:hover {
  border-color: #94a3b8;
  background-color: #ffffff;
}

.select-serious:focus {
  border-color: #2563eb;
  background-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.command-row-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid #f1f5f9;
  width: 100%;
  flex-wrap: wrap;
}

.segmented-sort-deck {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.deck-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  user-select: none;
}

.segmented-track {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px;
  gap: 1px;
}

.segment-btn {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  border: 0 !important;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.725rem;
  font-weight: 600;
  color: #475569;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.12s ease;
  white-space: nowrap;
  line-height: 1.25;
  text-decoration: none;
  box-sizing: border-box;
}

.segment-btn i {
  font-size: 0.70rem;
  color: #64748b;
  transition: color 0.12s ease;
}

.segment-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.segment-btn:hover i {
  color: #0f172a;
}

.segment-btn.active {
  background: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.segment-btn.active i {
  color: #60a5fa !important;
}

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

.filter-chip-select {
  height: 26px;
  padding: 0 1.5rem 0 0.5rem;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 500;
  color: #334155;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  max-width: 155px;
  text-overflow: ellipsis;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.4rem center;
  background-repeat: no-repeat;
  background-size: 1em 1em;
  box-sizing: border-box;
}

.filter-chip-select:hover {
  border-color: #94a3b8;
}

.filter-chip-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.filter-chip-select.has-value {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  font-weight: 600;
}

.btn-reset-deck {
  height: 30px;
  padding: 0 0.65rem;
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.12s ease;
  box-sizing: border-box;
}

.btn-reset-deck:hover {
  background: #fee2e2;
  color: #7f1d1d;
  border-color: #fca5a5;
}

/* ==========================================================================
   Responsive Mobile Architecture (Embedded & Adaptive)
   Desktop layout is 100% preserved; mobile activates strictly on < 992px / < 768px
   ========================================================================== */

/* Mobile elements hidden by default on desktop */
.mobile-nav-toggle {
  display: none;
}
.mobile-nav-backdrop {
  display: none;
}
.mobile-nav-drawer-header {
  display: none;
}
.mobile-drawer-user-section {
  display: none;
}

/* Site View Responsive Layout Container */
.site-view-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* --------------------------------------------------------------------------
   Tablet & Mobile Navigation Drawer (Max Width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .site-view-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .mobile-nav-backdrop.show {
    display: block !important;
    opacity: 1 !important;
  }

  .navbar-container {
    justify-content: space-between;
  }

  .navbar-user {
    display: none; /* Relocated to mobile drawer bottom */
  }

  .navbar-menu {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    background: #0f172a;
    border-left: 1px solid #334155;
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1rem;
    z-index: 1060;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
    gap: 0.35rem;
  }
  .navbar-menu.mobile-open {
    transform: translateX(0) !important;
    display: flex !important;
  }

  .mobile-nav-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.85rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-drawer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
  }

  .mobile-nav-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
  }
  .mobile-nav-close:hover {
    color: #ffffff;
  }

  .navbar-link {
    padding: 0.7rem 0.9rem;
    font-size: 0.925rem;
    border-radius: 6px;
    min-height: 44px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }
  .navbar-link:hover, .navbar-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  .mobile-drawer-user-section {
    display: block;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-drawer-user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.25rem;
  }
  .mobile-drawer-user-info i {
    font-size: 1.75rem;
    color: #60a5fa;
  }
}

/* --------------------------------------------------------------------------
   Handheld Phones & Field Techs (Max Width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
    width: 100%;
    max-width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .page-header .btn-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
  }

  .page-title {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .btn {
    min-height: 42px;
    font-size: 0.875rem;
  }

  /* Command Toolbar Phone Optimization */
  .enterprise-command-bar {
    padding: 0.75rem;
    gap: 0.65rem;
    border-radius: 8px;
    margin-bottom: 1rem;
  }

  .command-row-primary {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .search-box-serious {
    min-width: 0;
    width: 100%;
  }

  .search-box-serious input {
    height: 42px;
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
  }

  .primary-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 0.5rem;
  }

  .select-serious {
    width: 100%;
    height: 40px;
    font-size: 14px;
  }

  .command-row-secondary {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding-top: 0.5rem;
  }

  .segmented-sort-deck {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  /* Horizontal swipeable track on phones */
  .segmented-track {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 3px;
  }
  .segmented-track::-webkit-scrollbar {
    display: none;
  }

  .segment-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    min-height: 38px;
  }

  .filter-chips-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .filter-chip-select {
    width: 100%;
    max-width: 100%;
    height: 38px;
    font-size: 0.825rem;
  }

  .btn-reset-deck {
    grid-column: span 2;
    width: 100%;
    justify-content: center;
    height: 38px;
    font-size: 0.8rem;
  }

  /* Sites Table Touch Scrolling & Thumb Targets */
  .sites-table-wrapper {
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #cbd5e1;
    margin-top: 0.5rem;
  }

  .sites-table th, 
  .sites-table td {
    padding: 0.75rem 0.65rem;
  }

  .site-menu-btn {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  /* Forms & Card Layouts */
  .form-card {
    padding: 1.15rem;
    margin-bottom: 1.15rem;
    border-radius: 8px;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
  }

  .form-control {
    font-size: 16px; /* Prevents iOS auto-zoom */
    min-height: 42px;
    padding: 0.65rem 0.85rem;
  }

  /* Sticky Bulk Actions Bar on Mobile */
  .bulk-bar {
    width: calc(100% - 1.5rem);
    left: 0.75rem;
    right: 0.75rem;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    gap: 0.5rem;
    bottom: 0.75rem;
  }

  /* Modals */
  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-window {
    width: 100%;
    max-width: 100%;
    max-height: 94vh;
    margin: 0;
    border-radius: 8px;
  }
}

/* --------------------------------------------------------------------------
   Desktop vs Mobile Table / Card Segregation
   -------------------------------------------------------------------------- */
.desktop-only-table {
  display: block;
}
.mobile-sites-deck {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only-table {
    display: none !important;
  }
  .mobile-sites-deck {
    display: flex !important;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0.75rem;
    width: 100%;
  }

  .navbar-container {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.65rem 1rem !important;
    width: 100% !important;
  }
  .navbar-brand {
    font-size: 1.1rem !important;
    white-space: nowrap !important;
  }
  .mobile-nav-toggle {
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }

  /* Mobile Site Card (5-Row Diagram Layout with Zebra Alternating Colors) */
  .vlp-mobile-card {
    border-radius: 12px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  /* Card Zebra Striping (Odd Cards: Clean White with Royal Blue Indicator) */
  .mobile-sites-deck .vlp-mobile-card:nth-child(odd) {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-left: 5px solid #2563eb !important;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.05);
  }

  /* Card Zebra Striping (Even Cards: Slate Tint with Dark Slate Indicator) */
  .mobile-sites-deck .vlp-mobile-card:nth-child(even) {
    background-color: #eef2f6 !important;
    border: 1px solid #cbd5e1 !important;
    border-left: 5px solid #475569 !important;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.05);
  }

  /* Keep inner chips & buttons on even cards crisp with white background */
  .mobile-sites-deck .vlp-mobile-card:nth-child(even) .port-chip,
  .mobile-sites-deck .vlp-mobile-card:nth-child(even) .btn-site-menu,
  .mobile-sites-deck .vlp-mobile-card:nth-child(even) .coord-chip,
  .mobile-sites-deck .vlp-mobile-card:nth-child(even) .btn-bottom-tab {
    background-color: #ffffff;
    border-color: #cbd5e1;
  }

  .mobile-sites-deck .vlp-mobile-card:nth-child(even) .card-row-meta {
    border-bottom: 1px dashed #cbd5e1;
  }

  .mobile-sites-deck .vlp-mobile-card:nth-child(even) .card-row-bottom-actions {
    border-top: 1px solid #cbd5e1 !important;
  }

  /* Row 1: Site Name + Menu */
  .card-row-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .site-title-area {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
  }
  .site-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    text-decoration: none;
    word-break: break-word;
    overflow-wrap: break-word;
    display: block;
  }
  .site-title:hover {
    color: #2563eb;
  }
  .site-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
  }
  .sub-owner {
    color: #1d4ed8;
    font-weight: 600;
  }
  .sub-jur {
    color: #059669;
    font-weight: 600;
  }
  .btn-site-menu {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #475569;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }
  .btn-site-menu:active {
    background: #e2e8f0;
    color: #0f172a;
  }

  /* Row 2: Status | Type | IP (Single Row) */
  .card-row-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: 0.55rem;
    border-bottom: 1px dashed #e2e8f0;
  }
  .badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .status-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
  }
  .status-offline {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
  }
  .status-maintenance {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
  }
  .badge-type {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .chip-ip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
  }
  .chip-ip:active {
    background: #dbeafe;
  }

  /* Row 3: PORT [80] [9191] [18443]  [TEST] (Single Row, No Grey Border) */
  .card-row-ports.port-check-form {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    width: 100% !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    flex-wrap: wrap !important;
  }
  .card-row-ports .port-status-badge {
    width: 100% !important;
    flex-basis: 100% !important;
    margin-top: 0.35rem !important;
  }
  .port-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    margin-right: 0.1rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
  }
  .port-chips-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
  }
  .port-chips-wrapper::-webkit-scrollbar {
    display: none;
  }
  .port-chip {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.25rem 0.45rem;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    min-width: 38px;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
  }
  .port-chip.selected {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
  }
  .port-chip:active {
    transform: scale(0.96);
  }
  .btn-test {
    background: #0284c7;
    color: #ffffff;
    border: 1px solid #0284c7;
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
    transition: all 0.2s ease;
  }
  .btn-test:active {
    background: #0369a1;
  }
  .btn-test.is-probing, .btn-test-port.is-probing {
    background: #f59e0b !important;
    border-color: #d97706 !important;
    color: #ffffff !important;
    cursor: wait !important;
  }
  .btn-test.is-online, .btn-test-port.is-online {
    background: #10b981 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
  }
  .btn-test.is-offline, .btn-test-port.is-offline {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
  }

  /* Row 4: LAT | LON | [MAP] | [DISTANCE] */
  .card-row-location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    width: 100%;
  }
  .coord-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.22rem 0.45rem;
    font-size: 0.725rem;
    font-family: 'JetBrains Mono', monospace;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    cursor: pointer;
  }
  .coord-chip span.coord-lbl {
    color: #94a3b8;
    font-size: 0.675rem;
    font-weight: 700;
  }
  .btn-action-outline {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    font-size: 0.725rem;
    font-weight: 700;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
  }
  .btn-action-outline:active {
    background: #f1f5f9;
  }
  .btn-action-outline.btn-map {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fff5f5;
  }
  .btn-action-outline.btn-dist {
    color: #059669;
    border-color: #a7f3d0;
    background: #f0fdf4;
  }

  /* Row 5: [NOTES] [FILES] [FOTOS] (Grid 1fr 1fr 1fr - No Clipping!) */
  .card-row-bottom-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 0.4rem !important;
    width: 100% !important;
    padding-top: 0.5rem !important;
    border-top: 1px solid #f1f5f9 !important;
  }
  .btn-bottom-tab {
    width: 100% !important;
    min-width: 0 !important;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.45rem 0.2rem !important;
    font-size: 0.725rem !important;
    font-weight: 700;
    color: #334155;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap !important;
  }
  .btn-bottom-tab:active {
    background: #e2e8f0;
    color: #0f172a;
  }
  .btn-bottom-tab i {
    font-size: 0.8rem;
  }
  .btn-bottom-tab .tab-count {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.675rem;
    padding: 0.05rem 0.3rem;
    border-radius: 8px;
    font-weight: 700;
  }
}






