/* ============================================================
   Bank AMS — Design System v6 (FINAL - Cleaned)
   ============================================================ */

:root, [data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-2: #0f1524;
  --bg-elev: #111827;
  --bg-glass: rgba(17, 24, 39, 0.72);
  --bg-glass-strong: rgba(15, 21, 36, 0.95);

  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text:        #e5e7eb;
  --text-strong: #f8fafc;
  --text-muted:  #cbd5e1;
  --text-dim:    #94a3b8;

  --accent: #22d3ee;
  --accent-2: #6366f1;
  --accent-3: #f472b6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --shadow-lg: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 4px 12px -4px rgba(0, 0, 0, 0.4);
  --row-hover: rgba(34, 211, 238, 0.06);
  --row-stripe: rgba(148, 163, 184, 0.02);
}

[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-2: #eef2f9;
  --bg-elev: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-strong: rgba(255, 255, 255, 0.98);

  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);

  --text:        #0f172a;
  --text-strong: #020617;
  --text-muted:  #475569;
  --text-dim:    #94a3b8;

  --accent: #0891b2;
  --accent-2: #4f46e5;
  --accent-3: #db2777;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;

  --shadow-lg: 0 20px 50px -20px rgba(15, 23, 42, 0.15);
  --shadow-sm: 0 4px 12px -4px rgba(15, 23, 42, 0.08);
  --row-hover: rgba(8, 145, 178, 0.06);
  --row-stripe: rgba(15, 23, 42, 0.015);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ Topbar ============ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
  transition: all .3s;
}
.topbar-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}
.topbar-search i { color: var(--text-muted); }
.topbar-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  width: 100%;
  font-size: 14px;
}
.topbar-search input::placeholder { color: var(--text-dim); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-strong);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand i { color: var(--accent); font-size: 26px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all .2s;
}
.icon-btn:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: var(--border-strong);
  color: var(--accent);
  transform: translateY(-1px);
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
  font-weight: 500;
}
.profile-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  border-color: var(--border);
}

.avatar-sm, .avatar-xl {
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; margin: 0 auto; }

/* ============ Sidebar ============ */
.sidebar {
  position: fixed;
  top: 64px;
  bottom: 0;
  left: 0;
  width: 240px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  overflow-y: auto;
  transition: transform .3s ease;
  z-index: 900;
}
.sidebar.collapsed { transform: translateX(-100%); }

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.nav-link i { font-size: 18px; }
.nav-link:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-strong);
  transform: translateX(4px);
}
.nav-link.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.15), rgba(99, 102, 241, 0.08));
  color: var(--accent);
  font-weight: 600;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}
.sidebar-footer {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: var(--text-dim);
  font-size: 12px;
}

/* ============ Main Content ============ */
.main-content {
  margin-left: 240px;
  margin-top: 64px;
  padding: 28px 32px 80px;
  transition: margin .3s ease;
  min-height: calc(100vh - 64px);
  position: relative;
  z-index: 1;
}
.sidebar.collapsed ~ .main-content { margin-left: 0; }

/* ============ Page Header ============ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.025em;
  color: var(--text-strong) !important;
  line-height: 1.2;
}
.page-header p,
.page-header .text-muted,
.page-header small {
  color: var(--text-muted) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  margin: 0;
  opacity: 1 !important;
  line-height: 1.5;
}
.page-header code {
  color: var(--accent) !important;
  background: rgba(34, 211, 238, 0.12) !important;
  padding: 3px 10px !important;
  border-radius: 6px;
  font-size: 13px !important;
}

/* ============ Cards ============ */
.card-glass {
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: var(--shadow-lg);
  transition: all .3s;
  position: relative;
}
.card-glass:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.card-glass-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-glass-header h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}
.card-glass-header h5 i {
  color: var(--accent);
  font-size: 18px;
}

/* ============ Stat Cards ============ */
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 110px;
}
.stat-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
}
.card-gradient-1 { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.card-gradient-2 { background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%); }
.card-gradient-3 { background: linear-gradient(135deg, #10b981 0%, #22c55e 100%); }
.card-gradient-4 { background: linear-gradient(135deg, #f43f5e 0%, #ef4444 100%); }

.stat-card::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.stat-card::before {
  content: '';
  position: absolute;
  right: 20px;
  bottom: -40px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.stat-info { position: relative; z-index: 1; }
.stat-info span {
  font-size: 13px;
  opacity: 0.92;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-info h2 {
  font-size: 32px;
  font-weight: 800;
  margin: 6px 0 0;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ============ Tables ============ */
.table {
  color: var(--text) !important;
  background-color: transparent !important;
  margin-bottom: 0;
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
}
.table > :not(caption) > * > * {
  background-color: transparent !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}
.table thead th {
  color: var(--text-muted) !important;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-strong) !important;
  border-top: none !important;
  padding: 14px 16px;
  background: transparent !important;
}
.table tbody td {
  padding: 16px;
  font-size: 14px;
  vertical-align: middle;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.row-hover:hover > td {
  background: var(--row-hover) !important;
  color: var(--text-strong) !important;
}
.table td strong { color: var(--text-strong); font-weight: 600; }

.table .icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--accent) !important;
  transition: all .25s ease;
  text-decoration: none;
}
.table .icon-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0e1a !important;
  transform: translateY(-2px) scale(1.08);
}

/* ============ Badges & Code ============ */
.badge-soft {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(34, 211, 238, 0.2);
  display: inline-block;
}
[data-theme="light"] .badge-soft {
  background: rgba(8, 145, 178, 0.1);
  color: #0e7490;
  border-color: rgba(8, 145, 178, 0.2);
}
code, .ip-cell {
  background: rgba(148, 163, 184, 0.12);
  color: var(--accent);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  border: 1px solid var(--border);
}
[data-theme="light"] code,
[data-theme="light"] .ip-cell {
  background: rgba(8, 145, 178, 0.08);
  color: #0e7490;
}

/* ============ Buttons ============ */
.btn-glow {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff !important;
  border: none;
  padding: 11px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px -8px rgba(34, 211, 238, 0.5);
  text-decoration: none;
  white-space: nowrap;
}
.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(34, 211, 238, 0.7);
  color: #fff !important;
}

.btn-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.btn-link:hover { color: var(--accent-2); }

.btn-outline-secondary {
  color: var(--text) !important;
  border-color: var(--border-strong) !important;
  background: transparent !important;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 500;
}
.btn-outline-secondary:hover {
  background: rgba(148, 163, 184, 0.1) !important;
  border-color: var(--text-muted) !important;
  color: var(--text-strong) !important;
}

/* ============ EOL ============ */
.eol-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.eol-box {
  padding: 22px;
  border-radius: 14px;
  border: 1px solid var(--border);
  transition: transform .3s;
  text-align: center;
}
.eol-box:hover { transform: scale(1.03); }
.eol-box h3 {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.03em;
}
.eol-box span { color: var(--text-muted); font-size: 13px; }
.eol-box.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}
.eol-box.warning h3 { color: var(--warning); }
.eol-box.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}
.eol-box.danger h3 { color: var(--danger); }

/* ============ Agent List ============ */
.agent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agent-list li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.agent-list strong {
  display: block;
  font-size: 14px;
  color: var(--text-strong);
}
.agent-list small { color: var(--text-muted); font-size: 12px; }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-success {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  animation: pulse 2s infinite;
}
.dot-danger {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ============ Text utility ============ */
.text-muted {
  color: var(--text-muted) !important;
  opacity: 1 !important;
}
small, .small { color: var(--text-muted) !important; }
h1, h2, h3, h4, h5, h6 { color: var(--text-strong); }
strong, b { color: var(--text-strong); font-weight: 600; }

/* ============ Responsive ============ */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 24px 20px 60px; }
  .topbar-search { display: none; }
}
@media (max-width: 576px) {
  .main-content { padding: 16px 14px 40px; }
  .page-header h1 { font-size: 22px; }
  .stat-info h2 { font-size: 26px; }
  .eol-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MODAL — Backdrop dim, modal crisp
   ============================================================ */
.modal-backdrop {
  background-color: rgba(2, 5, 12, 0.85) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 99998 !important;
  pointer-events: none !important;
}
.modal-backdrop.show { opacity: 1 !important; }
[data-theme="light"] .modal-backdrop {
  background-color: rgba(15, 23, 42, 0.55) !important;
}

.modal { z-index: 99999 !important; }
.modal.show { z-index: 99999 !important; }
.modal-dialog {
  z-index: 100000 !important;
  pointer-events: auto !important;
}

/* ============================================================
   MODAL CONTENT — solid, bright, sharp
   ============================================================ */
#scanModal .modal-content.scan-modal {
  background: #0d1322 !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(34, 211, 238, 0.3) !important;
  border-radius: 20px !important;
  overflow: hidden;
  box-shadow:
    0 40px 100px -30px rgba(0, 0, 0, 1),
    0 0 120px -20px rgba(34, 211, 238, 0.4) !important;
  padding: 0;
  position: relative;
  z-index: 100001 !important;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1 !important;
  isolation: isolate;
}

[data-theme="light"] #scanModal .modal-content.scan-modal {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(8, 145, 178, 0.3) !important;
}

/* Kill ANY inherited filter on modal and descendants */
#scanModal,
#scanModal * {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ============ Modal Header ============ */
#scanModal .scan-modal-header {
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.28) 0%,
    rgba(99, 102, 241, 0.18) 50%,
    rgba(244, 114, 182, 0.12) 100%
  ) !important;
  border-bottom: 1px solid rgba(34, 211, 238, 0.4) !important;
  padding: 20px 24px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#scanModal .scan-modal-header .modal-title {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 17px;
  margin: 0;
}
[data-theme="light"] #scanModal .scan-modal-header .modal-title {
  color: #0f172a !important;
}
#scanModal .scan-modal-header small {
  color: #cbd5e1 !important;
  font-size: 12.5px;
  font-weight: 500;
  display: block;
  margin-top: 2px;
}
[data-theme="light"] #scanModal .scan-modal-header small {
  color: #475569 !important;
}
#scanModal .scan-modal-header .btn-close {
  filter: invert(1) brightness(1.5);
  opacity: 0.85;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-size: 14px;
  cursor: pointer;
  pointer-events: auto !important;
}
#scanModal .scan-modal-header .btn-close:hover {
  opacity: 1;
  background-color: rgba(239, 68, 68, 0.2);
}
[data-theme="light"] #scanModal .scan-modal-header .btn-close {
  filter: none;
  opacity: 0.55;
}

/* ============ Radar icon in header ============ */
.scan-icon-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 8px 24px -8px rgba(34, 211, 238, 0.8);
}
.scan-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 2px solid #22d3ee;
  opacity: 0;
  animation: scanPulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes scanPulse {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ============ Modal Body ============ */
#scanModal .scan-modal-body {
  background: #0d1322 !important;
  color: #e5e7eb !important;
  padding: 26px 24px !important;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}
[data-theme="light"] #scanModal .scan-modal-body {
  background: #ffffff !important;
  color: #0f172a !important;
}

/* ============ Modal Footer ============ */
#scanModal .scan-modal-footer {
  background: #0d1322 !important;
  border-top: 1px solid rgba(34, 211, 238, 0.3) !important;
  padding: 16px 24px !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  pointer-events: auto !important;
}
[data-theme="light"] #scanModal .scan-modal-footer {
  background: #f8fafc !important;
}
#scanModal .scan-modal-footer small { color: #cbd5e1 !important; }
[data-theme="light"] #scanModal .scan-modal-footer small { color: #475569 !important; }

/* ============ Modal buttons ============ */
#scanModal #scan-done-btn {
  background: linear-gradient(135deg, #22d3ee, #6366f1) !important;
  color: #fff !important;
  border: none !important;
  padding: 11px 24px !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  box-shadow: 0 8px 30px -8px rgba(34, 211, 238, 0.9) !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 100010 !important;
}
#scanModal #scan-done-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px -8px rgba(34, 211, 238, 1) !important;
}

#scanModal #scan-view-results {
  background: rgba(34, 211, 238, 0.12) !important;
  color: #67e8f9 !important;
  border: 1px solid rgba(34, 211, 238, 0.5) !important;
  padding: 11px 20px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer !important;
  pointer-events: auto !important;
  text-decoration: none;
  position: relative;
  z-index: 100010 !important;
}
#scanModal #scan-view-results:hover {
  background: rgba(34, 211, 238, 0.25) !important;
  color: #ffffff !important;
  border-color: #22d3ee !important;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.6);
}
[data-theme="light"] #scanModal #scan-view-results {
  color: #0e7490 !important;
  border-color: rgba(8, 145, 178, 0.4) !important;
  background: rgba(8, 145, 178, 0.08) !important;
}

#scanModal button,
#scanModal a.btn,
#scanModal .btn,
#scanModal .btn-glow,
#scanModal .btn-close {
  position: relative;
  z-index: 100010 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* ============================================================
   SCAN MODAL — Radar + Progress + Feed
   ============================================================ */
.scan-visual-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 12px 0 26px;
  border-bottom: 1px solid rgba(34, 211, 238, 0.15);
  margin-bottom: 24px;
}

.radar-container {
  position: relative;
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.radar-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(34, 211, 238, 0.15) 0%,
    rgba(34, 211, 238, 0.04) 60%,
    transparent 100%
  );
  border: 2px solid rgba(34, 211, 238, 0.6);
  overflow: hidden;
  box-shadow:
    inset 0 0 50px rgba(34, 211, 238, 0.35),
    0 0 60px rgba(34, 211, 238, 0.5);
}

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(34, 211, 238, 0.7) 0deg,
    rgba(34, 211, 238, 0.25) 40deg,
    transparent 90deg
  );
  animation: radarSweep 2.4s linear infinite;
  mask-image: radial-gradient(circle, black 60%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle, black 60%, transparent 100%);
}
@keyframes radarSweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.radar-ring-outer,
.radar-ring-inner {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, 0.3);
  pointer-events: none;
}
.radar-ring-outer { inset: 18%; }
.radar-ring-inner { inset: 40%; }

.radar-grid::before,
.radar-grid::after {
  content: '';
  position: absolute;
  background: rgba(34, 211, 238, 0.25);
  pointer-events: none;
}
.radar-grid::before {
  left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%);
}
.radar-grid::after {
  top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%);
}

.radar-blip {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 12px #22d3ee, 0 0 24px rgba(34, 211, 238, 0.7);
  opacity: 0;
  animation: blipPulse 2s ease-in-out infinite;
}
@keyframes blipPulse {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50%      { opacity: 1; transform: scale(1);   }
}

.radar-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #67e8f9;
  font-size: 32px;
  text-shadow:
    0 0 20px rgba(34, 211, 238, 1),
    0 0 40px rgba(34, 211, 238, 0.6);
  animation: radarCenterPulse 2s ease-in-out infinite;
}
@keyframes radarCenterPulse {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%      { transform: scale(1.15); opacity: 0.85; }
}

.radar-progress {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  transform: rotate(-90deg);
  pointer-events: none;
}
.radar-progress-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.15);
  stroke-width: 2;
}
.radar-progress-fill {
  fill: none;
  stroke: #22d3ee;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset .5s ease;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.9));
}

.scan-visual-status { flex: 1; min-width: 0; }

.scan-percent-big {
  font-size: 52px;
  font-weight: 900;
  color: #67e8f9;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 40px rgba(34, 211, 238, 0.9),
    0 0 80px rgba(34, 211, 238, 0.4);
  margin-bottom: 10px;
}
[data-theme="light"] .scan-percent-big {
  color: #0891b2;
  text-shadow: 0 0 30px rgba(8, 145, 178, 0.4);
}

#scan-status.scan-status-text {
  font-size: 16px !important;
  color: #ffffff !important;
  font-weight: 600;
  margin-bottom: 8px;
}
[data-theme="light"] #scan-status.scan-status-text {
  color: #0f172a !important;
}

.scan-subnet-label {
  font-size: 13px;
  color: #94a3b8;
}
.scan-subnet-label i {
  color: #22d3ee;
  margin-right: 4px;
}

.scan-counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.scan-counter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(34, 211, 238, 0.1) !important;
  border: 1px solid rgba(34, 211, 238, 0.35) !important;
  border-radius: 14px;
  transition: all .3s;
  box-shadow: 0 4px 20px -4px rgba(34, 211, 238, 0.25);
}
.scan-counter:hover {
  border-color: #22d3ee !important;
  transform: translateY(-2px);
  background: rgba(34, 211, 238, 0.15) !important;
}
[data-theme="light"] .scan-counter {
  background: rgba(8, 145, 178, 0.05) !important;
  border-color: rgba(8, 145, 178, 0.25) !important;
}
.scan-counter-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22d3ee, #6366f1) !important;
  color: #fff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -6px rgba(34, 211, 238, 0.8);
}
.scan-counter-value {
  font-size: 24px !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
}
[data-theme="light"] .scan-counter-value {
  color: #0f172a !important;
  text-shadow: none;
}
.scan-counter-label {
  font-size: 11px !important;
  color: #cbd5e1 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-top: 4px;
}
[data-theme="light"] .scan-counter-label { color: #475569 !important; }

.scan-counter.pulse {
  animation: counterPulse 0.5s ease;
}
@keyframes counterPulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6); }
  50%  { transform: scale(1.04); box-shadow: 0 0 0 14px rgba(34, 211, 238, 0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0);   }
}

.scan-log-wrap {
  background: #050810 !important;
  border: 1px solid rgba(34, 211, 238, 0.35) !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.6),
    0 0 50px -20px rgba(34, 211, 238, 0.5);
}
.scan-log-header {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #67e8f9 !important;
  background: rgba(34, 211, 238, 0.12);
  border-bottom: 1px solid rgba(34, 211, 238, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.scan-log {
  max-height: 240px;
  min-height: 120px;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.8;
  color: #cbd5e1;
}
.scan-log-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 2px;
  color: #cbd5e1 !important;
  animation: deviceFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.scan-log-line.success {
  color: #34d399 !important;
  font-weight: 700 !important;
}
.scan-log-line.error { color: #f87171 !important; }
.scan-log-line.info { color: #67e8f9 !important; }
@keyframes deviceFadeIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.device-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  flex-shrink: 0;
}
.device-icon.desktop  { background: rgba(34, 211, 238, 0.2); color: #22d3ee; }
.device-icon.laptop   { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.device-icon.printer  { background: rgba(244, 114, 182, 0.2); color: #f472b6; }
.device-icon.scanner  { background: rgba(244, 114, 182, 0.2); color: #f472b6; }
.device-icon.server   { background: rgba(239, 68, 68, 0.2);  color: #ef4444; }
.device-icon.switch   { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.device-icon.router   { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.device-icon.atm      { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.device-icon.monitor  { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.device-icon.unknown  { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

.device-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-text strong { color: #67e8f9 !important; font-weight: 700 !important; }
.device-text span { color: #cbd5e1 !important; }

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  margin-left: auto;
  animation: liveDotBlink 1s ease-in-out infinite;
}
@keyframes liveDotBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #ef4444; }
  50%      { opacity: 0.3; box-shadow: none; }
}

.confetti-container {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 100;
}
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -20px;
  animation: confettiFall 2s ease-in forwards;
}
@keyframes confettiFall {
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to   { transform: translateY(600px) rotate(720deg); opacity: 0; }
}

@media (max-width: 640px) {
  .scan-visual-header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  .radar-container { width: 130px; height: 130px; }
  .scan-percent-big { font-size: 40px; }
  .scan-counters { grid-template-columns: 1fr; }
  #scanModal .scan-modal-header { padding: 16px 18px !important; }
  #scanModal .scan-modal-body { padding: 20px 18px !important; }
  #scanModal .scan-modal-footer { flex-direction: column; gap: 12px; }
}

/* ============================================================
   Kill blur propagation from topbar/sidebar while modal is open
   ============================================================ */
body.modal-open .topbar,
body.modal-open .sidebar,
body.modal-open .stat-icon,
body.modal-open .dropdown-menu {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ============================================================
   FORM CONTROLS + FILTER BAR — restored
   ============================================================ */

.form-control, .form-select {
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  transition: all .3s;
}
.form-control:focus, .form-select:focus {
  background: rgba(34, 211, 238, 0.04);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
  color: var(--text);
  outline: none;
}
.form-control::placeholder { color: var(--text-dim); }
.form-select option {
  background: var(--bg-elev);
  color: var(--text);
}

.input-group-animated {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0;
}
.input-group-animated i {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}
.input-group-animated .form-control,
.input-group-animated input {
  width: 100%;
  padding: 11px 16px 11px 46px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all .3s;
}
.input-group-animated .form-control:focus,
.input-group-animated input:focus {
  border-color: var(--accent);
  background: rgba(34, 211, 238, 0.04);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.filter-bar .input-group-animated {
  flex: 1;
  min-width: 240px;
  margin: 0;
}
.filter-bar select {
  max-width: 240px;
  min-width: 180px;
}
.filter-bar .btn-glow {
  flex-shrink: 0;
}
/* ============================================================
   ASSET DETAIL PAGE — Beautiful redesign
   ============================================================ */

/* ---------- Hero Header ---------- */
.asset-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  margin-bottom: 24px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.08) 0%,
    rgba(99, 102, 241, 0.06) 50%,
    rgba(244, 114, 182, 0.04) 100%
  );
  border: 1px solid rgba(34, 211, 238, 0.2);
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
}

.asset-hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -50px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.15), transparent 70%);
  pointer-events: none;
}

.asset-hero-left {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1;
  min-width: 0;
}

.asset-hero-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 40px;
  flex-shrink: 0;
  box-shadow:
    0 12px 32px -8px rgba(34, 211, 238, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 1;
}

.asset-hero-icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 26px;
  border: 2px solid rgba(34, 211, 238, 0.3);
  animation: heroPulse 3s ease-in-out infinite;
}

@keyframes heroPulse {
  0%, 100% { transform: scale(1);   opacity: 0.5; }
  50%      { transform: scale(1.05); opacity: 0.2; }
}

.asset-hero-info {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.asset-hero-info h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  word-break: break-word;
}

.asset-hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.asset-hero-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.asset-hero-meta .status-online {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}
.asset-hero-meta .status-online i {
  font-size: 8px;
  animation: pulse 2s infinite;
}

.asset-hero-meta .status-offline {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.25);
}
.asset-hero-meta .status-offline i {
  font-size: 8px;
}

.asset-hero-meta .status-class {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}
.asset-hero-meta .classification-high {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.asset-hero-meta .classification-medium {
  background: rgba(34, 211, 238, 0.15);
  color: #22d3ee;
  border-color: rgba(34, 211, 238, 0.3);
}
.asset-hero-meta .classification-low {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.asset-hero-actions {
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.btn-icon-action {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all .25s;
  text-decoration: none;
}
.btn-icon-action:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0e1a;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(34, 211, 238, 0.6);
}

/* ---------- Detail Grid ---------- */
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px dashed var(--border);
  gap: 16px;
  transition: background .2s;
  border-radius: 8px;
}
.detail-row:hover {
  background: rgba(34, 211, 238, 0.04);
  padding-left: 12px;
  padding-right: 12px;
}
.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.detail-label i {
  color: var(--accent);
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.detail-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  text-align: right;
  word-break: break-word;
}

/* ---------- Timeline ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 46px;
  bottom: -8px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--border-strong) 0%,
    var(--border) 100%
  );
}

.timeline-dot {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.25);
  position: relative;
  z-index: 1;
}
.dot-purchase { background: rgba(99, 102, 241, 0.15); color: #818cf8; border-color: rgba(99, 102, 241, 0.3); }
.dot-warranty { background: rgba(16, 185, 129, 0.15); color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.dot-eol      { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
.dot-eos      { background: rgba(239, 68, 68, 0.15);  color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.dot-created  { background: rgba(34, 211, 238, 0.15); color: #22d3ee; border-color: rgba(34, 211, 238, 0.3); }
.dot-user     { background: rgba(244, 114, 182, 0.15); color: #f472b6; border-color: rgba(244, 114, 182, 0.3); }

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
  flex: 1;
  min-width: 0;
}

.timeline-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.timeline-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.pill-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ---------- Specs Grid (Computer Details) ---------- */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.spec-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all .3s;
}
.spec-card:hover {
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(34, 211, 238, 0.3);
}

.spec-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.spec-icon-cyan   { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }
.spec-icon-blue   { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.spec-icon-purple { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.spec-icon-green  { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.spec-icon-amber  { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.spec-icon-rose   { background: rgba(244, 114, 182, 0.15); color: #f472b6; }

.spec-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.spec-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.spec-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- IP Cards ---------- */
.ip-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ip-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: rgba(34, 211, 238, 0.04);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 14px;
  transition: all .3s;
}
.ip-card:hover {
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 8px 24px -8px rgba(34, 211, 238, 0.4);
}

.ip-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -6px rgba(34, 211, 238, 0.6);
}

.ip-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ip-card-body .ip-cell {
  font-size: 15px;
  padding: 6px 14px;
  background: rgba(34, 211, 238, 0.15);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--accent);
  border-radius: 8px;
  font-weight: 700;
  align-self: flex-start;
}

.ip-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

.ip-card-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ip-card-meta i {
  color: var(--accent);
  font-size: 13px;
}

.ip-card .icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all .25s;
  cursor: pointer;
  flex-shrink: 0;
}
.ip-card .icon-btn:hover {
  background: var(--accent);
  color: #0a0e1a;
  transform: scale(1.08);
  box-shadow: 0 8px 20px -6px rgba(34, 211, 238, 0.7);
}

/* ---------- App Icons (Installed Apps table) ---------- */
.app-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(99, 102, 241, 0.1));
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 1px solid rgba(34, 211, 238, 0.2);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}
.empty-state i {
  font-size: 48px;
  color: var(--text-dim);
  opacity: 0.5;
}
.empty-state p {
  margin: 12px 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}
.empty-state small {
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .asset-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
  }
  .asset-hero-icon {
    width: 64px;
    height: 64px;
    font-size: 30px;
  }
  .asset-hero-info h2 {
    font-size: 20px;
  }
  .asset-hero-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .detail-value {
    text-align: left;
  }
}

/* ---------- Print styles ---------- */
@media print {
  .topbar, .sidebar, .asset-hero-actions, .btn-outline-secondary {
    display: none !important;
  }
  .main-content {
    margin: 0 !important;
    padding: 20px !important;
  }
  .card-glass {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
}
/* ============================================================
   PREMIUM BACK BUTTON
   ============================================================ */
.btn-back-premium {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-back-premium::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity .3s;
  z-index: -1;
}

.btn-back-premium i {
  transition: transform .25s;
  font-size: 16px;
}

.btn-back-premium span {
  transition: all .25s;
}

.btn-back-premium:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(34, 211, 238, 0.5);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn-back-premium:hover i {
  transform: translateX(-4px);
}

/* On very small screens, hide the text, keep the icon */
@media (max-width: 640px) {
  .btn-back-premium span {
    display: none;
  }
  .btn-back-premium {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }
}

/* ============================================================
   AGENT PAGES
   ============================================================ */
.heartbeat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}
.heartbeat-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.05);
  transition: all .2s;
}
.heartbeat-list li:hover {
  background: rgba(34, 211, 238, 0.08);
}
.heartbeat-list strong {
  display: block;
  color: var(--text-strong);
  font-size: 14px;
}
.heartbeat-list small {
  color: var(--text-muted);
  font-size: 11.5px;
}

.success-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  margin-bottom: 24px;
}
.success-banner i {
  color: #10b981;
  font-size: 32px;
  flex-shrink: 0;
}
.success-banner h4 {
  margin: 0 0 4px;
  color: #10b981;
  font-size: 16px;
  font-weight: 700;
}
.success-banner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

.token-box {
  padding: 20px;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 14px;
  margin-bottom: 24px;
}
.token-box label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.token-value {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.token-value code {
  flex: 1;
  font-size: 14px;
  padding: 12px 16px;
  background: #050810;
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #67e8f9;
  border-radius: 10px;
  word-break: break-all;
  font-family: 'JetBrains Mono', monospace;
}
.token-value .icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #fff;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.token-value .icon-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px -6px rgba(34, 211, 238, 0.7);
}
.token-box small {
  color: var(--text-muted);
  font-size: 12.5px;
}

.install-instructions {
  padding: 20px;
  background: rgba(148, 163, 184, 0.05);
  border-radius: 14px;
}
.install-instructions h5 {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}
.install-instructions ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
}
.install-instructions code {
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
}
.install-instructions pre {
  background: #050810;
  color: #67e8f9;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  margin: 8px 0;
  overflow-x: auto;
  border: 1px solid rgba(34, 211, 238, 0.2);
}

/* ============================================================
   LOGIN PAGE — Beautiful, animated
   ============================================================ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: floatBlob 15s infinite ease-in-out;
}
.blob-1 { width: 500px; height: 500px; background: #6366f1; top: -100px; left: -100px; }
.blob-2 { width: 400px; height: 400px; background: #22d3ee; bottom: -100px; right: -100px; animation-delay: -5s; }
.blob-3 { width: 350px; height: 350px; background: #f472b6; top: 40%; left: 40%; animation-delay: -10s; }

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -60px) scale(1.1); }
  66%      { transform: translate(-30px, 40px) scale(0.95); }
}

.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 44px 40px 32px;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(34, 211, 238, 0.08);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  padding: 2px;
  background: linear-gradient(135deg, transparent 0%, var(--accent) 50%, transparent 100%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.4;
  pointer-events: none;
  animation: borderFlow 6s linear infinite;
  background-size: 300% 300%;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.brand-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #fff;
  box-shadow:
    0 10px 30px -10px rgba(34, 211, 238, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: floatIcon 3s ease-in-out infinite;
  position: relative;
}

.brand-icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 26px;
  border: 2px solid rgba(34, 211, 238, 0.3);
  animation: heroPulse 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.login-brand h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.login-brand p {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 6px 0 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form .input-group-animated {
  margin-bottom: 0;
}

.login-form .input-group-animated .form-control,
.login-form .input-group-animated input {
  padding: 15px 16px 15px 46px;
  font-size: 15px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all .3s;
}

.login-form .input-group-animated .form-control:focus,
.login-form .input-group-animated input:focus {
  border-color: var(--accent);
  background: rgba(34, 211, 238, 0.06);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15);
}

.login-form .btn-glow {
  width: 100%;
  justify-content: center;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 6px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
}

/* Error alert */
.login-body .alert {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-body .alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}
.login-body .alert i {
  font-size: 18px;
  flex-shrink: 0;
}

/* Light theme overrides */
[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 30px 60px -20px rgba(15, 23, 42, 0.15),
    0 0 0 1px rgba(8, 145, 178, 0.1);
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px 24px;
    border-radius: 20px;
  }
  .brand-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }
  .login-brand h1 {
    font-size: 20px;
  }
}

/* ============================================================
   PROFILE PAGE — Beautiful redesign
   ============================================================ */

/* ---------- Profile Hero ---------- */
.profile-hero {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 24px;
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.1) 0%,
    rgba(99, 102, 241, 0.08) 50%,
    rgba(244, 114, 182, 0.06) 100%
  );
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow:
    0 20px 50px -20px rgba(34, 211, 238, 0.3),
    0 0 0 1px rgba(34, 211, 238, 0.1) inset;
}

.profile-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.15), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.15), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(244, 114, 182, 0.08), transparent 50%);
  pointer-events: none;
}

.profile-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 32px;
  flex-wrap: wrap;
}

/* Large Avatar */
.profile-avatar-large {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow:
    0 20px 40px -12px rgba(34, 211, 238, 0.7),
    inset 0 2px 0 rgba(255, 255, 255, 0.25);
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid rgba(34, 211, 238, 0.3);
  animation: heroPulse 3s ease-in-out infinite;
  pointer-events: none;
}

.profile-avatar-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.3);
  animation: heroPulse 3s ease-in-out infinite reverse;
}

/* Hero Info */
.profile-hero-info {
  flex: 1;
  min-width: 0;
}

.profile-hero-info h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  line-height: 1.15;
  word-break: break-word;
}

.profile-hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid;
  transition: transform .25s;
}
.profile-badge:hover {
  transform: translateY(-1px);
}

.badge-role {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.35);
}

.badge-status {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
}
.badge-status i {
  font-size: 8px;
  animation: pulse 2s infinite;
}

.badge-branch {
  background: rgba(34, 211, 238, 0.15);
  color: #22d3ee;
  border-color: rgba(34, 211, 238, 0.35);
}

.profile-hero-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}
.profile-hero-email i {
  color: var(--accent);
}

.profile-hero-actions {
  flex-shrink: 0;
}
.profile-hero-actions .btn-glow {
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 700;
}

/* ---------- Mini Stat Cards ---------- */
.mini-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all .3s;
  height: 100%;
}
.mini-stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
}

.mini-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.mini-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.mini-stat-value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
  word-break: break-word;
}

/* ---------- Security Actions ---------- */
.security-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.security-action {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.04);
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .25s;
  position: relative;
}
.security-action:hover {
  background: rgba(34, 211, 238, 0.06);
  border-color: rgba(34, 211, 238, 0.25);
  transform: translateX(4px);
}

.security-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.security-action strong {
  display: block;
  color: var(--text-strong);
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 2px;
}
.security-action small {
  display: block;
  color: var(--text-muted);
  font-size: 12.5px;
}

.security-action-arrow {
  color: var(--text-dim);
  font-size: 20px;
  flex-shrink: 0;
  transition: transform .25s;
}
.security-action:hover .security-action-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.security-action-danger:hover {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.3);
}
.security-action-danger:hover .security-action-arrow {
  color: #ef4444;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .profile-hero-content {
    flex-direction: column;
    text-align: center;
    padding: 26px 20px;
  }
  .profile-hero-info {
    width: 100%;
  }
  .profile-hero-info h1 {
    font-size: 24px;
  }
  .profile-hero-badges {
    justify-content: center;
  }
  .profile-hero-email {
    justify-content: center;
  }
  .profile-hero-actions {
    width: 100%;
  }
  .profile-hero-actions .btn-glow {
    width: 100%;
    justify-content: center;
  }
  .profile-avatar-large {
    width: 96px;
    height: 96px;
    font-size: 36px;
  }
}

/* ============================================================
   BRANCH SCOPE BANNER
   ============================================================ */
.branch-scope-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  margin-bottom: 20px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.15), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 12px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}
.branch-scope-banner i {
  font-size: 18px;
}
.branch-scope-banner strong {
  color: var(--text-strong);
  font-weight: 700;
}

/* Agent info row in branch dashboard */
.agent-info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(34, 211, 238, 0.05);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 12px;
  margin-bottom: 10px;
}
.agent-info-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.agent-info-body {
  flex: 1;
}
.agent-info-body strong {
  display: block;
  color: var(--text-strong);
  font-size: 14.5px;
  margin-bottom: 2px;
}
.agent-info-body small {
  color: var(--text-muted);
  font-size: 12.5px;
}
.agent-info-actions .btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   HERO WELCOME BANNER — Dashboard header
   ============================================================ */
.hero-welcome-banner {
  position: relative;
  padding: 28px 32px;
  margin-bottom: 24px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.08) 0%,
    rgba(99, 102, 241, 0.06) 50%,
    rgba(244, 114, 182, 0.04) 100%
  );
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow:
    0 20px 50px -20px rgba(34, 211, 238, 0.25),
    0 0 0 1px rgba(34, 211, 238, 0.1) inset;
}

.hero-welcome-banner::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 22px;
  padding: 1.5px;
  background: linear-gradient(
    135deg,
    transparent 0%,
    var(--accent) 25%,
    var(--accent-2) 50%,
    var(--accent-3) 75%,
    transparent 100%
  );
  background-size: 300% 300%;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
  pointer-events: none;
  animation: heroBorderFlow 6s linear infinite;
}

@keyframes heroBorderFlow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.hero-bg-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 25%, rgba(34, 211, 238, 0.12), transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(99, 102, 241, 0.12), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(244, 114, 182, 0.06), transparent 50%);
  pointer-events: none;
  animation: heroMeshDrift 20s ease-in-out infinite alternate;
}

@keyframes heroMeshDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(2%, 2%) scale(1.02); }
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

/* ---------- Avatar ---------- */
.hero-avatar-block {
  position: relative;
  flex-shrink: 0;
}

.hero-avatar {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  box-shadow:
    0 12px 30px -8px rgba(34, 211, 238, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: heroAvatarFloat 4s ease-in-out infinite;
}

@keyframes heroAvatarFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.hero-avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 26px;
  border: 2px solid rgba(34, 211, 238, 0.4);
  animation: heroPulse 2.5s ease-in-out infinite;
  pointer-events: none;
}

.hero-avatar-ring::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 20px;
  border: 1.5px solid rgba(99, 102, 241, 0.3);
  animation: heroPulse 2.5s ease-in-out infinite reverse;
}

@keyframes heroPulse {
  0%, 100% { transform: scale(1);    opacity: 0.6; }
  50%      { transform: scale(1.08); opacity: 0.2; }
}

.hero-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #94a3b8;
  border: 3px solid #0a0e1a;
  z-index: 2;
}
.hero-status-dot.online {
  background: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
  animation: heroStatusPulse 2s infinite;
}

@keyframes heroStatusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50%      { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* ---------- Greeting ---------- */
.hero-greeting-block {
  flex: 1;
  min-width: 0;
}

.hero-greeting {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  line-height: 1.15;
}

.hero-name {
  background: linear-gradient(135deg, #22d3ee 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
}

.hero-wave {
  display: inline-block;
  animation: heroWave 2.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes heroWave {
  0%, 100% { transform: rotate(0deg); }
  15%      { transform: rotate(15deg); }
  30%      { transform: rotate(-8deg); }
  45%      { transform: rotate(12deg); }
  60%      { transform: rotate(-4deg); }
  75%      { transform: rotate(8deg); }
}

.hero-subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0 0 14px;
  font-weight: 500;
}

/* ---------- Meta Chips ---------- */
.hero-meta-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid;
  transition: transform .25s;
}
.hero-chip:hover {
  transform: translateY(-1px);
}

.hero-chip-cyan {
  background: rgba(34, 211, 238, 0.12);
  color: #22d3ee;
  border-color: rgba(34, 211, 238, 0.3);
}
.hero-chip-green {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}
.hero-chip-indigo {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}

/* ---------- Agent Card ---------- */
.hero-agent-card {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(34, 211, 238, 0.15);
  position: relative;
  z-index: 1;
}

.hero-agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hero-agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero-agent-badge i {
  font-size: 14px;
}

.hero-agent-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
}
.hero-agent-online i {
  font-size: 8px;
  animation: heroStatusPulse 2s infinite;
}

.hero-agent-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(34, 211, 238, 0.05);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 12px;
  transition: all .3s;
}

.hero-agent-row:hover {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.4);
  transform: translateY(-1px);
}

.hero-agent-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -6px rgba(34, 211, 238, 0.7);
}

.hero-agent-info {
  flex: 1;
  min-width: 0;
}
.hero-agent-info strong {
  display: block;
  color: var(--text-strong);
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 2px;
}
.hero-agent-info small {
  color: var(--text-muted);
  font-size: 12px;
}

.hero-agent-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .25s;
  white-space: nowrap;
}
.hero-agent-link:hover {
  color: var(--accent-2);
  gap: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero-welcome-banner {
    padding: 22px 20px;
  }
  .hero-greeting {
    font-size: 22px;
  }
  .hero-avatar {
    width: 60px;
    height: 60px;
    font-size: 22px;
  }
  .hero-content {
    gap: 16px;
  }
  .hero-agent-link {
    font-size: 12px;
  }
}

/* ---------- Light theme overrides ---------- */
[data-theme="light"] .hero-welcome-banner {
  background: linear-gradient(
    135deg,
    rgba(8, 145, 178, 0.06) 0%,
    rgba(79, 70, 229, 0.04) 50%,
    rgba(219, 39, 119, 0.02) 100%
  );
  border-color: rgba(8, 145, 178, 0.2);
}

[data-theme="light"] .hero-status-dot {
  border-color: #f5f7fb;
}