@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.ttf); font-weight: 400; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.ttf); font-weight: 700; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Black.ttf); font-weight: 900; }

:root {
  --bg: #f2f5fb; --panel: #ffffff; --ink: #14204a; --muted: #6b7698; --line: #e3e8f3;
  --blue: #2e7cf6; --blue-d: #1f55d8; --green: #22a55b; --red: #e0453f; --yellow: #f5a300; --side: #1546d0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1330; --panel: #151d44; --ink: #eef2ff; --muted: #9aa6cf; --line: #263166; --side: #0a1035; }
}
* { box-sizing: border-box; }
[v-cloak] { display: none; }
body { margin: 0; font-family: Vazirmatn, Tahoma, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; }
input, textarea, select, button { font-family: inherit; font-size: 14px; }
input, textarea, select { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); }
textarea { resize: vertical; }
h1, h2, h3 { margin: 0; }
h3 { font-size: 16px; margin-bottom: 12px; }
.mono { font-family: ui-monospace, Menlo, monospace; direction: ltr; unicode-bidi: plaintext; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }

.btn { border: 0; border-radius: 10px; padding: 9px 16px; cursor: pointer; background: var(--line); color: var(--ink); font-weight: 700; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: inherit; border: 1px solid currentColor; opacity: .8; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; }

.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #3fb6ff, #1546d0); padding: 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 12px; text-align: center; }
.login-icon { width: 96px; height: 96px; margin: 0 auto; }
.error { color: var(--red); margin: 0; }

.shell { display: flex; min-height: 100vh; }
.side { width: 230px; background: var(--side); color: #fff; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; margin-bottom: 22px; }
.brand img { width: 40px; height: 40px; }
.side nav { display: grid; gap: 4px; flex: 1; }
.side nav a { padding: 10px 12px; border-radius: 10px; cursor: pointer; color: #dbe6ff; }
.side nav a.active, .side nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.who { display: grid; gap: 4px; border-top: 1px solid rgba(255,255,255,.2); padding-top: 12px; }
.main { flex: 1; padding: 22px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.card.warn { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,163,0,.2); }
.card label { display: grid; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.card label.switch { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.card label.switch input { width: auto; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.grid.stats.small { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 4px; }
.stat b { font-size: 24px; font-weight: 900; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.hl { background: linear-gradient(160deg, #3fb6ff, #1f55d8); color: #fff; border: 0; }
.stat.hl span { color: #e3eeff; }

table { width: 100%; border-collapse: collapse; }
.list { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.list th, .list td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list th { color: var(--muted); font-weight: 700; font-size: 13px; background: rgba(46,124,246,.06); }
.list input { padding: 6px 8px; }
.clickable { cursor: pointer; }
.clickable:hover { background: rgba(46,124,246,.06); }
.kv td { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.kv td:last-child { text-align: left; font-weight: 700; }
.tag { padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.tag.ok { background: rgba(34,165,91,.15); color: var(--green); }
.tag.bad { background: rgba(224,69,63,.15); color: var(--red); }
.tag.warn { background: rgba(245,163,0,.18); color: var(--yellow); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 6px; }
.dot.ok { background: var(--green); } .dot.bad { background: var(--red); }
.toolbar, .row { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.row > input, .row > select { flex: 1; }
.links { display: flex; gap: 14px; margin-top: 12px; }
.links a { color: var(--blue); }

.chart { width: 100%; height: 200px; }
.chart .ba { fill: var(--blue); } .chart .bb { fill: var(--yellow); }
.chart-days { display: grid; grid-template-columns: repeat(14, 1fr); font-size: 11px; color: var(--muted); text-align: center; direction: ltr; }
.chart-legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin: 0 4px; vertical-align: middle; }
.lg.a { background: var(--blue); } .lg.b { background: var(--yellow); }

.maint-banner { background: var(--yellow); color: #3a2500; padding: 10px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.toast { position: fixed; bottom: 24px; left: 24px; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; z-index: 50; }
.drawer-bg { position: fixed; inset: 0; background: rgba(5,10,30,.45); display: flex; justify-content: flex-start; z-index: 40; }
.drawer { width: min(640px, 100%); background: var(--bg); height: 100vh; overflow-y: auto; padding: 20px; }

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  .side nav { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 16px; }
  .list { display: block; overflow-x: auto; }
}
