/* Aglis Custom IPAM - Cyber-Grid NOC Modern Dark Mode Theme */
:root,
html.dark {
  --bg-base: #060913;
  --bg-surface: #0b1120;
  --bg-card: rgba(13, 21, 38, 0.82);
  --bg-card-hover: rgba(19, 31, 56, 0.95);
  --bg-input: #090e1a;
  --bg-topbar: rgba(11, 17, 32, 0.92);
  --bg-sidebar: #090e1a;
  
  --border-subtle: rgba(56, 189, 248, 0.12);
  --border-glow: rgba(56, 189, 248, 0.28);
  --border-focus: #38bdf8;
  
  --neon-cyan: #00f2fe;
  --neon-blue: #38bdf8;
  --neon-indigo: #818cf8;
  --neon-emerald: #10b981;
  --neon-amber: #f59e0b;
  --neon-rose: #f43f5e;
  --neon-purple: #a855f7;
  --brand-orange: #f97316;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

html.light {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.94);
  --bg-sidebar: #ffffff;
  
  --border-subtle: #e2e8f0;
  --border-glow: rgba(14, 165, 233, 0.35);
  --border-focus: #0284c7;
  
  --neon-cyan: #0284c7;
  --neon-blue: #0369a1;
  --neon-indigo: #4f46e5;
  --neon-emerald: #059669;
  --neon-amber: #d97706;
  --neon-rose: #e11d48;
  --neon-purple: #7e22ce;
  --brand-orange: #ea580c;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
}

html.light body {
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(14, 165, 233, 0.06) 0%, transparent 60%),
    linear-gradient(to right, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
}

html.light .stat-card,
html.light .table-panel,
html.light .finder-hero-card,
html.light .calc-card,
html.light .modal-content {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

html.light .stat-val {
  color: #0f172a;
}

html.light .data-table thead th {
  background: #f1f5f9;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
}

html.light .data-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
}

html.light .data-table tbody tr:hover {
  background: #f8fafc;
}

html.light .search-hero {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

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

body {
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(14, 165, 233, 0.12) 0%, transparent 60%),
    linear-gradient(to right, rgba(56, 189, 248, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Container */
.app-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px 24px 60px 24px;
}

/* Top Header Bar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

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

.brand-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(99, 102, 241, 0.25));
  border: 1px solid var(--neon-cyan);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.2);
}

.brand-text h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ffffff 0%, #38bdf8 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--neon-cyan);
  -webkit-text-fill-color: var(--neon-cyan);
}

.brand-sub {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-status-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  font-size: 13px;
}

.pulse-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--neon-emerald);
  box-shadow: 0 0 10px var(--neon-emerald);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px var(--neon-emerald); }
  50% { opacity: 0.5; transform: scale(0.9); box-shadow: 0 0 2px var(--neon-emerald); }
}

/* Stats Overview Bar */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--stat-glow, var(--neon-blue)), transparent);
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--stat-glow, var(--neon-blue));
}

.stat-val {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-meta {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Global Instant Search Section */
.search-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-left {
  position: absolute;
  left: 16px;
  color: var(--neon-cyan);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 15px 120px 15px 48px;
  background: var(--bg-input);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  color: #ffffff;
  font-size: 15px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.25);
}

.search-input::placeholder {
  color: #475569;
  font-family: var(--font-sans);
  font-size: 14px;
}

.search-actions-right {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kbd-badge {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: none;
}
.search-clear-btn:hover {
  color: #ffffff;
}

/* Instant IP Detection Box */
.ip-detect-banner {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.1) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 8px;
  animation: fadeIn 0.2s ease-out;
}

.ip-detect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ip-detect-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-cyan);
}

.ip-detect-body {
  font-size: 13px;
  color: var(--text-main);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

/* Quick Filter Chips */
.quick-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-chip-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  margin-right: 4px;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.filter-chip:hover {
  background: rgba(56, 189, 248, 0.1);
  color: var(--neon-blue);
  border-color: rgba(56, 189, 248, 0.3);
}

.filter-chip.active {
  background: rgba(14, 165, 233, 0.2);
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
  font-weight: 600;
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.tabs-list {
  display: flex;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 20px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
  background: rgba(14, 165, 233, 0.06);
}

.tab-counter {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 12px;
  background: #1e293b;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tab-btn.active .tab-counter {
  background: rgba(0, 242, 254, 0.2);
  color: var(--neon-cyan);
}

/* Tab Content Action Toolbar */
.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-custom {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

.select-custom:focus {
  border-color: var(--border-focus);
}

/* Cyber Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.4);
}

.btn-accent {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}
.btn-accent:hover {
  background: #059669;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glow);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
}
.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
  color: #ffffff;
}

.btn-icon-only {
  padding: 6px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.btn-icon-only:hover {
  background: rgba(56, 189, 248, 0.1);
  color: var(--neon-blue);
  border-color: var(--neon-blue);
}

/* Quick Copy Button */
.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  transition: all 0.15s;
  margin-left: 4px;
  vertical-align: middle;
}
.btn-copy:hover {
  color: var(--neon-cyan);
  background: rgba(56, 189, 248, 0.12);
}
.btn-copy.copied {
  color: var(--neon-emerald);
}

/* Modern Data Table */
.table-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  margin-bottom: 16px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: #090e1a;
  padding: 12px 14px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.1s;
}

.data-table tbody tr:hover {
  background-color: rgba(56, 189, 248, 0.04);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Cell Monospace */
.cell-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #ffffff;
}

.cell-cidr {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--neon-cyan);
  display: inline-flex;
  align-items: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-v4 {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.badge-v6 {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
}

.badge-vlan {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: #38bdf8;
  font-family: var(--font-mono);
  cursor: pointer;
}
.badge-vlan:hover {
  background: rgba(14, 165, 233, 0.25);
  border-color: var(--neon-cyan);
}

.badge-status-active {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.badge-status-disabled {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fca5a5;
}

/* Dynamic Category Badges */
.badge-cat-p2p {
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.badge-cat-mgmt {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.badge-cat-loopback {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c4b5fd;
}

.badge-cat-pool {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.badge-cat-peer {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.badge-cat-default {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

.badge-cat-system {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.badge-cat-customer {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.badge-cat-service {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c4b5fd;
}

.device-tag {
  display: inline-block;
  background: #1e293b;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin: 1px 2px;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: #090e1a;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* CIDR Calculator Box */
.calc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}

.calc-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
}

.calc-card h3 {
  font-size: 17px;
  margin-bottom: 16px;
  color: var(--neon-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}
.calc-row-item:last-child {
  border-bottom: none;
}

.calc-key {
  color: var(--text-muted);
}
.calc-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.15s ease-out;
}

.modal-content {
  background: #0d1526;
  border: 1px solid var(--border-glow);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 24px rgba(56, 189, 248, 0.15);
  border-radius: 14px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  border-radius: 4px;
}
.modal-close:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #090e1a;
}

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

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

.form-help {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

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

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  color: #ffffff;
  animation: slideInRight 0.2s ease-out;
  min-width: 260px;
}

.toast-success {
  border-color: var(--neon-emerald);
}
.toast-error {
  border-color: var(--neon-rose);
}
.toast-info {
  border-color: var(--neon-blue);
}

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .calc-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 12px 14px 40px 14px;
  }
  .top-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-status-panel {
    width: 100%;
    justify-content: space-between;
  }
  .search-hero {
    padding: 14px;
  }
  .search-input {
    font-size: 13px;
    padding-right: 40px;
  }
  .kbd-badge {
    display: none;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tabs-nav {
    flex-direction: column;
    align-items: stretch;
  }
  .tabs-list {
    overflow-x: auto;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Free IP Finder Styles */
.finder-hero-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.finder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.finder-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--neon-cyan);
}

.finder-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.6;
}

.finder-input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.finder-input-wrapper {
  flex: 1;
  min-width: 260px;
}

.finder-input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.finder-presets-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.finder-presets-label {
  color: var(--text-dim);
  font-weight: 600;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--neon-cyan);
  cursor: pointer;
  transition: all 0.15s;
}

.preset-chip:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
  color: #ffffff;
}

/* Finder Metrics Grid */
.finder-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.finder-metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.finder-metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--metric-glow, var(--neon-blue)), transparent);
}

.finder-metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
}

.finder-metric-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.finder-metric-val {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 4px;
}

.finder-metric-sub {
  font-size: 12px;
  color: var(--text-dim);
}

/* IP Utilization Gauge Card */
.finder-gauge-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.finder-gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.finder-gauge-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.finder-gauge-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(9, 14, 26, 0.85);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  display: inline-block;
}

.dot-cyan {
  background-color: var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan);
}

.dot-emerald {
  background-color: var(--neon-emerald);
  box-shadow: 0 0 6px var(--neon-emerald);
  margin-left: 6px;
}

.finder-progress-track {
  height: 28px;
  background: #060913;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.finder-progress-used {
  background: linear-gradient(90deg, #0284c7 0%, #00f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.35);
}

.finder-progress-free {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.finder-progress-text {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #060913;
  white-space: nowrap;
  padding: 0 6px;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
}

.finder-gauge-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* CIDR Chips in Table */
.cidr-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cidr-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--neon-cyan);
  cursor: pointer;
  transition: all 0.15s;
}

.cidr-chip:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
  color: #ffffff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 5px;
}

/* VLAN Sub-Navigation / Segmented Control */
.vlan-subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.vlan-subnav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented-control {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.seg-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.seg-btn.active {
  background: rgba(0, 242, 254, 0.12);
  color: var(--neon-cyan);
  border-color: rgba(0, 242, 254, 0.35);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

.seg-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.seg-btn.active .seg-badge {
  background: rgba(0, 242, 254, 0.2);
  color: var(--neon-cyan);
}

/* Free IP Finder - Live Ping Scan Styles */
.btn-live-ping {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: #ffffff;
  border: 1px solid rgba(6, 182, 212, 0.6);
  box-shadow: 0 0 14px rgba(79, 70, 229, 0.45), 0 0 8px rgba(6, 182, 212, 0.35);
  font-weight: 700;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-live-ping:hover {
  background: linear-gradient(135deg, #4338ca 0%, #0891b2 100%);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.55), 0 0 12px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.btn-live-ping:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-radar-ping {
  background: rgba(79, 70, 229, 0.18);
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-radar-ping:hover {
  background: rgba(79, 70, 229, 0.35);
  border-color: #a5b4fc;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.45);
}

.btn-radar-ping:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-register-ip {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.btn-register-ip:hover {
  background: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.55);
  transform: translateY(-1px);
}

.btn-register-ip:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Status Badges */
.badge-ping-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

.badge-ping-clean {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.badge-ping-untested {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
}

/* Ping Alert Banner */
.finder-ping-alert {
  border-radius: 10px;
  padding: 16px 20px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.25s ease-out;
}

.finder-ping-alert.alert-danger {
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.18);
}

.finder-ping-alert.alert-clean {
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.18);
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulse 1.5s infinite;
}

/* Subnet Prefix Grouping & Table Styles */
.prefix-nav-wrapper {
  padding: 12px 20px 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 15, 29, 0.45);
}

.prefix-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.prefix-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.prefix-pill:hover {
  color: #ffffff;
  border-color: rgba(0, 242, 254, 0.45);
  background: rgba(0, 242, 254, 0.08);
  transform: translateY(-1px);
}

.prefix-pill.active {
  background: rgba(0, 242, 254, 0.16);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.28);
}

.prefix-pill .pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}

.prefix-pill.active .pill-count {
  background: rgba(0, 242, 254, 0.25);
  color: #ffffff;
}

.prefix-group-card {
  background: rgba(13, 19, 36, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.prefix-group-card:hover {
  border-color: rgba(0, 242, 254, 0.35);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.prefix-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(17, 24, 43, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.prefix-group-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.prefix-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.prefix-group-count {
  font-size: 12px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.prefix-group-count strong {
  color: #ffffff;
}

.btn-ping-prefix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: var(--neon-cyan);
}

.btn-ping-prefix:hover {
  background: rgba(0, 242, 254, 0.22);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.35);
  color: #ffffff;
}

.btn-ping-prefix:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   AGLIS NET - UNIFIED SUITE LAYOUT (Sidebar, Topbar, Footer, Dashboard)
   ========================================================================== */

/* Layout Wrapper */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  background-color: var(--bg-base);
}

/* Sidebar Drawer */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 256px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar Header / Brand */
.sidebar-header {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.sidebar-logo-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-logo-pulse {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--neon-emerald);
  box-shadow: 0 0 6px var(--neon-emerald);
}

.sidebar-brand-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.brand-text-ag {
  color: #0284c7;
  font-weight: 800;
}

.brand-text-lis {
  color: #f97316;
  font-weight: 800;
}

.brand-gradient-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(99, 102, 241, 0.25));
  border: 1px solid var(--border-glow);
  color: var(--neon-cyan);
}

.sidebar-brand-sub {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.sidebar-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

@media (min-width: 1024px) {
  .sidebar-close-btn {
    display: none;
  }
}

/* Sidebar Nav Body */
.sidebar-nav-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 12px 4px 12px;
}

.sidebar-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

html.light .sidebar-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sidebar-nav-item.active {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--neon-cyan);
  font-weight: 600;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.12);
}

html.light .sidebar-nav-item.active {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0284c7;
}

.sidebar-nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  flex-shrink: 0;
}

.sidebar-nav-item.active .sidebar-nav-badge {
  background: rgba(0, 242, 254, 0.2);
  color: var(--neon-cyan);
}

html.light .sidebar-nav-item.active .sidebar-nav-badge {
  background: #e0f2fe;
  color: #0284c7;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-status-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
}

html.light .sidebar-status-box {
  background: #f8fafc;
}

.sidebar-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.sidebar-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
}

.profile-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.profile-meta-wrap {
  min-width: 0;
  flex: 1;
}

.profile-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-user-role {
  font-size: 10px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-tag-pill {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--neon-emerald);
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 64px;
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 1024px) {
  .topbar {
    left: 256px;
    padding: 0 24px;
  }
}

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

.topbar-hamburger-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.topbar-hamburger-btn:hover {
  color: var(--text-main);
  border-color: var(--border-glow);
}

@media (min-width: 1024px) {
  .topbar-hamburger-btn {
    display: none;
  }
}

.topbar-breadcrumb-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.topbar-brand-chip {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-slash {
  color: var(--text-dim);
}

.topbar-active-title {
  color: var(--neon-cyan);
  font-weight: 600;
}

.topbar-infra-badge {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--neon-emerald);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
}

@media (min-width: 1280px) {
  .topbar-infra-badge {
    display: flex;
  }
}

.topbar-center {
  flex: 1;
  max-width: 440px;
  margin: 0 16px;
}

@media (max-width: 767px) {
  .topbar-center {
    display: none;
  }
}

.topbar-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  color: var(--neon-cyan);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.topbar-search-input {
  width: 100%;
  padding: 8px 64px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: all 0.2s;
}

.topbar-search-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

.topbar-search-input::placeholder {
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 12px;
}

.topbar-search-actions {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-kbd-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-clock {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--neon-cyan);
  font-weight: 600;
  padding: 4px 8px;
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 6px;
  white-space: nowrap;
}

@media (max-width: 639px) {
  .topbar-clock {
    display: none;
  }
}

.btn-icon-square {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-icon-square:hover {
  color: var(--text-main);
  border-color: var(--border-glow);
}

/* Main Wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: 0;
  padding-top: 64px; /* for fixed Topbar */
  transition: margin-left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
}

@media (min-width: 1024px) {
  .main-wrapper {
    margin-left: 256px;
  }
}

.content-container {
  flex: 1;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px 16px 40px 16px;
}

@media (min-width: 768px) {
  .content-container {
    padding: 24px 24px 48px 24px;
  }
}

/* App Footer */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 12px 20px;
  font-size: 11px;
  color: var(--text-muted);
  z-index: 30;
}

.footer-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-emerald);
  box-shadow: 0 0 6px var(--neon-emerald);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-badge-platform {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--neon-cyan);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Dashboard View Custom Elements */
.dashboard-welcome-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-title-wrap h2 {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

html.light .dashboard-title-wrap h2 {
  color: #0f172a;
}

.dashboard-title-wrap p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.dashboard-badges-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

html.light .dashboard-chip {
  background: #ffffff;
}

/* Module Jump Cards Grid */
.module-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

.module-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.12);
  color: var(--neon-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.module-card-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.module-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.module-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
  flex: 1;
}

.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--neon-cyan);
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Sequential Host IP Breakdown View Styles */
.host-ips-control-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(8px);
  margin-bottom: 20px;
}

.host-ips-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.host-ips-input-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.host-ips-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label-sm {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.host-ips-action-group {
  margin-bottom: 1px;
}

.btn-assign-ip {
  background: rgba(14, 165, 233, 0.2);
  color: var(--neon-cyan);
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-assign-ip:hover {
  background: var(--neon-cyan);
  color: #020617;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
}

.btn-list-ip {
  color: var(--neon-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-list-ip:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--neon-cyan);
}

.row-host-free {
  transition: background 0.15s ease;
}

.row-host-free:hover {
  background: rgba(16, 185, 129, 0.06) !important;
}

.row-host-assigned {
  transition: background 0.15s ease;
}

.row-host-assigned:hover {
  background: rgba(14, 165, 233, 0.06) !important;
}

.badge-cat-free {
  font-weight: 600;
  font-size: 11px;
}






