:root {
  --void: #070b12;
  --navy: #0d1524;
  --slate: #162033;
  --ink: #e8eef7;
  --muted: #8fa0b8;
  --line: rgba(212, 175, 102, 0.22);
  --line-soft: rgba(143, 160, 184, 0.18);
  --gold: #d4af66;
  --gold-bright: #f0d79a;
  --gold-deep: #9a7435;
  --sea: #3d8f86;
  --alert: #e07070;
  --ok: #6fbf9a;
  --panel: rgba(13, 21, 36, 0.78);
  --panel-solid: #101a2b;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Vazirmatn", Tahoma, sans-serif;
  --display: "Markazi Text", "Cormorant Garamond", serif;
  --latin: "Cormorant Garamond", Georgia, serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--void);
  line-height: 1.7;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    linear-gradient(145deg, #05080f 0%, #0c1422 45%, #081018 100%);
}

.vault-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 55%;
  background:
    radial-gradient(ellipse at 70% 0%, rgba(212, 175, 102, 0.16), transparent 55%),
    radial-gradient(ellipse at 15% 30%, rgba(61, 143, 134, 0.12), transparent 50%);
}

.gold-haze {
  position: absolute;
  inset: auto -15% -25% 20%;
  height: 55%;
  background: radial-gradient(ellipse at center, rgba(154, 116, 53, 0.14), transparent 60%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.shell {
  width: min(1140px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.4rem 0 4.5rem;
}

.brand-block {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.1rem;
  align-items: center;
  margin-bottom: 2rem;
  animation: rise 0.8s ease both;
}

.brand-tools {
  align-self: start;
}

.brand-seal {
  width: 3.4rem;
  height: 3.4rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow:
    0 0 0 4px rgba(212, 175, 102, 0.08),
    inset 0 0 18px rgba(212, 175, 102, 0.18);
}

.brand-seal span {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-bright), var(--gold-deep));
  box-shadow: 0 0 16px rgba(212, 175, 102, 0.45);
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.35rem, 5.5vw, 3.45rem);
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(120deg, #fff6e0 10%, var(--gold) 45%, #fff1cc 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-block h1 {
  margin: 0.35rem 0 0;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}

.lead {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 34rem;
  font-weight: 300;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 1.35rem;
  align-items: start;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, rgba(22, 32, 51, 0.92), rgba(10, 16, 28, 0.88));
  backdrop-filter: blur(14px);
  padding: 1.45rem 1.45rem 1.55rem;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 215, 154, 0.55), transparent);
}

.pay-form {
  animation: rise 0.85s ease 0.08s both;
}

.status-panel {
  animation: rise 0.85s ease 0.16s both;
  min-height: 30rem;
}

.panel-head {
  margin-bottom: 1.2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.15;
  color: #f5f8ff;
}

.panel-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.field {
  margin-bottom: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.01em;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid rgba(143, 160, 184, 0.28);
  background: rgba(7, 11, 18, 0.55);
  color: var(--ink);
  border-radius: 0;
  padding: 0.78rem 0.85rem;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input::placeholder {
  color: #617289;
}

.field input:focus,
.field select:focus,
.start-btn:focus-visible {
  outline: none;
  border-color: rgba(212, 175, 102, 0.7);
  box-shadow: 0 0 0 3px rgba(212, 175, 102, 0.14);
  background: rgba(7, 11, 18, 0.8);
}

.ltr-input {
  direction: ltr;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
}

.amount-field {
  margin-bottom: 1.25rem;
}

.amount-shell {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border: 1px solid rgba(212, 175, 102, 0.35);
  background:
    linear-gradient(180deg, rgba(212, 175, 102, 0.08), rgba(7, 11, 18, 0.4));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.amount-input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: var(--mono) !important;
  font-size: clamp(1.45rem, 3.2vw, 1.85rem) !important;
  font-weight: 500;
  letter-spacing: 0.04em;
  direction: ltr;
  text-align: left;
  padding: 1rem 0.95rem !important;
  color: var(--gold-bright) !important;
}

.amount-unit {
  display: grid;
  place-items: center;
  padding: 0 1rem;
  border-right: 1px solid rgba(212, 175, 102, 0.25);
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 600;
  background: rgba(212, 175, 102, 0.06);
}

.amount-words {
  margin: 0.45rem 0 0;
  min-height: 1.35em;
  font-size: 0.82rem;
  color: var(--muted);
}

.hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: #73849c;
}

.advanced {
  margin: 0.2rem 0 1.15rem;
  color: var(--muted);
}

.advanced summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--gold);
  list-style: none;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced .field {
  margin-top: 0.8rem;
}

.start-btn {
  width: 100%;
  border: 1px solid rgba(240, 215, 154, 0.45);
  background: linear-gradient(120deg, #c9a04a 0%, #f0d79a 42%, #a87d32 100%);
  color: #1a1408;
  font: inherit;
  font-weight: 700;
  padding: 0.95rem 1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 10px 28px rgba(154, 116, 53, 0.28);
}

.start-btn span {
  position: relative;
  z-index: 1;
}

.start-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

.start-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.start-btn:hover:not(:disabled)::after {
  transform: translateX(120%);
}

.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.form-error {
  margin: 0.8rem 0 0;
  color: var(--alert);
  font-size: 0.9rem;
}

.status-line {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.5em;
}

.stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}

.stage-list li {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--line-soft);
  color: #6f8098;
  font-size: 0.9rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.stage-list li:last-child {
  border-bottom: 0;
}

.stage-list .idx {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.7;
  color: #66788f;
}

.stage-list li.active {
  color: var(--gold-bright);
  font-weight: 600;
  background: linear-gradient(90deg, rgba(212, 175, 102, 0.1), transparent 70%);
}

.stage-list li.active .idx {
  color: var(--gold);
}

.stage-list li.done {
  color: var(--ok);
}

.stage-list li.error {
  color: var(--alert);
  font-weight: 600;
}

.stage-list li.active .pulse {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-inline-start: 0.35rem;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 10px rgba(240, 215, 154, 0.7);
  animation: blink 1.1s ease infinite;
  vertical-align: middle;
}

.tracking-box {
  margin-top: 1.15rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.45);
  display: grid;
  gap: 0.25rem;
}

.tracking-box span {
  font-size: 0.78rem;
  color: var(--gold);
}

.tracking-box code {
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #f4f7ff;
  direction: ltr;
  text-align: right;
}

.shot-figure {
  margin: 1.15rem 0 0;
  animation: rise 0.55s ease both;
}

.shot-figure figcaption {
  margin-bottom: 0.55rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gold);
}

.shot-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  background: #0a101c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

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

@keyframes blink {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.queue-panel {
  margin-top: 1.35rem;
  animation: rise 0.85s ease 0.16s both;
}

.active-job-card {
  margin: 0 0 1rem;
  padding: 1rem 1.05rem 0.85rem;
  border: 1px solid rgba(240, 215, 154, 0.28);
  background:
    linear-gradient(135deg, rgba(212, 175, 102, 0.1), rgba(7, 11, 18, 0.2)),
    rgba(10, 16, 26, 0.55);
}

.active-job-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.active-job-card .eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 600;
}

.active-job-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  color: #f4efe4;
}

.active-job-meta {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
}

.active-job-side {
  text-align: left;
  display: grid;
  gap: 0.4rem;
  justify-items: start;
}

.active-job-stage {
  margin: 0;
  font-size: 0.82rem;
  color: var(--gold-bright);
  font-weight: 600;
}

.badge.running {
  color: var(--gold-bright);
  border-color: rgba(240, 215, 154, 0.4);
  background: rgba(212, 175, 102, 0.12);
}

.stage-list.compact {
  margin: 0.35rem 0 0.55rem;
}

.stage-list.compact li {
  padding-block: 0.42rem;
  font-size: 0.86rem;
}

.queue-empty {
  padding: 1.1rem 0.2rem 0.35rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-panel {
  margin-top: 1.35rem;
  animation: rise 0.85s ease 0.22s both;
}

.history-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.45);
  color: var(--gold-bright);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.ghost-btn:hover {
  border-color: rgba(240, 215, 154, 0.55);
  background: rgba(212, 175, 102, 0.1);
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.history-table th {
  text-align: right;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.history-table td {
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.9rem;
  color: #d7e0ef;
  vertical-align: middle;
}

.history-table tbody tr:hover td {
  background: rgba(212, 175, 102, 0.05);
}

.history-table .mono {
  font-family: var(--mono);
  direction: ltr;
  text-align: right;
  letter-spacing: 0.03em;
  font-size: 0.84rem;
}

.history-table .amount-cell {
  font-family: var(--mono);
  color: var(--gold-bright);
  direction: ltr;
  text-align: right;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line-soft);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.done {
  color: var(--ok);
  border-color: rgba(111, 191, 154, 0.35);
  background: rgba(111, 191, 154, 0.08);
}

.badge.error {
  color: var(--alert);
  border-color: rgba(224, 112, 112, 0.35);
  background: rgba(224, 112, 112, 0.08);
}

.history-link {
  color: var(--gold-bright);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}

.history-link:hover {
  text-decoration: underline;
}

.history-table .empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 1.4rem 0.65rem;
}

@media (max-width: 900px) {
  .workspace,
  .field-row {
    grid-template-columns: 1fr;
  }

  .status-panel {
    min-height: 0;
  }

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

  .history-head {
    flex-direction: column;
    align-items: stretch;
  }
}

.login-body {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-panel {
  width: min(420px, 100%);
  text-align: center;
}

.login-panel .brand-seal {
  margin: 0 auto 1rem;
}

.login-brand {
  font-size: clamp(2rem, 5vw, 2.6rem) !important;
}

.login-panel h1 {
  margin: 0.4rem 0 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-bright);
}

.login-panel .lead {
  margin: 0.55rem auto 1.2rem;
  max-width: 28rem;
}

.login-panel .field {
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
