@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
  --bg-page: #f0f2f5;
  --bg-sidebar: #e4e7ec;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-hover: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --badge-blue: #1d4ed8;
  --status-green: #16a34a;
  --status-gold: #ca8a04;
  --status-red: #dc2626;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 20px 35px -5px rgba(15, 23, 42, 0.18), 0 8px 15px -6px rgba(15, 23, 42, 0.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ========================================================================= */
/* SHELL & SIDEBAR (MATCHING REFERENCE SCREENSHOT)                           */
/* ========================================================================= */
.nv-shell {
  display: flex;
  min-height: 100vh;
}

.nv-sidebar {
  width: 245px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid #d5dae2;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  flex-shrink: 0;
}

.nv-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text-primary);
  padding: 6px 10px 18px;
  border-bottom: 1px solid #d5dae2;
  margin-bottom: 14px;
}

.nv-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.nv-brand-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.nv-brand-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.nv-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nv-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 13px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.14s ease;
}

.nv-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.6);
  color: #0f172a;
}

.nv-nav-btn.active {
  background-color: #ffffff;
  color: var(--primary-blue);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.nv-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nv-nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.nv-nav-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}

.nv-nav-btn.active .nv-nav-pill {
  background: #dbeafe;
  color: #1d4ed8;
}

.nv-sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #d5dae2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========================================================================= */
/* MAIN WORKSPACE                                                            */
/* ========================================================================= */
.nv-main {
  flex: 1;
  padding: 26px 32px;
  max-width: 1520px;
  overflow-x: hidden;
}

.nv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.nv-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.nv-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ========================================================================= */
/* CARDS & SEARCH BAR                                                        */
/* ========================================================================= */
.nv-card {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.nv-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nv-search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text-primary);
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s;
}

.nv-search-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.nv-filter-links {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding-left: 2px;
}

.nv-filter-link {
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.nv-filter-link:hover {
  color: #0f172a;
}

.nv-filter-link.active {
  color: #0f172a;
  font-weight: 700;
  border-bottom-color: #0f172a;
}

/* ========================================================================= */
/* CUSTOMERS & PLAYLISTS TABLE                                               */
/* ========================================================================= */
.nv-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.nv-table {
  width: 100%;
  border-collapse: collapse;
}

.nv-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.nv-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #1e293b;
  vertical-align: middle;
}

.nv-table tbody tr:hover {
  background-color: #f8fafc;
}

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

/* Flag image */
.nv-flag-img {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid #cbd5e1;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* MAC Address styling */
.nv-mac-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

/* Solid Blue ANDROID Badge */
.nv-sys-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background-color: #1d4ed8;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Status Pill Badges */
.nv-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
}

.nv-status-active {
  background-color: #16a34a;
}

.nv-status-activated {
  background-color: #ca8a04;
}

.nv-status-locked {
  background-color: #dc2626;
}

/* Inline Note Edit */
.nv-note-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
}

.nv-edit-pen {
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
}

.nv-edit-pen:hover {
  background: #dbeafe;
}

/* Inline Row Action Icon Buttons (Playlist ☰+ & Settings ⚙️) */
.nv-action-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nv-icon-btn {
  width: 32px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.14s;
}

.nv-icon-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
}

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

.nv-btn-primary {
  background-color: var(--primary-blue);
  color: #ffffff;
}

.nv-btn-primary:hover {
  background-color: var(--primary-blue-hover);
}

.nv-btn-emerald {
  background-color: #16a34a;
  color: #ffffff;
}

.nv-btn-emerald:hover {
  background-color: #15803d;
}

.nv-btn-danger {
  background-color: #dc2626;
  color: #ffffff;
}

.nv-btn-danger:hover {
  background-color: #b91c1c;
}

.nv-btn-ghost {
  background-color: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

.nv-btn-ghost:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.nv-btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

.nv-input,
.nv-select,
.nv-textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  color: #0f172a;
  background-color: #ffffff;
  outline: none;
  font-family: inherit;
}

.nv-input:focus,
.nv-select:focus,
.nv-textarea:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.nv-form-group {
  margin-bottom: 13px;
}

.nv-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 5px;
}

/* ========================================================================= */
/* MODALS & CENTERED ACTIONS POPUP                                           */
/* ========================================================================= */
.nv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.nv-modal {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-modal);
  width: 100%;
  padding: 22px 24px;
  max-height: 92vh;
  overflow-y: auto;
}

.nv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

/* Centered Actions Menu List (Matches Screenshot 2) */
.nv-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 18px;
}

.nv-action-menu-item {
  width: 100%;
  padding: 10px 14px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.14s;
}

.nv-action-menu-item:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.nv-action-menu-item.danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ========================================================================= */
/* VPN CARDS GRID                                                            */
/* ========================================================================= */
.nv-vpn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.nv-vpn-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.nv-vpn-card.primary-node {
  border: 2px solid #2563eb;
  background: #f8fbff;
}

.nv-filter-tabs {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nv-tab-pill {
  padding: 6px 13px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.nv-tab-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

@media (max-width: 900px) {
  .nv-shell {
    flex-direction: column;
  }
  .nv-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #d5dae2;
  }
  .nv-main {
    padding: 16px;
  }
}
