/* ==========================================================================
   1REY — Design System
   داریک شیراز · سامانه استعلام هوشمند عیار، انگ و داکت
   ========================================================================== */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* surfaces */
  --bg: #08080b;
  --bg-2: #0c0c11;
  --surface: #111117;
  --surface-2: #16161e;
  --surface-3: #1c1c25;
  --surface-4: #23232e;

  /* gold */
  --gold-1: #fbefc2;
  --gold-2: #e8c56a;
  --gold-3: #c9973e;
  --gold-4: #8f6425;
  --gold-soft: rgba(232, 197, 106, 0.1);
  --gold-line: rgba(232, 197, 106, 0.22);
  --gold-line-strong: rgba(232, 197, 106, 0.42);
  --gold-grad: linear-gradient(135deg, #fbefc2 0%, #e8c56a 34%, #c9973e 66%, #f2d993 100%);
  --gold-grad-soft: linear-gradient(135deg, rgba(251, 239, 194, 0.16), rgba(201, 151, 62, 0.05));

  /* text */
  --text: #f6f3ec;
  --text-2: #d3cfc5;
  --muted: #a29d92;
  --dim: #77736b;

  /* lines */
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.12);

  /* status */
  --ok: #45d69b;
  --ok-bg: rgba(69, 214, 155, 0.1);
  --warn: #f2b64b;
  --warn-bg: rgba(242, 182, 75, 0.11);
  --bad: #ff7b7b;
  --bad-bg: rgba(255, 123, 123, 0.1);
  --info: #7ea9ff;
  --info-bg: rgba(126, 169, 255, 0.1);

  /* misc */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.75);
  --shadow-gold: 0 18px 60px -22px rgba(232, 197, 106, 0.38);
  --container: 1240px;
  --header-h: 78px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] { display: none !important; }

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.9;
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

::selection {
  background: rgba(232, 197, 106, 0.28);
  color: #fff;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.28; font-weight: 900; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.35rem); line-height: 1.4; }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.35rem); }
h4 { font-size: 1.02rem; }

p { color: var(--text-2); }

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

img, svg {
  display: block;
  max-width: 100%;
}

.ic {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex: none;
  vertical-align: -0.12em;
  font-size: 18px;
  overflow: visible;
}

ul, ol {
  list-style: none;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---------- backdrop decor ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 82% -8%, rgba(201, 151, 62, 0.13), transparent 62%),
    radial-gradient(800px 480px at 8% 12%, rgba(126, 169, 255, 0.05), transparent 60%),
    var(--bg);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.032;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: clamp(56px, 7vw, 104px);
  position: relative;
}

.section--tight { padding-block: clamp(40px, 5vw, 64px); }

.grid { display: grid; gap: 20px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.full { width: 100%; }
.relative { position: relative; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- typography helpers ---------- */
.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.white-text { color: #fff; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold-2);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-2));
}
.eyebrow--center::after {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-2), transparent);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.section-head p {
  max-width: 560px;
  margin-top: 8px;
}
.section-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.section-head--center p { margin-inline: auto; }

/* ---------- buttons ---------- */
.btn {
  --btn-h: 46px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: var(--btn-h);
  padding-inline: 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid transparent;
}
.btn .ic { font-size: 18px; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 2px;
}

.btn-gold {
  background: var(--gold-grad);
  color: #17120a;
  box-shadow: 0 10px 30px -12px rgba(232, 197, 106, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-gold::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.55) 48%, transparent 72%);
  transform: translateX(-130%);
  transition: transform 0.7s var(--ease);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(232, 197, 106, 0.6); }
.btn-gold:hover::after { transform: translateX(130%); }

.btn-dark {
  background: var(--surface-3);
  border-color: var(--line-2);
  color: var(--text);
}
.btn-dark:hover { background: var(--surface-4); border-color: var(--gold-line); }

.btn-outline {
  border-color: var(--gold-line);
  color: var(--gold-1);
  background: rgba(232, 197, 106, 0.02);
}
.btn-outline:hover { background: var(--gold-soft); border-color: var(--gold-line-strong); transform: translateY(-2px); }

.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { color: var(--gold-2); background: rgba(255, 255, 255, 0.04); }

.btn-danger { background: var(--bad-bg); color: var(--bad); border-color: rgba(255, 123, 123, 0.25); }
.btn-danger:hover { background: rgba(255, 123, 123, 0.18); }

.btn-sm { --btn-h: 36px; padding-inline: 14px; font-size: 12.5px; border-radius: 9px; }
.btn-sm .ic { font-size: 15px; }
.btn-lg { --btn-h: 54px; padding-inline: 30px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 0.2s;
}
.btn-icon:hover { color: var(--gold-2); background: var(--gold-soft); border-color: var(--gold-line); }
.btn-icon .ic { font-size: 17px; }

.btn[disabled] { opacity: 0.55; pointer-events: none; }

.link-gold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-2);
  font-weight: 600;
  font-size: 13px;
  transition: gap 0.2s, color 0.2s;
}
.link-gold:hover { color: var(--gold-1); gap: 10px; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge .ic { font-size: 13px; }
.badge-ok { color: var(--ok); background: var(--ok-bg); border-color: rgba(69, 214, 155, 0.18); }
.badge-warn { color: var(--warn); background: var(--warn-bg); border-color: rgba(242, 182, 75, 0.18); }
.badge-bad { color: var(--bad); background: var(--bad-bg); border-color: rgba(255, 123, 123, 0.18); }
.badge-info { color: var(--info); background: var(--info-bg); border-color: rgba(126, 169, 255, 0.18); }
.badge-gold { color: var(--gold-1); background: var(--gold-soft); border-color: var(--gold-line); }
.badge-muted { color: var(--muted); background: rgba(255, 255, 255, 0.05); border-color: var(--line); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  font-size: 11.5px;
  transition: 0.2s;
}
button.chip:hover, a.chip:hover { border-color: var(--gold-line); color: var(--gold-1); background: var(--gold-soft); }
.chip .ic { font-size: 14px; color: var(--gold-2); }
.chip-mono {
  font-family: "Vazirmatn", monospace;
  letter-spacing: 0.02em;
  direction: ltr;
  font-weight: 600;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(69, 214, 155, 0.12); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(242, 182, 75, 0.12); }
.dot-bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 123, 123, 0.12); }
.dot-gold { background: var(--gold-2); box-shadow: 0 0 0 3px rgba(232, 197, 106, 0.12); }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008)), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}
.card--flat { background: var(--surface); }
.card--glow { box-shadow: var(--shadow-gold); border-color: var(--gold-line); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}
.card-title .ic { color: var(--gold-2); font-size: 18px; }
.card-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }

/* corner ticks for framed cards */
.frame-ticks::before,
.frame-ticks::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--gold-line-strong);
  border-style: solid;
  pointer-events: none;
}
.frame-ticks::before { top: 10px; right: 10px; border-width: 1px 1px 0 0; border-radius: 0 5px 0 0; }
.frame-ticks::after { bottom: 10px; left: 10px; border-width: 0 0 1px 1px; border-radius: 0 0 0 5px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.field > label .req { color: var(--gold-2); }
.field .hint { font-size: 11px; color: var(--dim); line-height: 1.7; }

.input,
.select,
.textarea {
  width: 100%;
  height: 46px;
  padding-inline: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.textarea { height: auto; min-height: 100px; padding-block: 10px; resize: vertical; line-height: 1.8; }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255, 255, 255, 0.2); }
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--gold-3);
  box-shadow: 0 0 0 3px rgba(232, 197, 106, 0.1);
  background: rgba(255, 255, 255, 0.03);
}
.select {
  appearance: none;
  padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23a29d92' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 13px center;
  cursor: pointer;
}
.select option { background: var(--surface-2); color: var(--text); }
.input-group { position: relative; }
.input-group .input { padding-inline-start: 44px; }
.input-group .ig-icon {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
  font-size: 18px;
}
.input-group .ig-icon .ic { font-size: 18px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
}
.check input {
  appearance: none;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: 0.2s;
}
.check input:checked { background: var(--gold-2); border-color: var(--gold-2); }
.check input:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2317120a' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center/12px no-repeat;
}
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.switch input { appearance: none; width: 38px; height: 21px; border-radius: 99px; background: var(--surface-4); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: 0.25s; flex: none; }
.switch input::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: var(--muted); top: 2px; right: 2px; transition: 0.25s var(--ease); }
.switch input:checked { background: rgba(232, 197, 106, 0.22); border-color: var(--gold-line-strong); }
.switch input:checked::after { background: var(--gold-2); transform: translateX(-17px); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-row { display: flex; gap: 12px; align-items: center; }

/* ---------- segmented tabs ---------- */
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative;
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.2s;
  white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  color: #17120a;
  background: var(--gold-grad);
  box-shadow: 0 4px 14px -6px rgba(232, 197, 106, 0.5);
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { min-width: 640px; font-size: 12.5px; }
.table th {
  text-align: right;
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.022);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table th:first-child { border-start-start-radius: 10px; }
.table th:last-child { border-start-end-radius: 10px; }
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  color: var(--text-2);
  vertical-align: middle;
}
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; }
.table .cell-main { color: var(--text); font-weight: 600; }
.table .cell-sub { font-size: 10.5px; color: var(--dim); margin-top: 1px; }

/* ---------- avatar ---------- */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-1);
  background: var(--gold-grad-soft);
  border: 1px solid var(--gold-line);
  flex: none;
}
.avatar--sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 4, 7, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}
.modal[hidden] { display: none; }
.modal-dialog {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.32s var(--ease);
  overflow: hidden;
}
.modal-dialog--wide { max-width: 780px; }
.modal-dialog--xl { max-width: 980px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; }
.modal-head p { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: none;
  transition: 0.2s;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

/* ---------- drawer ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: flex;
  justify-content: flex-end;
  background: rgba(4, 4, 7, 0.6);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s ease;
}
.drawer[hidden] { display: none; }
.drawer-panel {
  width: min(720px, 100%);
  height: 100%;
  background: var(--bg-2);
  border-inline-start: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  animation: drawerIn 0.36s var(--ease);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer-body { padding: 24px; overflow-y: auto; flex: 1; }
.drawer-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex: none;
  background: var(--surface);
}

/* ---------- toast ---------- */
.toasts {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(22, 22, 30, 0.96);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.7);
  animation: toastIn 0.35s var(--ease);
  font-size: 12.5px;
  color: var(--text-2);
  backdrop-filter: blur(10px);
}
.toast.out { animation: toastOut 0.25s ease forwards; }
.toast .ic { font-size: 18px; margin-top: 1px; flex: none; }
.toast-ok .ic { color: var(--ok); }
.toast-warn .ic { color: var(--warn); }
.toast-bad .ic { color: var(--bad); }
.toast-info .ic { color: var(--info); }
.toast b { color: var(--text); font-weight: 700; }

/* ---------- empty ---------- */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--dim);
}
.empty .ic { font-size: 40px; color: var(--surface-4); margin-inline: auto; margin-bottom: 12px; }
.empty p { font-size: 12.5px; color: var(--dim); }

/* ---------- misc ---------- */
.divider-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
  border: 0;
}
.kv { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 9px; border-bottom: 1px dashed rgba(255, 255, 255, 0.06); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv dt, .kv .k { color: var(--dim); }
.kv dd, .kv .v { color: var(--text); font-weight: 600; text-align: left; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.ltr { direction: ltr; unicode-bidi: embed; }
.num { font-variant-numeric: tabular-nums; }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a35; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a48; }

/* ---------- animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes drawerIn { from { transform: translateX(-100%); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseSoft { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shimmer { to { background-position: 200% 0; } }
@keyframes scanLine { 0% { top: 8%; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { top: 92%; opacity: 0; } }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(232, 197, 106, 0.22);
  border-top-color: var(--gold-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  flex: none;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

/* ---------- responsive base ---------- */
@media (max-width: 900px) {
  .container { padding-inline: 18px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  .btn { --btn-h: 44px; padding-inline: 16px; }
  .modal { padding: 10px; }
  .modal-dialog { max-height: calc(100vh - 20px); }
  .modal-head, .modal-body, .modal-foot { padding-inline: 18px; }
  .toasts { left: 12px; right: 12px; max-width: none; bottom: 12px; }
    .table { min-width: 560px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
