@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-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
    --side: #1d4a43; --side-2: #255850; --accent: #1d7a6b;
    --bg: #f5f7fa; --card: #fff; --line: #e8edf2; --text: #1f2937; --muted: #6b7280;
    --blue: #1a9bd7; --orange: #f59e0b; --green: #22a55a; --red: #e53935; --purple: #6c5ce7; --teal: #0d9488;
    --male: #2f7ae5; --female: #e84b8a;
    --radius: 16px; --shadow: 0 2px 10px rgba(15, 23, 42, .06);
}
.theme-admin { --side: #1e293b; --side-2: #2a3a52; --accent: #2563eb; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Vazirmatn, Tahoma, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.7; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.4; }
img { max-width: 100%; }
.ic { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.err { color: var(--red); display: block; font-size: 12px; margin-top: 4px; }
.ok-text { color: var(--green); }
.hidden { display: none !important; }
.mt { margin-top: 16px; }
.nowrap { white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 270px; flex-shrink: 0; background: var(--side); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-radius: 0 0 0 0; }
.side-head { padding: 28px 20px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-name { font-weight: 700; font-size: 16px; margin-top: 12px; }
.chip { display: inline-block; margin-top: 6px; font-size: 11px; padding: 2px 12px; border-radius: 20px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); }
.nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: rgba(255,255,255,.82); font-size: 13px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 700; }
.nav a .ic { opacity: .8; }
.nav .count { margin-inline-start: auto; background: var(--orange); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 8px; line-height: 20px; }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 12px; }
.side-foot button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: none; border: 0; color: rgba(255,255,255,.8); font: inherit; padding: 10px; cursor: pointer; border-radius: 10px; }
.side-foot button:hover { background: rgba(255,255,255,.06); color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 32px; max-width: 1240px; width: 100%; margin: 0 auto; }

/* ---------- avatar ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar.lg { width: 96px; height: 96px; border: 4px solid rgba(255,255,255,.2); font-size: 34px; }
.avatar.md { width: 64px; height: 64px; font-size: 24px; }
.avatar.xs { width: 34px; height: 34px; font-size: 14px; }
.avatar-fallback { background: hsl(var(--h), 45%, 88%); color: hsl(var(--h), 45%, 30%); font-weight: 700; }
.avatar-admin { background: #fff; color: #111; font-weight: 700; font-size: 24px; }
.member-hero .avatar.lg { border-color: var(--line); }

/* ---------- page head ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 8px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.section-title { font-size: 16px; margin: 8px 0 14px; }

/* ---------- panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.narrow { max-width: 720px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel-head.mt { margin-top: 26px; }
.panel-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.ic-purple .ic { color: var(--purple); } .ic-orange .ic { color: var(--orange); } .ic-blue .ic { color: var(--blue); }
.sub-title { margin: 24px 0 12px; font-size: 15px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.cols-2 > * { min-width: 0; }
.cols-2.wide-first { grid-template-columns: 1.6fr 1fr; }
.cols-2 > .panel, .cols-2 > div > .panel:last-child { margin-bottom: 0; }
.cols-2 > div > .panel { margin-bottom: 20px; }
.cols-2 + .panel, .cols-2 + section { margin-top: 20px; }

/* ---------- alerts / badges ---------- */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 13px; border: 1px solid; }
.alert.success { background: #ecfdf3; border-color: #b7ebc9; color: #166534; }
.alert.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 10px; border-radius: 8px; white-space: nowrap; line-height: 20px; }
.badge.ok { background: #dcfce7; color: #15803d; }
.badge.warn { background: #fef3c7; color: #b45309; }
.badge.bad { background: #fee2e2; color: #dc2626; }
.badge.info { background: #dbeafe; color: #1d4ed8; }
.badge.muted { background: #f1f5f9; color: #64748b; }
.badge.kind-news { background: #dbeafe; color: #1d4ed8; }
.badge.kind-program { background: #ede9fe; color: #6d28d9; }
.badge.kind-renewal { background: #fee2e2; color: #dc2626; }
.badge.kind-notice { background: #fef3c7; color: #b45309; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: 13px; padding: 10px 22px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; background: var(--accent); color: #fff; text-decoration: none !important; transition: filter .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.primary { background: var(--accent); }
.btn.green { background: var(--green); } .btn.red { background: var(--red); } .btn.purple { background: var(--purple); }
.btn.blue { background: linear-gradient(90deg, #1a9bd7, #2178d6); } .btn.dark { background: #1f2937; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: #f8fafc; }
.btn.lg { padding: 13px 44px; font-size: 15px; }
.btn.sm { padding: 6px 14px; font-size: 12px; }
.btn.xs { padding: 3px 12px; font-size: 11px; border-radius: 8px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.form-actions.center { justify-content: center; border: 0; }
.panel.form-actions { margin-top: 0; padding-top: 22px; border-top: 1px solid var(--line); }
.form-actions form { display: inline; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form.grid-2, .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
.span-2 { grid-column: 1 / -1; }
.form label, .form fieldset { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; }
.form label > .badge { align-self: flex-start; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea { font: inherit; width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; color: var(--text); transition: border-color .15s, background .15s; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
input[type=file] { background: transparent; border: 0; padding: 0; }
textarea { resize: vertical; }
.locked { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1px dashed var(--line); border-radius: 12px; background: #f1f5f9; color: var(--muted); font-weight: 400; }
.radio-q { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 18px !important; }
.radio-q legend { padding: 0 6px; font-weight: 700; }
.radio { flex-direction: row !important; align-items: center; gap: 6px !important; font-weight: 400 !important; }
.upload-field .lbl { font-size: 13px; font-weight: 500; display: block; margin-bottom: 8px; }
.upload-field .lbl em { color: var(--green); font-style: normal; font-size: 12px; }
.drop { border: 2px dashed #d5dde6; border-radius: 14px; padding: 22px 12px; text-align: center; display: flex !important; flex-direction: column; align-items: center; gap: 4px !important; cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--accent); background: #f8fafc; }
.drop b { color: var(--text); font-size: 14px; }
.drop small { font-size: 11px; }
.drop.has { border-color: #b7ebc9; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop .picked { color: var(--green); font-size: 12px; font-weight: 700; }
.doc-link { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; margin-top: 6px; }
.uploads { margin-top: 4px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; flex: 1; min-width: 140px; }
.meter { position: relative; height: 30px; border-radius: 15px; background: #e5e7eb; overflow: hidden; margin-bottom: 20px; }
.meter span { position: absolute; inset: 0 0 0 auto; background: linear-gradient(90deg, #34d399, var(--accent)); border-radius: 15px; }
.meter b { position: relative; display: block; text-align: center; line-height: 30px; font-size: 12px; color: #111; }
.strength { height: 6px; border-radius: 3px; background: #e5e7eb; overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: right; font-weight: 500; color: var(--muted); background: #f8fafc; padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfc; }
.table .actions { display: flex; gap: 6px; align-items: center; justify-content: flex-start; }
.table .actions form { display: inline; }
.who { display: flex; align-items: center; gap: 10px; }
.who span { display: flex; flex-direction: column; line-height: 1.4; }
.who small { color: var(--muted); font-size: 11px; }
.sms-body { max-width: 420px; font-size: 12px; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters a { padding: 6px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 12px; }
.filters a.on { background: var(--side); color: #fff; border-color: var(--side); }
.filters a:hover { text-decoration: none; }
.filters .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar input { flex: 2; min-width: 200px; background: #fff; }
.search-bar select { flex: 1; min-width: 140px; width: auto; background: #fff; }
.pager { display: flex; gap: 4px; justify-content: center; margin: 10px 0 20px; flex-wrap: wrap; }
.pager a { min-width: 34px; text-align: center; padding: 4px 8px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--text); }
.pager a.on { background: var(--side); color: #fff; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty .ic { opacity: .4; }
.empty p { margin: 8px 0 0; }

/* ---------- member dashboard tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 26px; }
.tile { border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 6px 20px rgba(15,23,42,.07); color: var(--text); transition: transform .15s, box-shadow .15s; }
.tile:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15,23,42,.12); }
.tile-top { height: 84px; display: flex; align-items: center; justify-content: center; color: #fff; }
.tile-body { padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.tile-body span { font-size: 12px; color: var(--muted); }
.tile-body b { font-size: 18px; }
.tile-body b.small { font-size: 13px; }
.t-blue .tile-top { background: var(--blue); } .t-blue b { color: #0f172a; }
.t-orange .tile-top { background: var(--orange); }
.t-green .tile-top { background: var(--green); } .t-green b { color: var(--green); }
.t-purple .tile-top { background: var(--purple); } .t-purple b { color: var(--purple); }
.t-red .tile-top { background: var(--red); } .t-red b { color: var(--red); }
.t-teal .tile-top { background: var(--teal); }
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.news li:last-child { border-bottom: 0; }
.news p { margin: 2px 0; font-size: 13px; color: #374151; }
.news small { color: var(--muted); font-size: 11px; }
.mini-event { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-event:last-child { border-bottom: 0; }
.mini-event small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.date-box { width: 54px; height: 58px; border-radius: 12px; background: #f0fdf9; color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.date-box b { font-size: 20px; line-height: 1; } .date-box span { font-size: 11px; }
.nfc-box { display: flex; gap: 16px; align-items: center; margin-top: 20px; }
.nfc-box > div:first-child { width: 56px; height: 56px; border-radius: 14px; background: #f0fdf9; color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nfc-box p { margin: 2px 0; font-size: 12px; }
.nfc-box a { word-break: break-all; }
.status-box { text-align: center; padding: 50px 20px; max-width: 640px; margin: 0 auto; }
.status-box h2 { margin: 16px 0 8px; }
.status-ic { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.status-ic.warn { background: #fef3c7; color: #b45309; } .status-ic.bad { background: #fee2e2; color: #dc2626; }

/* ---------- membership card ---------- */
.card-previews { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.card-previews h4 { text-align: center; font-size: 13px; margin-bottom: 12px; color: #374151; }
.mcard { position: relative; aspect-ratio: 1.586; border-radius: 16px; background: linear-gradient(135deg, #1b4a42, #12352f); border: 2px solid #c9a227; color: #fff; padding: 18px 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.18); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; column-gap: 18px; align-items: center; }
.mc-org { grid-column: 1 / -1; font-size: 11px; color: #e8d48a; margin-bottom: 8px; }
.mc-photo { width: 92px; height: 112px; border-radius: 10px; object-fit: cover; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.mc-info { display: flex; flex-direction: column; line-height: 1.35; z-index: 1; }
.mc-name { font-size: 18px; margin-bottom: 6px; }
.mc-info small { font-size: 9px; opacity: .7; }
.mc-info span { font-size: 13px; font-weight: 700; letter-spacing: .3px; }
.mc-info .gold { color: #f5c518; }
.mc-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.2); margin-top: 8px; padding-top: 6px; font-size: 11px; z-index: 1; }
.mc-watermark { position: absolute; left: 20px; bottom: 18px; font-size: 110px; font-weight: 700; opacity: .06; line-height: 1; pointer-events: none; }
.mcard[dir=ltr] .mc-watermark { left: auto; right: 20px; }

/* ---------- pay ---------- */
.pay-box { text-align: center; max-width: 680px; padding: 36px 22px; }
.pay-ic { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; background: #dcfce7; color: var(--green); display: flex; align-items: center; justify-content: center; }
.pay-box h2 { font-size: 17px; }
.amount { margin: 10px 0 16px; color: var(--muted); }
.amount b { font-size: 30px; color: var(--green); }

/* ---------- events ---------- */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 26px; }
.event-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; color: var(--text); }
a.event-card:hover { text-decoration: none; border-color: var(--accent); }
.event-card.past { opacity: .75; }
.event-card h4 { font-size: 15px; margin-bottom: 4px; }
.event-card .meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.event-card .desc { font-size: 12px; color: #4b5563; margin: 4px 0; }
.event-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; gap: 8px; }
.event-foot a { display: inline-flex; align-items: center; gap: 4px; }
.poster { width: calc(100% + 36px); margin: -18px -18px 10px; height: 160px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; display: block; }
.poster.big { width: 100%; margin: 0 0 16px; height: auto; max-height: 280px; border-radius: 12px; }
.poster-fallback { background: linear-gradient(135deg, hsl(var(--h), 55%, 45%), hsl(calc(var(--h) + 40), 60%, 35%)); color: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center; }

/* ---------- docs ---------- */
.doc-list { display: flex; flex-direction: column; }
.doc-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc-item:last-child { border-bottom: 0; }
.doc-item > span { flex: 1; }
.doc-item > .ic { color: var(--accent); }
.doc-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; color: var(--text); font-size: 11px; text-align: center; }
.thumb img, .thumb .pdf, .thumb > span { width: 100%; height: 80px; object-fit: cover; border-radius: 8px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); }
.empty-thumb { opacity: .6; }

/* ---------- tickets ---------- */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 75%; padding: 12px 16px; border-radius: 14px; background: #f1f5f9; }
.msg.mine { align-self: flex-start; background: color-mix(in srgb, var(--accent) 10%, #fff); }
.msg.theirs { align-self: flex-end; }
.msg-meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.msg-file { font-size: 12px; display: inline-flex; gap: 4px; margin-top: 6px; }

/* ---------- details ---------- */
.detail { display: grid; grid-template-columns: 200px 1fr; gap: 10px 20px; margin: 0; }
.detail dt { color: var(--muted); font-size: 13px; }
.detail dd { margin: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.member-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.member-hero .grow { flex: 1; min-width: 240px; }
.member-hero h2 { font-size: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.member-hero p { margin: 4px 0; }
.hero-actions { display: flex; gap: 10px; }
details summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.bullets { padding-inline-start: 20px; margin: 8px 0; }
.tips ol { padding-inline-start: 22px; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.dir-card { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--text); }
a.dir-card:hover { text-decoration: none; border-color: var(--accent); }
.dir-card div { display: flex; flex-direction: column; line-height: 1.5; }
.dir-card span { font-size: 13px; color: var(--accent); }
.dir-card small { color: var(--muted); font-size: 12px; display: flex; gap: 4px; align-items: center; }

/* ---------- admin stats ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.stat-cards.small .stat { border-top-width: 1px; padding: 14px 18px; }
.stat-cards.small b { font-size: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; justify-content: space-between; align-items: flex-start; box-shadow: var(--shadow); color: var(--text); }
a.stat:hover { text-decoration: none; box-shadow: 0 8px 22px rgba(15,23,42,.1); }
.stat div { display: flex; flex-direction: column; }
.stat span { font-size: 13px; font-weight: 700; }
.stat b { font-size: 30px; line-height: 1.5; }
.stat b.sm { font-size: 18px; line-height: 2.2; }
.stat small { font-size: 11px; color: var(--muted); }
.stat i { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: var(--muted); flex-shrink: 0; }
.s-orange { border-top-color: var(--orange); } .s-orange i { background: #fef3c7; color: var(--orange); }
.s-purple { border-top-color: var(--purple); } .s-purple i { background: #ede9fe; color: var(--purple); }
.s-red { border-top-color: var(--red); } .s-red i { background: #fee2e2; color: var(--red); }
.s-green { border-top-color: var(--green); } .s-green i { background: #dcfce7; color: var(--green); }
.s-blue { border-top-color: var(--blue); } .s-blue i { background: #e0f2fe; color: var(--blue); }

.hbars { display: flex; flex-direction: column; gap: 18px; }
.hbar-lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.track { height: 10px; border-radius: 5px; background: #eef2f6; overflow: hidden; display: flex; }
.track span { display: block; height: 100%; border-radius: 5px; }
.track.stacked { width: var(--w); min-width: 4%; }
.track.stacked span { border-radius: 0; }
.male { background: var(--male); } .female { background: var(--female); }
.prov-list { display: flex; flex-direction: column; gap: 16px; max-height: 640px; overflow-y: auto; padding-inline-end: 4px; }
.prov-sub { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; max-width: 100%; }
.donut-wrap { display: flex; align-items: center; gap: 24px; margin-top: 22px; }
.donut { --p: 50; width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--male) calc(var(--p) * 1%), var(--female) 0); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.donut::before { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: #fff; }
.donut b, .donut span { position: relative; } .donut b { font-size: 22px; line-height: 1; } .donut span { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-inline-end: 4px; }
.vbars { display: flex; justify-content: space-between; gap: 8px; height: 170px; align-items: flex-end; padding-top: 18px; }
.vcol { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; }
.vcol small { font-size: 11px; color: var(--muted); }
.vpair { flex: 1; display: flex; gap: 4px; align-items: flex-end; width: 100%; justify-content: center; }
.vpair span { width: 16px; min-height: 3px; border-radius: 5px 5px 0 0; position: relative; }
.vpair em { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; font-style: normal; color: var(--muted); }
.req, i.req { background: #c4b5fd; } .iss, i.iss { background: var(--purple); }
.split-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-top: 22px; background: #eef2f6; }
.todo, i.todo { background: var(--orange); } .done, i.done { background: var(--green); }

.article p { margin: 6px 0; }

/* ---------- auth ---------- */
.auth { background: linear-gradient(160deg, var(--side), var(--side-2)); }
/* member sign-in / sign-up: light background (client, 1405/09); the admin login stays dark */
.theme-member.auth { background: radial-gradient(circle at 15% 10%, #dcefeb 0, transparent 45%), radial-gradient(circle at 90% 85%, #e3ebf6 0, transparent 45%), #eef3f6; }
.theme-member.auth .auth-card { box-shadow: 0 10px 40px rgba(15, 40, 60, .10); border: 1px solid #e2e9ef; }
input::placeholder { color: #a8b1bd; }
input:focus::placeholder { color: transparent; }
/* show-password eye */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-left: 42px !important; }
.pw-eye { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; padding: 6px; cursor: pointer; color: var(--muted); line-height: 0; border-radius: 8px; }
.pw-eye:hover { color: var(--accent); background: #f1f5f9; }
/* password pattern checklist */
.pw-rules { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; font-weight: 400; color: var(--muted); }
.pw-rules li::before { content: "○"; margin-left: 4px; }
.pw-rules li.ok { color: var(--green); }
.pw-rules li.ok::before { content: "✓"; }
.pw-rules li.bad { color: var(--red); }
.pw-rules li.bad::before { content: "✕"; }
/* review before sign-up */
.review-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.review-box { background: #fff; border-radius: 18px; width: 100%; max-width: 620px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.review-box h3 { padding: 18px 22px 6px; font-size: 17px; }
.review-box > p { padding: 0 22px; margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.review-list { overflow-y: auto; padding: 0 22px; margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0; }
.review-list dt, .review-list dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.review-list dt { color: var(--muted); padding-left: 16px; }
.review-list dd { font-weight: 500; word-break: break-word; }
.review-list dd.empty { color: var(--muted); font-weight: 400; }
.review-foot { padding: 14px 22px 18px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); }
.review-foot .btns { display: flex; gap: 10px; }
.review-foot .btns .btn { flex: 1; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-card { background: #fff; border-radius: 22px; padding: 32px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card:has(.grid-2) { max-width: 780px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; color: var(--accent); }
.auth-brand div { display: flex; flex-direction: column; line-height: 1.4; }
.auth-brand b { color: var(--text); font-size: 16px; }
.auth-brand span { color: var(--muted); font-size: 12px; }
.auth-title { font-size: 19px; margin-bottom: 8px; }
.auth-card .muted { font-size: 13px; }
.auth-card .form { margin-top: 16px; }
.auth-alt { text-align: center; margin-top: 16px; font-size: 13px; }
.otp-input { text-align: center; font-size: 24px; letter-spacing: 10px; font-weight: 700; }

/* ---------- public profile (NFC) ---------- */
.public-profile { background: linear-gradient(160deg, #1d4a43, #0f2b27); min-height: 100vh; }
.pp-wrap { display: flex; justify-content: center; padding: 30px 16px; }
.pp-card { background: #fff; border-radius: 24px; padding: 28px 24px; width: 100%; max-width: 420px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.pp-org { display: flex; gap: 6px; justify-content: center; align-items: center; color: #1d7a6b; font-weight: 700; font-size: 13px; margin-bottom: 18px; }
.pp-photo { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; border: 5px solid #e6f4f1; display: inline-flex; align-items: center; justify-content: center; font-size: 46px; }
.pp-card h1 { font-size: 22px; margin-top: 14px; }
.pp-en { color: var(--muted); font-size: 13px; }
.pp-spec { color: #1d7a6b; font-weight: 700; margin-top: 4px; }
.pp-status { display: inline-flex; gap: 6px; align-items: center; margin: 14px 0; padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 700; }
.pp-status.ok { background: #dcfce7; color: #15803d; } .pp-status.bad { background: #fee2e2; color: #dc2626; }
.pp-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: right; margin: 10px 0; font-size: 13px; }
.pp-info dt { color: var(--muted); } .pp-info dd { margin: 0; font-weight: 700; text-align: left; }
.pp-mark { width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; background: #e6f4f1; color: #1d7a6b; display: flex; align-items: center; justify-content: center; }
.pp-rows { text-align: right; border-top: 1px solid var(--line); margin-top: 6px; }
.pp-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pp-row:last-child { border-bottom: 0; }
.pp-row > .ic { color: #1d7a6b; margin-top: 3px; }
.pp-row small { display: block; color: var(--muted); font-size: 12px; }
.pp-row span, .pp-row a { font-weight: 700; font-size: 14px; }
.dir-card .dir-line { display: flex; gap: 6px; align-items: flex-start; color: #374151; font-size: 12px; }
.dir-card .dir-line .ic { color: var(--muted); margin-top: 3px; }
.pp-bio { font-size: 13px; color: #374151; border-top: 1px solid var(--line); padding-top: 12px; text-align: justify; }
.pp-foot { font-size: 11px; color: var(--muted); margin-top: 16px; }

/* ---------- public directory ---------- */
.public-dir { background: var(--bg); }
.dir-wrap { max-width: 1100px; margin: 0 auto; padding: 30px 16px; }
.dir-wrap h1 { font-size: 22px; display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.dir-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dir-filters input { flex: 2; min-width: 180px; background: #fff; }
.dir-filters select { flex: 1; min-width: 150px; background: #fff; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* ---------- certificate ---------- */
.cert-page { background: #e5e7eb; }
.cert-actions { text-align: center; padding: 20px; }
.cert { max-width: 900px; margin: 0 auto 30px; background: #fff; padding: 16px; aspect-ratio: 1.414; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.cert-inner { border: 3px double #c9a227; height: 100%; padding: 40px 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px; }
.cert-org { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #1d4a43; font-size: 18px; }
.cert h1 { font-size: 38px; color: #1d4a43; }
.cert p { font-size: 18px; line-height: 2.2; max-width: 680px; }
.cert-foot { display: flex; justify-content: space-between; width: 100%; font-size: 13px; color: var(--muted); margin-top: 30px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .cols-2, .cols-2.wide-first { grid-template-columns: 1fr; }
    .cols-2 > .panel { margin-bottom: 0; }
}
@media (max-width: 900px) {
    .side { position: fixed; right: 0; top: 0; z-index: 50; transform: translateX(100%); transition: transform .25s; box-shadow: -10px 0 40px rgba(0,0,0,.3); }
    .side.open { transform: none; }
    .topbar { display: flex; align-items: center; gap: 12px; background: var(--side); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 40; font-weight: 700; }
    .menu-btn { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; display: flex; }
    .content { padding: 20px 16px; }
    .tiles { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .card-previews { grid-template-columns: 1fr; }
    .doc-thumbs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .form.grid-2, .grid-2 { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat { padding: 14px; } .stat i { display: none; } .stat b { font-size: 24px; }
    .tiles { grid-template-columns: 1fr 1fr; }
    .tile-top { height: 64px; }
    .detail, .kv { grid-template-columns: 1fr; gap: 2px; }
    .detail dd, .kv dd { margin-bottom: 10px; }
    .panel { padding: 16px; }
    .auth-card { padding: 22px; }
    .mc-photo { width: 70px; height: 86px; }
    .mc-name { font-size: 15px; }
    .msg { max-width: 92%; }
    .page-head h1 { font-size: 19px; }
    .cert-inner { padding: 20px; } .cert h1 { font-size: 26px; } .cert p { font-size: 14px; }
}

/* ---------- print ---------- */
@media print {
    body { background: #fff; }
    .side, .topbar, .page-actions, .alert, .form-actions, .cert-actions, .panel:not(.printable) { display: none !important; }
    .content { padding: 0; }
    .printable { display: block; }
    .mcard { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none; }
    .card-previews { grid-template-columns: 1fr 1fr; }
    .cert { box-shadow: none; margin: 0; max-width: none; }
    .cert-page { background: #fff; }
}

.temp-pass { font-size: 16px; letter-spacing: 1px; background: #fff; padding: 2px 8px; border-radius: 6px; margin: 0 4px; }
.auth-register { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; text-align: center; font-size: 13px; color: var(--muted); }

.brand-logo { width: 46px; height: 46px; object-fit: contain; }
.pp-logo { width: 28px; height: 28px; object-fit: contain; }
.cert-logo { width: 72px; height: 72px; object-fit: contain; }
.logo-preview { max-width: 160px; max-height: 120px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.kbd-warn { display: none; align-items: center; gap: 6px; font-size: 12px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 12px; margin-top: 2px; }
.kbd-warn.on { display: flex; }
.pay-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.pay-tabs button { font: inherit; font-weight: 700; font-size: 13px; padding: 9px 20px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--text); }
.pay-tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.card-box { background: #f8fafc; border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; text-align: right; }
.card-box b { font-size: 17px; letter-spacing: 2px; }
.receipt-thumb { max-height: 70px; border-radius: 8px; }

.logo-remove { margin: -8px 0 20px; }

/* admin member page: edit form, password reset, delete */
details.panel > summary.panel-head { list-style: none; margin-bottom: 0; color: inherit; font-size: inherit; }
details.panel > summary.panel-head::-webkit-details-marker { display: none; }
details.panel > summary.panel-head h3::after { content: " ▾"; color: var(--muted); font-size: 12px; }
details.panel[open] > summary.panel-head h3::after { content: " ▴"; }
.danger-zone { border: 1px solid #f5c2c0; }
.danger-zone h3 { color: var(--red); }
a.mini-event { color: inherit; text-decoration: none !important; }
a.mini-event:hover b { color: var(--accent); }
.mini-poster { width: 92px; height: 120px; object-fit: cover; border-radius: 10px; flex-shrink: 0; box-shadow: var(--shadow); background: #f1f5f9; }
@media (max-width: 520px) { .mini-poster { width: 70px; height: 92px; } }
/* Jalali date picker */
.jcal { position: absolute; z-index: 200; width: 272px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(15, 23, 42, .16); padding: 10px; direction: rtl; font-size: 13px; }
.jcal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.jcal-head b { font-size: 14px; }
.jcal button { font: inherit; border: 0; background: transparent; cursor: pointer; border-radius: 8px; color: var(--text); }
.jcal-head button { width: 32px; height: 32px; font-size: 20px; line-height: 1; color: var(--accent); }
.jcal-head button:hover, .jcal-d:hover, .jcal-foot button:hover { background: #f1f5f9; }
.jcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jcal-w { color: var(--muted); font-size: 11px; padding: 4px 0; }
.jcal-d { height: 34px; }
.jcal-d.today { box-shadow: inset 0 0 0 1px var(--accent); }
.jcal-d.on { background: var(--accent) !important; color: #fff; }
.jcal-foot { display: flex; justify-content: space-between; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.jcal-foot button { padding: 4px 10px; color: var(--accent); }
.form .is-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(229, 57, 53, .12); }
.upload-field .err { margin-top: 6px; }
/* poster lightbox */
img.poster, img.mini-poster { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(10, 15, 25, .88); display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox button { position: absolute; top: 14px; left: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; cursor: pointer; }
/* member panel: the whole poster is visible on the cards (no cropping) */
.theme-member img.poster { height: 200px; object-fit: contain; background: #0f172a; }
/* sign-in pages: the logo stands above the association name, larger (client, 1405/09/12) */
.auth-brand { flex-direction: column; text-align: center; gap: 12px; }
.auth-brand div { align-items: center; }
.auth-brand b { font-size: 18px; }
.auth-brand .brand-logo { width: 104px; height: 104px; border-radius: 50%; object-fit: contain; }
.auth-title { text-align: center; }
@media (max-width: 520px) { .auth-brand .brand-logo { width: 84px; height: 84px; } }
