:root {
  --primary: #0f766e;
  --primary-soft: color-mix(in srgb, var(--primary) 10%, white);
  --primary-dark: color-mix(in srgb, var(--primary) 80%, black);
  --text: #111827;
  --muted: #6b7280;
  --line: #e8eaee;
  --surface: #f6f7f9;
  --white: #fff;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px rgba(17, 24, 39, .06);
  --font: "Vazirmatn", Tahoma, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
[dir="ltr"] { text-align: left; }

.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--primary); color: #fff;
  font-weight: 700; font-size: .95rem; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-light { background: var(--surface); color: var(--text); }
.btn-light:hover { background: var(--line); }
.btn-outline { background: transparent; color: var(--primary); border-color: currentColor; }
.btn-outline:hover { background: var(--primary-soft); }
.btn-danger { background: transparent; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { height: 36px; padding: 0 14px; font-size: .85rem; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface); }
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Forms */
.field { margin-bottom: 16px; }
.field > label, .field-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; }
.field .help { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.field .error, .form-error { color: var(--danger); font-size: .85rem; margin-top: 4px; }
.form-error { background: #fef2f2; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field input[type=color] { width: 64px; height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.field input[type=file] { width: 100%; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.radio-cards { display: grid; gap: 10px; }
.radio-cards label {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600;
}
.radio-cards label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-cards input { accent-color: var(--primary); width: 18px; height: 18px; }
.radio-cards ul, .radio-cards div > div { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* Cards, badges, alerts */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card-title { font-size: 1rem; font-weight: 800; margin-bottom: 14px; }
.badge {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface); color: var(--muted);
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1d4ed8; }

.messages { position: fixed; inset-inline: 0; top: 16px; z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; padding: 0 16px; }
.message {
  pointer-events: auto; max-width: 520px; padding: 12px 18px; border-radius: 12px;
  background: #111827; color: #fff; box-shadow: var(--shadow); font-size: .92rem;
  animation: msg-in .25s ease-out;
}
.message.error { background: var(--danger); }
.message.success { background: #065f46; }
@keyframes msg-in { from { opacity: 0; transform: translateY(-8px); } }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); font-weight: 600;
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: start; font-weight: 600; color: var(--muted); font-size: .82rem; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfc; }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--surface); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .icon { width: 44px; height: 44px; margin: 0 auto 12px; stroke-width: 1.4; color: #c4c8d0; }
