:root {
    --bg: #0b1626; --bg2: #11223a; --card: #152a45; --line: #223a5c;
    --text: #e8eef7; --muted: #93a4bd; --gold: #d4a94f; --gold-d: #b98d2f; --danger: #d9534f; --ok: #2e9e6b;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Vazirmatn, Tahoma, sans-serif; direction: rtl; line-height: 1.8; }
body { background: linear-gradient(rgba(11,22,38,.88), rgba(11,22,38,.92)), url('/images/bg-desk.jpg') center / cover fixed no-repeat, var(--bg); }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: .4em 0; }
.container { width: min(1180px, 94%); margin-inline: auto; }
.muted { color: var(--muted); }
.price { color: var(--gold); font-weight: 700; }

/* header */
.site-header { background: linear-gradient(rgba(17,34,58,.82), rgba(17,34,58,.9)), url('/images/ParhamInvest_Landscape.jpg') center / cover no-repeat, var(--bg2); border-bottom: 1px solid var(--line); }
.header-top { display: flex; align-items: center; gap: 1.5rem; padding: .8rem 0; }
.brand { font-size: 1.4rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.brand-mark { background: var(--gold); color: #1a1405; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; }
.top-links { display: flex; gap: 1.2rem; margin-inline-end: auto; }
.top-links a { color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: .7rem; }
.profile-wrap { position: relative; }
.profile-btn { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 50%; width: 2.4rem; height: 2.4rem; cursor: pointer; position: relative; }
.profile-badge { position: absolute; top: -.35rem; left: -.35rem; background: var(--danger); color: #fff; border-radius: 999px; min-width: 1.2rem; height: 1.2rem; font-size: .72rem; line-height: 1.2rem; text-align: center; padding: 0 .2rem; }
.profile-tooltip { position: absolute; top: calc(100% + .4rem); left: 0; width: min(360px, 85vw); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .55rem; z-index: 40; max-height: 300px; overflow: auto; }
.task-tip-row { width: 100%; text-align: right; background: transparent; border: 0; border-bottom: 1px dashed var(--line); padding: .45rem .25rem; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.task-tip-row:last-child { border-bottom: 0; }
.task-priority-urgent { color: #ff6f6f; }
.task-priority-medium { color: #ffad42; }
.task-priority-normal { color: #ffd75e; }
.task-state-resolved { color: #57d48d; }
.task-state-handled { color: #ffd75e; }
.task-state-not-resolved { color: #ff6f6f; }

/* horizontal menu */
.main-menu { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 1rem 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.main-menu li a { display: block; padding: .8rem 1.4rem; color: var(--text); }
.main-menu li a:hover { background: var(--line); text-decoration: none; }
.main-menu li a.active { background: var(--gold); color: #1a1405; font-weight: 700; }

.page-body { min-height: 55vh; padding-bottom: 2rem; }
.hero { text-align: center; padding: 2.5rem 1rem; background: linear-gradient(135deg, var(--card), var(--bg2)); border-radius: 16px; margin-bottom: 1.5rem; }
.hero h1 { color: var(--gold); font-size: 2.4rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--gold); margin: 1.5rem 0 1rem; }
.more { text-align: center; margin: 1rem 0; }

/* buttons & forms */
.btn { display: inline-block; border: 1px solid transparent; border-radius: 8px; padding: .55rem 1.2rem; cursor: pointer; font: inherit; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: #1a1405; font-weight: 700; }
.btn-gold:hover { background: var(--gold-d); text-decoration: none; }
.btn-outline { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-outline:hover { background: rgba(212,169,79,.12); text-decoration: none; }
.btn-danger-sm { background: var(--danger); color: #fff; border: 0; border-radius: 6px; padding: .2rem .7rem; cursor: pointer; font: inherit; }
.btn.block { display: block; width: 100%; margin-top: .7rem; text-align: center; }
.btn.plus { font-size: 1.4rem; line-height: 1; padding: .2rem .9rem; }
.icon-btn { background: none; border: 0; color: var(--text); font-size: 1.2rem; cursor: pointer; }
.form-ctl { width: 100%; padding: .55rem .8rem; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.form-ctl:focus { outline: 2px solid var(--gold); }
label { display: block; margin-top: .7rem; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.check-row input { width: auto; }
.alert-pi { padding: .6rem 1rem; border-radius: 8px; margin: .7rem 0; }
.alert-pi.error { background: rgba(217,83,79,.15); border: 1px solid var(--danger); }
.alert-pi.ok { background: rgba(46,158,107,.15); border: 1px solid var(--ok); }

/* cards & carousel */
.carousel-wrap { display: flex; align-items: center; gap: .5rem; }
.carousel-track { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; flex: 1; padding: .3rem; }
.carousel-track::-webkit-scrollbar { display: none; }
.car-btn { background: var(--card); color: var(--gold); border: 1px solid var(--line); border-radius: 50%; width: 2.4rem; height: 2.4rem; font-size: 1.4rem; cursor: pointer; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card-pi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; min-width: 280px; scroll-snap-align: start; transition: transform .15s; }
.grid-cards .card-pi { min-width: 0; }
.card-pi:hover { transform: translateY(-3px); border-color: var(--gold); }
.card-img { height: 160px; background: var(--line) center/cover no-repeat; }
.card-media { position: relative; height: 160px; overflow: hidden; }
.card-media .card-img { height: 100%; }
.card-preview-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.card-preview-time { position: absolute; left: .45rem; bottom: .4rem; z-index: 2; padding: .1rem .4rem; border-radius: 4px; background: rgba(0,0,0,.72); color: #fff; direction: ltr; font: .78rem Tahoma, sans-serif; }
.card-body-pi { padding: .8rem 1rem; }
.card-body-pi p { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: .2rem 0; }
.card-meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }

/* modal */
.modal-backdrop-pi { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 1000; outline: none; padding: 1rem; }
.modal-pi { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; width: min(760px, 100%); max-height: 92vh; display: flex; flex-direction: column; }
.modal-head, .modal-foot { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.2rem; }
.modal-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-foot { border-top: 1px solid var(--line); justify-content: space-between; }
.modal-foot-left, .modal-foot-right { display: flex; align-items: center; gap: .6rem; }
.modal-body-pi { padding: 0 1.2rem 1rem; overflow-y: auto; }
.modal-footer-pi-top { padding: .6rem 1.2rem; border-top: 1px solid var(--line); overflow-y: auto; max-height: 30vh; }
.modal-actions { display: flex; gap: .6rem; }
.dlg-img { width: 100%; max-height: 280px; object-fit: cover; border-radius: 10px; margin-top: .8rem; }
.dlg-img.small { max-width: 200px; }
.dlg-video { width: 100%; margin: .8rem 0; border-radius: 10px; background: #000; }
.dlg-desc { font-size: 1.05rem; }

/* keyword grid */
.kw-row { display: grid; grid-template-columns: 70px 50px 1fr; gap: .5rem; margin-bottom: .4rem; align-items: center; }
.kw-spacer { display: block; }
.kw-counter { text-align: center; background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: .3rem; width: 100%; }
.kw-select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: .35rem; font: inherit; }

/* rich text */
.rte-toolbar { display: flex; gap: .3rem; flex-wrap: wrap; margin: .4rem 0; }
.rte-toolbar button { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: .2rem .7rem; cursor: pointer; font: inherit; }
.rte-area { min-height: 180px; padding: .7rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.rte-area.readonly { background: transparent; border: 0; padding: 0; }

/* auth / panel */
.auth-box { max-width: 440px; margin: 2rem auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; }
.tabs { display: flex; gap: .4rem; margin-bottom: .5rem; }
.tabs button { flex: 1; background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: .4rem; cursor: pointer; font: inherit; }
.tabs button.active { color: #1a1405; background: var(--gold); }
.captcha { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; }
.captcha img { border-radius: 6px; }
.captcha input { width: 8rem; }
.panel-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; }
.panel-menu { display: flex; flex-direction: column; background: var(--card); border-radius: 12px; overflow: hidden; align-self: start; }
.panel-menu a { padding: .8rem 1.2rem; color: var(--text); border-bottom: 1px solid var(--line); }
.panel-menu a.active { background: var(--gold); color: #1a1405; }
.stat-box { background: var(--card); border: 1px solid var(--gold); border-radius: 12px; padding: 1rem 1.5rem; display: inline-block; min-width: 240px; }
.stat-label { color: var(--muted); }
.stat-value { font-size: 2.4rem; color: var(--gold); font-weight: 800; }
.grid-table { width: 100%; border-collapse: collapse; }
.grid-table th, .grid-table td { padding: .6rem; border-bottom: 1px solid var(--line); text-align: right; }
.grid-table tr.clickable { cursor: pointer; }
.grid-table tr.clickable:hover { background: var(--card); }
.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; }
.form-grid { max-width: 520px; margin-bottom: 1rem; }
.wallets { display: flex; flex-wrap: wrap; gap: 1rem; }
.wallet { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; text-align: center; max-width: 260px; }
.wallet .qr { background: #fff; padding: .5rem; border-radius: 8px; margin: .5rem 0; }
.wallet .qr svg { width: 100%; height: auto; }
.wallet code { word-break: break-all; font-size: .8rem; }
.contact-list { list-style: none; padding: 0; }
.map-box iframe { width: 100%; height: 380px; border: 0; border-radius: 12px; }

/* footer */
.site-footer { background: var(--bg2); border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.5rem; }
.footer-banner { display: block; width: min(1180px, 94%); margin: 0 auto 1.2rem; border-radius: 12px; }
.page-photo { display: block; max-width: 100%; max-height: 420px; margin: 1rem auto; border-radius: 14px; border: 1px solid var(--line); }
.search-panel { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; background: var(--card); border-radius: 10px; padding: .7rem 1rem; margin: 1rem 0; }
.search-panel .form-ctl { width: auto; min-width: 200px; }
.grid-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; }
.membership-option { margin-top: .6rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid h4 { color: var(--gold); }
.copyright { text-align: center; color: var(--muted); padding: 1rem; border-top: 1px solid var(--line); margin-top: 1rem; }

#blazor-error-ui { background: #5a1d1d; color: #fff; display: none; position: fixed; inset-inline: 0; bottom: 0; padding: .6rem 1.2rem; z-index: 2000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; inset-inline-start: .75rem; top: .5rem; }

@media (max-width: 760px) {
    .header-top { flex-wrap: wrap; }
    .panel-layout { grid-template-columns: 1fr; }
}
