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

:root {
  --bg: #f4f6fa; --surface: #ffffff; --text: #1d2433; --muted: #6b7385; --line: #e3e7ef;
  --brand: #1f5c99; --brand-2: #00a2e0; --up: #13924a; --down: #cf2a3c;
  --call-bg: #ecf5e7; --put-bg: #fdecea; --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f141c; --surface: #18202b; --text: #e6eaf2; --muted: #98a2b5; --line: #2a3443;
          --brand: #5a9be0; --brand-2: #39c0f2; --up: #3fbf74; --down: #f06676; --call-bg: #1c2b1f; --put-bg: #33201f; }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Vazirmatn, Tahoma, sans-serif; background: var(--bg); color: var(--text); line-height: 1.8; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: .4rem 0 1rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.center { text-align: center; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand svg { width: 28px; height: 28px; color: var(--brand-2); }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a { color: var(--text); }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }

.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: .55rem 1.3rem;
       font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-sm { padding: .3rem .9rem; font-size: .9rem; }
.nav .btn { color: #fff; }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.wide { width: 100%; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.flash { border-radius: 10px; padding: .6rem 1rem; margin: 16px 0; background: #e8f3ff; color: #144a7a; }
.flash-error { background: #fdecea; color: #8a1c1c; }
.flash-success { background: #e9f7ee; color: #145a2f; }

.hero { text-align: center; padding: 56px 0 24px; }
.hero h1 { font-size: 1.9rem; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 24px; }
.cta { display: flex; gap: 12px; justify-content: center; }
.note { max-width: 560px; margin: 24px auto; }

.auth { max-width: 420px; margin: 40px auto; }
.auth label { display: block; margin-bottom: 14px; font-weight: 700; font-size: .95rem; }
.auth input { display: block; width: 100%; margin-top: 4px; padding: .55rem .8rem; font: inherit; font-weight: 400;
              border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
.auth input:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
.auth .helptext, .auth ul { font-size: .8rem; color: var(--muted); font-weight: 400; }
.auth ul { margin: 4px 0 0; padding-inline-start: 18px; }
.err { display: block; color: var(--down); font-weight: 400; font-size: .85rem; }

.day-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 16px; gap: 8px; }
.day-head h1 { margin: 0; }
.pager { white-space: nowrap; font-size: .95rem; }
.pager.off { color: var(--line); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi-label { color: var(--muted); font-size: .9rem; }
.kpi-val { font-size: 1.35rem; font-weight: 700; }
.kpi-val small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.chg { font-weight: 700; font-size: .95rem; }
.chg.up { color: var(--up); } .chg.down { color: var(--down); }

.report-img { padding: 12px; text-align: center; }
.report-img img { width: 100%; max-width: 620px; border-radius: 10px; display: block; margin: 0 auto; }
.img-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

.sec { font-size: 1.15rem; margin: 28px 0 12px; }
.tops { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.top h3 { margin: 0 0 8px; font-size: 1rem; }
.top table, .arch { width: 100%; border-collapse: collapse; }
.top td { padding: 6px 8px; border-top: 1px solid var(--line); }
.top.call tr:nth-child(odd) td { background: var(--call-bg); }
.top.put tr:nth-child(odd) td { background: var(--put-bg); }
.rank { width: 2rem; color: var(--muted); }
.sym { font-weight: 700; }
.num { text-align: left; font-variant-numeric: tabular-nums; }
.unit { font-size: .8rem; margin-top: 6px; }

.table-card { padding: 0; overflow-x: auto; }
.arch th, .arch td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.arch th { color: var(--muted); font-weight: 400; font-size: .9rem; }
.arch td.num { text-align: left; }
.arch tr:last-child td { border-bottom: 0; }

.foot { color: var(--muted); font-size: .85rem; padding: 40px 16px 32px; text-align: center; }

@media (max-width: 640px) {
  .kpis, .tops { grid-template-columns: 1fr; }
  .day-head h1 { font-size: 1.15rem; }
  .hero h1 { font-size: 1.45rem; }
}

/* market tabs on the daily report and archive pages: بورس اوراق | بورس کالا */
.mk-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0 6px; }
.mk-tabs a { padding: .5rem 1.2rem; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.mk-tabs a:hover { color: var(--text); text-decoration: none; }
.mk-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
