:root {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #121212;
  --accent: #fffc00;
  --white: #ffffff;
  --text: #e6e6e6;
  --muted: #8c8c8c;
  --line: rgba(255, 252, 0, 0.14);
  --success: #4ade80;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

#floating-dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.page--wide { max-width: 720px; }

.hidden { display: none !important; }

.reveal {
  animation: fadeUp 0.45s ease both;
}

.reveal:nth-child(2) { animation-delay: 0.05s; }
.reveal:nth-child(3) { animation-delay: 0.1s; }
.reveal:nth-child(4) { animation-delay: 0.15s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Landing ── */

.hero {
  text-align: center;
  margin-bottom: 1.75rem;
}

.hero__logo {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--white);
  margin-bottom: 0.35rem;
}

.hero__logo span { color: var(--accent); }

.hero__headline {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}

.hero__sub {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.name-ticker {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.name-ticker--in {
  opacity: 1;
  transform: translateY(0);
}

.notice-fr {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 252, 0, 0.12);
  background: rgba(255, 252, 0, 0.04);
}

.features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.features li {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card--narrow { max-width: 380px; margin: 0 auto; }

/* ── Form ── */

.form { display: flex; flex-direction: column; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field { position: relative; }

.field__prefix {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.field__input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--white);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s;
}

.field__prefix + .field__input { padding-left: 1.75rem; }

.field__input::placeholder { color: var(--muted); }

.field__input:focus { border-color: rgba(255, 252, 0, 0.4); }
.field__input.valid { border-color: rgba(74, 222, 128, 0.45); }
.field__input.invalid { border-color: rgba(248, 113, 113, 0.55); }
.field__input--mono { font-family: ui-monospace, monospace; }
.field__input--code {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  font-weight: 700;
}

.phone-field { display: flex; gap: 0.45rem; }

.phone-field__code {
  flex-shrink: 0;
  min-width: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}

.field-hint { font-size: 0.72rem; color: var(--muted); }

.field-error {
  display: none;
  font-size: 0.72rem;
  color: var(--danger);
}

.field-error.visible { display: block; }
.field-error--center { text-align: center; }

.toggle-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.toggle-group--quad { grid-template-columns: repeat(2, 1fr); }

.toggle {
  padding: 0.65rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.toggle:hover { border-color: rgba(255, 252, 0, 0.35); }

.toggle.active {
  border-color: var(--accent);
  color: var(--white);
  background: rgba(255, 252, 0, 0.06);
}

.form-ready {
  display: none;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--success);
  padding: 0.5rem;
}

.form-ready.visible { display: block; }

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  text-decoration: none;
}

.btn--primary {
  width: 100%;
  padding: 0.85rem;
  background: var(--accent);
  color: #111;
  font-size: 0.95rem;
}

.btn--primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn--primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--ghost {
  padding: 0.6rem 1rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.82rem;
}

.btn--ghost:hover { border-color: rgba(255, 252, 0, 0.3); color: var(--accent); }

.btn--danger {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: var(--danger);
}

.btn--sm { padding: 0.45rem 0.75rem; font-size: 0.78rem; }
.btn--xs { padding: 0.3rem 0.55rem; font-size: 0.7rem; }

.footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Status page ── */

.status-head {
  text-align: center;
  margin-bottom: 1.25rem;
}

.status-head__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}

.status-head__user {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.steps {
  display: flex;
  gap: 0;
  list-style: none;
  margin-bottom: 1.5rem;
  padding: 0;
}

.steps__item {
  flex: 1;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.5rem 0.15rem;
  border-bottom: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.steps__item span {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.steps__item--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.steps__item--active span {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

.steps__item--done {
  color: var(--success);
  border-bottom-color: rgba(74, 222, 128, 0.35);
}

.steps__item--done span {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.35);
  color: var(--success);
}

.status-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.status-text {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  max-width: 28ch;
}

.status-text--warn { color: var(--danger); }

.status-code-display {
  font-family: ui-monospace, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--accent);
}

.status-loader {
  display: flex;
  gap: 0.35rem;
}

.status-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s ease infinite;
}

.status-loader span:nth-child(2) { animation-delay: 0.15s; }
.status-loader span:nth-child(3) { animation-delay: 0.3s; }

.status-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 2.5px solid rgba(255, 252, 0, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: status-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

@keyframes status-spin {
  to { transform: rotate(360deg); }
}

.success-box {
  text-align: center;
  padding: 1rem 0;
  width: 100%;
}

.success-box__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: var(--success);
}

.success-box__icon svg { width: 28px; height: 28px; }

.success-box__title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.4rem;
}

.success-box__msg {
  font-size: 0.95rem;
  color: var(--text);
}

/* ── Admin ── */

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-head__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
}

.admin-head__sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.admin-head--center { text-align: center; }

.admin-top__actions { display: flex; gap: 0.4rem; }

.link-back {
  display: inline-block;
  margin-top: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
}

.link-back:hover { color: var(--accent); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stat {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.stat__value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}

.stat__label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 0.2rem;
}

.stat--alert .stat__value { color: var(--accent); }

.queue {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.queue--urgent { border-color: rgba(255, 252, 0, 0.2); }

.queue--pulse {
  box-shadow: 0 0 0 1px rgba(255, 252, 0, 0.12);
}

.queue--muted { opacity: 0.7; }

.queue__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.queue__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
}

.queue__desc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.4;
}

.queue__count {
  flex-shrink: 0;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--white);
  font-weight: 700;
  font-size: 0.78rem;
}

.queue--urgent .queue__count {
  background: rgba(255, 252, 0, 0.12);
  color: var(--accent);
}

.queue__list { display: flex; flex-direction: column; gap: 0.5rem; }

.queue-empty {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

.request-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.request-card--confirm {
  flex-direction: column;
  align-items: stretch;
  border-color: rgba(255, 252, 0, 0.2);
}

.request-card--wait { border-color: rgba(255, 252, 0, 0.1); }

.request-card__main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.request-card__user {
  font-weight: 600;
  color: var(--white);
  font-size: 0.88rem;
}

.request-card__detail,
.request-card__time {
  font-size: 0.75rem;
  color: var(--muted);
}

.request-card__hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}

.request-card__actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.request-card--confirm .request-card__actions {
  justify-content: stretch;
  width: 100%;
}

.request-card--confirm .request-card__actions .btn { flex: 1; }

.request-card__badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.request-card__side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.verify-block {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-align: center;
  background: rgba(255, 252, 0, 0.04);
  border: 1px solid rgba(255, 252, 0, 0.15);
}

.verify-block__label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.verify-block__code {
  font-family: ui-monospace, monospace;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  color: var(--accent);
}

.pill-status {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}

.pill-status--approved { color: var(--success); background: rgba(74, 222, 128, 0.1); }
.pill-status--rejected,
.pill-status--code_wrong { color: var(--danger); background: rgba(248, 113, 113, 0.1); }

.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.table th,
.table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255, 252, 0, 0.04); }

.table-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem !important;
}

.link-inline {
  color: var(--accent);
  text-decoration: none;
}

.link-inline:hover { text-decoration: underline; }

.admin-bar { margin-top: 0.5rem; }

.blud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.blud-top__actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.queue-detail {
  text-align: center;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
}

.assignment-box {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.assignment-box__user {
  font-weight: 700;
  color: var(--white);
  font-size: 1rem;
}

.assignment-box__detail {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.2rem 0 0.5rem;
}

.work-actions {
  display: flex;
  gap: 0.5rem;
}

.work-actions .btn { flex: 1; }

.blud-add-form {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.blud-list { display: flex; flex-direction: column; gap: 0.45rem; }

.blud-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.blud-row span:first-child { flex: 1; color: var(--white); font-weight: 600; }

@media (max-width: 767px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin-top { flex-direction: column; }
  .request-card { flex-direction: column; align-items: stretch; }
  .request-card__actions { width: 100%; }
  .request-card__actions .btn { flex: 1; }
  .features { gap: 0.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  .status-spinner {
    animation: none;
    border-color: rgba(255, 252, 0, 0.35);
    border-top-color: var(--accent);
  }
}
