@font-face {
  font-family: "Sora";
  src: local("Sora"), local("Sora Regular"), local("Sora-Regular");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --panel: rgba(18, 19, 24, 0.94);
  --panel-strong: #151822;
  --accent: #d2b45b;
  --accent-2: #7da9ff;
  --text: #f2f4f8;
  --muted: #9aa4b2;
  --danger: #e36b5d;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Sora", "Futura", "Avenir Next", "Helvetica Neue", sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(210, 180, 91, 0.15), transparent 45%),
              radial-gradient(circle at 70% 10%, rgba(125, 169, 255, 0.16), transparent 40%),
              #0b0c0f;
  color: var(--text);
  min-height: 100vh;
}

.ambient {
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.03), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px 12px;
  position: relative;
  z-index: 1;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #d2b45b, #7da9ff);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.brand h1 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: 0.04em;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.top-actions {
  display: none;
  gap: 16px;
  align-items: center;
}

.user-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.banner {
  text-align: center;
  padding: 10px 16px;
  background: rgba(227, 107, 93, 0.2);
  border-top: 1px solid rgba(227, 107, 93, 0.5);
  border-bottom: 1px solid rgba(227, 107, 93, 0.5);
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.shell {
  padding: 24px 48px 48px;
  position: relative;
  z-index: 1;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: fadeIn 0.6s ease-out;
}

.login-panel {
  max-width: 460px;
  margin: 48px auto;
}

.app-panel {
  display: none;
}

.muted {
  color: var(--muted);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

input, select {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
}

button {
  border: none;
  cursor: pointer;
  font-weight: 600;
  border-radius: 12px;
  padding: 10px 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button.primary {
  background: linear-gradient(135deg, #d2b45b, #7da9ff);
  color: #12131a;
  box-shadow: 0 10px 24px rgba(125, 169, 255, 0.3);
}

button.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}

.notice {
  margin-top: 16px;
  color: var(--danger);
}

.register-block {
  display: none;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 24px;
}

.filters {
  position: sticky;
  top: 24px;
  height: fit-content;
}

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

.filter-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.admin-block {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: none;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.query-status {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(125, 169, 255, 0.12);
  border: 1px solid rgba(125, 169, 255, 0.25);
}

.query-label {
  font-weight: 600;
}

.progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7da9ff, #d2b45b);
  transition: width 0.2s ease;
}

.query-percent {
  min-width: 48px;
  text-align: right;
  font-weight: 600;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.table-wrapper {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

th {
  position: sticky;
  top: 0;
  background: rgba(18, 20, 30, 0.98);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.detail-btn {
  font-size: 0.8rem;
}

.masked {
  letter-spacing: 0.2em;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 10;
}

.modal-card {
  background: var(--panel-strong);
  border-radius: 24px;
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
  box-shadow: var(--shadow);
  animation: slideUp 0.4s ease;
}

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

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

.detail-field {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 14px;
}

.detail-field span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-field strong {
  font-size: 0.95rem;
  word-break: break-word;
}

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

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

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

  .filters {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .shell {
    padding: 24px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    grid-template-columns: 1fr;
  }
}
