@font-face {
  font-family: Vazirmatn;
  src: url("/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #101714;
  --bg-2: #18241e;
  --card: #1d2b24;
  --line: #31463b;
  --text: #eef6f0;
  --muted: #a9bfb2;
  --gold: #e0b15a;
  --gold-2: #8a6a2e;
  --ok: #3cba78;
  --bad: #e26b5a;
  --warn: #e0b15a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  background:
    radial-gradient(1200px 400px at 100% -10%, rgba(224, 177, 90, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px 20px;
}
.screen h1 { font-size: 1.35rem; margin: 0 0 8px; }
.screen p { color: var(--muted); max-width: 36rem; line-height: 1.7; }
.mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border: 1px solid var(--gold-2);
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-weight: 700;
  background: var(--bg-2);
}

.shell { min-height: 100vh; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 23, 20, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
}
.top strong { font-size: 1.05rem; }
.muted { color: var(--muted); }
.top .muted { display: block; font-size: 0.82rem; margin-top: 2px; }

.nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  position: sticky;
  top: 58px;
  z-index: 4;
}
.nav button, .ghost, .primary, .danger, .ok {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 8px 12px;
  white-space: nowrap;
}
.nav button.active, .primary {
  background: var(--gold);
  color: #1a1408;
  border-color: var(--gold);
  font-weight: 700;
}
.danger { border-color: var(--bad); color: var(--bad); }
.ok { border-color: var(--ok); color: var(--ok); }
.ghost { background: var(--card); }

.view { padding: 16px; max-width: 1100px; margin: 0 auto; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.card .k { color: var(--muted); font-size: 0.8rem; }
.card .v { font-size: 1.35rem; font-weight: 700; margin-top: 4px; }
.card .s { color: var(--muted); font-size: 0.78rem; margin-top: 4px; }
h2 { font-size: 1rem; margin: 18px 0 8px; }
.note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
  background: #14201b;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: right; vertical-align: top; }
th { color: var(--muted); font-weight: 400; }
.scroll { overflow-x: auto; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 72px; }
.bars i {
  display: block;
  flex: 1;
  background: linear-gradient(180deg, var(--gold), #6d5424);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}

label { display: block; font-size: 0.82rem; color: var(--muted); margin: 10px 0 4px; }
input[type="text"], input[type="number"], input[type="search"], textarea, select {
  width: 100%;
  background: #101916;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  outline: none;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pager { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  border: 1px solid var(--line);
}
.badge.on { color: var(--ok); border-color: var(--ok); }
.badge.off { color: var(--bad); border-color: var(--bad); }
.error {
  background: rgba(226, 107, 90, 0.12);
  color: #ffd0c8;
  border: 1px solid var(--bad);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); margin-top: 10px; }
.check input { width: auto; margin-top: 4px; }
.progress {
  height: 8px;
  background: #101916;
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress span { display: block; height: 100%; background: var(--gold); }

@media (max-width: 800px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; }
  .top { grid-column: 1 / -1; }
  .nav {
    grid-row: 2;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: calc(100vh - 62px);
    border-bottom: 0;
    border-left: 1px solid var(--line);
  }
  .nav button { text-align: right; border-radius: 12px; }
  .view { grid-column: 2; }
}
