:root {
  --bg: #070b18;
  --bg-card: #0c1326;
  --bg-card-2: #0f1830;
  --bg-input: #080e1e;
  --border: #1d2948;
  --border-hi: #2b3c68;
  --violet: #8b5cf6;
  --violet-hi: #a78bfa;
  --sky: #38bdf8;
  --green: #22c55e;
  --emerald: #34d399;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
  --text: #e6eefc;
  --muted: #8ea1c2;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 45% at 20% 0%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(ellipse 70% 40% at 85% 0%, rgba(56, 189, 248, 0.08), transparent 60%),
    linear-gradient(rgba(139, 92, 246, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 34px 34px, 34px 34px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: var(--sky);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(7, 11, 24, 0.82);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.4px;
  color: #fff;
  text-decoration: none !important;
}

.brand-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #ddd6fe;
}

.nav-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 24, 48, 0.9);
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  transition: 0.15s ease;
}
.nav-pill:hover {
  border-color: var(--violet);
  text-decoration: none;
}

.nav-pill-green {
  border-color: rgba(34, 197, 94, 0.38);
  color: #86efac;
  background: rgba(34, 197, 94, 0.08);
}

.nav-pill-violet {
  border-color: rgba(139, 92, 246, 0.45);
  color: #ddd6fe;
  background: rgba(139, 92, 246, 0.12);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulseDot 1.8s infinite;
}

.pulse-dot.paused {
  background: var(--amber);
  animation: none;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.lang-select {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
}

/* Container */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 18px 60px;
}

/* Banners */
.status-banner {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  font-weight: 600;
}
.status-banner.show { display: block; }

.promo-banner {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.12), rgba(139, 92, 246, 0.16));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.promo-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.promo-tag {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}

.promo-price {
  font-size: 15px;
  font-weight: 600;
}
.promo-old {
  text-decoration: line-through;
  color: #fca5a5;
  margin-right: 6px;
}
.promo-new {
  color: #4ade80;
  font-weight: 800;
}

.promo-timer {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 15px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(7, 11, 24, 0.72);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde047;
}

/* Hero & Tabs */
.hero {
  text-align: center;
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 31px;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(90deg, #ffffff 0%, #c4b5fd 52%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0 auto 18px;
  max-width: 760px;
  color: var(--muted);
  font-size: 14.5px;
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tab-btn {
  border: 1px solid var(--border-hi);
  background: var(--bg-card);
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: 0.15s ease;
}
.tab-btn:hover {
  color: #fff;
  border-color: var(--violet);
}
.tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(56, 189, 248, 0.18));
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
}

/* Views & Grid */
.view { display: none; }
.view.active { display: block; }

.grid-3 {
  display: grid;
  grid-template-columns: 325px minmax(420px, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.narrow {
  max-width: 980px;
  margin: 0 auto;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1120px) {
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.card-title {
  margin: 0 0 12px;
  font-size: 15.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Left Instructions */
.pin-alert {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
}

.req-box {
  padding: 12px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.32);
  margin-bottom: 14px;
  font-size: 13px;
}
.req-box h4 {
  margin: 0 0 8px;
  color: #93c5fd;
  font-size: 13px;
}
.req-box ul {
  margin: 0;
  padding-left: 18px;
}
.req-box li {
  margin-bottom: 6px;
}

.steps-guide {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 13px;
  color: #cbd5e1;
}
.steps-guide li {
  margin-bottom: 8px;
}

.danger-box {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  font-weight: 700;
  font-size: 12.5px;
  text-align: center;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 8px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-hi);
  font-size: 12px;
}
.step.active {
  color: #ddd6fe;
}
.step.active .step-num {
  background: var(--violet);
  border-color: var(--violet-hi);
  color: #fff;
}
.step.done {
  color: #86efac;
}
.step.done .step-num {
  background: var(--green);
  border-color: var(--emerald);
  color: #052e16;
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
}
.step-line.done {
  background: var(--green);
}

/* Form elements */
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.input-row {
  display: flex;
  gap: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: 0.15s ease;
}

textarea {
  font-family: var(--mono);
  font-size: 12.5px;
  resize: vertical;
  min-height: 145px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid var(--border-hi);
  background: var(--bg-card-2);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  border-color: var(--violet-hi);
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  padding: 13px 18px;
  font-size: 14.5px;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6366f1 55%, #0284c7);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-danger {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
}

.btn-amber {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
}

.cdk-info-pill {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
  display: none;
}
.cdk-info-pill.err {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}
.cdk-info-pill.show { display: block; }

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 24, 48, 0.75);
  border: 1px solid var(--border-hi);
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 12.8px;
}
.check-label input {
  margin-top: 3px;
  accent-color: var(--violet);
}

.quick-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.32);
  margin-bottom: 12px;
}

/* Task Tracker */
.tracker-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.empty-box {
  border: 1px dashed var(--border-hi);
  border-radius: 12px;
  padding: 26px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
}

.task-item {
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(8, 14, 30, 0.9);
  font-size: 12.5px;
}
.task-item.st-running { border-color: rgba(56, 189, 248, 0.55); }
.task-item.st-success { border-color: rgba(34, 197, 94, 0.55); }
.task-item.st-failed, .task-item.st-cancelled { border-color: rgba(239, 68, 68, 0.55); }

.task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.task-email {
  font-family: var(--mono);
  font-weight: 700;
  color: #fff;
  word-break: break-all;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.b-wait { background: rgba(245, 158, 11, 0.16); color: #fde047; }
.b-run  { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }
.b-ok   { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.b-err  { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }

.task-msg {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* Quick Links Bottom Card */
.quick-links-card {
  max-width: 860px;
  margin: 22px auto 0;
}
.ql-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 640px) {
  .ql-grid { grid-template-columns: 1fr; }
}
.ql-item {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-hi);
  transition: 0.15s ease;
  text-decoration: none !important;
}
.ql-item:hover {
  border-color: var(--violet);
  transform: translateY(-1px);
}
.ql-item strong {
  display: block;
  color: #fff;
  font-size: 13.5px;
}
.ql-item span {
  font-size: 12px;
  color: var(--muted);
}

/* Results / Tables */
.pre-out {
  margin-top: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}
table.data-table th {
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
}

/* Toast Notifications */
.toast-stack {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  position: relative;
  overflow: hidden;
  background: #101935;
  border: 1px solid var(--border-hi);
  border-left: 4px solid var(--violet);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.2s ease forwards;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Admin Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.stat-box .k { font-size: 12px; color: var(--muted); }
.stat-box .v { font-size: 22px; font-weight: 800; color: #fff; margin-top: 4px; }
