/* Fonts & Base Resets */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

[v-cloak] {
  display: none !important;
}

:root {
  --bg-color: #0b0816;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1b1437 0%, #080610 80%);
  --panel-bg: rgba(18, 14, 38, 0.4);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-hover: rgba(99, 102, 241, 0.25);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --accent: #d946ef;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* App Shell Layout */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 80px 24px;
  flex: 1;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
  border-color: var(--panel-border-hover);
}

/* Header Styles */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 24px;
  position: relative;
  z-index: 100;
}

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

.logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--primary-glow);
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Group Selector Dropdown & Creator */
.group-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  min-width: 200px;
  transition: all 0.3s ease;
}

.group-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-icon-only {
  padding: 10px;
  border-radius: 12px;
}

/* Language Dropdown Switcher */
.lang-dropdown {
  position: relative;
  user-select: none;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.lang-current:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
}

.lang-current svg {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.lang-dropdown.open .lang-current svg {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: #1a1530;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 4px;
  z-index: 1000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.lang-option:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-primary);
}

.lang-option.active {
  background: rgba(99, 102, 241, 0.18);
  color: var(--primary);
}

.lang-flag {
  font-size: 1.1rem;
  line-height: 1;
}

/* Theme Toggle Switch (unchanged) */
.theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  display: flex;
  padding: 3px;
  cursor: pointer;
}

.theme-btn {
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.theme-btn:not(.active):hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

/* Metrics Dashboard Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--metric-glow-color, var(--primary-glow)) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.metric-info {
  z-index: 1;
}

.metric-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(to right, #ffffff, #eef2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric-value.highlight-success {
  background: linear-gradient(to right, #34d399, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric-icon-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--metric-accent-color, var(--primary));
  z-index: 1;
}

/* Two-Column Workspace Layout */
.workspace-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }
}

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

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 700;
}

.panel-title svg {
  color: var(--primary);
}

.panel-body {
  padding: 24px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

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

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
  font-family: var(--font-sans);
  transition: all 0.3s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  background: rgba(255, 255, 255, 0.06);
}

.form-input.code-font {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* List Items (Keys & Credentials) */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.item-list::-webkit-scrollbar {
  width: 6px;
}

.item-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.list-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.key-prefix-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* Switch UI Toggle Button */
.switch-control {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-primary);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--success);
  border-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Full Width Logs Section */
.logs-section {
  margin-bottom: 24px;
}

.logs-table-container {
  overflow-x: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.logs-table th {
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.logs-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  vertical-align: middle;
}

.logs-table tbody tr {
  transition: background-color 0.2s ease;
}

.logs-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.method-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-sans);
}

.method-badge.get { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.method-badge.post { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.method-badge.put { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.method-badge.delete { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

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

.status-dot.success { background-color: var(--success); box-shadow: 0 0 8px var(--success-glow); }
.status-dot.warning { background-color: var(--warning); box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
.status-dot.error { background-color: var(--danger); box-shadow: 0 0 8px var(--danger-glow); }

.rescued-tag {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.log-error-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin-top: 4px;
}

.log-error-title {
  color: #fca5a5;
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 2px;
}

.log-error-text {
  color: #fca5a5;
  font-size: 0.85rem;
  word-break: break-all;
}

.code-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.strategy-badge {
  background: rgba(217, 70, 239, 0.15);
  color: #f5d0fe;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.80rem;
}

/* Modal dialogs */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 4, 14, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

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

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Key display container after generation */
.key-reveal-container {
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed var(--primary);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  text-align: center;
}

.key-reveal-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: #a5b4fc;
  word-break: break-all;
  user-select: all;
  margin-bottom: 8px;
}

.key-warning {
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.empty-state svg {
  color: var(--text-muted);
  width: 48px;
  height: 48px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(18, 14, 38, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  padding: 14px 20px;
  border-radius: 12px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid var(--primary);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

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

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

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Auth Screen Styles */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-panel {
  max-width: 420px;
  width: 100%;
  padding: 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* User profile header styles */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  padding: 4px 4px 4px 12px;
  border-radius: 12px;
}

.user-email {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* Navigation Tab Buttons inside Header */
.header-nav {
  display: flex;
  gap: 8px;
  margin-left: 24px;
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  outline: none;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab-btn.active {
  color: white;
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.1);
}

/* Billing Panel Styles */
.billing-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

.billing-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .billing-summary-grid {
    grid-template-columns: 1fr;
  }
}

.billing-plan-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

.plan-badge-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-badge {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-badge.free {
  background: rgba(156, 163, 175, 0.15);
  color: #d1d5db;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.plan-badge.developer {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.plan-badge.business {
  background: rgba(217, 70, 239, 0.15);
  color: #f5d0fe;
  border: 1px solid rgba(217, 70, 239, 0.3);
  box-shadow: 0 0 15px rgba(217, 70, 239, 0.15);
}

.usage-progress-container {
  margin-top: 4px;
}

.usage-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.usage-progress-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  overflow: hidden;
}

.usage-progress-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.usage-progress-bar-fill.normal,
.usage-progress-bar-fill.success {
  background: linear-gradient(to right, var(--primary), var(--accent));
}

.usage-progress-bar-fill.warning {
  background: linear-gradient(to right, var(--warning), #fbbf24);
}

.usage-progress-bar-fill.danger {
  background: linear-gradient(to right, var(--danger), #f87171);
}

.overage-alert-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.875rem;
  color: #fbbf24;
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.overage-charge-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--warning);
}

/* Pricing Cards */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

.pricing-card {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: var(--panel-border-hover);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.12);
}

.pricing-card.current-active {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
  background: rgba(99, 102, 241, 0.03);
}

.pricing-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-plan-name {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: white;
}

.pricing-plan-price {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 16px 0;
  color: white;
  line-height: 1;
}

.pricing-plan-price span {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.pricing-plan-price span.pricing-old-price {
  font-size: 1.25rem;
  color: var(--danger);
  opacity: 0.85;
  text-decoration: line-through;
  margin-right: 6px;
  font-weight: 500;
  vertical-align: middle;
}

.discount-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 6px;
  vertical-align: middle;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pricing-plan-period {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 6px;
  letter-spacing: 0.02em;
}

.pricing-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
  width: 100%;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.pricing-features-list li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pricing-features-list li svg {
  color: var(--success);
  flex-shrink: 0;
}

/* Admin Panel Specific Styles */
.admin-table th {
  font-family: var(--font-sans);
  color: var(--text-secondary);
}

.admin-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.table-row-hover {
  transition: background-color 0.2s ease;
}

.table-row-hover:hover {
  background: rgba(255, 255, 255, 0.02) !important;
}

.status-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pill.online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.offline {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-outline:hover {
  background: var(--danger);
  color: white;
  box-shadow: 0 0 12px var(--danger-glow);
}

.btn-success-outline {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid var(--success);
  color: var(--success);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-success-outline:hover {
  background: var(--success);
  color: white;
  box-shadow: 0 0 12px var(--success-glow);
}

/* Loading Splash Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0b071a;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

.logo-icon.pulse {
  animation: pulse 1.5s infinite ease-in-out;
  width: 56px;
  height: 56px;
  font-size: 1.75rem;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.5;
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
    box-shadow: 0 0 25px 12px rgba(99, 102, 241, 0.2);
  }
  100% {
    transform: scale(0.95);
    opacity: 0.5;
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

.loading-text {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ==========================================
   Light Theme Styling overrides
   ========================================== */
body.light-theme {
  --bg-color: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e0e7ff 0%, #f8fafc 80%);
  --panel-bg: rgba(255, 255, 255, 0.75);
  --panel-border: rgba(15, 23, 42, 0.08);
  --panel-border-hover: rgba(79, 70, 229, 0.25);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.15);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #d97706;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.15);
  --accent: #9333ea;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.05);
}

body.light-theme .form-input,
body.light-theme .group-select,
body.light-theme select.form-input {
  background: rgba(15, 23, 42, 0.04);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .form-input:focus,
body.light-theme .group-select:focus {
  background: #ffffff;
  border-color: var(--primary);
}

body.light-theme .btn-secondary {
  background: rgba(15, 23, 42, 0.05);
  color: #334155;
  border-color: transparent;
}

body.light-theme .btn-secondary:hover {
  background: rgba(15, 23, 42, 0.09);
  color: #0f172a;
}

body.light-theme .nav-tab-btn {
  color: #475569;
}

body.light-theme .nav-tab-btn:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.04);
}

body.light-theme .nav-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

body.light-theme .tab-pane-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

body.light-theme .log-item {
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

body.light-theme .log-item:hover {
  background: rgba(15, 23, 42, 0.02);
}

body.light-theme .detail-grid {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.05);
}

body.light-theme .admin-table th {
  background: rgba(15, 23, 42, 0.03);
  color: #334155;
}

body.light-theme .admin-table td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

body.light-theme .admin-user-row:hover {
  background: rgba(15, 23, 42, 0.02);
}

body.light-theme .modal-overlay {
  background: rgba(15, 23, 42, 0.4);
}

body.light-theme .toast {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: #0f172a;
  box-shadow: var(--shadow-lg);
}

body.light-theme .logo-text h1 {
  background: linear-gradient(to right, #0f172a, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .logo-section .logo-icon {
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
}

body.light-theme .loading-screen {
  background: #f8fafc;
}

body.light-theme .loading-text {
  color: #475569;
}

body.light-theme .lang-current,
body.light-theme .theme-toggle {
  background: rgba(15, 23, 42, 0.04);
}

body.light-theme .lang-menu {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

body.light-theme .lang-option {
  color: #475569;
}

body.light-theme .lang-option:hover {
  background: rgba(99, 102, 241, 0.08);
  color: #1e293b;
}

body.light-theme .lang-option.active {
  color: var(--primary);
}

body.light-theme .theme-btn:not(.active):hover {
  background: rgba(15, 23, 42, 0.02);
}

body.light-theme .metric-value {
  background: linear-gradient(to right, #0f172a, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .metric-value.highlight-success {
  background: linear-gradient(to right, #059669, #047857);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .pricing-plan-name,
body.light-theme .pricing-plan-price {
  color: var(--text-primary);
}

body.light-theme .key-prefix-badge {
  color: var(--primary);
  background: rgba(79, 70, 229, 0.1);
}

body.light-theme .strategy-badge {
  color: var(--accent);
  background: rgba(147, 51, 234, 0.1);
}

body.light-theme .rescued-tag {
  color: #065f46;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.25);
}

body.light-theme .log-error-title,
body.light-theme .log-error-text {
  color: #b91c1c;
}

body.light-theme .method-badge.get {
  background: rgba(4, 120, 87, 0.1);
  color: #047857;
}

body.light-theme .method-badge.post {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

body.light-theme .method-badge.put {
  background: rgba(180, 83, 9, 0.1);
  color: #b45309;
}

body.light-theme .method-badge.delete {
  background: rgba(185, 28, 28, 0.1);
  color: #b91c1c;
}

body.light-theme .auth-header h2 {
  background: linear-gradient(to right, #0f172a, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Global Tooltip Styles */
.global-tooltip {
  position: fixed;
  background: rgba(11, 8, 22, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  color: #f3f4f6;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: normal;
  white-space: normal;
  width: 325px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  line-height: 1.4;
  text-align: center;
  z-index: 999999;
  animation: tooltipFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: help;
  position: relative;
  margin-left: 6px;
  transition: all 0.2s ease;
  vertical-align: middle;
}

body.light-theme .help-tooltip {
  background: rgba(0, 0, 0, 0.08);
}

.help-tooltip:hover {
  background: var(--primary);
  color: white;
}

/* Target Card & Mini Details Styles */
.target-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

body.light-theme .target-card {
  background: rgba(15, 23, 42, 0.02);
}

.mini-targets-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.8rem;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.light-theme .mini-targets-card {
  background: rgba(15, 23, 42, 0.02);
}

/* Danger Button overrides for Light Theme */
body.light-theme .btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

body.light-theme .btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

/* Gateway Info Banner */
.gateway-info-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

body.light-theme .gateway-info-banner {
  background: rgba(0, 0, 0, 0.02);
}

.gateway-link-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gateway-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.gateway-url {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .gateway-url {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.03);
}

.gateway-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background-color: var(--success, #22c55e);
  box-shadow: 0 0 8px var(--success, #22c55e);
  animation: pulse-dot 2s infinite;
}

.status-dot.offline {
  background-color: var(--text-muted, #94a3b8);
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Dashboard Footer */

.dashboard-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-top: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0.6;
  transition: opacity 0.25s ease, border-color 0.25s ease;
}

.dashboard-footer:hover {
  opacity: 1;
}

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

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.footer-link:hover {
  color: var(--primary);
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
}

.footer-link svg {
  opacity: 0.7;
  transition: opacity 0.18s ease;
}

.footer-link:hover svg {
  opacity: 1;
}

.footer-divider {
  color: var(--text-secondary);
  opacity: 0.4;
  font-size: 0.9rem;
  user-select: none;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.5;
}

body.light-theme .dashboard-footer {
  background: var(--panel-bg);
}
