:root {
  --bg: #0a0d13;
  --bg-2: #0e121a;
  --panel: #141a24;
  --panel-2: #1b2330;
  --line: #273041;
  --line-2: #323d52;
  --text: #e9edf4;
  --muted: #8a94a6;
  --accent: #10a37f;
  --accent-2: #0d8c6d;
  --wait: #d8a63a;
  --mid: #5b9be0;
  --done: #10a37f;
  --danger: #e5534b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 100% -10%, #11182400, #0a0d13), var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Vazirmatn", Tahoma, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}
[dir="rtl"] body { font-family: "Vazirmatn", Tahoma, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px; height: 60px;
  background: rgba(16,21,30,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 19px; color: var(--text); letter-spacing: -.01em; }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  color: var(--muted); font-weight: 500; padding: 7px 11px; border-radius: 9px;
}
.nav-links a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-user { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.uname { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-tag {
  text-transform: uppercase; font-size: 11px; letter-spacing: .05em;
  background: var(--panel-2); color: var(--muted);
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
}
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.link-btn:hover { color: var(--text); }

.lang { display: inline-flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang a { color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.lang a:hover { color: var(--text); text-decoration: none; }
.lang a.on { background: var(--accent); color: #fff; }

.wrap { max-width: 960px; margin: 0 auto; padding: 30px 20px 70px; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card.narrow { max-width: 440px; margin-inline: auto; margin-top: 44px; }
h1 { font-size: 22px; margin: 0 0 14px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 20px 0 12px; }

.form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form input, .form select {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  padding: 11px 12px; border-radius: 10px; font: inherit;
}
.form input:focus, .form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,163,127,.15); }
.form input[type="file"] { padding: 9px 12px; cursor: pointer; }
.form input[type="file"]::file-selector-button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin-inline-end: 12px; font: inherit; cursor: pointer; }
.form input[type="file"]::file-selector-button:hover { border-color: var(--accent); }
.row-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.row-form label { font-size: 13px; }

button.primary {
  background: var(--accent); color: #fff; border: none;
  padding: 11px 18px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
}
button.primary:hover { background: var(--accent-2); }
button.primary.sm, button.sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 600; }
button.sm { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
button.primary.sm { border: none; background: var(--accent); color: #fff; }
button.danger { background: rgba(229,83,75,.15); border-color: rgba(229,83,75,.4); color: #f2a7a2; }
button.danger:hover { background: rgba(229,83,75,.25); }

.muted { color: var(--muted); }
.center { text-align: center; }
.alert { background: rgba(229,83,75,.12); border: 1px solid rgba(229,83,75,.4); color: #f2a7a2; padding: 10px 12px; border-radius: 10px; font-size: 14px; }

.notice { padding: 14px 16px; border-radius: 11px; margin: 0 0 18px; border: 1px solid var(--line); }
.notice.wait { background: rgba(216,166,58,.1); border-color: rgba(216,166,58,.35); }
.notice.done { background: rgba(16,163,127,.1); border-color: rgba(16,163,127,.35); }
.card .notice { margin: 14px 0; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.badge.wait { color: var(--wait); border-color: rgba(216,166,58,.4); background: rgba(216,166,58,.1); }
.badge.mid { color: var(--mid); border-color: rgba(91,155,224,.4); background: rgba(91,155,224,.1); }
.badge.done { color: var(--done); border-color: rgba(16,163,127,.4); background: rgba(16,163,127,.1); }
.badge.danger-badge { color: #f2a7a2; border-color: rgba(229,83,75,.4); background: rgba(229,83,75,.12); }
.asset-pill { display: inline-block; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; font-weight: 700; letter-spacing: .03em; padding: 3px 9px; border-radius: 7px; background: rgba(91,155,224,.12); border: 1px solid rgba(91,155,224,.35); color: var(--mid); }
button:disabled { opacity: .5; cursor: not-allowed; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }

.stat-row { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 150px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.stat-n { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.stat-l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.inline-form { display: inline-flex; gap: 6px; align-items: center; margin-inline-end: 8px; margin-bottom: 4px; }
.inline-form input { background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 6px 9px; border-radius: 8px; font: inherit; font-size: 13px; width: 130px; }
.inline-form input:focus { outline: none; border-color: var(--accent); }

.keycode { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; letter-spacing: .04em; background: var(--bg); border: 1px solid var(--line); padding: 3px 8px; border-radius: 7px; color: var(--text); }
.copy { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 7px; cursor: pointer; padding: 3px 8px; font-size: 13px; }
.copy:hover { color: var(--text); }

.staff-link { color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; }
.staff-link:hover { color: var(--text); border-color: var(--line-2); text-decoration: none; }

.hero { max-width: 560px; margin: 8vh auto 0; text-align: center; }
.hero-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: rgba(16,163,127,.1); border: 1px solid rgba(16,163,127,.3); padding: 5px 12px; border-radius: 999px; margin-bottom: 20px; }
.hero-title { font-size: 40px; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 14px; background: linear-gradient(180deg, #fff, #b9c2d0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 16px; color: var(--muted); margin: 0 auto 32px; max-width: 460px; }
.hero-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; }
.hero-form input {
  flex: 1; background: var(--panel); border: 1px solid var(--line-2); color: var(--text);
  padding: 15px 18px; border-radius: 12px; font: inherit; font-size: 17px; text-align: center;
  letter-spacing: .12em; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-transform: uppercase;
}
.hero-form input::placeholder { letter-spacing: .12em; color: #4e5869; }
.hero-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(16,163,127,.16); }
.hero-form button { padding-inline: 24px; font-size: 16px; border-radius: 12px; white-space: nowrap; }
.hero-alt { margin-top: 24px; font-size: 14px; }
.hero-alt a { color: var(--muted); }
.hero-alt a:hover { color: var(--accent); }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.card-head h1 { margin: 0; }

.stepper { list-style: none; display: flex; padding: 0; margin: 4px 0 24px; counter-reset: step; }
.stepper li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.stepper li::before { content: ""; position: absolute; top: 15px; inset-inline-start: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.current::before { background: var(--accent); }
.stepper .dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--panel-2); border: 2px solid var(--line); color: var(--muted); }
.stepper li.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper li.current .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px rgba(16,163,127,.14); }
.stepper .lbl { font-size: 12px; color: var(--muted); max-width: 90px; }
.stepper li.done .lbl, .stepper li.current .lbl { color: var(--text); }

@media (max-width: 620px) {
  .hero { margin-top: 4vh; }
  .hero-title { font-size: 30px; }
  .hero-form { flex-direction: column; }
  .stepper .lbl { font-size: 11px; }
  .topbar { flex-wrap: wrap; height: auto; gap: 8px 14px; padding: 10px 14px; }
  .brand { font-size: 17px; }
  .nav-user { margin-inline-start: auto; gap: 8px; }
  .nav-links { order: 3; flex-basis: 100%; overflow-x: auto; gap: 4px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .nav-links a { white-space: nowrap; padding: 6px 10px; }
  .wrap { padding: 20px 16px 60px; }
  .uname { display: none; }
  .stat { min-width: 0; flex-basis: calc(50% - 7px); }
}

.btn { display: inline-block; font-weight: 600; cursor: pointer; font: inherit; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-decoration: none; }
.btn:hover { text-decoration: none; border-color: var(--line-2); }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.disabled, .btn[disabled] { opacity: .45; pointer-events: none; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pager .muted { font-size: 13px; }

.form-grid { display: grid; gap: 12px; margin-top: 6px; }
.form-grid .field { display: flex; flex-direction: column; gap: 5px; }
.form-grid .field span { font-size: 13px; color: var(--muted); font-weight: 600; }
.form-grid input { padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; }
.form-grid input:focus { outline: none; border-color: var(--accent); }

.dep-list { display: grid; gap: 10px; margin: 14px 0; }
.dep-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dep-addr { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; padding: 6px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); word-break: break-all; flex: 1; min-width: 180px; }

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7fa;
    --bg-2: #ffffff;
    --panel: #ffffff;
    --panel-2: #eef1f6;
    --line: #dde3ec;
    --line-2: #c7d0de;
    --text: #1a2230;
    --muted: #68727f;
    --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.08);
  }
  body { background: radial-gradient(1200px 600px at 100% -10%, #e8eef700, #f5f7fa), var(--bg); }
  .topbar { background: rgba(255,255,255,.85); }
  .badge.danger-badge { color: #b4332b; }
  .asset-pill { color: #2b6cb0; }
}

.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-logo { display: block; border-radius: 6px; }
