:root {
  --bg: #07101f;
  --bg-2: #0d1730;
  --panel: rgba(17, 24, 43, 0.88);
  --text: #f3f6ff;
  --muted: #aab4d0;
  --accent: #8cb2ff;
  --accent-2: #9b8cff;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(122, 162, 255, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(155, 140, 255, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
}

.container {
  max-width: 900px;
  margin: 48px auto;
  padding: 0 18px;
}

.hero { margin-bottom: 18px; }
.hero.compact { margin-bottom: 16px; }

h1 {
  margin: 0 0 10px;
  font-size: 2.35rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 720px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.neutral-badge {
  background: rgba(140, 178, 255, 0.12);
  border: 1px solid rgba(140, 178, 255, 0.22);
  color: #dce8ff;
}

.success-badge {
  background: rgba(53, 212, 154, 0.14);
  border: 1px solid rgba(53, 212, 154, 0.28);
  color: #d9fff0;
}

.card {
  background: linear-gradient(180deg, rgba(23, 32, 57, 0.94), rgba(20, 28, 48, 0.94));
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

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

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #dde6ff;
}

input {
  width: 100%;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 14, 28, 0.78);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus {
  border-color: rgba(140, 178, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(140, 178, 255, 0.14);
  transform: translateY(-1px);
}

button,
.magic-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 13px 19px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08111f;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(122, 162, 255, 0.24);
}

button:hover,
.magic-link:hover { filter: brightness(1.05); }

.submit-row { display: flex; justify-content: flex-start; }

.error {
  margin: 16px 0;
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(255, 114, 114, 0.12);
  border: 1px solid rgba(255, 114, 114, 0.32);
  color: #ffd7d7;
}

.quota-box {
  margin-top: 18px;
  padding: 15px 16px;
  border-radius: 14px;
  background: rgba(122, 162, 255, 0.08);
  border: 1px solid rgba(122, 162, 255, 0.18);
  color: #dfe7ff;
  line-height: 1.5;
}

.quota-box.success {
  background: rgba(53, 212, 154, 0.12);
  border-color: rgba(53, 212, 154, 0.28);
  color: #d9fff0;
}

.quota-box.warning {
  background: rgba(255, 184, 77, 0.12);
  border-color: rgba(255, 184, 77, 0.28);
  color: #ffe8c7;
}

.quota-box.loading { opacity: 0.86; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.info-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 15px 16px;
  min-height: 96px;
}

.info-item.wide { grid-column: 1 / -1; }

.info-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9fb0d9;
  margin-bottom: 8px;
}

.info-value {
  display: block;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
}

.link-wrap { margin-top: 20px; }

.action-panel {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(122, 162, 255, 0.08), rgba(155, 140, 255, 0.08));
  border: 1px solid rgba(122, 162, 255, 0.16);
}

.action-panel-text h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.action-panel-text p {
  margin: 0;
  color: var(--muted);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.secondary-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(140, 178, 255, 0.35);
  box-shadow: none;
}

.secondary-btn:hover { background: rgba(140, 178, 255, 0.08); }
.copy-status { margin-top: 12px; color: var(--muted); }
.footer-actions { margin-top: 18px; }
.back-link { display: inline-block; margin-top: 4px; color: #b8ccff; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .field-grid,
  .info-grid { grid-template-columns: 1fr; }
  .info-item,
  .info-item.wide { grid-column: auto; }
  .container { margin: 28px auto; }
  .card { padding: 18px; }
  h1 { font-size: 1.85rem; }
}


.hidden { display: none !important; }
.small-badge { margin-bottom: 10px; padding: 6px 10px; font-size: 0.78rem; }

.loading-card {
  margin-top: 20px;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(122, 162, 255, 0.10), rgba(155, 140, 255, 0.08));
  border: 1px solid rgba(140, 178, 255, 0.18);
}

.loading-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.loading-top h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.loading-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.countdown-ring {
  min-width: 124px;
  min-height: 124px;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, rgba(255,255,255,0.08), rgba(122,162,255,0.10));
  border: 1px solid rgba(140, 178, 255, 0.28);
  box-shadow: inset 0 0 25px rgba(140, 178, 255, 0.06);
}

.countdown-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.countdown-unit {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-bar {
  margin-top: 18px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s linear;
}

.loading-status {
  margin-top: 14px;
  font-weight: 700;
  color: #e5ecff;
}

.loading-hints {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.hint-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 700px) {
  .loading-top { flex-direction: column; align-items: flex-start; }
  .countdown-ring { min-width: 108px; min-height: 108px; }
  .loading-hints { grid-template-columns: 1fr; }
}


.backend-status-meta {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}


.admin-shell { max-width: 1320px; }
.admin-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.admin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.stat-card { padding: 20px; }
.stat-card h3 { margin: 0; color: var(--muted); font-size: 0.95rem; }
.stat-value { margin-top: 10px; font-size: 2rem; font-weight: 800; }
.admin-card { margin-top: 18px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.08); vertical-align: top; }
.admin-table th { color: var(--muted); font-weight: 700; }
.single-grid { grid-template-columns: 1fr; }
.admin-login-shell { max-width: 760px; }
.admin-login-card { margin-top: 18px; }
.bootstrap-box { margin-bottom: 12px; }

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-hero { flex-direction: column; align-items: flex-start; }
}

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


.admin-nav-links { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.admin-link {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 14px; border-radius: 12px; text-decoration: none;
  background: rgba(255,255,255,0.05); color: #eef3ff; border: 1px solid rgba(255,255,255,0.08);
}
.admin-link.active-link { background: rgba(122,162,255,0.16); border-color: rgba(122,162,255,0.32); }
.admin-header-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.admin-who { color: var(--muted); }
.orders-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.orders-filter-grid label { display: flex; flex-direction: column; gap: 8px; }
.orders-filter-grid span { color: var(--muted); font-size: 0.92rem; }
.wide-field { grid-column: span 2; }
.orders-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.orders-section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.results-count { color: var(--muted); }
.pretty-output {
  width: 100%; min-height: 260px; resize: vertical; border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(9,12,18,0.78);
  color: #f3f7ff; padding: 16px; font: 500 0.95rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 1080px) {
  .orders-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .orders-filter-grid { grid-template-columns: 1fr; }
  .wide-field { grid-column: span 1; }
  .admin-header-side { align-items: flex-start; }
}


.inline-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.limit-inline { display: flex; gap: 8px; align-items: center; }
.limit-inline input { max-width: 96px; }
.row-actions-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.danger-btn { background: rgba(255, 82, 82, 0.14); border-color: rgba(255, 82, 82, 0.34); }
