:root {
  --bg-deep: #070b14;
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-card-elevated: rgba(22, 33, 58, 0.9);
  --bg-input: rgba(9, 14, 26, 0.9);
  --border-subtle: rgba(100, 149, 237, 0.16);
  --border-glow: rgba(0, 229, 255, 0.45);
  --cyan: #00e5ff;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --emerald: #10b981;
  --amber: #f59e0b;
  --danger: #ef4444;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 12% 10%, rgba(0, 229, 255, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 88% 15%, rgba(139, 92, 246, 0.14) 0%, transparent 42%),
    radial-gradient(circle at 50% 90%, rgba(59, 130, 246, 0.10) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Padauk', 'Pyidaungsu', 'Noto Sans Myanmar', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

.admin-container {
  max-width: 920px;
}

/* Header & Brand */
.brand-header {
  text-align: center;
  margin-bottom: 22px;
  position: relative;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.14), rgba(139, 92, 246, 0.18));
  border: 1px solid rgba(0, 229, 255, 0.32);
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.18);
  margin-bottom: 12px;
}

.brand-logo-wrap svg {
  width: 42px;
  height: 42px;
}

.brand-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #ffffff 0%, #67e8f9 55%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.35;
}

.brand-subtitle {
  margin: 4px 0 12px;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.server-pill-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #6ee7b7;
  font-size: 0.82rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.88); }
}

/* Announcement Banner */
.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.09), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(0, 229, 255, 0.24);
  color: #e0f2fe;
  font-size: 0.92rem;
}

.notice-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease;
}

.card:hover {
  border-color: rgba(100, 149, 237, 0.28);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.card-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Input Controls */
.key-input-wrapper {
  position: relative;
}

.key-textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 14px 15px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1.5px solid rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-all;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.key-textarea::placeholder {
  font-family: 'Padauk', 'Pyidaungsu', 'Noto Sans Myanmar', sans-serif;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.key-textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.14);
}

.input-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.mini-btn-group {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.5;
}

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

.btn-mini {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  background: rgba(51, 65, 85, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.btn-mini:hover:not(:disabled) {
  background: rgba(71, 85, 105, 0.75);
  color: #ffffff;
  border-color: rgba(0, 229, 255, 0.4);
}

.btn-primary {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.03rem;
  color: #041019;
  background: linear-gradient(135deg, #00e5ff 0%, #38bdf8 50%, #60a5fa 100%);
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.26);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(0, 229, 255, 0.38);
}

.btn-telegram {
  width: 100%;
  padding: 13px 18px;
  font-size: 0.96rem;
  color: #ffffff;
  background: linear-gradient(135deg, #0088cc 0%, #2563eb 100%);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.32);
}

.btn-telegram:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.48);
}

.btn-viber {
  width: 100%;
  padding: 13px 18px;
  font-size: 0.96rem;
  color: #ffffff;
  background: linear-gradient(135deg, #7360f2 0%, #8b5cf6 55%, #6d28d9 100%);
  box-shadow: 0 8px 22px rgba(115, 96, 242, 0.34);
}

.btn-viber:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(115, 96, 242, 0.52);
}

.btn-outline {
  padding: 10px 16px;
  font-size: 0.9rem;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(30, 41, 59, 0.95);
}

.btn-danger {
  padding: 8px 13px;
  font-size: 0.84rem;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
  color: #ffffff;
}

/* Saved / Demo Key Chips */
.chips-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.chips-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.key-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(99, 179, 237, 0.22);
  color: #e2e8f0;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.key-chip:hover {
  border-color: var(--cyan);
  background: rgba(14, 116, 144, 0.28);
}

.key-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  font-size: 0.75rem;
  line-height: 1;
}

.key-chip-remove:hover {
  background: var(--danger);
  color: #fff;
}

/* Error Box */
.alert-box {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 0.93rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: fadeSlideUp 0.25s ease;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.38);
  color: #fecaca;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #a7f3d0;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.38);
  color: #fde68a;
}

/* Result Dashboard */
.result-card {
  animation: fadeSlideUp 0.32s ease;
  border-color: rgba(0, 229, 255, 0.28);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-top-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.account-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  word-break: break-word;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 700;
}

.badge-server {
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.36);
  color: #93c5fd;
}

.badge-proto {
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.36);
  color: #c4b5fd;
}

.badge-online {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.badge-offline {
  background: rgba(100, 116, 139, 0.2);
  border: 1px solid rgba(100, 116, 139, 0.35);
  color: #94a3b8;
}

/* Status Banner */
.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 0.96rem;
  flex-wrap: wrap;
}

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

.status-expired, .status-depleted {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.42);
  color: #fca5a5;
}

.status-not_started {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.status-disabled {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

/* Circular Gauge + Data Stats Layout */
.usage-hero {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(9, 14, 26, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.12);
  margin-bottom: 16px;
}

@media (max-width: 520px) {
  .usage-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

.ring-wrap {
  position: relative;
  width: 144px;
  height: 144px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-svg {
  width: 144px;
  height: 144px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.14);
  stroke-width: 11;
}

.ring-progress {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ring-percent {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
}

.ring-caption {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.data-summary-col {
  width: 100%;
}

.remaining-label {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.remaining-value {
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1.25;
  margin: 2px 0 10px;
}

.linear-bar-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
  margin-bottom: 10px;
}

.linear-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  transition: width 0.6s ease;
}

.used-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  color: #cbd5e1;
  gap: 8px;
  flex-wrap: wrap;
}

/* Metrics 2x2 Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

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

.stat-box {
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.13);
}

.stat-box-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.stat-box-value {
  font-size: 1.08rem;
  font-weight: 700;
  color: #f8fafc;
}

/* Expiry Card */
.expiry-panel {
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.88));
  border: 1px solid rgba(139, 92, 246, 0.26);
}

.expiry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.expiry-row + .expiry-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.16);
}

.expiry-key {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.expiry-val {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.expiry-countdown {
  color: #c4b5fd;
  font-size: 1.06rem;
}

/* Buy VPN CTA Card */
.store-cta-card {
  background: linear-gradient(145deg, rgba(17, 27, 52, 0.92), rgba(28, 20, 56, 0.92));
  border: 1px solid rgba(139, 92, 246, 0.35);
  position: relative;
  overflow: hidden;
}

.store-cta-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.14);
  border: 1px solid rgba(0, 229, 255, 0.32);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.store-cta-title {
  margin: 0 0 6px;
  font-size: 1.28rem;
  font-weight: 800;
  color: #ffffff;
}

.store-cta-desc {
  margin: 0 0 16px;
  font-size: 0.92rem;
  color: #cbd5e1;
}

.admin-tg-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  background: rgba(7, 11, 20, 0.65);
  border: 1px solid rgba(99, 179, 237, 0.22);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.admin-tg-handle {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: #38bdf8;
}

.admin-viber-box {
  border-color: rgba(139, 92, 246, 0.28);
}

.admin-viber-handle {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: #c4b5fd;
}

.cta-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}

@media (max-width: 520px) {
  .cta-buttons-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.site-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cyan);
}

/* Admin Panel Specific Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

.form-group {
  margin-bottom: 14px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.77rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.form-input, .form-select {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.14);
}

.server-item-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(9, 14, 26, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.server-item-info h4 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-item-url {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.server-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  border: 1px solid var(--cyan);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden {
  display: none !important;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(4, 16, 25, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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