:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #1c2434;
  --muted: #6b7688;
  --line: #e4e8ef;
  --brand: #1c6ef2;
  --brand-ink: #ffffff;
  --ok: #12935b;
  --warn: #b7791f;
  --danger: #d64545;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  font-size: 14px;
  line-height: 1.7;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.4; }
code { background: #eef1f6; padding: 2px 6px; border-radius: 6px; font-size: 12.5px; word-break: break-all; }

.shell { display: flex; min-height: 100vh; }

.side {
  width: 236px; flex: 0 0 236px; background: #101a2e; color: #c7d0de; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.side .brand { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 14px; }
.side .brand span { display: block; font-size: 11.5px; font-weight: 400; color: #8fa0bb; }
.side a {
  display: block; padding: 9px 12px; border-radius: 9px; color: #c7d0de; font-weight: 500;
}
.side a:hover { background: #1b2942; text-decoration: none; color: #fff; }
.side a.active { background: var(--brand); color: #fff; }
.side .spacer { flex: 1; }
.side .who { font-size: 12px; color: #8fa0bb; padding: 8px 12px; border-top: 1px solid #22304a; }

.main { flex: 1; min-width: 0; padding: 22px 26px 60px; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.topbar h1 { font-size: 20px; }
.topbar .sub { color: var(--muted); font-size: 12.5px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px;
}
.card > h2 { font-size: 15px; }
.card .hint { color: var(--muted); font-size: 12.5px; margin: -4px 0 12px; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } .side { display: none; } }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 24px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12.5px; }

label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 12.5px; }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); font-family: inherit; font-size: 13.5px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(28,110,242,.18); border-color: var(--brand); }
.field { margin-bottom: 12px; }
.field .note { color: var(--muted); font-size: 11.5px; margin-top: 4px; }

.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px;
  background: var(--brand); color: var(--brand-ink); font-family: inherit; font-size: 13.5px;
  font-weight: 600; cursor: pointer;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 5px 11px; font-size: 12.5px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.empty { color: var(--muted); padding: 14px 4px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge.ok { background: #e7f6ee; color: var(--ok); }
.badge.warn { background: #fdf3e2; color: var(--warn); }
.badge.danger { background: #fdecec; color: var(--danger); }
.badge.muted { background: #eef1f6; color: var(--muted); }

.alert { border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; font-size: 13.5px; }
.alert-ok { background: #e7f6ee; border: 1px solid #bfe6cd; color: #0f6b43; }
.alert-error { background: #fdecec; border: 1px solid #f3bcbc; color: #96201f; }
.alert-info { background: #eaf1fe; border: 1px solid #c6dbff; color: #1a4fa0; }

.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline form { display: inline-flex; gap: 6px; align-items: center; }
.tiny { font-size: 11.5px; color: var(--muted); }

.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1200px 600px at 80% -10%, #dbe7ff 0%, transparent 60%), var(--bg);
}
.auth .box { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 26px; }
.auth .brand { text-align: center; margin-bottom: 18px; }
.auth .brand b { display: block; font-size: 19px; }
.auth .brand span { color: var(--muted); font-size: 12.5px; }
