:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(168, 85, 247, 0.4);
  --accent-primary: #6366f1;
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Background Glow Effects */
.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, var(--accent-primary), var(--accent-purple));
}

.bg-glow-2 {
  bottom: -100px;
  right: -100px;
  background: radial-gradient(circle, var(--accent-cyan), var(--accent-primary));
}

/* Glassmorphism Card Base */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Login Page Styling */
.login-body {
  justify-content: center;
  align-items: center;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  z-index: 10;
}

.login-card {
  padding: 40px 32px;
  text-align: center;
}

.login-header {
  margin-bottom: 32px;
}

.brand-badge {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 10px 25px -5px rgba(168, 85, 247, 0.4);
}

.brand-icon {
  width: 32px;
  height: 32px;
  color: #fff;
}

.brand-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #fff 30%, var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
}

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

.input-group {
  text-align: left;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(10, 15, 26, 0.8);
  border: 1px solid var(--border-card);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.btn {
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
  color: #fff;
  box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px -4px rgba(168, 85, 247, 0.5);
}

.btn-secondary {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.btn-secondary:hover {
  background: rgba(168, 85, 247, 0.25);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
}

.login-footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Dashboard Top Navigation */
.top-nav {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-badge-small {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.green-dot {
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

.red-dot {
  background-color: var(--accent-red);
  box-shadow: 0 0 10px var(--accent-red);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.role-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
  padding: 10px;
}

.btn-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-card);
  padding: 8px 16px;
  font-size: 14px;
}

.btn-danger-outline:hover {
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

/* Dashboard Container */
.dashboard-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
  flex: 1;
  z-index: 10;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.purple-glow { background: linear-gradient(135deg, #6366f1, #a855f7); }
.cyan-glow { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.green-glow { background: linear-gradient(135deg, #10b981, #059669); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
}

/* Category Sections */
.category-section {
  margin-bottom: 40px;
}

.category-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.service-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 30px -5px rgba(168, 85, 247, 0.2);
}

.service-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.service-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-purple);
}

.service-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.service-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.service-footer {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-card);
}

.latency-badge {
  font-size: 12px;
  color: var(--text-muted);
}

.launch-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modal Overlay & Card Base */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
}

.modal-section {
  margin-bottom: 28px;
}

.modal-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Service Detail Modal Specifics */
.detail-modal-card {
  max-width: 720px;
}

.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid var(--border-card);
  margin-bottom: 24px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-launch-hero {
  padding: 10px 18px;
  font-size: 14px;
  text-decoration: none;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.metric-card-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-card-val {
  font-size: 22px;
  font-weight: 700;
}

.info-table-wrap {
  background: rgba(10, 15, 26, 0.6);
  border-radius: 12px;
  border: 1px solid var(--border-card);
  padding: 12px 16px;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.info-table td {
  padding: 8px 0;
}

.info-table td:first-child {
  color: var(--text-muted);
  width: 160px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-card);
}

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

.user-table th, .user-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-card);
}

.user-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 120px auto;
  gap: 12px;
}

.form-field input, .form-field select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(10, 15, 26, 0.8);
  border: 1px solid var(--border-card);
  color: #fff;
  font-size: 14px;
  outline: none;
}

.btn-sm-danger {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  cursor: pointer;
}

.btn-sm-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

.modal-msg {
  margin-top: 12px;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
}

.hidden {
  display: none !important;
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-card);
  z-index: 10;
}
