:root {
  --sidebar-width: 240px;
  --topbar-height: 56px;
  --content-bg: #f1f5f9;
  --vpn-primary: #1050b4;
  --vpn-primary-hover: #0d408d;
  --vpn-sidebar: #0f172a;
  --vpn-sidebar-muted: #64748b;
  --vpn-border: #e2e8f0;
  --vpn-text: #1f2937;
}

body {
  background: #ffffff;
  color: var(--vpn-text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
}

a {
  text-decoration: none;
}

.btn {
  font-size: 0.875rem;
}

.btn-primary {
  background-color: var(--vpn-primary) !important;
  border-color: var(--vpn-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--vpn-primary-hover) !important;
  border-color: var(--vpn-primary-hover) !important;
  box-shadow: 0 0 0 0.2rem rgba(16, 80, 180, 0.18) !important;
}

.btn-outline-primary {
  color: var(--vpn-primary);
  border-color: rgba(16, 80, 180, 0.24);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: rgba(16, 80, 180, 0.08);
  color: var(--vpn-primary-hover);
  border-color: rgba(16, 80, 180, 0.35);
}

.card {
  background: #ffffff;
  border: 1px solid var(--vpn-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--vpn-border);
  color: var(--vpn-text);
}

.form-control,
.form-select {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: var(--vpn-text);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--vpn-primary);
  box-shadow: 0 0 0 0.2rem rgba(16, 80, 180, 0.15);
}

.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

#vpn-auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(180deg, #eaf0f8 0%, #ffffff 100%);
}

.vpn-auth-shell {
  min-height: 100vh;
}

.vpn-auth-brand {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.vpn-auth-panel {
  max-width: 520px;
}

.vpn-auth-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

#vpn-wrapper {
  min-height: 100vh;
  background: var(--content-bg);
}

#vpn-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  position: sticky;
  top: 0;
  background: var(--vpn-sidebar);
  color: #e2e8f0;
  transition: transform 0.25s ease;
  z-index: 1040;
}

.vpn-sidebar-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vpn-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1050b4 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1rem;
}

.vpn-brand-name {
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.vpn-brand-sub {
  color: var(--vpn-sidebar-muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.vpn-nav-label {
  color: #8899aa;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.vpn-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.2rem;
  border-radius: 10px;
  color: #dbe4ef;
  transition: background 0.15s ease, color 0.15s ease;
}

.vpn-nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.vpn-nav-link.active {
  background: var(--vpn-primary);
  color: #ffffff;
}

.vpn-nav-link i {
  width: 1rem;
  text-align: center;
}

.vpn-sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.vpn-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vpn-user-name {
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
}

.vpn-user-meta {
  color: var(--vpn-sidebar-muted);
  font-size: 0.72rem;
}

.vpn-logout-link {
  color: var(--vpn-sidebar-muted);
  font-size: 1rem;
}

.vpn-logout-link:hover {
  color: #f87171;
}

#vpn-content {
  min-height: 100vh;
  background: var(--content-bg);
}

#vpn-topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--vpn-border);
}

.vpn-topbar-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #0f172a;
}

#vpn-content main {
  background: var(--content-bg);
}

#vpn-content .content {
  background: transparent;
  padding-top: 0;
  padding-bottom: 0;
}

#vpn-content .container,
#vpn-content .container-fluid {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.vpn-page-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.vpn-page-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.vpn-page-subtitle {
  color: #64748b;
  margin-bottom: 0;
}

.vpn-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.vpn-stat-card {
  position: relative;
  overflow: hidden;
}

.vpn-stat-card .card-body {
  padding: 1.15rem;
}

.vpn-stat-label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vpn-stat-value {
  color: #0f172a;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.35rem;
}

.vpn-stat-meta {
  color: #64748b;
  font-size: 0.82rem;
  margin-top: 0.35rem;
}

.vpn-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(16, 80, 180, 0.1);
  color: var(--vpn-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vpn-panel-title {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}

.vpn-panel-subtitle {
  color: #64748b;
  font-size: 0.82rem;
}

.vpn-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.vpn-kv-item {
  border: 1px solid var(--vpn-border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.85rem 0.95rem;
}

.vpn-kv-label {
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.vpn-kv-value {
  color: #0f172a;
  font-weight: 600;
  word-break: break-word;
}

.vpn-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.vpn-status-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.vpn-status-pill.online {
  color: #166534;
  background: #dcfce7;
}

.vpn-status-pill.online::before {
  background: #16a34a;
}

.vpn-status-pill.offline {
  color: #991b1b;
  background: #fee2e2;
}

.vpn-status-pill.offline::before {
  background: #dc2626;
}

.vpn-client-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.vpn-client-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.vpn-client-name {
  color: #0f172a;
  font-weight: 600;
}

.vpn-client-meta {
  color: #64748b;
  font-size: 0.8rem;
}

.vpn-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  padding: 1rem;
  text-align: center;
}

.vpn-section-card .card-body {
  padding: 1.5rem;
}

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

.vpn-form-shell {
  max-width: 820px;
}

.vpn-form-shell .card-body {
  padding: 1.5rem;
}

.vpn-form-intro {
  color: #64748b;
  margin-bottom: 1.25rem;
}

.vpn-data-card {
  border: 1px solid var(--vpn-border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 1rem;
}

.vpn-data-label {
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.vpn-data-value {
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.vpn-list-card {
  border: 1px solid var(--vpn-border);
  border-radius: 12px;
  background: #ffffff;
}

.vpn-mini-stat {
  border: 1px solid var(--vpn-border);
  border-radius: 12px;
  background: #ffffff;
  padding: 1rem;
}

.vpn-mini-stat-label {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vpn-mini-stat-value {
  color: #0f172a;
  font-size: 1.65rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.vpn-code {
  display: inline-flex;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 600;
}

.vpn-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.vpn-soft-divider {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

#vpn-content .table {
  --bs-table-bg: transparent;
  --bs-table-border-color: #f1f5f9;
  --bs-table-hover-bg: rgba(0, 0, 0, 0.015);
  font-size: 0.875rem;
  margin-bottom: 0;
}

#vpn-content .table thead th {
  color: #6b7280;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e5e7eb;
  background: #fafbfc;
}

#vpn-content .table-responsive {
  background: #ffffff;
  border: 1px solid var(--vpn-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.breadcrumb {
  margin-bottom: 0;
}

.breadcrumb-item,
.breadcrumb-item a {
  color: #64748b;
}

.breadcrumb-item.active {
  color: #0f172a;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.vpn-filter-field {
  min-width: 220px;
  flex: 1 1 260px;
}

.filter-bar > div {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.filter-bar .btn {
  height: 38px;
  align-self: flex-end;
}

.filter-bar .form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.28rem;
}

.filter-bar .form-select,
.filter-bar .form-control {
  min-height: 38px;
}

#vpn-content .form-label {
  margin-bottom: 0.28rem;
}

#vpn-content .mb-3 {
  margin-bottom: 0.85rem !important;
}

.table-total-records {
  color: #64748b;
  font-size: 0.84rem;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.vpn-breadcrumb-wrap {
  margin-bottom: 1rem;
}

@media (max-width: 1199.98px) {
  .vpn-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  #vpn-sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.28);
  }

  #vpn-wrapper.sidebar-open #vpn-sidebar {
    transform: translateX(0);
  }
}

@media (max-width: 767.98px) {
  .vpn-summary-grid,
  .vpn-kv {
    grid-template-columns: 1fr;
  }

  .vpn-page-header,
  .vpn-client-row,
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}