@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/Vazirmatn-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/Vazirmatn-Bold.woff2') format('woff2');
}

:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #e5e7eb;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --success-bg: #ecfdf5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--primary);
}

.inline {
  display: inline;
  margin: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}

h1 {
  margin-top: 0;
  font-size: 1.4rem;
}

.muted {
  color: var(--muted);
}

.hints {
  color: var(--muted);
  padding-inline-start: 20px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 0.9rem;
  color: var(--muted);
}

.captcha {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.captcha-image {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f1f5f9;
  max-width: 100%;
  height: auto;
}

.captcha input[type='text'] {
  flex: 1 1 120px;
  min-width: 120px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

input[type='text'],
input[type='password'],
input[type='file'] {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-link {
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.search-actions,
.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.export-bar {
  margin-top: 8px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.small {
  font-size: 0.85rem;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 16px;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  background: var(--bg);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.alert-success {
  background: #dcfce7;
  color: #166534;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
}

.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 20px 0;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.badge-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.summary th {
  width: 220px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.table th,
.table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: right;
}

.table th {
  background: var(--bg);
  font-weight: 600;
}

.mono {
  font-family: 'Courier New', monospace;
  direction: ltr;
  text-align: left;
  unicode-bidi: embed;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 24px 0;
  font-size: 0.85rem;
}

.footer-logo {
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.nav-user {
  padding-inline-start: 8px;
}

.inline-form {
  display: inline;
  margin: 0;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.badge-ok {
  background: var(--success-bg);
  color: #047857;
}

.badge-muted {
  background: var(--bg);
  color: var(--muted);
}

.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 16px;
}

.filters .field {
  flex: 1 1 160px;
}

.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pre-wrap {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
}

