/* ══════════════════════════════════════════════════════
   PatchPanel Pro — Dark Premium Mobile UI
   ══════════════════════════════════════════════════════ */

:root {
  --bg: #0a0a14;
  --bg2: #0f0f1e;
  --card: #141428;
  --card2: #1a1a32;
  --border: #242448;
  --accent: #e94560;
  --accent2: #ff6b6b;
  --blue: #2980b9;
  --green: #27ae60;
  --yellow: #f39c12;
  --purple: #8e44ad;
  --orange: #e67e22;
  --text: #e8e8f0;
  --text2: #9898b0;
  --text3: #5a5a70;
  --header-h: 60px;
  --tab-h: 64px;

  /* device colors */
  --cam: #e74c3c;
  --ap:  #2980b9;
  --prf: #27ae60;
  --tab: #f39c12;
  --sw:  #8e44ad;
  --nvr: #e67e22;
  --srv: #7f8c8d;
  --fw:  #c0392b;
}

/* ─── LIGHT THEME VARIABLES ─── */
body.light-theme {
  --bg: #f5f6fa;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #f0f2f5;
  --border: #dcdde1;
  --text: #1a1a2e;
  --text2: #64748b;
  --text3: #95a5a6;
}
body.light-theme .app-header,
body.light-theme .tab-bar {
  background: rgba(255, 255, 255, 0.9);
}

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

html { font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ─── HEADER ─── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(10,10,20,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}
.header-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #8b2fc9);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(233,69,96,0.4);
}
.brand-title { font-size: 15px; font-weight: 700; display: block; }
.brand-sub { font-size: 10px; color: var(--text2); display: block; }
.header-right { display: flex; align-items: center; gap: 8px; }
.sync-badge {
  background: var(--accent); color: white;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.sync-badge:empty, .sync-badge[data-count="0"] { background: var(--text3); }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text3); transition: background 0.3s;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.offline { background: var(--accent); }
.status-label { font-size: 11px; color: var(--text2); }

/* ─── TAB BAR ─── */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--tab-h);
  background: rgba(10,10,20,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
}
.tab-btn {
  flex: 1; border: none; background: transparent; color: var(--text3);
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-family: inherit; font-size: 10px; font-weight: 500;
  transition: color 0.2s, transform 0.1s;
  padding: 0 4px;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn svg { width: 22px; height: 22px; }
.tab-btn.active { color: var(--accent); }
.tab-btn.active svg { filter: drop-shadow(0 0 4px var(--accent)); }
.tab-btn:active { transform: scale(0.92); }

/* ─── MAIN ─── */
.app-main {
  padding-top: calc(var(--header-h) + 12px);
  padding-bottom: calc(var(--tab-h) + 12px);
  padding-left: 12px; padding-right: 12px;
  min-height: 100vh;
}
.tab-pane { display: none; animation: fadeIn 0.25s ease; }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── DASHBOARD ── */
.dash-hero {
  position: relative;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card) 80%, transparent) 0%, color-mix(in srgb, var(--card2) 90%, transparent) 100%);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px; 
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.dash-hero::before {
  content: '';
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at top right, rgba(233, 69, 96, 0.1), transparent 40%),
              radial-gradient(circle at bottom left, rgba(139, 47, 201, 0.1), transparent 40%);
  pointer-events: none;
  z-index: 0;
}
.dash-hero h1 { 
  font-size: 22px; 
  font-weight: 800; 
  margin-bottom: 6px; 
  background: linear-gradient(to right, var(--text), var(--text2)); 
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent; 
  position: relative; z-index: 1;
}
.dash-hero p { 
  font-size: 13px; 
  color: var(--text2); 
  position: relative; z-index: 1;
  font-weight: 500;
}

/* ── STATS CARDS (Redesign) ── */
.stat-grid { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 12px; 
  margin-bottom: 20px; 
}
.stat-card {
  position: relative;
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px; 
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.stat-icon { font-size: 24px; margin-bottom: 8px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.stat-val { font-size: 32px; font-weight: 900; color: var(--text); line-height: 1; letter-spacing: -1px; }
.stat-lbl { font-size: 12px; color: var(--text2); margin-top: 6px; font-weight: 600; }

/* ── DEVICE BREAKDOWN CHIPS (Redesign) ── */
.type-grid { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 10px; 
  margin-bottom: 24px; 
  justify-content: center;
}
.type-pill {
  border-radius: 12px; 
  padding: 8px 16px; 
  font-size: 12px; 
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--tc) 30%, transparent); 
  background: color-mix(in srgb, var(--tc) 15%, transparent);
  color: color-mix(in srgb, var(--tc) 90%, var(--text));
  display: flex; 
  align-items: center; 
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s, background 0.2s;
}
.type-pill:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--tc) 25%, transparent);
}

/* ── MAIN CTA BUTTON (Redesign) ── */
.btn-add-big {
  width: 100%; 
  padding: 18px; 
  border: none; 
  border-radius: 16px;
  background: linear-gradient(135deg, #e94560, #8b2fc9, #e94560);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  color: white; 
  font-size: 16px; 
  font-weight: 800;
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 12px;
  margin-bottom: 24px; 
  box-shadow: 0 6px 24px rgba(233,69,96,0.3);
  transition: transform 0.15s, box-shadow 0.15s; 
  font-family: inherit;
}
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.btn-add-big:active { 
  transform: scale(0.96); 
  box-shadow: 0 3px 12px rgba(233,69,96,0.2); 
}

/* ── RECENT CONNECTIONS (Redesign) ── */
.section-title { 
  font-size: 14px; 
  font-weight: 800; 
  color: var(--text2); 
  margin-bottom: 12px; 
  letter-spacing: 0.5px; 
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before { content:''; display:block; width:4px; height:14px; background:var(--accent); border-radius:2px; }

.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-card {
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 14px;
  padding: 14px 16px; 
  display: flex; 
  align-items: center; 
  gap: 14px;
  cursor: pointer; 
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.recent-card:hover { background: var(--card2); border-color: var(--accent); transform: translateX(2px); }
.recent-card:active { border-color: var(--accent); transform: scale(0.98); }

.rc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.rc-info { flex: 1; min-width: 0; }
.rc-label { font-size: 13px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.rc-sub { font-size: 11px; color: var(--text2); }
.rc-pp { font-size: 11px; color: var(--text3); font-family: 'JetBrains Mono', monospace; text-align: left; }
.empty-msg { color: var(--text3); text-align: center; padding: 30px; font-size: 13px; }

/* ─── ADD FORM ─── */
.form-header { margin-bottom: 16px; }
.form-header h2 { font-size: 20px; font-weight: 700; }
.form-header p { font-size: 13px; color: var(--text2); }
.add-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.form-row { display: flex; gap: 10px; }
.form-group.half { flex: 1; }
input, select, textarea {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: inherit; font-size: 14px;
  padding: 12px 14px; outline: none; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,69,96,0.15);
}
select option { background: var(--card2); }
.readonly-field { opacity: 0.6; cursor: not-allowed; }
.mono-field { font-family: 'JetBrains Mono', monospace; }

.label-preview {
  background: var(--bg2); border: 1px dashed var(--border); border-radius: 8px;
  padding: 10px 14px; font-family: 'JetBrains Mono', monospace; font-size: 13px;
  color: var(--accent); margin-bottom: 4px; min-height: 38px;
}

/* Type selector */
.type-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.type-btn {
  padding: 12px 6px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text2); cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 600;
  text-align: center; transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.type-btn:active { transform: scale(0.94); }
.type-btn.selected {
  background: color-mix(in srgb, var(--tc) 20%, transparent);
  border-color: var(--tc); color: var(--tc);
  box-shadow: 0 0 12px color-mix(in srgb, var(--tc) 30%, transparent);
}

/* Status selector */
.status-selector { display: flex; gap: 8px; }
.status-btn {
  flex: 1; padding: 10px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text2); cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 600;
  transition: all 0.2s; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.status-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(233,69,96,0.1); }

/* Form actions */
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn-save {
  flex: 2; padding: 16px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #c0392b);
  color: white; font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit; box-shadow: 0 4px 16px rgba(233,69,96,0.4);
  transition: transform 0.1s; -webkit-tap-highlight-color: transparent;
}
.btn-save:active { transform: scale(0.97); }
.btn-clear {
  flex: 1; padding: 16px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--card); color: var(--text2); font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent;
}

/* Toast */
.toast {
  position: fixed; bottom: calc(var(--tab-h) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--green); color: white; padding: 12px 24px; border-radius: 24px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s; z-index: 200; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.toast.error { background: var(--accent); }

/* ─── PATCH PANELS ─── */
.panel-header { margin-bottom: 16px; }
.panel-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.filter-row select { max-width: 200px; }
.pp-grid { display: flex; flex-direction: column; gap: 10px; }
.pp-card {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 14px; cursor: pointer; transition: border-color 0.2s, transform 0.1s;
}
.pp-card:active { transform: scale(0.98); border-color: var(--accent); }
.pp-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pp-card-id { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; color: var(--accent); }
.pp-card-loc { font-size: 11px; color: var(--text2); }
.pp-mini-ports { display: flex; flex-wrap: wrap; gap: 3px; }
.pp-mini-port {
  width: 14px; height: 14px; border-radius: 3px; background: var(--border);
  transition: background 0.2s;
}
.pp-mini-port.used { background: var(--green); }
.pp-mini-port.issue { background: var(--accent); }
.pp-stats { display: flex; gap: 10px; margin-top: 8px; font-size: 11px; color: var(--text2); }

/* ─── MODAL ─── */
.modal {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  align-items: flex-end;
}
.modal.open { display: flex; }
.modal-content {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 20px; width: 100%; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
  padding: 0;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header {
  background: var(--card2);
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--border);
}
.modal-body {
  overflow-y: auto;
  flex: 1;
  max-height: calc(85vh - 80px) !important;
}

@media (min-width: 769px) {
  .modal {
    align-items: center !important;
    justify-content: center !important;
  }
  .modal-content {
    max-height: 85vh !important;
    border-radius: 20px !important;
    margin: auto !important;
  }
  .modal-body {
    max-height: calc(85vh - 80px) !important;
  }
}
.modal-header h3 { font-size: 16px; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--text); }
.modal-close {
  background: rgba(233, 69, 96, 0.1);
  border: 1.5px solid rgba(233, 69, 96, 0.3);
  color: var(--accent);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-close:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.08);
}
.modal-close:active {
  transform: scale(0.95);
}

/* Port grid in modal */
.port-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; direction: ltr !important; }
.port-cell {
  border-radius: 8px; padding: 6px 4px; text-align: center;
  cursor: pointer; border: 1.5px solid transparent; transition: transform 0.1s;
  background: var(--card); border-color: var(--border);
}
.port-cell:active { transform: scale(0.92); }
.port-cell.used { border-color: transparent; }
.port-num { font-size: 9px; color: var(--text3); margin-bottom: 2px; font-family: 'JetBrains Mono', monospace; }
.port-dev { font-size: 8px; font-weight: 600; line-height: 1.2; }

/* ─── IP TABLE ─── */
.iptable-header { margin-bottom: 14px; }
.iptable-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.search-bar-wrap { margin-bottom: 10px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fpill {
  padding: 5px 12px; border-radius: 16px; font-size: 11px; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--card); color: var(--text2);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: all 0.2s;
}
.fpill.active { background: var(--accent); border-color: var(--accent); color: white; }
.fpill.cam { color: var(--cam); border-color: var(--cam); }
.fpill.cam.active { background: var(--cam); color: white; }
.fpill.ap  { color: var(--ap); border-color: var(--ap); }
.fpill.ap.active { background: var(--ap); color: white; }
.fpill.prf { color: var(--prf); border-color: var(--prf); }
.fpill.prf.active { background: var(--prf); color: white; }
.fpill.tab { color: var(--tab); border-color: var(--tab); }
.fpill.tab.active { background: var(--tab); color: white; }
.fpill.sw  { color: var(--sw); border-color: var(--sw); }
.fpill.sw.active { background: var(--sw); color: white; }
.fpill.nvr { color: var(--nvr); border-color: var(--nvr); }
.fpill.nvr.active { background: var(--nvr); color: white; }

.ip-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
.ip-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ip-table th {
  background: #0d0d24; color: var(--text2); padding: 10px 8px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border); white-space: nowrap; font-weight: 700;
  position: sticky; top: 0;
}
.ip-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ip-table tr:last-child td { border-bottom: none; }
.ip-table tr:hover td { background: rgba(255,255,255,0.02); }
.ip-table .lbl { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 11px; }
.ip-table .ip  { font-family: 'JetBrains Mono', monospace; color: var(--text2); }
.type-badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-badge {
  display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 9px; font-weight: 600;
}
.sb-active { background: rgba(39,174,96,0.2); color: var(--green); }
.sb-tbd    { background: rgba(243,156,18,0.2); color: var(--yellow); }
.sb-issue  { background: rgba(233,69,96,0.2); color: var(--accent); }

/* ─── SEARCH ─── */
.search-hero { margin-bottom: 16px; }
.search-hero h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.big-search-wrap { position: relative; }
.big-search {
  width: 100%; padding: 16px 18px; font-size: 16px;
  background: var(--card2); border: 2px solid var(--border); border-radius: 16px;
  color: var(--text); font-family: inherit; outline: none; transition: border-color 0.2s;
}
.big-search:focus { border-color: var(--accent); }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.result-card {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 14px; cursor: pointer; transition: border-color 0.2s;
}
.result-card:active { border-color: var(--accent); }
.rc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rc-label-big { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; }
.rc-details { font-size: 11px; color: var(--text2); display: flex; flex-wrap: wrap; gap: 8px; }
.rc-detail-item { display: flex; gap: 3px; }
.rc-detail-item span:first-child { color: var(--text3); }

/* ─── PREMIUM LOGIN OVERLAY ─── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: radial-gradient(circle at center, #0f0f2d 0%, #05050f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.05);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(20, 20, 40, 0.65);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1.5px solid rgba(233, 69, 96, 0.25);
  border-radius: 24px;
  padding: 35px 25px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(233, 69, 96, 0.1);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: loginCardIntro 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #8b2fc9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  color: white;
  margin: 0 auto 16px auto;
  box-shadow: 0 8px 30px rgba(233, 69, 96, 0.45);
}

.login-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.login-header p {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 30px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-container {
  position: relative;
  width: 100%;
}

.input-container svg {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text3);
  transition: color 0.3s;
}

.input-container input {
  padding: 14px 44px 14px 16px !important;
  background: rgba(10, 10, 20, 0.5) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 12px !important;
  color: var(--text) !important;
  font-size: 14px !important;
  transition: all 0.3s !important;
}

.input-container input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 15px rgba(233, 69, 96, 0.25) !important;
  background: rgba(10, 10, 20, 0.8) !important;
}

.input-container input:focus + svg {
  color: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
}

.btn-login {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #b82548);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
  transition: all 0.3s;
  font-family: inherit;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login:hover {
  box-shadow: 0 5px 25px rgba(233, 69, 96, 0.6);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(233, 69, 96, 0.3);
}

.login-error {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #ff6b6b;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  display: none;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.login-footer {
  margin-top: 25px;
  font-size: 11px;
  color: var(--text3);
  font-family: monospace;
}

/* ══════════════════════════════════════════════════════
   RACK VISUALIZER PREMIUM STYLING
   ══════════════════════════════════════════════════════ */
.rack-controls-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.rack-legends {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
}

.leg-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* Cabinet Frame */
.rack-frame-outer {
  background: #08080f;
  border: 4px solid #1a1a2e;
  border-radius: 16px;
  padding: 12px 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 40px rgba(255,255,255,0.03);
  margin: 0 auto 20px auto;
  width: fit-content;
  min-width: 660px;
  max-width: 100%;
  position: relative;
  border-color: var(--border);
  box-sizing: border-box;
}

.rack-frame-header {
  background: linear-gradient(180deg, #1f1f3a, #111124);
  border-bottom: 2px solid #2d2d52;
  border-radius: 8px 8px 0 0;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.rack-fan-grill {
  display: flex;
  gap: 4px;
}
.rack-fan-grill::before {
  content: '••••••••';
  color: var(--text3);
  font-size: 12px;
  letter-spacing: 2px;
}

.rack-cabinet-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(233,69,96,0.5);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.rack-rails {
  display: flex;
  background: #030307;
  border-radius: 4px;
  position: relative;
  padding: 4px 0;
  border: 1px solid rgba(255,255,255,0.02);
  width: 100%;
  box-sizing: border-box;
}

.rack-rail-left, .rack-rail-right {
  width: 24px;
  background: linear-gradient(90deg, #09090f 0%, #161626 50%, #05050b 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  flex-shrink: 0;
}
.rack-rail-right {
  background: linear-gradient(270deg, #09090f 0%, #161626 50%, #05050b 100%);
}

/* Dynamic Rack Rails and Screws styling */
.rack-rail-u-notch {
  height: 44px;
  margin-bottom: 3px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 0;
}

.rack-rail-u-notch:last-child {
  margin-bottom: 0;
}

.rail-screw-hole {
  width: 7px;
  height: 7px;
  background: #09090f;
  border-radius: 50%;
  border: 1px solid #2a2a3e;
  box-shadow: inset 0 1px 2px #000, 0 0.5px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  transition: all 0.25s ease;
}

.rail-screw-hole::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2.5px;
  height: 2.5px;
  background: #252538;
  border-radius: 50%;
  box-shadow: inset 0 0.5px 0.5px #000;
}

.rail-tick-mark {
  width: 10px;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.5px;
  transition: all 0.25s ease;
}

.rack-units-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch !important;
  gap: 3px;
  padding: 0 6px;
  min-height: 100px;
  box-sizing: border-box !important;
}

/* A single U item */
.rack-unit-wrapper {
  display: flex;
  align-items: stretch;
  position: relative;
  height: 44px; /* Fixed height of a single U slot */
  min-height: 44px;
  width: 100% !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  box-sizing: border-box;
}

.rack-u-number {
  position: absolute;
  left: -22px;
  width: 18px;
  font-size: 8px;
  color: var(--text3);
  font-family: monospace;
  text-align: center;
  align-self: center;
}
.rack-unit-wrapper::after {
  content: attr(data-u);
  position: absolute;
  right: -22px;
  width: 18px;
  font-size: 8px;
  color: var(--text3);
  font-family: monospace;
  text-align: center;
  align-self: center;
}

.rack-unit-inner {
  flex: 1;
  width: 100% !important;
  box-sizing: border-box !important;
  border-radius: 4px;
  min-height: 44px;
  height: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  overflow: hidden;
}

/* Force devices sitting in U slots to align perfectly flush and occupy 100% height */
.rack-unit-inner .rack-device:not(.shelf-mounted) {
  border-radius: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  box-sizing: border-box !important;
  border-left: none !important;
  border-right: none !important;
}

/* Devices inside Rack */
.rack-device {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 10px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
}

/* empty slot */
.rack-unit-empty {
  border: 1px dashed rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.01);
  color: rgba(255,255,255,0.08);
  font-family: monospace;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: 100% !important;
  min-height: 44px;
  box-sizing: border-box !important;
}

/* Specific Equipment */
.rack-device.patch-panel {
  background: linear-gradient(180deg, #18181c 0%, #0e0e10 100%);
  border-color: #2b2b32;
}

.rack-device.switch {
  background: linear-gradient(180deg, #2d3238 0%, #1a1e22 100%);
  border-color: #3e454d;
}

.rack-device.core-switch {
  background: linear-gradient(180deg, #1a2238 0%, #0d121f 100%);
  border-color: #2c3a5e;
}

.rack-device.server {
  background: linear-gradient(180deg, #20242a 0%, #0e1013 100%);
  border-color: #343a44;
}

.rack-device.firewall {
  background: linear-gradient(180deg, #7f1d1d 0%, #450a0a 100%);
  border-color: #991b1b;
}

.rack-device.organizer {
  background: linear-gradient(180deg, #111 0%, #000 100%);
  border-color: #222;
  box-shadow: none;
}

.rack-device-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text2);
  margin-bottom: 2px;
}

.rack-device-title {
  font-weight: 700;
  font-size: 10px;
}

.rack-device-brand {
  color: var(--accent);
  font-weight: 800;
  font-size: 9px;
}

/* Ports Layout */
.rack-ports-grid {
  display: grid;
  grid-template-rows: repeat(2, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  padding: 4px 6px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.05);
}
.rack-ports-grid.ports-24 {
  grid-template-rows: 1fr;
}

/* A single port in Rack visualizer */
.rack-port {
  width: 9px;
  height: 9px;
  background: #1e222b;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.rack-port:hover {
  transform: scale(1.3);
  z-index: 10;
}

.rack-port.used {
  border-color: var(--conn-color);
  box-shadow: 0 0 6px var(--conn-color);
  background: var(--conn-color);
}

.rack-port.issue {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 8px var(--accent);
}

/* Flashing traffic LEDs for switch */
.switch-leds-bar {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.4);
  padding: 2px 5px;
  border-radius: 2px;
  align-self: flex-start;
}

.switch-led {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #27ae60;
  animation: traffic-blink 0.25s infinite ease-in-out;
}
.switch-led:nth-child(even) {
  animation-delay: 0.08s;
  animation-duration: 0.35s;
}
.switch-led:nth-child(3n) {
  animation-delay: 0.15s;
  animation-duration: 0.2s;
  background: #f39c12;
}

@keyframes traffic-blink {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); background-color: #2ecc71; }
}

/* Server visual details */
.server-bays {
  display: flex;
  gap: 4px;
  flex: 1;
  padding: 2px 0;
}
.server-bay {
  flex: 1;
  background: #111;
  border: 1px solid #333;
  border-radius: 1px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 2px;
}
.server-bay::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #27ae60;
  box-shadow: 0 0 3px #27ae60;
}
.server-bay.offline::before {
  background: #7f8c8d;
  box-shadow: none;
}

.server-lcd {
  width: 60px;
  height: 12px;
  background: rgba(0, 168, 255, 0.15);
  border: 1px solid rgba(0, 168, 255, 0.4);
  color: #00a8ff;
  font-family: monospace;
  font-size: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

/* Organizer visual comb */
.organizer-combs {
  display: flex;
  justify-content: space-around;
  width: 100%;
  height: 10px;
  border-top: 1px solid #222;
}
.organizer-comb-tooth {
  width: 2px;
  height: 8px;
  background: #222;
}

/* Wheel look */
.rack-frame-footer {
  height: 15px;
  background: linear-gradient(180deg, #111 0%, #050505 100%);
  border-radius: 0 0 8px 8px;
  position: relative;
}
.rack-wheels {
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
}
.wheel {
  width: 14px;
  height: 8px;
  background: #222;
  border-radius: 2px;
}



/* Tooltip overlay styling inside modal */
.tooltip-detail-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  margin-top: 12px;
}
.tooltip-detail-table tr {
  border-bottom: 1px solid var(--border);
}
.tooltip-detail-table td {
  padding: 8px 4px;
}
.tooltip-detail-table td:first-child {
  color: var(--text2);
  font-size: 11px;
  text-transform: uppercase;
  width: 35%;
}
.tooltip-detail-table td:last-child {
  font-family: monospace;
  font-weight: 600;
}

/* ─── Admin Tab UI ─── */
.admin-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .admin-layout-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

.admin-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.admin-card:hover {
  border-color: rgba(233, 69, 96, 0.4);
  box-shadow: 0 8px 32px rgba(233, 69, 96, 0.05);
}

.admin-card-header {
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.admin-card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text1);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-left: 4px;
}

.user-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.user-item-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--accent);
}

.user-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text1);
}

.user-item-meta {
  font-size: 11px;
  color: var(--text2);
}

.user-role-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.user-role-badge.admin {
  background: rgba(233, 69, 96, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.user-role-badge.worker {
  background: rgba(41, 128, 185, 0.15);
  color: #2980b9;
  border: 1px solid #2980b9;
}

.btn-delete-user {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border: 1.5px solid #e74c3c;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete-user:hover {
  background: #e74c3c;
  color: #fff;
  box-shadow: 0 0 8px #e74c3c;
}

/* Scrollable log table styles */
.log-table-wrap {
  max-height: 400px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1.5px solid var(--border);
}

.log-table th {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
  border-bottom: 2px solid var(--border) !important;
}

.log-table td {
  font-size: 12px;
  padding: 10px 8px;
}

.log-action-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.log-action-badge.add {
  background: rgba(39, 174, 96, 0.15);
  color: var(--green);
}

.log-action-badge.update {
  background: rgba(243, 156, 18, 0.15);
  color: var(--yellow);
}

.log-action-badge.delete {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.log-action-badge.login {
  background: rgba(142, 68, 173, 0.15);
  color: #8e44ad;
}

.log-action-badge.other {
  background: rgba(127, 140, 141, 0.15);
  color: #7f8c8d;
}

/* Light Theme overrides for admin panel */
body.light-theme .user-item-card {
  background: rgba(0, 0, 0, 0.02);
}
body.light-theme .user-item-card:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* ─── PREMIUM SVG PATCH CORDS STYLING ─── */
@keyframes flow {
  to { stroke-dashoffset: -20; }
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.8; stroke-width: 2.2px; }
  50% { opacity: 1; stroke-width: 2.8px; }
}
.patch-cord-path {
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.3s ease;
  pointer-events: none;
  stroke-dasharray: 6, 4;
  animation: flow 1.2s linear infinite, pulse-glow 2s ease-in-out infinite;
}
.patch-cord-path.camera {
  animation-duration: 0.9s, 1.5s;
}
.patch-cord-path.ap {
  animation-duration: 1.1s, 2s;
}
.patch-cord-path.prf {
  animation-duration: 1.4s, 2.5s;
}
.patch-cord-path.issue {
  stroke-dasharray: 3, 3;
  animation: flow 0.5s linear infinite;
  stroke-width: 3px !important;
}

/* ─── PREMIUM PDU 1U DEVICE STYLING ─── */
.rack-device.pdu {
  background: linear-gradient(180deg, #15151e 0%, #0c0c12 100%);
  border-color: #252535;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  height: 44px;
}
.pdu-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.pdu-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 800;
  color: var(--text3);
  letter-spacing: 0.5px;
}
.pdu-volt-display {
  background: #020205;
  border: 1px solid #1a1a2e;
  border-radius: 4px;
  color: #00ffcc;
  text-shadow: 0 0 6px rgba(0, 255, 204, 0.8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  text-align: center;
  min-width: 50px;
  transition: all 0.3s ease;
}
.pdu-sockets {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pdu-socket {
  width: 22px;
  height: 22px;
  background: radial-gradient(circle, #20202d 60%, #101018 100%);
  border: 1px solid #2e2e42;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}
.pdu-socket::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.03);
  background: #09090e;
  display: flex;
}
.pdu-socket::after {
  content: '••';
  color: #000;
  font-size: 10px;
  position: absolute;
  top: 3px;
  letter-spacing: 2px;
  text-indent: 1px;
}
.pdu-right {
  display: flex;
  align-items: center;
}
.pdu-switch-container {
  display: flex;
  align-items: center;
}
.pdu-switch {
  width: 26px;
  height: 16px;
  background: #20202d;
  border: 1.5px solid #333;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  padding: 1px;
}
.pdu-switch-led {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #555;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform: translateX(0);
}
.pdu-switch.active {
  border-color: #e94560;
  background: rgba(233, 69, 96, 0.1);
}
.pdu-switch.active .pdu-switch-led {
  background: #e94560;
  transform: translateX(-10px);
  box-shadow: 0 0 10px #e94560;
}

/* ─── DYNAMIC RACK EDIT MODE STYLING ─── */
.rack-rails.edit-active .rack-unit-wrapper:hover .rack-unit-inner {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.03);
}
.rack-unit-edit-controls {
  position: absolute;
  right: -52px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
  z-index: 150;
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateY(-50%) translateX(10px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}
.btn-u-edit, .btn-u-delete {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.btn-u-edit:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-u-delete:hover {
  background: #e74c3c;
  color: white;
  border-color: #e74c3c;
}

/* ─── VISUAL-FIRST DEVICE SELECTOR CARDS ─── */
.type-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px !important;
  margin-top: 5px;
}
@media (min-width: 600px) {
  .type-selector {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}
.type-btn {
  height: 110px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 15px 10px !important;
  border-radius: 16px !important;
  border: 2px solid var(--border) !important;
  background: var(--card) !important;
  color: var(--text2) !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.type-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.03) 0%, transparent 80%);
  opacity: 0;
  transition: opacity 0.3s;
}
.type-btn:hover {
  border-color: rgba(255,255,255,0.15) !important;
  color: var(--text) !important;
}
.type-btn:hover::before {
  opacity: 1;
}
.type-btn.selected {
  transform: translateY(-2px);
  border-color: var(--tc) !important;
  background: color-mix(in srgb, var(--tc) 8%, var(--card)) !important;
  color: var(--text) !important;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--tc) 15%, rgba(0,0,0,0.4)) !important;
}
.type-card-icon {
  width: 32px;
  height: 32px;
  color: var(--text2);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.type-btn.selected .type-card-icon {
  color: var(--tc) !important;
  transform: scale(1.1);
  filter: drop-shadow(0 0 6px var(--tc));
}
.type-btn span {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

/* Animations for Visual Cards */
@keyframes flash-red {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.type-btn.selected .cam-led {
  animation: flash-red 0.8s infinite ease-in-out;
}
@keyframes ap-pulse {
  0% { transform: scale(1) rotate(0deg); opacity: 0.5; }
  50% { transform: scale(1.08) rotate(180deg); opacity: 1; }
  100% { transform: scale(1) rotate(360deg); opacity: 0.5; }
}
.type-btn.selected .wifi-waves {
  animation: ap-pulse 3s infinite linear;
  transform-origin: 12px 12px;
}

/* ─── RUIJIE SWITCH PORTS GRID ─── */
.rack-switch-ports-grid {
  display: grid;
  grid-template-rows: repeat(2, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  padding: 4px 6px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.05);
}
.switch-port {
  width: 9px;
  height: 9px;
  background: #15181f;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  transition: all 0.2s;
}
.switch-port.used {
  border-color: var(--conn-color);
  box-shadow: 0 0 6px var(--conn-color);
  background: var(--conn-color);
}
.switch-port.issue {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 8px var(--accent);
}

/* ─── REALISTIC CAT6 PHYSICAL PATCH PANEL STYLES ─── */
.physical-pp-wrapper {
  margin-bottom: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.physical-pp-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 8px;
}
.physical-pp-title h4 {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}
.physical-pp-title span {
  font-size: 11px;
  color: var(--text2);
}

/* 1U Patch Panel Chassis */
.rack-patch-panel-chassis {
  display: flex;
  background: linear-gradient(180deg, #101015 0%, #16161f 50%, #0d0d12 100%);
  border: 2px solid #222230;
  border-radius: 6px;
  padding: 8px 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  width: 100%;
  box-sizing: border-box;
  align-items: stretch;
  overflow: hidden;
  margin-bottom: 8px;
  direction: ltr !important; /* Force Left-To-Right ports ordering */
}

/* Metallic rack ears (brackets) */
.pp-ear-left, .pp-ear-right {
  width: 32px;
  background: linear-gradient(90deg, #2d2d3a 0%, #3e3e52 50%, #20202a 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  flex-shrink: 0;
  border-right: 1px solid #1a1a24;
  position: relative;
}
.pp-ear-right {
  background: linear-gradient(270deg, #2d2d3a 0%, #3e3e52 50%, #20202a 100%);
  border-right: none;
  border-left: 1px solid #1a1a24;
}

/* Screws */
.pp-screw {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e2e2ec 0%, #8a8a9e 60%, #4a4a58 100%);
  box-shadow: 1px 1px 3px rgba(0,0,0,0.6), inset -1px -1px 2px rgba(0,0,0,0.4);
  position: relative;
}
/* Screw cross slots */
.pp-screw::before, .pp-screw::after {
  content: '';
  position: absolute;
  background: #333;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.pp-screw::before { width: 8px; height: 1.5px; }
.pp-screw::after { width: 1.5px; height: 8px; }

/* Panel Main Port Area */
.pp-port-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 12px;
  justify-content: center;
  min-width: 0;
  overflow-x: auto !important; /* Enable swiping/scrolling on mobile! */
  -webkit-overflow-scrolling: touch;
}
.pp-port-area::-webkit-scrollbar {
  height: 4px;
}
.pp-port-area::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}
.pp-port-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Paper label strip */
.paper-label-strip {
  background: #fdfdfd;
  background-image: linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px);
  background-size: calc(100% / 24) 100%;
  border: 1px solid #c0c0d0;
  border-radius: 2px;
  height: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 groups matching ports row */
  gap: 16px; /* spacing between blocks matching ports row */
  width: 100%;
  min-width: 750px; /* Prevent shrinking on mobile */
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.2);
  direction: ltr !important;
}

.pp-labels-group {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px; /* match port socket gaps */
  height: 100%;
  direction: ltr !important;
}

.label-strip-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', Courier, monospace;
  font-size: 8px;
  font-weight: 800;
  color: #1a1a2e;
  text-shadow: 0.2px 0.2px 0.5px rgba(0,0,0,0.1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 1px;
  border-right: 1px dashed rgba(0, 0, 0, 0.15);
  text-align: center;
}
.label-strip-cell:last-child {
  border-right: none;
}

/* Ports row */
.pp-ports-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 groups of 6 ports */
  gap: 16px; /* spacing between blocks */
  width: 100%;
  min-width: 750px; /* Prevent shrinking on mobile */
}

.pp-ports-group {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.03);
}

.pp-port-socket-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* RJ45 socket styling */
.rj45-socket-wrapper {
  width: 24px;
  height: 24px;
  background: #060608;
  border: 1.5px solid #22222e;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.8), 0 1px 2px rgba(255,255,255,0.05);
  cursor: pointer;
  transition: all 0.2s;
}

.rj45-socket-wrapper:hover {
  border-color: var(--accent);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8), 0 0 8px rgba(233,69,96,0.3);
  transform: translateY(-1px);
}

/* Empty RJ45 Socket with gold copper pins */
.rj45-empty-socket {
  width: 16px;
  height: 14px;
  background: #0a0a0f;
  border-radius: 2px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.9);
}

/* Draw the 8 gold/copper pins */
.rj45-empty-socket::before {
  content: '';
  position: absolute;
  top: 1px; left: 2px; right: 2px;
  height: 6px;
  background: repeating-linear-gradient(90deg, #c5a059 0px, #c5a059 1px, transparent 1px, transparent 2.2px);
  opacity: 0.85;
}

/* The tab cutout at bottom of RJ45 */
.rj45-empty-socket::after {
  content: '';
  position: absolute;
  bottom: 0px; left: 5px; width: 6px; height: 3px;
  background: #050507;
  border-radius: 1px 1px 0 0;
  border-top: 1px solid #1a1a24;
}

/* RJ45 Plug Connector inserted */
.rj45-connector-plug {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  position: relative;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all 0.2s;
}

.rj45-connector-plug.CAMERA {
  background: linear-gradient(135deg, #ff4d4d 0%, #cc1111 100%);
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.rj45-connector-plug.AP {
  background: linear-gradient(135deg, #3498db 0%, #1c5980 100%);
  box-shadow: 0 0 10px rgba(41, 128, 185, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.rj45-connector-plug.PC, .rj45-connector-plug.PRF {
  background: linear-gradient(135deg, #2ecc71 0%, #1b7a43 100%);
  box-shadow: 0 0 10px rgba(39, 174, 96, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.rj45-connector-plug.TEL {
  background: linear-gradient(135deg, #1abc9c 0%, #117a65 100%);
  box-shadow: 0 0 10px rgba(26, 188, 156, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.rj45-connector-plug.PRN {
  background: linear-gradient(135deg, #16a085 0%, #0e6251 100%);
  box-shadow: 0 0 10px rgba(22, 160, 133, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.rj45-connector-plug.CPE {
  background: linear-gradient(135deg, #d35400 0%, #7e3300 100%);
  box-shadow: 0 0 10px rgba(211, 84, 0, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.rj45-connector-plug.TAB {
  background: linear-gradient(135deg, #f39c12 0%, #a06405 100%);
  box-shadow: 0 0 10px rgba(243, 156, 18, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.rj45-connector-plug.SW {
  background: linear-gradient(135deg, #9b59b6 0%, #683080 100%);
  box-shadow: 0 0 10px rgba(155, 89, 182, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.rj45-connector-plug.NVR, .rj45-connector-plug.SRV, .rj45-connector-plug.FW {
  background: linear-gradient(135deg, #e67e22 0%, #904c0f 100%);
  box-shadow: 0 0 10px rgba(230, 126, 34, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.rj45-connector-plug.RTR {
  background: linear-gradient(135deg, #3498db 0%, #1c5980 100%);
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.6), inset 0 1px 1px rgba(255,255,255,0.4);
}
.rj45-connector-plug.OTHER {
  background: linear-gradient(135deg, #7f8c8d 0%, #4a5455 100%);
  box-shadow: 0 0 8px rgba(127, 140, 141, 0.5), inset 0 1px 1px rgba(255,255,255,0.3);
}

/* Rubber strain-relief boot ridge */
.rj45-connector-plug::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 6px;
  background: inherit;
  border-radius: 1px;
  bottom: -4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(0,0,0,0.2);
}

/* Glowing Cable tail coming out of boot */
.rj45-connector-plug::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 20px;
  bottom: -22px;
  border-radius: 2px;
  background: inherit;
  filter: brightness(1.2) drop-shadow(0 0 3px currentColor);
  opacity: 0.8;
  z-index: -1;
  pointer-events: none;
}

/* Port number label below the socket */
.rj45-port-number-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  color: var(--text3);
  font-weight: 600;
  margin-top: 4px;
}

/* Free Switch Port dropdown & styling for patching wizard modal */
.patching-wizard-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.patching-wizard-form h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.patching-wizard-form p {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.5;
}
.patching-wizard-form label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
}
.port-selector-wizard-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  max-height: 120px;
  overflow-y: auto;
}
.wizard-port-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  padding: 6px 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.wizard-port-btn.occupied {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bg);
  border-color: transparent;
}
.wizard-port-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 8px rgba(233,69,96,0.5);
}

/* ─── PREMIUM PROJECT OVERLAY & CARDS ─── */
.project-card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 12px;
  max-height: 250px;
  overflow-y: auto;
  padding: 4px;
  margin-top: 15px;
}
@media (min-width: 480px) {
  .project-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.project-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: right;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-card:hover {
  background: rgba(233, 69, 96, 0.05);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.15);
}
.project-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.project-card p {
  font-size: 11px;
  color: var(--text2);
  margin: 0;
  line-height: 1.4;
  flex-grow: 1;
}
.project-card .proj-meta {
  font-size: 9px;
  color: var(--text3);
  font-family: monospace;
  margin-top: 4px;
}
.project-card.active {
  border-color: var(--accent) !important;
  background: rgba(233, 69, 96, 0.1) !important;
  box-shadow: 0 0 15px rgba(233, 69, 96, 0.2) !important;
}

/* Dynamic height adjustment for smaller Racks */
.rack-unit-empty {
  transition: all 0.2s ease;
}
.btn-u-edit, .btn-u-delete {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── CUSTOM PROJECT SELECTOR & DYNAMIC FLOORS ─── */
.project-select-wrapper select {
  font-family: inherit;
  transition: all 0.3s ease;
}
.project-select-wrapper select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(233, 69, 96, 0.25);
}
.logo-preset-btn {
  transition: all 0.2s ease;
}
.logo-preset-btn:hover {
  background: var(--border) !important;
  transform: scale(1.1);
}
.logo-preset-btn:active {
  transform: scale(0.95);
}
.floor-input-row {
  animation: slideInDown 0.25s ease;
}

/* 🌐 Premium Fiber Optic Patch Panel Styling */

/* Fiber Panel Container in Rack */
.rack-device.fiber-panel {
  background: linear-gradient(180deg, #12121e 0%, #08080f 100%);
  border-color: #20202e;
  position: relative;
  border-style: solid;
  border-width: 1.5px;
}

/* Bright yellow outer border/glow for SM */
.rack-device.fiber-panel.sm {
  border-color: rgba(255, 235, 59, 0.45);
  box-shadow: 0 0 12px rgba(255, 235, 59, 0.15), inset 0 1px 2px rgba(255, 235, 59, 0.05);
}

/* Bright aqua outer border/glow for MM */
.rack-device.fiber-panel.mm {
  border-color: rgba(0, 242, 254, 0.45);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.15), inset 0 1px 2px rgba(0, 242, 254, 0.05);
}

/* Fiber Port Grid (Small adapter slots) */
.fiber-ports-grid {
  display: grid;
  gap: 3.5px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.05);
  margin-top: 3px;
  margin-bottom: 3px;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
}

.fiber-ports-grid.ports-24 {
  grid-template-columns: repeat(24, 1fr);
}

.fiber-ports-grid.ports-12 {
  grid-template-columns: repeat(12, 1fr);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* Fiber Port (Small circles/squares for ports in the Rack view) */
.rack-port.fiber-port {
  width: 9px;
  height: 9px;
  border-radius: 1.5px;
  background: #060608;
  border: 1px solid #1c1c24;
  position: relative;
  overflow: visible;
  transition: all 0.2s;
  cursor: pointer;
}

.rack-port.fiber-port:hover {
  border-color: var(--accent);
  box-shadow: 0 0 5px var(--accent);
}

/* LC Duplex internal slot details for Rack View - Stacked Vertically */
.rack-port.fiber-port.lc_duplex::before,
.rack-port.fiber-port.lc_duplex::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  left: 3px;
  border-radius: 50%;
}
.rack-port.fiber-port.lc_duplex::before { top: 1px; }
.rack-port.fiber-port.lc_duplex::after { bottom: 1px; }

/* LC Quad internal slot details for Rack View - 2x2 Stacked Grid */
.rack-port.fiber-port.lc_quad::before,
.rack-port.fiber-port.lc_quad::after {
  content: '';
  position: absolute;
  width: 2.2px;
  height: 2.2px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  box-shadow: 0 4.5px 0 rgba(255, 255, 255, 0.2);
}
.rack-port.fiber-port.lc_quad::before { left: 1.5px; top: 1px; }
.rack-port.fiber-port.lc_quad::after { right: 1.5px; top: 1px; }

/* LC Simplex internal slot details for Rack View */
.rack-port.fiber-port.lc_simplex::before {
  content: '';
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.2);
  top: 3.2px;
  left: 3.2px;
  border-radius: 50%;
}

/* SC Duplex internal slot details for Rack View */
.rack-port.fiber-port.sc_duplex::before,
.rack-port.fiber-port.sc_duplex::after {
  content: '';
  position: absolute;
  width: 2.5px;
  height: 4.5px;
  background: rgba(255, 255, 255, 0.25);
  top: 2.2px;
  border-radius: 0.35px;
}
.rack-port.fiber-port.sc_duplex::before { left: 1.5px; }
.rack-port.fiber-port.sc_duplex::after { right: 1.5px; }

/* SC Simplex internal slot details for Rack View */
.rack-port.fiber-port.sc_simplex::before {
  content: '';
  position: absolute;
  width: 3.5px;
  height: 4.5px;
  background: rgba(255, 255, 255, 0.25);
  top: 2.2px;
  left: 2.7px;
  border-radius: 0.35px;
}

/* Color empty adapters internally by mode in Rack view */
.rack-port.fiber-port.sm::before,
.rack-port.fiber-port.sm::after {
  background: rgba(255, 235, 59, 0.6) !important;
}
.rack-port.fiber-port.mm::before,
.rack-port.fiber-port.mm::after {
  background: rgba(0, 242, 254, 0.6) !important;
}

/* Color empty LC Quad in Rack View by mode */
.rack-port.fiber-port.lc_quad.sm::before,
.rack-port.fiber-port.lc_quad.sm::after {
  background: rgba(255, 235, 59, 0.6) !important;
  box-shadow: 0 4.5px 0 rgba(255, 235, 59, 0.6) !important;
}
.rack-port.fiber-port.lc_quad.mm::before,
.rack-port.fiber-port.lc_quad.mm::after {
  background: rgba(0, 242, 254, 0.6) !important;
  box-shadow: 0 4.5px 0 rgba(0, 242, 254, 0.6) !important;
}

/* Glowing connector adapters in rack ports when plugged */
.rack-port.fiber-port.used.sm {
  background: #ffeb3b !important;
  box-shadow: 0 0 6px #ffeb3b, inset 0 1px 1px rgba(255,255,255,0.8);
  border-color: #ffd32a;
}
.rack-port.fiber-port.used.mm {
  background: #00f2fe !important;
  box-shadow: 0 0 6px #00f2fe, inset 0 1px 1px rgba(255,255,255,0.8);
  border-color: #00d2d3;
}

/* ────────────────────────────────────────────────────────── */
/* ─── FIBER CHASSIS VIEW (For Panels Tab) ──────────────── */
/* ────────────────────────────────────────────────────────── */

.rack-patch-panel-chassis.fiber-chassis {
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, #101017 0%, #060609 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 15px rgba(0,0,0,0.6);
}

.rack-patch-panel-chassis.fiber-chassis.sm {
  border-left: 4px solid #ffeb3b;
  border-right: 4px solid #ffeb3b;
}

.rack-patch-panel-chassis.fiber-chassis.mm {
  border-left: 4px solid #00f2fe;
  border-right: 4px solid #00f2fe;
}

.paper-label-strip.fiber-label-strip {
  background: rgba(255,255,255,0.02);
  border-bottom: 1.5px solid #1a1a24;
}

.pp-port-socket-container.fiber-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

/* Fiber Socket Wrapper */
.fiber-socket-wrapper {
  width: 28px;
  height: 28px;
  background: #050507;
  border: 1.5px solid #20202e;
  border-radius: 5px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.9), 0 1px 1px rgba(255,255,255,0.02);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fiber-socket-wrapper:hover {
  border-color: var(--accent);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(233,69,96,0.45);
  transform: translateY(-1.5px);
}

/* Highlight border of socket by fiber mode when connected */
.fiber-socket-wrapper.sm.used {
  border-color: rgba(255, 235, 59, 0.4);
}
.fiber-socket-wrapper.mm.used {
  border-color: rgba(0, 242, 254, 0.4);
}

/* Empty fiber adapters (LC/SC Simplex/Duplex) */
.fiber-empty-adapter {
  width: 18px;
  height: 16px;
  border-radius: 2px;
  position: relative;
  box-shadow: inset 0 2.5px 5px rgba(0,0,0,0.95);
  background: #0a0a0f;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* LC Duplex: Two small circular ports vertically stacked (Taj fo9 Taj) */
.fiber-empty-adapter.lc_duplex::before,
.fiber-empty-adapter.lc_duplex::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  position: absolute;
  left: 6px;
  background: #151520;
  border: 1px solid rgba(255,255,255,0.06);
}
.fiber-empty-adapter.lc_duplex::before { top: 2px; }
.fiber-empty-adapter.lc_duplex::after { bottom: 2px; }

/* LC Quad: 4 small circular ports in a 2x2 grid */
.fiber-empty-adapter.lc_quad::before,
.fiber-empty-adapter.lc_quad::after {
  content: '';
  position: absolute;
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: #151520;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 7px 0 #151520;
}
.fiber-empty-adapter.lc_quad::before { left: 2.5px; top: 1.5px; }
.fiber-empty-adapter.lc_quad::after { right: 2.5px; top: 1.5px; }

/* LC Simplex: One small circular port in the center */
.fiber-empty-adapter.lc_simplex::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #151520;
  border: 1px solid rgba(255,255,255,0.06);
}

/* SC Duplex: Two larger square ports inside (side-by-side) */
.fiber-empty-adapter.sc_duplex::before,
.fiber-empty-adapter.sc_duplex::after {
  content: '';
  width: 5.5px;
  height: 9px;
  border-radius: 1px;
  position: absolute;
  top: 3.5px;
  background: #151520;
  border: 1px solid rgba(255,255,255,0.06);
}
.fiber-empty-adapter.sc_duplex::before { left: 2px; }
.fiber-empty-adapter.sc_duplex::after { right: 2px; }

/* SC Simplex: One larger square port in the center */
.fiber-empty-adapter.sc_simplex::before {
  content: '';
  width: 7px;
  height: 9px;
  border-radius: 1px;
  background: #151520;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Color empty adapters internally by mode for high realism */
.fiber-empty-adapter.sm::before,
.fiber-empty-adapter.sm::after {
  border-color: rgba(255, 235, 59, 0.5) !important;
  background: rgba(255, 235, 59, 0.05);
}

.fiber-empty-adapter.mm::before,
.fiber-empty-adapter.mm::after {
  border-color: rgba(0, 242, 254, 0.5) !important;
  background: rgba(0, 242, 254, 0.05);
}

/* Color empty LC Quad adapters internally by mode with border ring shadows */
.fiber-empty-adapter.lc_quad.sm::before,
.fiber-empty-adapter.lc_quad.sm::after {
  border-color: rgba(255, 235, 59, 0.5) !important;
  box-shadow: 0 7px 0 #151520, 0 7px 0 1px rgba(255, 235, 59, 0.5);
}

.fiber-empty-adapter.lc_quad.mm::before,
.fiber-empty-adapter.lc_quad.mm::after {
  border-color: rgba(0, 242, 254, 0.5) !important;
  box-shadow: 0 7px 0 #151520, 0 7px 0 1px rgba(0, 242, 254, 0.5);
}

/* Plugged Fiber Cable Connector */
.fiber-plug-connector {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  position: relative;
  box-shadow: 0 3px 6px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all 0.2s;
}

/* SM Yellow plugged style */
.fiber-plug-connector.sm {
  background: linear-gradient(135deg, #ffee55 0%, #d4ac0d 100%);
  box-shadow: 0 0 12px rgba(255, 235, 59, 0.65), inset 0 1px 1px rgba(255,255,255,0.5);
}

/* MM Aqua plugged style */
.fiber-plug-connector.mm {
  background: linear-gradient(135deg, #00f2fe 0%, #11999e 100%);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.65), inset 0 1px 1px rgba(255,255,255,0.5);
}

/* Rubber boots for fiber connectors */
.fiber-plug-connector::before {
  content: '';
  position: absolute;
  width: 9px;
  height: 6px;
  background: inherit;
  border-radius: 1px;
  bottom: -4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(0,0,0,0.2);
}

/* Glowing Cable tail coming out of boot */
.fiber-plug-connector::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 24px;
  bottom: -27px;
  border-radius: 2px;
  background: inherit;
  filter: brightness(1.35) drop-shadow(0 0 4px currentColor);
  opacity: 0.95;
  z-index: -1;
  pointer-events: none;
}

/* Specific connector visual details for plugged state */
.fiber-plug-connector.lc_duplex::before,
.fiber-plug-connector.lc_quad::before,
.fiber-plug-connector.sc_duplex::before {
  width: 13px;
}

/* Smooth micro-animations for cords and ports */
@keyframes fiber-glow {
  0%, 100% { opacity: 0.85; filter: brightness(1.1) drop-shadow(0 0 4px currentColor); }
  50% { opacity: 1; filter: brightness(1.35) drop-shadow(0 0 8px currentColor); }
}

/* Interactive SVG Patch Cords Hover & Glow System */
.port-highlight-active {
  box-shadow: 0 0 12px var(--accent), 0 0 24px var(--accent) !important;
  border-color: var(--accent) !important;
  transform: scale(1.15) !important;
  z-index: 100 !important;
  position: relative !important;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Dim all paths except the hovered one */
.patch-cord-path.dimmed {
  opacity: 0.12 !important;
  filter: grayscale(85%) brightness(0.6) !important;
  stroke-width: 1px !important;
}

/* Neon glow for highlighted path */
.patch-cord-path.highlighted {
  opacity: 1 !important;
  stroke-width: 4.8px !important;
  filter: drop-shadow(0 0 8px currentColor) brightness(1.2) !important;
  animation: flow 0.6s linear infinite, pulse-glow 1.5s ease-in-out infinite !important; /* Fast flow + glow */
}

/* Apply neon glow effect to fiber optic cables in SVG overlay */
.patch-cord-path[stroke="#ffeb3b"], .patch-cord-path[stroke="#ffd32a"] {
  stroke-width: 3px !important;
  filter: drop-shadow(0 0 3px rgba(255, 235, 59, 0.8));
  animation: fiber-cable-pulse 2s infinite ease-in-out;
}

.patch-cord-path[stroke="#00f2fe"], .patch-cord-path[stroke="#00d2d3"] {
  stroke-width: 3px !important;
  filter: drop-shadow(0 0 3px rgba(0, 242, 254, 0.8));
  animation: fiber-cable-pulse 2s infinite ease-in-out;
}

@keyframes fiber-cable-pulse {
  0%, 100% { stroke-width: 2.5px; opacity: 0.85; }
  50% { stroke-width: 3.2px; opacity: 1; }
}

/* Fiber Strand Selection Tabs inside modal */
.strand-btn {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.strand-btn:hover {
  border-color: var(--accent);
  color: var(--text1);
}
.strand-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
  box-shadow: 0 0 10px rgba(233, 69, 96, 0.4);
}

/* ====================================================== */
/* 🌐 High-Fidelity Interactive Fiber Sleeves & Adapters */
/* ====================================================== */

/* General Sleeve Styling */
.fiber-sleeve {
  display: block;
  border-radius: 50%;
  position: relative;
  background: #191b22;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effect */
.fiber-sleeve:hover {
  transform: scale(1.3);
  border-color: var(--accent) !important;
  box-shadow: 0 0 8px var(--accent), inset 0 1px 2px rgba(255,255,255,0.2) !important;
  z-index: 10;
}

/* Active/Used state by Fiber Mode */
.sm .fiber-sleeve.used {
  background: #ffd32a !important;
  border-color: #ffeaa7 !important;
  box-shadow: 0 0 6px rgba(255, 211, 42, 0.8), inset 0 1px 2px rgba(255,255,255,0.8);
  animation: fiber-glow 1.5s infinite ease-in-out;
}

.mm .fiber-sleeve.used {
  background: #00d2d3 !important;
  border-color: #81ecec !important;
  box-shadow: 0 0 6px rgba(0, 210, 211, 0.8), inset 0 1px 2px rgba(255,255,255,0.8);
  animation: fiber-glow 1.5s infinite ease-in-out;
}

/* Issue State */
.fiber-sleeve.issue.used {
  background: #ff7675 !important;
  border-color: #ff8787 !important;
  box-shadow: 0 0 8px #ff7675, inset 0 1px 2px rgba(255,255,255,0.8) !important;
  animation: none !important;
}

/* ────────────────────────────────────────────────────── */
/* 1. RACK VIEW ADAPTERS & SLEEVES (.rack-port) */
/* ────────────────────────────────────────────────────── */

/* Rack Fiber Adapter Outer slot size override */
.rack-port.fiber-port-adapter {
  background: #050508 !important;
  border: 1.5px solid #20202e !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible !important;
}

.rack-port.fiber-port-adapter:hover {
  border-color: rgba(255,255,255,0.2) !important;
  transform: scale(1.15);
}

/* Duplex vertically stacked slots in Rack */
.rack-port.fiber-port-adapter.lc_duplex,
.rack-port.fiber-port-adapter.sc_duplex {
  width: 14px !important;
  height: 26px !important;
  margin-top: -8px !important;
  flex-direction: column !important;
  gap: 2.5px !important;
  padding: 3px 0 !important;
  border-radius: 3px !important;
}

.rack-port.fiber-port-adapter.lc_duplex .fiber-sleeve,
.rack-port.fiber-port-adapter.sc_duplex .fiber-sleeve {
  width: 8px !important;
  height: 8px !important;
}

/* Quad 2x2 grid slots in Rack */
.rack-port.fiber-port-adapter.lc_quad {
  width: 22px !important;
  height: 22px !important;
  margin-top: -6px !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 1fr 1fr !important;
  gap: 2px !important;
  padding: 3px !important;
  border-radius: 3px !important;
}

.rack-port.fiber-port-adapter.lc_quad .fiber-sleeve {
  width: 7px !important;
  height: 7px !important;
}

/* Simplex center slot in Rack */
.rack-port.fiber-port-adapter.lc_simplex,
.rack-port.fiber-port-adapter.sc_simplex {
  width: 16px !important;
  height: 16px !important;
  margin-top: -3px !important;
  border-radius: 3px !important;
}

.rack-port.fiber-port-adapter.lc_simplex .fiber-sleeve,
.rack-port.fiber-port-adapter.sc_simplex .fiber-sleeve {
  width: 10px !important;
  height: 10px !important;
}

/* ────────────────────────────────────────────────────── */
/* 2. PANELS GRID VIEW ADAPTERS & SLEEVES (.fiber-socket-wrapper) */
/* ────────────────────────────────────────────────────── */

/* Duplex vertically stacked slots in Panels Grid */
.fiber-socket-wrapper.lc_duplex,
.fiber-socket-wrapper.sc_duplex {
  flex-direction: column !important;
  gap: 3.5px !important;
  padding: 3px 0 !important;
  justify-content: center !important;
}

.fiber-socket-wrapper.lc_duplex .fiber-sleeve,
.fiber-socket-wrapper.sc_duplex .fiber-sleeve {
  width: 9px !important;
  height: 9px !important;
}

/* Quad 2x2 grid slots in Panels Grid */
.fiber-socket-wrapper.lc_quad {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 1fr 1fr !important;
  gap: 2.5px !important;
  padding: 4px !important;
}

.fiber-socket-wrapper.lc_quad .fiber-sleeve {
  width: 8px !important;
  height: 8px !important;
}

/* Simplex center slot in Panels Grid */
.fiber-socket-wrapper.lc_simplex,
.fiber-socket-wrapper.sc_simplex {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.fiber-socket-wrapper.lc_simplex .fiber-sleeve,
.fiber-socket-wrapper.sc_simplex .fiber-sleeve {
  width: 12px !important;
  height: 12px !important;
}

/* ────────────────────────────────────────────────────── */
/* 3. RTL OVERRIDE & MOBILE RACK VIEW ALIGNMENT REMEDIES   */
/* ────────────────────────────────────────────────────── */

/* Force strict Left-to-Right layout direction for Network components to match real-world hardware numbering */
.rack-scroll-wrapper, 
.rack-frame-outer, 
.rack-rails, 
.rack-units-container,
.rack-unit-wrapper, 
.rack-unit-inner, 
.rack-patch-panel-chassis,
.ports-24, 
.ports-48, 
.fiber-ports-grid, 
.rack-switch-ports-grid, 
.pp-ports-row, 
.paper-label-strip, 
.pp-ports-group {
  direction: ltr !important;
  text-align: left !important;
}

/* Make sure the U numbers remain on the left and never mirror in RTL */
.rack-u-number {
  left: -22px !important;
  right: auto !important;
}

/* Remove margin-bottom and extra space for patch panel chassis when placed inside the Rack units */
.rack-unit-inner .rack-patch-panel-chassis {
  margin-bottom: 0 !important;
  border-radius: 0 !important;
  height: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  background: linear-gradient(180deg, #18181c 0%, #0e0e10 100%) !important;
}

/* Hide the silver metallic ears of patch panels inside the rack so they align perfectly flush with switches and Cable Organizers */
.rack-unit-inner .pp-ear-left, 
.rack-unit-inner .pp-ear-right {
  display: none !important;
}

/* Let the port area occupy full width and prevent scrollbars inside the rack */
.rack-unit-inner .pp-port-area {
  padding: 2px 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Compact the label strip and ports inside the rack to fit elegantly within the 44px 1U slot height */
.rack-unit-inner .paper-label-strip {
  height: 10px !important;
  font-size: 8px !important;
  padding: 0 !important;
  margin-bottom: 2px !important;
  width: 100% !important;
  min-width: 0 !important; /* CRITICAL: Override the 750px min-width to prevent rack container overflow! */
}

.rack-unit-inner .label-strip-cell {
  font-size: 7px !important;
  line-height: 10px !important;
}

.rack-unit-inner .pp-ports-row {
  height: 24px !important;
  margin-top: 0 !important;
  min-width: 0 !important; /* CRITICAL: Override the 750px min-width to prevent rack container overflow! */
  width: 100% !important;
}

.rack-unit-inner .pp-port-socket-container {
  gap: 1px !important;
}

.rack-unit-inner .rj45-socket-wrapper {
  width: 16px !important;
  height: 16px !important;
}

.rack-unit-inner .rj45-port-number-lbl {
  font-size: 6px !important;
  margin-top: 1px !important;
}

/* Switch port sizing overrides to fit beautifully and align with patch panels */
.rack-unit-inner .rack-switch-ports-grid {
  gap: 2px !important;
  padding: 2px 4px !important;
  height: 24px !important;
  align-items: center !important;
}

.rack-unit-inner .switch-socket-wrapper {
  width: 12px !important;
  height: 12px !important;
}

.rack-unit-inner .switch-empty-socket {
  width: 7px !important;
  height: 7px !important;
}

.rack-unit-inner .switch-connector-plug {
  width: 8px !important;
  height: 8px !important;
}

/* Compact fiber chassis elements when rendered inside the rack U slots */
.rack-unit-inner .fiber-socket-wrapper {
  width: 18px !important;
  height: 18px !important;
}

.rack-unit-inner .rack-port.fiber-port-adapter.lc_duplex,
.rack-unit-inner .rack-port.fiber-port-adapter.sc_duplex,
.rack-unit-inner .fiber-socket-wrapper.lc_duplex,
.rack-unit-inner .fiber-socket-wrapper.sc_duplex {
  width: 12px !important;
  height: 20px !important;
  margin-top: 0 !important;
  padding: 1px 0 !important;
  gap: 1.5px !important;
}

.rack-unit-inner .rack-port.fiber-port-adapter.lc_duplex .fiber-sleeve,
.rack-unit-inner .rack-port.fiber-port-adapter.sc_duplex .fiber-sleeve,
.rack-unit-inner .fiber-socket-wrapper.lc_duplex .fiber-sleeve,
.rack-unit-inner .fiber-socket-wrapper.sc_duplex .fiber-sleeve {
  width: 6px !important;
  height: 6px !important;
}

.rack-unit-inner .rack-port.fiber-port-adapter.lc_quad,
.rack-unit-inner .fiber-socket-wrapper.lc_quad {
  width: 18px !important;
  height: 18px !important;
  margin-top: 0 !important;
  gap: 1.5px !important;
  padding: 2px !important;
}

.rack-unit-inner .rack-port.fiber-port-adapter.lc_quad .fiber-sleeve,
.rack-unit-inner .fiber-socket-wrapper.lc_quad .fiber-sleeve {
  width: 5px !important;
  height: 5px !important;
}

.rack-unit-inner .rack-port.fiber-port-adapter.lc_simplex,
.rack-unit-inner .rack-port.fiber-port-adapter.sc_simplex,
.rack-unit-inner .fiber-socket-wrapper.lc_simplex,
.rack-unit-inner .fiber-socket-wrapper.sc_simplex {
  width: 14px !important;
  height: 14px !important;
  margin-top: 0 !important;
}

.rack-unit-inner .rack-port.fiber-port-adapter.lc_simplex .fiber-sleeve,
.rack-unit-inner .rack-port.fiber-port-adapter.sc_simplex .fiber-sleeve,
.rack-unit-inner .fiber-socket-wrapper.lc_simplex .fiber-sleeve,
.rack-unit-inner .fiber-socket-wrapper.sc_simplex .fiber-sleeve {
  width: 8px !important;
  height: 8px !important;
}

/* Force vertical column stacking for 48-port stacked chassis within rack U slots */
.rack-unit-inner {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: stretch !important;
  overflow: hidden !important;
  height: 100% !important;
}

/* Fix mobile viewport overflow by forcing the scrollable wrapper behavior */
@media (max-width: 768px) {
  .rack-scroll-wrapper {
    overflow-x: auto !important;
    display: block !important;
    width: 100% !important;
  }
  .rack-frame-outer {
    width: fit-content !important;
    min-width: 660px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
}

/* ─── DESKTOP SWITCH SHELF & HIGH FIDELITY SFP STYLES ─── */
.rack-shelf-container {
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.35) !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  /* Dark textured steel tray shelf floor at the bottom of the slot */
  border-bottom: 3.5px solid #3c3c4a !important;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.6) !important;
}

/* Make shelf switches occupy centered smaller width f.e. 60%-70% of rack and hover beautifully */
.rack-shelf-container .rack-device.switch.shelf-mounted {
  width: 65% !important;
  height: 38px !important;
  border-radius: 4px !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.95), inset 0 1px 0 rgba(255,255,255,0.05) !important;
  border: 1.5px solid #32373e !important;
  margin: 0 auto !important;
  background: linear-gradient(180deg, #202428 0%, #121417 100%) !important;
}

/* Switch SFP cages */
.switch-sfp-ports-container {
  display: flex !important;
  gap: 3px !important;
  align-items: center !important;
  background: #09090b !important;
  padding: 2px 4px !important;
  border-radius: 3px !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  height: 24px !important;
}

.switch-sfp-port {
  width: 12px !important;
  height: 12px !important;
  background: linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%) !important;
  border: 1.2px solid #5c677d !important;
  border-radius: 2px !important;
  position: relative !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.switch-sfp-port::after {
  content: '' !important;
  width: 4px !important;
  height: 4px !important;
  background: #3a4150 !important;
  border-radius: 50% !important;
  display: block !important;
  transition: all 0.2s ease !important;
}

.switch-sfp-port.used {
  border-color: #2ecc71 !important;
  box-shadow: 0 0 6px rgba(46, 204, 113, 0.6) !important;
  background: linear-gradient(135deg, #10393c 0%, #082d2c 100%) !important;
}
.switch-sfp-port.used::after {
  background: #2ecc71 !important;
  box-shadow: 0 0 4px #2ecc71 !important;
}

.switch-sfp-port.issue {
  border-color: #e94560 !important;
  box-shadow: 0 0 8px rgba(233, 69, 96, 0.8) !important;
  background: linear-gradient(135deg, #4c1130 0%, #30061c 100%) !important;
}
.switch-sfp-port.issue::after {
  background: #e94560 !important;
  box-shadow: 0 0 4px #e94560 !important;
}

/* Custom styling for SFP buttons inside wizard & edit port selector grid */
.wizard-port-btn.sfp-port-btn {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  border-color: #3b82f6 !important;
  color: #60a5fa !important;
  font-weight: bold !important;
  font-size: 8px !important;
}
.wizard-port-btn.sfp-port-btn.selected {
  background: #3b82f6 !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.8) !important;
}
.wizard-port-btn.sfp-port-btn.occupied {
  border-color: #27ae60 !important;
  background: #27ae6022 !important;
  color: #2ecc71 !important;
}
.wizard-port-btn.sfp-port-btn.invalid-medium {
  opacity: 0.25 !important;
  cursor: not-allowed !important;
  border-color: rgba(255,255,255,0.05) !important;
  color: #555 !important;
  background: transparent !important;
}

/* invalid-medium style for standard RJ45 button as well */
.wizard-port-btn.invalid-medium {
  opacity: 0.25 !important;
  cursor: not-allowed !important;
  border-color: rgba(255,255,255,0.05) !important;
  color: #555 !important;
  background: transparent !important;
}

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

/* Realistic Mini RJ45 Sockets for Switch Ports */
.switch-socket-wrapper {
  width: 14px;
  height: 14px;
  background: #18191e;
  border: 1px solid #7f8c8d; /* Realistic steel/metallic shielding border */
  border-radius: 2px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.85), 0 1px 0 rgba(255,255,255,0.15); /* Top shine and deep inner shadow */
  cursor: pointer;
  transition: all 0.2s;
}
.switch-socket-wrapper:hover {
  border-color: #dfe6e9; /* Brighter metallic shine on hover */
  background: #202229;
}
.switch-socket-wrapper.used {
  border-color: var(--conn-color);
  box-shadow: 0 0 8px var(--conn-color), inset 0 1px 2px rgba(0,0,0,0.5); /* Glow of active connection */
}
.switch-socket-wrapper.issue {
  border-color: var(--accent) !important;
  box-shadow: 0 0 10px var(--accent) !important;
}
.switch-empty-socket {
  width: 8px;
  height: 8px;
  background: #09090c; /* Deep hollow opening */
  border-radius: 1px;
  box-shadow: inset 0 1.5px 3px rgba(0,0,0,0.95);
  position: relative;
}
/* Ultra-realistic Gold Pins representation inside empty sockets */
.switch-empty-socket::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 1px;
  background: linear-gradient(90deg, #d3b03b 20%, transparent 20%, transparent 40%, #d3b03b 40%, transparent 40%, transparent 60%, #d3b03b 60%, transparent 60%, transparent 80%, #d3b03b 80%);
  top: 1.5px;
  left: 1px;
  opacity: 0.85;
}
.switch-connector-plug {
  width: 10px;
  height: 10px;
  border-radius: 1.5px;
  background: var(--conn-color);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 1px 3px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.45);
  position: relative;
}
.switch-connector-plug::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255,255,255,0.45);
  top: 1px;
  left: 1px;
  border-radius: 50%;
}

/* Premium Styling for Allowed Devices Dual List Selector */
.dual-device-item {
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
  user-select: none !important;
}
.dual-device-item:hover {
  transform: translateY(-1.5px) !important;
  background: rgba(255,255,255,0.06) !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35) !important;
}
.dual-device-item.active:hover {
  border-color: rgba(46, 204, 113, 0.5) !important;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.15) !important;
}
.dual-device-item.available:hover {
  border-color: rgba(255,255,255,0.15) !important;
}
.allowed-devices-dual-layout .dual-column {
  display: flex;
  flex-direction: column;
}
.allowed-devices-dual-layout .dual-column span {
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.1px;
}

/* Enable mobile horizontal scroll/swipe for switches f-الـ Switches tab */
#tab-switches .rack-device.switch,
#tab-switches .rack-device.core-switch,
#tab-switches .rack-device.firewall {
  min-width: 680px !important;
  width: 680px !important;
  flex-shrink: 0 !important;
  margin: 0 auto !important;
}

/* Specific styling to ensure perfect LTR scroll boundaries */
.switch-tab-scroll-wrapper::-webkit-scrollbar {
  height: 5px;
}
.switch-tab-scroll-wrapper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}
.switch-tab-scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.switch-tab-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --- High-Fidelity Interactive Ports for Routers, PABX, UPS, NAS --- */
.router-port {
  width: 14px;
  height: 14px;
  background: #000;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.router-port:hover {
  border-color: #ff79c6;
  box-shadow: 0 0 6px rgba(255, 121, 198, 0.6);
  transform: scale(1.15);
}
.router-port.used {
  background: var(--conn-color, #ff79c6);
  border-color: var(--conn-color, #ff79c6);
}
.router-port .port-indicator {
  position: absolute;
  bottom: -9px;
  font-size: 4px;
  color: #8e8e9e;
  font-family: monospace;
  white-space: nowrap;
  pointer-events: none;
}
/* WAN specific style */
.router-port.wan:hover {
  border-color: #ff5555;
  box-shadow: 0 0 6px rgba(255, 85, 85, 0.8);
}
/* LAN specific style */
.router-port.lan:hover {
  border-color: #00a8ff;
  box-shadow: 0 0 6px rgba(0, 168, 255, 0.8);
}

/* Analog Telephone Port (RJ11 green/grey style) */
.router-port.analog-port {
  border-color: rgba(46, 204, 113, 0.3);
  background: #1e1e24;
}
.router-port.analog-port:hover {
  border-color: #2ecc71;
  box-shadow: 0 0 6px rgba(46, 204, 113, 0.8);
}

/* UPS outlets (C13 socket design) */
.ups-outlet-socket {
  width: 18px;
  height: 14px;
  background: #111;
  border: 1.5px solid #3c3c44;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2.5px 0;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
}
.ups-outlet-socket:hover {
  border-color: #e1b12c;
  box-shadow: 0 0 8px rgba(225, 177, 44, 0.8);
  transform: scale(1.1);
}
.ups-outlet-socket.used {
  border-color: #e1b12c;
  background: #222;
  box-shadow: 0 0 5px rgba(225, 177, 44, 0.4);
}
.ups-outlet-socket .outlet-hole {
  width: 2.5px;
  height: 2.5px;
  background: #000;
  border-radius: 50%;
}
.ups-outlet-socket .outlet-hole.hole1 {
  width: 3.5px;
  height: 2px;
  border-radius: 1px;
}
.ups-outlet-socket .outlet-hole.hole2 {
  margin-top: 1px;
}

/* PoE port indicator overlay */
.switch-socket-wrapper.poe-port::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 3px;
  background: #ff9f43;
  border-radius: 50%;
  box-shadow: 0 0 2px #ff9f43;
}

/* ─── CASCADE PATH VISUALIZER ─── */
.cascade-flow-visualizer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  direction: ltr !important;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
  position: relative;
  min-width: 80px;
}

.step-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #181922;
  border: 2px solid var(--border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.flow-step:hover .step-icon {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.step-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text1);
  margin-top: 8px;
  word-break: break-all;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-sub {
  font-size: 8px;
  font-weight: 600;
  color: var(--text2);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flow-connector {
  flex: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
}

.connector-line {
  height: 3px;
  width: 100%;
  position: relative;
  border-radius: 2px;
}

.connector-line.fiber-sm {
  background: #ffeb3b;
  box-shadow: 0 0 8px #ffeb3b;
}

.connector-line.fiber-mm {
  background: #00f2fe;
  box-shadow: 0 0 8px #00f2fe;
}

.connector-line.patch-cord {
  background: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
}

.connector-line::after {
  content: '▶';
  position: absolute;
  right: -5px;
  top: -4px;
  font-size: 8px;
  color: inherit;
  text-shadow: 0 0 4px currentColor;
}

/* Blinking Warning Icon Overlay for problematic ports */
.rj45-socket-wrapper.used.issue::before,
.rj45-socket-wrapper.issue::before,
.switch-socket-wrapper.issue::before,
.switch-sfp-port.issue::before,
.fiber-sleeve.issue::before,
.router-port-wrapper.issue::before {
  content: "⚠️";
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 9px;
  line-height: 1;
  z-index: 100;
  animation: blink 0.8s infinite alternate;
  pointer-events: none;
  text-shadow: 0 0 4px #e94560, 0 0 2px #000;
}





