/* آوان — سامانه جامع مدیریت پانسیون مطالعاتی
   هویت بصری: سبز تیره + طلایی (برگرفته از طرح صفحه ورود)، فونت وزیرمتن، راست‌به‌چپ، موبایل‌محور */

@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 {
  --g900: #0a2a23;
  --g800: #0f3d33;
  --g700: #14503f;
  --g600: #1b6652;
  --g100: #e3efe9;
  --g50: #f1f7f4;
  --gold: #c6a15b;
  --gold-dark: #a7843f;
  --gold-light: #efe2c0;
  --bg: #f6f4ee;
  --card: #ffffff;
  --text: #1c2925;
  --muted: #6b7a74;
  --border: #e6e1d5;
  --ok: #1f8a5b;   --ok-bg: #e2f4ea;
  --bad: #c0392b;  --bad-bg: #fbe7e4;
  --warn: #b7791f; --warn-bg: #fdf1dc;
  --info: #2b6cb0; --info-bg: #e5eef9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 61, 51, .06), 0 4px 16px rgba(15, 61, 51, .06);
  --sidebar: 248px;
}

* { box-sizing: border-box; }
/* اندازه پیش‌فرض همه آیکون‌ها؛ بخش‌های خاص (منو، دکمه اسکن، نوار پایین) اندازه خودشان را دارند */
.ic { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.2em; }
html { font-size: 15.5px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Vazirmatn", Tahoma, sans-serif; background: var(--bg); color: var(--text);
  line-height: 1.75; font-feature-settings: "ss01";
}
a { color: var(--g600); text-decoration: none; }
a:hover { color: var(--g800); }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; color: var(--g900); }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; color: var(--g900); }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.pre { white-space: pre-line; }
.inline { display: inline; margin: 0; }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ---------- چیدمان کلی ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; background: linear-gradient(180deg, var(--g800), var(--g900));
  color: #dfe9e4; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1rem .75rem;
  display: flex; flex-direction: column;
}
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: .75rem; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--g900); font-weight: 700; font-size: 1.2rem;
}
.brand-mark svg { width: 66%; height: 66%; display: block; }
.brand-text b { display: block; color: #fff; font-size: 1.1rem; line-height: 1.3; }
.brand-text span { font-size: .75rem; color: var(--gold-light); opacity: .85; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav .sec { font-size: .72rem; color: rgba(255,255,255,.45); padding: .8rem .75rem .25rem; }
.side-nav a {
  display: flex; align-items: center; gap: .65rem; color: #d5e2dc; padding: .55rem .75rem; border-radius: 10px; font-size: .95rem;
}
.side-nav a svg { width: 19px; height: 19px; opacity: .8; flex-shrink: 0; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: rgba(198,161,91,.16); color: #fff; box-shadow: inset -3px 0 0 var(--gold); }
.side-nav a .count { margin-inline-start: auto; background: var(--gold); color: var(--g900); border-radius: 99px; font-size: .72rem; padding: 0 .45rem; font-weight: 700; }
.side-foot { margin-top: auto; padding: .75rem .5rem 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.side-foot .who { color: #fff; }
.side-foot .who small { color: var(--gold-light); display: block; }
.side-foot .links { display: flex; gap: .75rem; margin-top: .4rem; }
.side-foot a, .side-foot button { color: #b9cbc3; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.side-foot a:hover, .side-foot button:hover { color: #fff; }

.main { flex: 1; min-width: 0; }
.topbar {
  display: none; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem 1rem;
  background: var(--g800); color: #fff; position: sticky; top: 0; z-index: 30;
}
.topbar .brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; }
.topbar .brand-mark { width: 32px; height: 32px; font-size: 1rem; border-radius: 9px; }
.menu-btn { background: none; border: 0; color: #fff; padding: .3rem; cursor: pointer; }
.menu-btn svg { width: 26px; height: 26px; }
.container { max-width: 1280px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.page-head .sub { color: var(--muted); font-size: .92rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- کارت‌ها و گرید ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 1rem 1.1rem 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid > .card { margin-bottom: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid + .card, .grid + .grid, .card + .grid { margin-top: 1rem; }
.grid.top { align-items: start; }
.col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.col > .card { margin-bottom: 0; }
.card-link { display: block; color: inherit; border-color: var(--gold); background: #fffdf7; }
.card-link:hover { color: inherit; box-shadow: 0 6px 24px rgba(198,161,91,.18); }
.card-link b { display: flex; align-items: center; gap: .4rem; color: var(--g900); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow);
  display: block; color: inherit; position: relative; overflow: hidden;
}
a.stat:hover { border-color: var(--gold); color: inherit; }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stats.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat .label { font-size: .85rem; color: var(--muted); }
.stat .value { font-size: 1.75rem; font-weight: 700; color: var(--g900); line-height: 1.3; }
.stat .value small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.stat .hint { font-size: .8rem; color: var(--muted); }
.stat::after { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--g600); }
.stat.ok::after { background: var(--ok); } .stat.bad::after { background: var(--bad); }
.stat.warn::after { background: var(--warn); } .stat.gold::after { background: var(--gold); } .stat.info::after { background: var(--info); }
.up { color: var(--ok); } .down { color: var(--bad); }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem 1.05rem; min-height: 42px;
  border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text); font: inherit; font-size: .95rem;
  cursor: pointer; white-space: nowrap; line-height: 1.4;
}
.btn:hover { background: var(--g50); color: var(--text); }
.btn-primary { background: var(--g800); border-color: var(--g800); color: #fff; }
.btn-primary:hover { background: var(--g700); color: #fff; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); border-color: var(--gold-dark); color: var(--g900); font-weight: 700; }
.btn-gold:hover { filter: brightness(1.05); color: var(--g900); }
.btn-danger { color: var(--bad); border-color: #f0c7c1; }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 32px; padding: .2rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-lg { min-height: 54px; padding: .7rem 1.6rem; font-size: 1.1rem; font-weight: 700; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg, .card-head h2 svg, h2 > svg, b > svg { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }
.btn-lg svg { width: 22px; height: 22px; }
.link-btn { background: none; border: 0; color: var(--g600); cursor: pointer; font: inherit; padding: 0; }
.link-btn.danger { color: var(--bad); }

/* ---------- فرم‌ها ---------- */
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 1rem; color: var(--text); padding: .5rem .75rem; min-height: 44px; width: 100%;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(198,161,91,.35); border-color: var(--gold); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--g700); }
.check { flex-direction: row; align-items: center; gap: .45rem; color: var(--text); cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filter-bar label { min-width: 8.5rem; }
.date-input { max-width: 10rem; direction: ltr; text-align: right; }
.time-input { max-width: 6.5rem; direction: ltr; text-align: center; }
.req::after { content: " *"; color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: .3rem .8rem; border-radius: 99px; border: 1px solid var(--border); background: #fff;
  color: var(--text); cursor: pointer; font-size: .9rem; user-select: none;
}
.chip input:checked + span { background: var(--g800); color: #fff; border-color: var(--g800); }
.chip input:focus-visible + span { outline: 3px solid rgba(198,161,91,.4); }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.segmented a { padding: .4rem .9rem; color: var(--text); font-size: .9rem; border-inline-start: 1px solid var(--border); }
.segmented a:first-child { border-inline-start: 0; }
.segmented a.active { background: var(--g800); color: #fff; }

/* ---------- جدول ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: .6rem .7rem; text-align: right; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: var(--g50); color: var(--g800); font-weight: 700; font-size: .85rem; white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover { background: #fbfaf6; }
td.num, th.num { text-align: center; white-space: nowrap; }
tr.muted-row td { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* ---------- برچسب‌ها ---------- */
.badge { display: inline-block; padding: .05rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--g100); color: var(--g700); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.gold { background: var(--gold-light); color: var(--gold-dark); }
.badge.gray { background: #eeece6; color: var(--muted); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--muted); margin-inline-end: .3rem; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }

/* ---------- پیام‌ها ---------- */
.flash { padding: .75rem 1rem; border-radius: 12px; margin-bottom: .75rem; border: 1px solid; font-size: .95rem; }
.flash.success { background: var(--ok-bg); border-color: #b5dfc8; color: #165c3e; }
.flash.error { background: var(--bad-bg); border-color: #f1c0b9; color: #8c2a1f; }
.flash.info, .flash.message { background: var(--info-bg); border-color: #bcd2ee; color: #234f80; }
.notice { padding: .8rem 1rem; border-radius: 12px; background: var(--warn-bg); color: #7a4f12; border: 1px solid #f0d9a8; margin-bottom: 1rem; font-size: .93rem; }
.notice.info { background: var(--info-bg); color: #234f80; border-color: #bcd2ee; }

/* ---------- تب‌ها ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs button {
  background: none; border: 0; padding: .6rem 1rem; font: inherit; color: var(--muted); cursor: pointer; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--g800); border-color: var(--gold); font-weight: 700; }

/* ---------- نمودار میله‌ای (HTML/CSS؛ در PDF هم درست چاپ می‌شود) ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 1.2rem; direction: ltr; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-stack { width: 100%; max-width: 46px; display: flex; align-items: flex-end; gap: 3px; height: calc(100% - 2.6rem); }
.bar { flex: 1; border-radius: 6px 6px 2px 2px; background: var(--g600); position: relative; min-height: 2px; }
.bar.alt { background: var(--gold); }
.bar.ghost { background: repeating-linear-gradient(45deg, var(--gold-light), var(--gold-light) 4px, #fff 4px, #fff 8px); border: 1px dashed var(--gold); }
.bar .v { position: absolute; top: -1.25rem; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--g800); white-space: nowrap; }
.bar-label { font-size: .72rem; color: var(--muted); margin-top: .3rem; text-align: center; line-height: 1.3; white-space: nowrap; }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: middle; margin-inline-end: .3rem; background: var(--g600); }
.legend i.alt { background: var(--gold); }
.legend i.ghost { background: var(--gold-light); border: 1px dashed var(--gold); }
.hbar { display: grid; grid-template-columns: 7.5rem 1fr 4rem; align-items: center; gap: .6rem; margin-bottom: .45rem; font-size: .9rem; }
.hbar .track { background: var(--g50); border-radius: 99px; height: .7rem; overflow: hidden; }
.hbar .fill { height: 100%; background: linear-gradient(90deg, var(--g600), var(--g700)); border-radius: 99px; }
.progress { background: var(--g50); border-radius: 99px; height: .6rem; overflow: hidden; }
.progress > div { height: 100%; background: var(--gold); border-radius: 99px; }

/* ---------- صفحه زنده سالن ---------- */
.live-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.live-group h3 { display: flex; justify-content: space-between; align-items: center; font-size: .95rem; }
.people { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto;
  scrollbar-gutter: stable; padding-inline-end: .9rem; margin-inline-end: -.9rem; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.people::-webkit-scrollbar { width: 6px; }
.people::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.people li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.people li:last-child { border-bottom: 0; }
.people .meta { font-size: .78rem; color: var(--muted); }
.slot-now { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .75rem; border-radius: 99px; background: var(--g800); color: #fff; font-size: .85rem; }
.slot-now.break { background: var(--gold); color: var(--g900); }
.pulse { width: .55rem; height: .55rem; border-radius: 50%; background: #5fe0a5; box-shadow: 0 0 0 0 rgba(95,224,165,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(95,224,165,.6); } 70% { box-shadow: 0 0 0 8px rgba(95,224,165,0); } 100% { box-shadow: 0 0 0 0 rgba(95,224,165,0); } }

/* ---------- صفحه ورود ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--g900); }
.login-hero {
  position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(1200px 500px at 110% -10%, rgba(198,161,91,.25), transparent 60%),
    radial-gradient(700px 400px at -20% 120%, rgba(27,102,82,.7), transparent 60%),
    linear-gradient(160deg, var(--g800), var(--g900));
}
.login-hero.has-photo { background-size: cover; background-position: center; }
.login-hero.has-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(10,42,35,.75), rgba(10,42,35,.92)); }
.login-hero > * { position: relative; }
.hero-title { font-size: 2.6rem; font-weight: 700; line-height: 1.5; margin: 0; color: #fff; }
.hero-title em { font-style: normal; color: var(--gold); }
.hero-line { width: 180px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 1rem 0; }
.hero-sub { font-size: 1.15rem; color: #d7e4de; max-width: 30rem; }
.hero-sub b { color: var(--gold-light); }
.hero-features { display: flex; gap: 2rem; flex-wrap: wrap; }
.hero-features div { display: flex; align-items: center; gap: .6rem; color: #e8efe9; font-size: .95rem; }
.hero-features svg { width: 30px; height: 30px; color: var(--gold); }
.hero-deco { position: absolute; inset-inline-end: -60px; top: 30%; width: 380px; opacity: .08; }
.login-side { display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--bg);
  background-image: radial-gradient(600px 300px at 100% 0, rgba(198,161,91,.12), transparent 60%); }
.login-card {
  width: 100%; max-width: 410px; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); border: 1px solid rgba(198,161,91,.35);
  border-radius: 22px; padding: 2.2rem 2rem 1.75rem; box-shadow: 0 20px 60px rgba(10,42,35,.15);
}
.login-logo { text-align: center; margin-bottom: .25rem; }
.login-logo .wordmark { font-size: 2.3rem; font-weight: 700; letter-spacing: .5rem; color: var(--g800); line-height: 1; }
.login-logo .wave { display: block; margin: .25rem auto 0; width: 120px; }
.login-title { text-align: center; font-weight: 700; color: var(--g900); font-size: 1.02rem; margin: .5rem 0 .25rem; }
.login-ornament { display: flex; align-items: center; gap: .75rem; margin: .75rem 0 1.25rem; color: var(--gold); }
.login-ornament::before, .login-ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.login-ornament::after { background: linear-gradient(270deg, transparent, var(--gold)); }
.input-icon { position: relative; }
.input-icon svg { position: absolute; inset-inline-end: .85rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.input-icon input { padding-inline-end: 2.6rem; min-height: 50px; border-radius: 14px; background: #fff; }
.login-card .btn-primary { min-height: 52px; border-radius: 14px; font-size: 1.05rem; font-weight: 700; margin-top: .5rem; }
.login-foot { text-align: center; font-size: .82rem; color: var(--muted); margin-top: 1.25rem; }

/* ---------- صفحه اسکن QR ---------- */
.scan-page { min-height: 100vh; background: linear-gradient(170deg, var(--g800), var(--g900)); color: #fff; display: flex; flex-direction: column; }
.scan-head { padding: 1.25rem 1.25rem .5rem; display: flex; align-items: center; justify-content: space-between; }
.scan-head .brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; }
.scan-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 1.25rem; max-width: 480px; width: 100%; margin: 0 auto; }
.scan-hello { font-size: 1.35rem; font-weight: 700; margin-bottom: .25rem; }
.scan-clock { font-size: 3.2rem; font-weight: 700; color: var(--gold); line-height: 1.2; }
.scan-status { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.1); border-radius: 99px; padding: .3rem .9rem; font-size: .9rem; margin: .75rem 0 1.5rem; }
.scan-actions { display: flex; flex-direction: column; gap: .75rem; }
.scan-btn {
  width: 100%; min-height: 76px; border-radius: 20px; border: 0; font: inherit; font-size: 1.35rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .6rem;
}
.scan-btn.primary { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--g900); box-shadow: 0 10px 30px rgba(198,161,91,.35); }
.scan-btn.secondary { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); min-height: 60px; font-size: 1.1rem; }
.scan-btn svg { width: 28px; height: 28px; }
.scan-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1.5rem; text-align: center; }
.scan-mini div { background: rgba(255,255,255,.07); border-radius: 14px; padding: .6rem .3rem; }
.scan-mini b { display: block; font-size: 1.2rem; color: #fff; }
.scan-mini span { font-size: .75rem; color: #b9cbc3; }
.scan-done { text-align: center; }
.scan-done .tick { width: 110px; height: 110px; border-radius: 50%; background: rgba(95,224,165,.15); display: grid; place-items: center; margin: 0 auto 1rem; }
.scan-done .tick svg { width: 64px; height: 64px; color: #5fe0a5; }
.scan-done.blocked .tick { background: rgba(233,120,100,.15); }
.scan-done.blocked .tick svg { color: #f19b8b; }
.scan-foot { text-align: center; padding: 1rem; font-size: .85rem; }
.scan-foot a { color: var(--gold-light); }
.scan-page .flash { color: var(--text); }

/* ---------- پنل دانش‌آموز ---------- */
.student-shell .container { max-width: 980px; padding-bottom: 2.5rem; }
@media (max-width: 700px) { .student-shell .container { padding-bottom: 6rem; } }
.s-top { background: linear-gradient(160deg, var(--g800), var(--g900)); color: #fff; padding: 1rem 1.25rem 3.5rem; }
.s-top-inner { max-width: 980px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.s-top .brand { display: flex; align-items: center; gap: .6rem; color: #fff; }
.s-top .brand-mark { width: 36px; height: 36px; }
.s-top nav { display: flex; gap: .25rem; }
.s-top nav a { color: #cfe0d8; padding: .35rem .8rem; border-radius: 9px; font-size: .92rem; }
.s-top nav a.active, .s-top nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.s-top .acct { display: flex; gap: .75rem; align-items: center; font-size: .85rem; }
.s-top .acct a, .s-top .acct button { color: #cfe0d8; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.s-lift { margin-top: -2.75rem; }
.hello-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hello-card .big { font-size: 1.25rem; font-weight: 700; color: var(--g900); }
.state-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .9rem; border-radius: 99px; font-weight: 700; font-size: .9rem; }
.state-pill.inside { background: var(--ok-bg); color: var(--ok); }
.state-pill.temp_out { background: var(--warn-bg); color: var(--warn); }
.state-pill.left, .state-pill.none { background: #eeece6; color: var(--muted); }
.tabbar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); z-index: 40;
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(15,61,51,.08);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: .7rem; color: var(--muted); padding: .2rem 0; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.active { color: var(--g800); font-weight: 700; }
.tabbar a.active svg { color: var(--gold-dark); }
.log-list { list-style: none; padding: 0; margin: 0; }
.log-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.log-list li:last-child { border-bottom: 0; }
.taraz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; text-align: center; }
.taraz-grid .box { border-radius: 14px; padding: .8rem; background: var(--g50); }
.taraz-grid .box.target { background: #fbf6ea; }
.taraz-grid b { display: block; font-size: 1.6rem; color: var(--g900); }
/* قانون‌ها (مطابق پوسترهای مجموعه) */
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.rule-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 5rem; }
.rule-head { background: linear-gradient(160deg, var(--g800), var(--g900)); color: #fff; padding: .9rem 1.1rem; }
.rule-no { display: inline-block; font-size: .78rem; color: var(--g900); background: var(--gold); border-radius: 99px; padding: .1rem .7rem; font-weight: 700; }
.rule-head h2 { color: #fff; margin: .45rem 0 0; font-size: 1.2rem; }
.rule-text { margin: 1rem 1.1rem 0; padding: .1rem .8rem; line-height: 2; border-inline-start: 3px solid var(--gold); }
.rule-points { list-style: none; margin: .6rem 1.1rem 0; padding: 0; display: grid; gap: .45rem; }
.rule-points li { background: var(--g50); border-radius: 10px; padding: .5rem .75rem; display: flex; flex-direction: column; gap: .1rem; }
.rule-points li b { font-weight: 600; color: var(--g900); }
.rule-points li span { font-size: .85rem; color: var(--muted); }
.rule-tagline { margin: .8rem 1.1rem 1rem; color: var(--gold-dark); font-size: .9rem; font-style: normal; }
.rule-tagline::before { content: "♡ "; }
.rule-card > :last-child:not(.rule-tagline) { margin-bottom: 1rem; }
.rule-index { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.rule-index a { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; padding: .25rem .65rem .25rem .5rem; border: 1px solid var(--border); border-radius: 99px; color: var(--text); }
.rule-index a span { width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center; background: var(--gold-light); color: var(--gold-dark); font-size: .72rem; font-weight: 700; }
.rule-row { display: flex; align-items: center; gap: .8rem; padding: .65rem 0; border-bottom: 1px dashed var(--border); }
.rule-row:last-child { border-bottom: 0; }
.rule-row.off { opacity: .55; }
.rule-num { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--gold-light); color: var(--gold-dark); font-weight: 700; }
.rule-row-main { flex: 1; min-width: 0; }
.rule-row-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rule-row-actions { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) {
  .rule-grid { grid-template-columns: 1fr; }
  .rule-row { flex-wrap: wrap; }
  .rule-row-text { white-space: normal; }
  .rule-row-actions { width: 100%; }
}

/* ---------- جمله انگیزشی ---------- */
.hello-card { flex-direction: column; align-items: stretch; }
.hello-main { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.daily-quote { position: relative; margin: 0; padding: .8rem 1.1rem .8rem 2.6rem; border-radius: 12px;
  background: linear-gradient(135deg, #fbf6ea, #f6efdc); border: 1px solid var(--gold-light); }
.daily-quote p { margin: 0; color: var(--g900); font-size: 1rem; line-height: 1.9; white-space: pre-line; }
.daily-quote cite { display: block; font-style: normal; font-size: .85rem; color: var(--gold-dark); margin-top: .2rem; }
.daily-quote .q-mark { position: absolute; left: .8rem; top: .35rem; font-size: 1.8rem; color: var(--gold); line-height: 1; }
.scan-quote { margin: 1.25rem auto 0; max-width: 24rem; padding: .9rem 1.1rem; border-radius: 14px; background: rgba(198,161,91,.12);
  border: 1px solid rgba(198,161,91,.35); color: #f3ead2; font-size: 1.02rem; line-height: 1.9; white-space: pre-line; }
.scan-quote cite { display: block; font-style: normal; font-size: .85rem; color: var(--gold); margin-top: .3rem; }
.quote-row { display: flex; gap: .75rem; align-items: center; padding: .75rem 1.1rem; border-bottom: 1px solid var(--border); }
.quote-row:last-child { border-bottom: 0; }
.quote-row.off { background: #faf9f5; }
.quote-row.off textarea { color: var(--muted); }
.quote-edit { flex: 1; display: grid; grid-template-columns: 1fr 9rem auto; gap: .5rem; align-items: center; }
.quote-edit textarea { min-height: 44px; }
.quote-actions { display: flex; gap: .75rem; align-items: center; white-space: nowrap; }
@media (max-width: 700px) {
  .quote-row { flex-direction: column; align-items: stretch; }
  .quote-edit { grid-template-columns: 1fr auto; }
  .quote-edit textarea { grid-column: 1 / -1; }
}

/* ---------- صفحه خطا ---------- */
.error-box { max-width: 480px; margin: 12vh auto; text-align: center; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1100px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; inset-inline-start: 0; top: 0; z-index: 50; transform: translateX(100%); transition: transform .2s; box-shadow: -10px 0 40px rgba(0,0,0,.25); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 45; }
  .topbar { display: flex; }
  .container { padding: 1rem 1rem 3rem; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
@media (max-width: 700px) {
  html { font-size: 15px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .stats, .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .value { font-size: 1.45rem; }
  .s-top nav { display: none; }
  .tabbar { display: flex; }
  .hbar { grid-template-columns: 6rem 1fr 3.4rem; }
  .bars { height: 150px; gap: 3px; }
  .hide-sm { display: none; }
  th, td { padding: .5rem .45rem; }
}

@media print {
  .sidebar, .topbar, .tabbar, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
  .container { padding: 0; max-width: none; }
}
