/* ===========================================================================
   DataPortal — үндсэн загвар
   Өнгө, үсэг, хэмжээ нь canvas дээрх "Өнгө, үсэг, компонент" хуудастай ижил.
   Mobile-first: эхлээд утасны, дараа нь @media (min-width) доор компьютерийн хэв.
=========================================================================== */

:root {
    /* Брэнд */
    --orkhon: #0F5C5A;        /* үндсэн: товч, линк, hero */
    --khangai: #0A4240;       /* бараан: hover, footer, chip */
    --khangai-mid: #1C6E6A;
    --erdene-zuu: #D99A2B;    /* онцлох үйлдэл: Хайх, Залгах */
    --tal: #F4F6F5;           /* дэвсгэр */
    --ink: #13201E;           /* текст */
    --muted: #4E5D5A;         /* туслах текст */
    --border: #DCE3E1;
    --line: #EEF1F0;
    --surface: #FFFFFF;
    --mint: #CFE5E2;

    /* Модуль бүрийн өнгө (дэвсгэр / тод) */
    --directory-bg: #E3EFEE;  --directory: #0F5C5A;
    --ads-bg: #FBF0DC;        --ads: #8A5A0E;
    --events-bg: #F8E6E1;     --events: #B5482F;
    --news-bg: #E4ECF7;       --news: #2F5D9E;

    /* Төлөв */
    --success: #1F7A3F;
    --danger: #B3261E;
    --danger-bg: #FBE7E5;

    --radius: 12px;
    --radius-lg: 16px;
    --font-body: 'Golos Text', system-ui, sans-serif;
    --font-display: 'Montserrat', var(--font-body);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
    margin: 0;
    background: var(--tal);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    padding-bottom: 76px; /* утасны доод цэсний зай */
}

a { color: var(--orkhon); }
a:hover { color: var(--khangai); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 800; }
p { margin: 0; }
code { font-size: .9em; background: var(--directory-bg); padding: 1px 6px; border-radius: 6px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--muted); font-size: 14px; }
.nowrap { white-space: nowrap; }
.icon { flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Модулийн өнгөний туслах класс --------------------------------------- */
.tone-directory { background: var(--directory-bg); color: var(--directory); }
.tone-ads       { background: var(--ads-bg);       color: var(--ads); }
.tone-events    { background: var(--events-bg);    color: var(--events); }
.tone-news      { background: var(--news-bg);      color: var(--news); }

/* --- Товч ---------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px; border-radius: var(--radius);
    font-family: var(--font-body); font-weight: 800; font-size: 15px;
    text-decoration: none; cursor: pointer; border: 2px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--orkhon); color: #fff; }
.btn-primary:hover { background: var(--khangai); color: #fff; }
.btn-accent { background: var(--erdene-zuu); color: var(--ink); }
.btn-accent:hover { background: #C88A1F; color: var(--ink); }
.btn-outline { background: var(--surface); color: var(--orkhon); border-color: var(--orkhon); }
.btn-ghost { background: transparent; color: var(--orkhon); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.is-soon { opacity: .55; cursor: not-allowed; }

/* --- Header -------------------------------------------------------------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 10; }
.header-row { display: flex; align-items: center; gap: 10px 20px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
/* Утсан дээр зай хэмнэхийн тулд зөвхөн лого (загвар: "Нүүр — утас") */
.brand-name { display: none; font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--orkhon); }

.location-picker { position: relative; }
.location-picker summary {
    list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer;
    height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 20px;
    background: var(--tal); font-weight: 700; font-size: 14px; color: var(--ink);
}
.location-picker summary::-webkit-details-marker { display: none; }
.location-picker summary .icon:first-child { color: var(--orkhon); }
.location-menu {
    position: absolute; top: 46px; left: 0; z-index: 20; width: 240px; max-height: 360px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(19, 32, 30, .14); padding: 6px;
}
.location-menu a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.location-menu a:hover { background: var(--tal); }
.location-menu a.active { background: var(--directory-bg); color: var(--orkhon); font-weight: 800; }

.main-nav { display: none; gap: 4px; flex: 1 1 auto; }
.main-nav a { padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink); }
.main-nav a:hover { background: var(--tal); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.header-actions form { margin: 0; }
.header-actions .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.avatar {
    width: 40px; height: 40px; border-radius: 20px; border: 2px solid #8FC9C2; background: var(--directory-bg);
    color: var(--orkhon); font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}

/* --- Hero ---------------------------------------------------------------- */
.hero { background: var(--orkhon); color: #fff; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px; padding-top: 32px; }
.hero-text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 18px; padding-bottom: 28px; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4.2vw, 42px); }
.eyebrow { color: var(--erdene-zuu); font-size: 13px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.hero-art { flex: 1 1 340px; min-width: 0; align-self: flex-end; display: none; }
.hero-art svg { display: block; }

.hero-search { display: flex; gap: 8px; }
.hero-search .btn-lg { padding: 0 18px; }
.search-field {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 14px;
    background: var(--surface); color: var(--muted); border-radius: 14px;
}
.search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: var(--font-body); font-size: 16px; color: var(--ink); }

/* Утсан дээр нэг мөрөнд хажуу тийш гүйлгэнэ, компьютер дээр олон мөрт */
.hero-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.hero-chips::-webkit-scrollbar { display: none; }
.hero-chip {
    flex: none; height: 40px; padding: 0 14px; border-radius: 20px; background: var(--khangai); color: #fff;
    text-decoration: none; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center;
}
.hero-chip:hover { color: #fff; background: #08332F; }
.hero-reset { color: var(--mint); font-weight: 700; font-size: 14px; }
.hero-reset:hover { color: #fff; }

/* --- Нүүр хуудасны хэсгүүд ----------------------------------------------- */
.home { display: flex; flex-direction: column; gap: 40px; padding-top: 28px; padding-bottom: 56px; }

.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.module-card {
    display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; color: var(--ink);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.module-card:hover { border-color: var(--orkhon); color: var(--ink); }
.module-card strong { display: block; font-size: 16px; }
.module-card small { display: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.module-icon { width: 48px; height: 48px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; }

.split { display: flex; flex-wrap: wrap; gap: 40px 32px; }
.block { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.block-wide { flex: 999 1 560px; }
.block-narrow { flex: 1 1 320px; }
.block-head { display: flex; justify-content: space-between; align-items: center; }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.card-media { height: 140px; position: relative; display: flex; align-items: center; justify-content: center; }
/* Утсан дээр зар 2 баганаар (загвар: "Нүүр — утас") */
.ads-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ads-grid .card-media { height: 110px; }
.ads-grid .card-body { padding: 10px 12px 12px; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.card h3 { line-height: 1.35; }
.meta { color: var(--muted); font-size: 13px; font-weight: 600; }
.price { color: var(--ads); font-size: 17px; font-weight: 800; }

.date-badge {
    position: absolute; left: 12px; top: 12px; width: 58px; padding: 6px 0; border-radius: 10px;
    background: var(--surface); color: var(--events); display: flex; flex-direction: column; align-items: center;
}
.date-badge span { font-size: 10px; font-weight: 800; }
.date-badge strong { font-family: var(--font-display); font-size: 22px; line-height: 1.1; }

.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.list-item { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.list-item:first-child { border-top: 0; }
.list-item h3 { font-size: 15px; font-weight: 700; line-height: 1.4; }
.list-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; }

.org-card { padding: 16px; gap: 14px; justify-content: space-between; }
.org-head { display: flex; gap: 12px; align-items: center; }
.org-initials {
    width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--directory-bg); color: var(--orkhon);
    font-family: var(--font-display); font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.org-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.verified {
    width: 18px; height: 18px; border-radius: 9px; background: var(--orkhon); color: #fff; margin-left: 4px;
    display: inline-flex; align-items: center; justify-content: center; vertical-align: -3px; /* нэрийн сүүлийн үгийн хажууд */
}
.org-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.opening { font-size: 13px; font-weight: 800; }
.opening::before { content: "● "; }
.opening:empty::before { content: ""; }
.status-open { color: var(--success); }
.status-closed { color: var(--danger); }

.soum-band { background: var(--directory-bg); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.soum-band h2 { color: var(--khangai); }
.soum-band p { color: var(--muted); font-weight: 600; font-size: 15px; margin-top: 4px; }
.soum-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.soum-chip {
    height: 40px; padding: 0 14px; border-radius: 20px; background: var(--surface); border: 1px solid #C5D8D5;
    color: var(--khangai); text-decoration: none; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center;
}
.soum-chip.active { background: var(--orkhon); border-color: var(--orkhon); color: #fff; }

/* --- Form --------------------------------------------------------------- */
.auth-card { max-width: 420px; margin: 24px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.field input {
    height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius);
    font-family: var(--font-body); font-size: 16px; color: var(--ink); background: var(--surface);
}
/* Routes.razor дахь FocusOnNavigate хуудас солигдох бүрт h1-д focus өгдөг (дэлгэц уншигчид шинэ хуудсыг
   зарлахад хэрэгтэй). Хөтөч үүнийг хүрээгээр тодруулдаг тул зөвхөн тэр хүрээг нууна.
   Гарын Tab-аар орж ирсэн товч, холбоосын focus хэвээр харагдана. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus { outline: none; }

.field input:focus { outline: 2px solid var(--orkhon); outline-offset: 1px; }
.validation-message { color: var(--danger); font-size: 13px; font-weight: 600; }
.field .hint { font-weight: 500; font-size: 13px; color: var(--muted); }
.center { text-align: center; }
.alert { padding: 12px 14px; border-radius: var(--radius); background: var(--danger-bg); color: var(--danger); font-weight: 700; font-size: 14px; }

/* --- Утас баталгаажуулах (/verify) ------------------------------------- */
.verify { display: flex; flex-direction: column; gap: 14px; }
.verify-box {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    background: var(--directory-bg); border-radius: var(--radius); padding: 16px;
}
.verify-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.verify-code { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--orkhon); letter-spacing: 2px; }
.verify-status { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: var(--muted); }
.verify-countdown { margin-left: auto; font-variant-numeric: tabular-nums; }
.spinner {
    width: 16px; height: 16px; border-radius: 50%; flex: none;
    border: 2px solid var(--border); border-top-color: var(--orkhon); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* --- Зар: жагсаалт, дэлгэрэнгүй, нийтлэх, хяналт ------------------------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.see-all { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 14px; text-decoration: none; }
.back-link { display: inline-block; margin-bottom: 12px; font-weight: 700; font-size: 14px; text-decoration: none; }
.notice { padding: 12px 14px; border-radius: var(--radius); background: #E3F2E8; color: var(--success); font-weight: 700; font-size: 14px; }

.card-link { text-decoration: none; color: var(--ink); transition: border-color .15s; }
.card-link:hover { color: var(--ink); border-color: var(--orkhon); }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.search-field-sm { height: 48px; border: 1px solid var(--border); border-radius: var(--radius); flex: 1 1 220px; }
.select-field { flex: 1 1 160px; display: flex; }
.select-field select, .field select, .field textarea {
    width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    font-family: var(--font-body); font-size: 16px; color: var(--ink);
}
.select-field select, .field select { height: 48px; padding: 0 12px; }
.field textarea { padding: 12px 14px; resize: vertical; min-height: 150px; line-height: 1.5; }
.field select:focus, .field textarea:focus { outline: 2px solid var(--orkhon); outline-offset: 1px; }

/* Хэвтээ гүйдэг ангиллын товчнууд */
.chip-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex: none; height: 38px; padding: 0 14px; border-radius: 19px; background: var(--surface); border: 1px solid var(--border);
    color: var(--ink); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; text-decoration: none;
}
.chip:hover { border-color: var(--orkhon); color: var(--ink); }
.chip.active { background: var(--orkhon); border-color: var(--orkhon); color: #fff; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; }

.tag-success { background: #E3F2E8; color: var(--success); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-muted { background: var(--line); color: var(--muted); }

.ad-detail { display: grid; gap: 20px; grid-template-areas: "media" "main" "side"; }
.ad-media { grid-area: media; height: 260px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; }
.ad-main { grid-area: main; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ad-side { grid-area: side; display: flex; flex-direction: column; gap: 12px; }
.price-lg { font-size: 24px; }
.ad-body { white-space: pre-line; overflow-wrap: anywhere; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 8px; }

.form-card { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.field-row { display: grid; gap: 16px; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
.radio-row { display: flex; gap: 8px 18px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-row input { width: 18px; height: 18px; accent-color: var(--orkhon); }
.input-suffix { position: relative; display: flex; }
.input-suffix input { width: 100%; padding-right: 40px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 800; }

/* Устгах: <details> дээр дарахад баталгаажуулах хэсэг нээгдэнэ */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8E1D17; color: #fff; }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: #EBC2BE; }
.confirm summary { list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm-body {
    display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 12px; min-width: 240px; text-align: left;
    border: 1px solid #EBC2BE; border-radius: var(--radius); background: #FFF8F7;
}

.own-ad { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.own-ad-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 240px; }
.own-ad h3 a { color: var(--ink); text-decoration: none; }
.own-ad h3 a:hover { color: var(--orkhon); }
.account-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.account-links form { margin: 0; }

.table .actions { text-align: right; white-space: nowrap; }

/* Утсан дээр хүснэгтийн мөр бүр карт болно (хажуу тийш гүйлгэхгүй) */
@media (max-width: 759px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; }
    .table-stack tr { padding: 12px 14px; border-top: 1px solid var(--border); }
    .table-stack tr:first-child { border-top: 0; }
    .table.table-stack td { padding: 3px 0; border-top: 0; }
    .table.table-stack td.actions { text-align: left; padding-top: 8px; }
    .table-stack td.nowrap { color: var(--muted); font-size: 13px; }
}
.table .actions .confirm { display: inline-block; }

/* Утсан дээр header-т зай хэмнэнэ: "+" дүрс, аватар; Гарах ба Админ нь "Миний зарууд" хуудсанд */
/* "Нийтлэх" — зөвхөн + дүрстэй дөрвөлжин товч, дүрс яг голдоо (бүх дэлгэцэнд) */
.header-actions .btn-post { width: 44px; height: 44px; min-height: 0; padding: 0; gap: 0; flex: none; }
@media (max-width: 759px) { .header-actions .btn-post { width: 40px; height: 40px; } }
.header-actions .btn-post svg { display: block; margin: 0; }
.header-actions .logout-form, .header-actions .admin-link { display: none; }
a.avatar { text-decoration: none; }

/* --- Админ самбар (Layout/AdminLayout.razor) ----------------------------- */
body:has(.admin-shell) { padding-bottom: 0; }   /* админд утасны доод цэс байхгүй */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.admin-side { background: var(--khangai); color: var(--mint); display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 10px; }
.admin-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.admin-brand:hover { color: #fff; }
.admin-brand strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.2; }
.admin-brand small { display: block; color: var(--mint); font-weight: 700; font-size: 13px; }
/* Утсан дээр хэвтээ гүйдэг цэс, зөвхөн ажилладаг цэсүүд */
.admin-menu { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.admin-menu::-webkit-scrollbar { display: none; }
.admin-menu-item {
    flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 14px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 15px; text-decoration: none;
}
.admin-menu-item:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.admin-menu-item.active { background: var(--khangai-mid); }
.admin-menu-item.is-soon { display: none; color: rgba(207, 229, 226, .45); cursor: default; }
.admin-menu-item.is-soon small { font-size: 11px; font-weight: 700; }
.admin-side-foot { display: flex; align-items: center; gap: 18px; font-size: 13px; font-weight: 700; }
.admin-side-foot a { color: var(--mint); text-decoration: none; }
.admin-side-foot a:hover { color: #fff; }
.admin-side-foot form { margin: 0; }
.admin-user { display: none; color: #fff; }
.admin-logout { background: none; border: 0; padding: 0; color: var(--mint); font: inherit; cursor: pointer; }
.admin-logout:hover { color: #fff; }
.admin-main { flex: 1; min-width: 0; padding: 24px 16px 48px; }
.admin-main h1 { font-family: var(--font-display); font-size: 26px; }
.admin-sub { color: var(--muted); font-weight: 500; margin-top: 4px; }

@media (min-width: 900px) {
    .admin-shell { flex-direction: row; }
    .admin-side { width: 240px; flex: none; position: sticky; top: 0; height: 100vh; padding: 24px 16px; gap: 28px; overflow-y: auto; }
    .admin-menu { flex-direction: column; overflow: visible; margin: 0; padding: 0; gap: 4px; }
    .admin-menu-item.is-soon { display: flex; }
    .admin-side-foot { flex-direction: column; align-items: flex-start; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--khangai-mid); font-size: 14px; }
    .admin-user { display: block; }
    .admin-main { padding: 36px 32px 56px; }
    .admin-main h1 { font-size: 30px; }
}

/* --- Зарын зураг ----------------------------------------------------------- */
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.gallery { position: relative; overflow: hidden; background: #0d1f1d; }
.gallery-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.gallery-nav {
    display: none; position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 22px;
    border: 0; background: rgba(255, 255, 255, .9); color: var(--ink); font-size: 28px; line-height: 1; cursor: pointer;
}
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery.has-js .gallery-nav { display: block; }
.gallery-count { position: absolute; right: 12px; bottom: 12px; padding: 3px 10px; border-radius: 12px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; font-weight: 700; }

.photo-drop {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px;
    border: 2px dashed var(--border); border-radius: var(--radius); color: var(--orkhon); font-weight: 800; cursor: pointer; background: var(--tal);
}
.photo-drop:hover { border-color: var(--orkhon); }
/* Жинхэнэ input-ийг бүх талбайг хамруулан ил тод болгоно: дарахад файл сонгогч нээгдэнэ */
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop:focus-within { outline: 2px solid var(--orkhon); outline-offset: 1px; }
.photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.photo-previews:empty { display: none; }
.photo-previews figure { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line); }
.photo-previews img { width: 100%; height: 100%; object-fit: cover; }
.photo-previews figcaption { position: absolute; left: 6px; top: 6px; padding: 1px 6px; border-radius: 6px; background: var(--orkhon); color: #fff; font-size: 11px; }
.photo-note { grid-column: 1 / -1; color: var(--ads); font-size: 13px; }

.ad-thumb { width: 64px; height: 48px; flex: none; border-radius: 8px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cell-with-thumb { display: flex; gap: 12px; align-items: flex-start; }

/* --- Лавлах ---------------------------------------------------------------- */
/* Нэр дээрх холбоос картыг бүхэлд нь дарагддаг болгоно, "Залгах" товч дээр нь гарна */
.org-card { position: relative; }
.stretched { color: var(--ink); text-decoration: none; }
.stretched::after { content: ""; position: absolute; inset: 0; }
.stretched:hover { color: var(--orkhon); }
.org-foot a, .org-foot button { position: relative; z-index: 1; }
.org-photo { width: 52px; height: 52px; flex: none; border-radius: 14px; object-fit: cover; }
.org-address { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-grid { grid-template-columns: 1fr; }
.chip-sm { height: 32px; font-size: 13px; padding: 0 12px; }
.chip-row-sub { margin-top: -6px; }
.verified-lg { width: 24px; height: 24px; border-radius: 12px; vertical-align: 2px; }
.org-media-empty { background: var(--directory-bg); }
.org-initials-lg { width: 96px; height: 96px; border-radius: 24px; font-size: 32px; background: var(--surface); }
.org-line { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-weight: 600; }
.org-line svg { flex: none; margin-top: 2px; }

.hours h2 { font-size: 17px; margin-bottom: 8px; }
.hours-table { border-collapse: collapse; width: 100%; max-width: 360px; font-size: 15px; }
.hours-table th, .hours-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.hours-table th { font-weight: 600; color: var(--muted); width: 45%; }
.hours-table tr.today th, .hours-table tr.today td { color: var(--ink); font-weight: 800; background: var(--directory-bg); }

.contact-link {
    display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    text-decoration: none; color: var(--ink); font-weight: 700; overflow-wrap: anywhere;
}
.contact-link:hover { border-color: var(--orkhon); color: var(--orkhon); }
.contact-kind { font-size: 12px; color: var(--muted); font-weight: 700; }

/* Google Maps байршил */
.gmap-input { display: flex; gap: 8px; flex-wrap: wrap; }
.gmap-input input { flex: 1 1 260px; }
.gmap-status { font-size: 14px; font-weight: 700; color: var(--muted); min-height: 0; }
.gmap-status:empty { display: none; }
.gmap-status.ok { color: var(--success); }
.gmap-status.error { color: var(--danger); }
.gmap-frame { display: block; width: 100%; height: 260px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--directory-bg); }
.org-map h2 { font-size: 17px; margin-bottom: 8px; }
.map-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Бүртгэх форм: ажлын цаг */
.hours-form { display: flex; flex-direction: column; gap: 8px; }
.hours-row {
    display: grid; gap: 4px 6px; align-items: center;
    grid-template-columns: 64px minmax(0, 1fr) 12px minmax(0, 1fr);
    grid-template-areas: "day open dash close" ". closed closed closed";
}
.hours-day { grid-area: day; font-weight: 700; font-size: 14px; }
.hours-row [data-open] { grid-area: open; }
.hours-row [data-close] { grid-area: close; }
.hours-dash { grid-area: dash; text-align: center; color: var(--muted); }
.hours-closed { grid-area: closed; display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; }
.hours-closed input { width: 18px; height: 18px; accent-color: var(--orkhon); }
.hours-row input[type="time"] {
    height: 42px; padding: 0 4px 0 8px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 14px; width: 100%; min-width: 0;
}
.hours-row.is-closed input[type="time"] { opacity: .35; }
.hours-copy { margin-top: 10px; height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; white-space: normal; text-align: center; }

.my-tabs { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.my-tabs .chip-row { flex: 1 1 auto; }
.post-choices .module-card.is-soon { opacity: .5; }

/* Админ: ангилал */
.category-new { gap: 10px; }
.category-new-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.category-new-row .field { flex: 1 1 200px; }
.category-new-row .field-narrow { flex: 0 0 110px; }
.inline-input { height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 15px; width: 100%; min-width: 160px; }
.inline-number { width: 84px; min-width: 0; }
.category-group td { background: var(--tal); }
.category-group .inline-input { font-weight: 800; }
.category-child td:first-child { padding-left: 34px; }
.is-inactive td { opacity: .55; }
.is-inactive td.actions { opacity: 1; }
.action-row { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: flex-start; }
.action-row form { margin: 0; }

/* --- Эвент ------------------------------------------------------------------ */
.event-poster img { width: 100%; height: 100%; object-fit: contain; }
.event-date-hero { flex-direction: column; color: var(--events); }
.event-date-hero span { font-weight: 800; font-size: 16px; letter-spacing: .5px; }
.event-date-hero strong { font-family: var(--font-display); font-size: 72px; line-height: 1; }
.event-facts { display: flex; flex-direction: column; gap: 6px; }
.event-facts .org-line { color: var(--ink); font-weight: 700; }
.card.is-past { opacity: .7; }

/* Сарын туузан цэс: ‹ [Ойрын] [10-р сар] [11-р сар] … › — утсан дээр хуруугаар гүйлгэнэ */
.month-bar { display: flex; align-items: stretch; gap: 8px; }
.month-arrow {
    flex: none; width: 40px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    color: var(--orkhon); font-size: 26px; text-decoration: none;
}
.month-arrow:hover { border-color: var(--orkhon); color: var(--orkhon); }
.month-strip {
    position: relative; flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
    scrollbar-width: none; padding: 2px;
}
.month-strip::-webkit-scrollbar { display: none; }
.month-chip {
    flex: none; scroll-snap-align: center; min-width: 96px; padding: 8px 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface); color: var(--ink); text-decoration: none;
    display: flex; flex-direction: column; gap: 1px; line-height: 1.2;
}
.month-chip small { font-size: 11px; font-weight: 700; color: var(--muted); }
.month-chip strong { font-family: var(--font-display); font-size: 16px; }
.month-count { font-size: 12px; font-weight: 700; color: var(--events); }
.month-chip:hover { border-color: var(--events); color: var(--ink); }
.month-chip.is-empty .month-count { color: var(--muted); }
.month-chip.is-past:not(.active) { background: var(--tal); }
.month-chip.active { background: var(--events); border-color: var(--events); color: #fff; }
.month-chip.active small, .month-chip.active .month-count { color: rgba(255, 255, 255, .85); }
.month-chip-now { justify-content: center; min-width: 76px; }
.month-chip[data-current-month]:not(.active) { border-color: var(--events); }
@media (max-width: 759px) {
    .month-arrow { width: 32px; }
    .month-chip { min-width: 84px; padding: 7px 10px; }
}

/* Доод талын өмнөх / дараах сар */
.month-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.month-pager-link {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg);
    border: 1px solid var(--border); background: var(--surface); color: var(--ink); text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.month-pager-link:hover { border-color: var(--events); color: var(--ink); transform: translateY(-1px); }
.month-pager-link.next { justify-content: flex-end; text-align: right; }
.month-pager-link small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.month-pager-link strong { font-family: var(--font-display); font-size: 15px; }
.month-pager-arrow {
    flex: none; width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
    background: var(--events-bg); color: var(--events); font-weight: 800; font-size: 18px;
}
.datetime-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.datetime-row input { width: 100%; min-width: 0; }

/* --- Сумд ------------------------------------------------------------------- */
.soum-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.soum-card {
    display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; text-decoration: none;
    background: var(--surface); border: 1px solid var(--border); color: var(--ink); transition: border-color .15s, transform .15s;
}
.soum-card:hover { border-color: var(--orkhon); color: var(--ink); transform: translateY(-2px); }
.soum-card-media { position: relative; aspect-ratio: 16 / 9; background: var(--orkhon); }
.soum-card-media img, .soum-card-media .soum-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.soum-card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0, 0, 0, .55)); }
.soum-card-name {
    position: absolute; left: 12px; bottom: 10px; z-index: 1; color: #fff;
    font-family: var(--font-display); font-weight: 800; font-size: 18px; text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.soum-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.soum-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.soum-stats strong { color: var(--ink); }

.soum-hero { position: relative; min-height: 260px; display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: var(--orkhon); }
.soum-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.soum-hero-row { position: relative; z-index: 1; width: 100%; }
.soum-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .05), rgba(0, 0, 0, .6)); }
.soum-hero-text { padding-top: 28px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* Зураггүй сум: зурмал дүрслэл хүрээтэй (утсан дээр дээр нь, компьютер дээр баруун талд) */
.soum-hero-split { align-items: stretch; }
.soum-hero-split::after { display: none; }
.soum-hero-split .soum-hero-row { display: flex; flex-direction: column; padding-top: 20px; }
.soum-hero-split .soum-hero-text { padding-top: 16px; }
.soum-hero-figure { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
.soum-hero-figure .soum-art { display: block; width: 100%; height: 100%; }
.soum-hero-split .soum-hero-figure { order: -1; }
.soum-hero h1 { font-family: var(--font-display); font-size: 34px; color: #fff; }
.soum-hero-sub { color: var(--mint); font-weight: 600; }
.soum-crumb { color: var(--mint); font-weight: 700; font-size: 14px; text-decoration: none; }
.soum-crumb:hover { color: #fff; }
.soum-hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.soum-hero-stats a {
    padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25);
    color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; backdrop-filter: blur(4px);
}
.soum-hero-stats a:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.soum-hero-stats strong { font-weight: 800; }
.soum-about { display: grid; gap: 16px; }
.soum-about-text { display: flex; flex-direction: column; gap: 12px; }
.soum-about-text h2 { font-size: 20px; }
.soum-facts div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.soum-facts div strong { font-family: var(--font-display); }
.soum-band-link { color: var(--orkhon); font-weight: 700; }
.completeness { display: flex; flex-wrap: wrap; gap: 4px; }
.form-card-wide { max-width: 860px; margin: 0; }
.field-row-3 { display: grid; gap: 16px; }
.cover-current { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.cover-current img { width: 160px; height: 90px; object-fit: cover; border-radius: 10px; }

/* --- Хүснэгт ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 16px; background: var(--tal); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.table td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: top; }

/* --- Footer ------------------------------------------------------------- */
.site-footer { background: var(--khangai); color: var(--mint); padding: 28px 0; font-size: 14px; font-weight: 600; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.footer-brand { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #fff; margin-right: 8px; }
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.footer-nav a { color: #fff; text-decoration: none; font-weight: 700; }

/* --- Утасны доод цэс ----------------------------------------------------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: 68px;
    background: var(--surface); border-top: 1px solid var(--border);
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700;
}
.bottom-nav a:hover { color: var(--orkhon); }

/* --- Мэдээ ---------------------------------------------------------------- */
/* Мэдээ бүр тусдаа карт, хооронд нь зайтай */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-row {
    display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.news-row:hover { border-color: #B9C7C4; box-shadow: 0 4px 16px rgba(19, 32, 30, .07); }
.news-row:hover .news-title { color: var(--orkhon); text-decoration: underline; }
.news-media { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.news-media img { width: 100%; height: 100%; object-fit: cover; }
.news-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.news-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; line-height: 1.35; }
.news-summary { color: var(--muted); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Эхний (онцлох) мэдээ: зураг дээр, том гарчиг */
.news-lead { grid-template-columns: 1fr; padding: 0 0 18px; }
.news-lead .news-media { aspect-ratio: 16 / 9; border-radius: 0; }
.news-lead .news-text { padding: 0 16px; }
.news-lead .news-title { font-size: 22px; }
.news-lead .news-summary { -webkit-line-clamp: 3; font-size: 15px; }

.news-page { display: grid; gap: 20px; }
.news-article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.news-article h1 { font-size: 26px; line-height: 1.25; }
.news-lede { font-size: 17px; line-height: 1.55; color: var(--muted); font-weight: 500; }
.news-cover { margin: 0 -18px; }
.news-cover img { width: 100%; height: auto; max-height: 620px; object-fit: cover; display: block; background: var(--line); }
.news-body { font-size: 16.5px; line-height: 1.75; overflow-wrap: anywhere; }
.news-body p + p { margin-top: 1em; }
.news-body a { word-break: break-all; }
.news-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.news-photos a { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--line); }
.news-photos img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.news-photos a:hover img { transform: scale(1.03); }
.news-byline { border-top: 1px solid var(--line); padding-top: 12px; }
.news-side { display: flex; flex-direction: column; gap: 12px; }
.side-title { font-size: 16px; }
.news-related { display: flex; flex-direction: column; }
.news-related a { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.news-related a:first-child { border-top: 0; padding-top: 0; }
.news-related a:hover strong { color: var(--orkhon); text-decoration: underline; }
.news-related strong { font-size: 14.5px; line-height: 1.4; }
/* Нүүр, сумын хуудасны жижиг жагсаалт: мэдээ бүр тусдаа карт */
.news-mini-list { display: flex; flex-direction: column; gap: 10px; }
.news-mini-list .news-mini { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); border-top: 1px solid var(--border); }
.news-mini-list .news-mini:hover { border-color: #B9C7C4; box-shadow: 0 4px 16px rgba(19, 32, 30, .07); }
.news-mini { flex-direction: row; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.news-mini-text { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.news-mini strong { font-size: 15px; line-height: 1.4; }
.news-mini:hover strong { color: var(--orkhon); text-decoration: underline; }

/* Админ: хэрэглэгчид */
.avatar-sm { width: 36px; height: 36px; font-size: 13px; flex: none; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* --- Апп суулгах (PWA, js/pwa.js) ------------------------------------------- */
[hidden] { display: none !important; }
.footer-install {
    display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
    color: var(--erdene-zuu); font: inherit; font-weight: 800;
}
.footer-install:hover { text-decoration: underline; }
/* Утсан дээр доод цэсний дээр, компьютер дээр баруун доод буланд */
.install-bar {
    position: fixed; z-index: 40; left: 12px; right: 12px; bottom: 84px;
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px;
    padding: 12px 10px 12px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(19, 32, 30, .18);
}
.install-bar img { border-radius: 10px; }
.install-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.install-text strong { font-size: 15px; }
.install-text small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.install-close {
    width: 32px; height: 32px; border: 0; border-radius: 16px; background: none; cursor: pointer;
    color: var(--muted); font-size: 22px; line-height: 1;
}
.install-close:hover { background: var(--line); color: var(--ink); }
/* iPhone/iPad заавар (js/pwa.js үүсгэнэ): бараан дэвсгэр, алхмууд, хөтчийн товч руу заасан сум */
html.guide-open { overflow: hidden; }
.install-guide {
    position: fixed; inset: 0; z-index: 100; background: rgba(10, 30, 28, .62);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    animation: guide-fade .18s ease-out;
}
.guide-sheet {
    position: relative; width: 100%; max-width: 400px; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow-y: auto;
    background: var(--surface); border-radius: 20px; padding: 18px 16px 16px;
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
/* Сум доод талд бол картыг дээш, дээд талд бол доош шахна (сум дарагдахгүй) */
.guide-bottom-center, .guide-bottom-right { margin-bottom: 60px; }
.guide-top-right { margin-top: 60px; }
.guide-sheet img { border-radius: 14px; }
.guide-sheet h2 { font-size: 20px; margin: 2px 0 0; }
.guide-lead { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.guide-close { position: absolute; top: 10px; right: 10px; }
.guide-steps { list-style: none; margin: 4px 0 2px; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.guide-steps li {
    display: grid; grid-template-columns: 24px 40px minmax(0, 1fr); align-items: center; gap: 10px;
    padding: 8px 10px; background: var(--tal); border-radius: 12px; font-size: 14.5px; line-height: 1.35;
}
.guide-num {
    width: 24px; height: 24px; border-radius: 12px; background: var(--orkhon); color: #fff;
    font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.guide-icon {
    width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
    color: #007AFF;   /* iOS-ийн цэнхэр: хөтчийн товчтой адилхан харагдуулна */
    display: inline-flex; align-items: center; justify-content: center;
}
.guide-where { color: var(--muted); font-size: 13px; }
.guide-arrow {
    position: fixed; z-index: 101; color: #fff; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4));
    animation: guide-bounce 1s ease-in-out infinite;
}
.guide-arrow-bottom-center { bottom: 10px; left: 50%; margin-left: -22px; }
.guide-arrow-bottom-right { bottom: 10px; right: 18px; }
.guide-arrow-top-right { top: 10px; right: 14px; transform: rotate(180deg); animation-name: guide-bounce-up; }
@keyframes guide-fade { from { opacity: 0; } }
@keyframes guide-bounce { 50% { transform: translateY(10px); } }
@keyframes guide-bounce-up { 0%, 100% { transform: rotate(180deg); } 50% { transform: rotate(180deg) translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
    .install-guide, .guide-arrow { animation: none; }
}
/* Апп дотроос (суулгасан) нээхэд хөтчийн биш, апп шиг харагдуулна */
@media (display-mode: standalone) {
    .footer-install, .install-bar { display: none !important; }
}

/* ===========================================================================
   Компьютер (760px-ээс өргөн)
=========================================================================== */
@media (min-width: 760px) {
    body { padding-bottom: 0; }
    .bottom-nav { display: none; }
    .main-nav { display: flex; }
    .brand-name { display: inline; }
    .header-row { padding-top: 12px; padding-bottom: 12px; }
    .header-actions { margin-left: 0; }
    .header-actions .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
    .hero-search .btn-lg { padding: 0 24px; }
    .hero-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
        .hero-row { padding-top: 48px; }
    .hero-text { padding-bottom: 40px; }
    .hero-art { display: block; }
    .module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
    .module-card { padding: 18px; gap: 14px; }
    .module-card strong { font-size: 17px; }
    .module-card small { display: block; }
    .module-icon { width: 52px; height: 52px; }
    h2 { font-size: 24px; }
    .card-grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .ads-grid { gap: 14px; }
    .ads-grid .card-media { height: 140px; }
    .ads-grid .card-body { padding: 14px; }
    .soum-band { padding: 28px; }

    .header-actions .logout-form, .header-actions .admin-link { display: block; }
    .header-actions .admin-link { display: inline-flex; }
    .ads-grid-wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .org-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .soum-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
    .soum-hero { min-height: 340px; }
    .soum-hero-split .soum-hero-row { flex-direction: row; align-items: center; gap: 40px; padding-top: 32px; padding-bottom: 32px; }
    .soum-hero-split .soum-hero-text { flex: 1 1 auto; padding: 0; }
    .soum-hero-split .soum-hero-figure { order: 0; flex: 0 0 min(48%, 560px); }
    .soum-hero h1 { font-size: 46px; }
    .soum-about { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .field-row.field-row-3 { grid-template-columns: repeat(3, 1fr); }
    .hours-row { grid-template-columns: 90px 130px 14px 130px auto; grid-template-areas: "day open dash close closed"; }
    .hours-closed { margin-left: 8px; }
    .gmap-frame { height: 340px; }
    .chip-row { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
    .field-row { grid-template-columns: 1fr 1fr; }
    .form-card { padding: 28px; }
    .ad-detail { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto 1fr; grid-template-areas: "media side" "main side"; align-items: start; }
    .ad-media { height: 320px; }
    .ad-main h1 { font-size: 32px; }
    .news-list { gap: 16px; }
    .news-row { grid-template-columns: 200px minmax(0, 1fr); gap: 18px; padding: 18px; }
    .news-title { font-size: 18px; }
    .news-lead { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); padding: 0; gap: 0; }
    .news-lead .news-media { aspect-ratio: auto; min-height: 300px; }
    .news-lead .news-text { padding: 28px; justify-content: center; gap: 10px; }
    .news-lead .news-title { font-size: 28px; }
    .news-page { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .news-article { padding: 32px 40px; gap: 18px; }
    .news-article h1 { font-size: 36px; }
    .news-cover { margin: 0 -40px; }
    .news-body { max-width: 68ch; }
    .news-photos { grid-template-columns: repeat(3, 1fr); }
    .news-side { position: sticky; top: 90px; }
}
a.tag { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

@media (min-width: 760px) {
    .install-bar { left: auto; right: 20px; bottom: 20px; width: 400px; }
}

/* Таблет (iPad босоо, 760–1023px): цэс бүтэн багтахгүй тул лого нэр, "Нийтлэх" бичгийг нууж зөвхөн дүрс үлдээнэ */
@media (min-width: 760px) and (max-width: 1023px) {
    .brand-name { display: none; }
    .main-nav { gap: 0; }
    .main-nav a { padding: 10px 8px; }
}

/* Жижиг утас (iPhone SE 320px г.м.): толгой хэсэг багтахгүй тул зай, товчийг багасгана */
@media (max-width: 359px) {
    .header-row { gap: 6px; }
    .header-actions { gap: 6px; }
    .header-actions .btn { padding: 0 10px; font-size: 13px; }
    .location-picker summary { padding-left: 8px; padding-right: 8px; gap: 4px; }
}

/* Админ: сумын зурмал дүрслэл сонгох (Pages/Admin/SoumEdit.razor) */
.art-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 6px; }
.art-option { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.art-option input { position: absolute; opacity: 0; pointer-events: none; }
.art-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 3px solid transparent; outline: 1px solid var(--border); }
.art-thumb .soum-art { display: block; width: 100%; height: 100%; }
.art-label { font-size: 13px; font-weight: 600; line-height: 1.3; }
.art-option:hover .art-thumb { outline-color: var(--orkhon); }
.art-option input:checked + .art-thumb { border-color: var(--orkhon); outline-color: var(--orkhon); }
.art-option input:checked ~ .art-label { color: var(--orkhon); font-weight: 800; }
.art-option input:focus-visible + .art-thumb { outline: 3px solid var(--erdene-zuu); }
.ad-thumb .soum-art { width: 100%; height: 100%; display: block; }

/* --- Админ: үнийн тохиргоо (Pages/Admin/Pricing.razor) ------------------------ */
.pricing h2 { font-size: 19px; }
.side-card.pay-switch { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; text-align: left; }
.pay-switch-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-switch-title strong { font-family: var(--font-display); font-size: 18px; }
.pay-switch-text { display: flex; flex-direction: column; gap: 6px; }
/* Унтраалга: form-ийн submit товч (JavaScript-гүй) */
.switch {
    flex: none; position: relative; width: 60px; height: 34px; border: 0; border-radius: 17px; cursor: pointer;
    background: #C8D3D1; transition: background .2s;
}
.switch-knob {
    position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 13px; background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch.is-on { background: var(--orkhon); }
.switch.is-on .switch-knob { transform: translateX(26px); }
.switch:focus-visible { outline: 3px solid var(--erdene-zuu); outline-offset: 2px; }

.pricing-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pricing-table .code, .pricing .code { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.pricing-table tr.is-muted td { color: var(--muted); }
.planned { color: #B26B00; font-weight: 700; }
.pricing-panels { display: grid; gap: 16px; align-items: start; }
.pricing-panels .side-card { display: flex; flex-direction: column; gap: 14px; }
.field-date input { max-width: 220px; }
.info-note {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
    background: #E3EEEC; color: var(--ink); font-size: 14px; line-height: 1.5;
}
.info-note svg { flex: none; margin-top: 2px; color: var(--orkhon); }
.pricing-panels .side-card > .btn { align-self: flex-start; }
.limit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.limit-row label, .limit-row > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.limit-row strong { font-size: 15px; }
.limit-input, .quiet-hours input {
    height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius);
    font-family: var(--font-body); color: var(--ink); background: var(--surface);
}
.limit-input:focus, .quiet-hours input:focus { outline: 2px solid var(--orkhon); outline-offset: 1px; }
.limit-input { width: 72px; text-align: center; font-weight: 800; font-size: 16px; flex: none; }
.quiet-hours { display: flex; align-items: center; gap: 6px; }
.quiet-hours input { width: 76px; text-align: center; font-weight: 800; font-size: 16px; }
.current-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.current-price strong { font-family: var(--font-display); font-size: 28px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--orkhon); }

@media (min-width: 1100px) {
    .pricing-panels { grid-template-columns: 1.15fr 1fr; }
}

/* --- Админ: системийн тохиргоо (Pages/Admin/Settings.razor) ------------------- */
.settings-group h2 { font-size: 18px; margin-bottom: 4px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting-row:first-of-type { border-top: 0; }
.setting-row.is-unused { opacity: .6; }
.setting-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setting-text strong { font-size: 15px; }
.setting-key { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 11.5px; color: var(--muted); }
.setting-input { display: flex; align-items: center; gap: 8px; flex: none; }
.time-input { width: 80px; }
/* Checkbox-ийг унтраалга хэлбэрээр (JavaScript-гүй) */
.toggle { position: relative; display: inline-flex; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { position: relative; width: 52px; height: 30px; border-radius: 15px; background: #C8D3D1; transition: background .2s; }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.toggle input:checked + .toggle-track { background: var(--orkhon); }
.toggle input:checked + .toggle-track .toggle-knob { transform: translateX(22px); }
.toggle input:focus-visible + .toggle-track { outline: 3px solid var(--erdene-zuu); outline-offset: 2px; }
/* Хадгалах товч доор наалттай: урт хуудсанд доош гүйлгэх шаардлагагүй */
.settings-save {
    position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: 0 -6px 20px rgba(19, 32, 30, .08);
}
@media (max-width: 600px) {
    .setting-row { flex-direction: column; align-items: flex-start; }
}
.validation-summary { margin: 0; padding-left: 18px; color: var(--danger); font-size: 14px; font-weight: 600; }
.validation-summary:empty { display: none; }

/* ------------------------------------------------------------------ Мэдэгдэл (push) */
.tag-warn { background: var(--ads-bg); color: var(--ads); }
.tag-info { background: var(--news-bg); color: var(--news); }
.text-danger { color: var(--danger); }
.table .num { text-align: right; white-space: nowrap; }

/* Толгойн хонх */
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--line); color: var(--orkhon); }
.bell-dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--events); box-shadow: 0 0 0 2px var(--surface); }

/* /notifications: захиалах хэсэг */
.push-panel { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; padding: 16px; border-radius: var(--radius-lg); background: var(--directory-bg); border: 1px solid var(--mint); }
.push-panel.is-on { background: var(--surface); border-color: var(--border); }
.push-panel-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--orkhon); color: #fff; flex: none; }
.push-panel-main { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 0; }
.push-panel-main [data-push-status].is-error { color: var(--danger); font-weight: 600; }
.push-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.push-soum { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.push-soum select { min-height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; max-width: 100%; }

.notify-item { flex-direction: row; align-items: flex-start; gap: 12px; color: inherit; text-decoration: none; }
.notify-item:hover strong { color: var(--orkhon); }
.notify-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.notify-thumb-icon { display: grid; place-items: center; background: var(--tal); color: var(--muted); }
.notify-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.notify-main strong { font-size: 15px; line-height: 1.35; }
.notify-stats { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 4px; }
.notify-stats strong { color: var(--ink); }
.own-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.own-actions form { margin: 0; }

/* /notify/...: урьдчилан харах (утасны мэдэгдэл шиг), хамрах хүрээ сонгох */
.push-preview { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--tal); border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(19, 32, 30, .08); }
.push-preview-icon { border-radius: 9px; flex: none; }
.push-preview-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-size: 14px; }
.push-preview-text small { color: var(--muted); font-size: 12px; }
.push-preview-text span { color: var(--muted); overflow-wrap: anywhere; }
.push-preview-img { border-radius: 10px; object-fit: cover; flex: none; }
.audience-list { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.audience-list legend { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.audience-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.audience-option:has(input:checked) { border-color: var(--orkhon); background: var(--directory-bg); }
.audience-option input { width: 20px; height: 20px; accent-color: var(--orkhon); flex: none; }
.audience-option.is-disabled { opacity: .6; cursor: not-allowed; }
.audience-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.audience-main small { color: var(--muted); font-size: 13px; }
.audience-main .audience-warn { color: var(--danger); font-weight: 600; }
.audience-price { font-weight: 800; font-family: var(--font-display); white-space: nowrap; }
.btn-notify { gap: 8px; }
@media (max-width: 759px) {
    /* Хонх нэмэгдсэн тул утсан дээр байршлын нэрийг нэг мөрөнд, хэт урт бол "…" */
    .icon-btn { width: 34px; height: 34px; }
    .bell-dot { top: 5px; right: 6px; }
    .location-picker { min-width: 0; }
    .location-picker summary span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28vw; }
}
@media (max-width: 359px) {
    .location-picker summary span { display: none; }   /* 320px: зөвхөн 📍 дүрс */
}

/* Шууд ирсэн мэдэгдэл (wwwroot/js/realtime.js, SignalR): утасны мэдэгдэл шиг дээрээс гулсаж буух баннер */
.toast-stack { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60;
    display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 20px)); pointer-events: none; }
.toast { pointer-events: auto; position: relative; display: flex; gap: 11px; align-items: center; padding: 11px 38px 11px 11px;
    background: rgba(250, 250, 248, .86); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
    color: #111; text-decoration: none; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .6);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .08);
    opacity: 0; transform: translateY(-120%); transition: opacity .3s ease, transform .4s cubic-bezier(.2, .9, .3, 1.15); }
.toast.is-in { opacity: 1; transform: none; }
.toast-icon { width: 38px; height: 38px; border-radius: 9px; flex: none; align-self: flex-start; }
.toast-img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }
.toast-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; font-size: 14px; line-height: 1.3; }
.toast-text small { color: #6b6b6b; font-size: 12px; font-weight: 600; }
.toast-text strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-text span { color: #333; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.toast-close { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #777; font-size: 20px; line-height: 1; cursor: pointer; }
.toast-close:hover { background: rgba(0, 0, 0, .06); }
@media (prefers-color-scheme: dark) {
    .toast { background: rgba(38, 38, 40, .86); color: #f2f2f2; border-color: rgba(255, 255, 255, .08); }
    .toast-text small { color: #a8a8a8; }
    .toast-text span { color: #d6d6d6; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ------------------------------------------------------------------ Хянах самбар (/admin) */
.tag-directory { background: var(--directory-bg); color: var(--directory); }
.tag-ads { background: var(--ads-bg); color: var(--ads); }
.tag-events { background: var(--events-bg); color: var(--events); }
.tag-news { background: var(--news-bg); color: var(--news); }

.dash-attention { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-ok { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius); background: var(--directory-bg); color: var(--directory); font-weight: 600; }
.dash-alert { display: inline-flex; align-items: baseline; gap: 6px; padding: 9px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); text-decoration: none; font-size: 14px; }
.dash-alert strong { font-family: var(--font-display); font-size: 17px; }
.dash-alert:hover { border-color: var(--orkhon); }
.dash-alert.is-urgent { background: var(--events-bg); border-color: transparent; color: var(--events); }

.dash-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dash-kpis > :last-child { grid-column: span 2; }   /* орлого: 7 карт → мөр бүр дүүрэн */
@media (min-width: 760px) { .dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 759px) { .dash-kpi { padding: 12px; } .dash-kpi-value { font-size: 24px; } .dash-kpi-foot { font-size: 12px; } }
.dash-kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
    color: var(--ink); text-decoration: none; border-top: 4px solid var(--orkhon); min-width: 0; }
.dash-kpi:hover { box-shadow: 0 6px 18px rgba(19, 32, 30, .08); }
.dash-kpi.kpi-directory { border-top-color: var(--directory); }
.dash-kpi.kpi-ads { border-top-color: var(--ads); }
.dash-kpi.kpi-events { border-top-color: var(--events); }
.dash-kpi.kpi-news { border-top-color: var(--news); }
.dash-kpi-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.dash-kpi-value { font-family: var(--font-display); font-size: 30px; line-height: 1.15; overflow-wrap: anywhere; }
.dash-kpi-sub { font-size: 13px; color: var(--muted); }
.dash-kpi-foot { font-size: 13px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); }

.dash-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dash-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.dash-panel-head h2 { font-family: var(--font-display); font-size: 18px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1099px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

.dash-chart { margin: 0; overflow-x: auto; direction: rtl; }   /* rtl: утсан дээр сүүлийн өдрүүд эхэлж харагдана */
.dash-chart svg { width: 100%; min-width: 560px; height: auto; display: block; direction: ltr; }   /* утсан дээр хэвтээ гүйлгэнэ, бичиг жижгэрэхгүй */
.dash-chart .grid { stroke: var(--line); stroke-width: 1; }
.dash-chart .axis { stroke: var(--border); stroke-width: 1; }
.dash-chart .tick { font-size: 11px; fill: var(--muted); font-family: inherit; }
.dash-chart .hit { fill: transparent; }
.dash-chart .fill { fill: var(--orkhon); }
.dash-chart .bar:hover .hit { fill: var(--line); }
.dash-chart .bar:hover .fill { fill: var(--directory); }
.dash-table summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--orkhon); }
.dash-table .table-wrap { max-height: 320px; overflow: auto; margin-top: 8px; }

.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav strong { min-width: 130px; text-align: center; font-size: 14px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { min-height: 84px; border-radius: 10px; background: var(--tal); padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.is-outside { background: transparent; opacity: .45; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--orkhon); }
.cal-day.has-events { background: var(--events-bg); }
.cal-num { font-size: 12px; font-weight: 700; }
.cal-event { display: block; font-size: 11.5px; line-height: 1.25; padding: 2px 5px; border-radius: 6px; background: var(--surface); color: var(--events);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; font-weight: 600; }
.cal-event:hover { background: var(--events); color: #fff; }
.cal-more { font-size: 11px; color: var(--events); font-weight: 700; padding-left: 4px; }
@media (max-width: 599px) {
    .cal-day { min-height: 46px; padding: 4px 2px; align-items: center; }
    .cal-event { width: 7px; height: 7px; padding: 0; border-radius: 50%; background: var(--events); font-size: 0; }
    .cal-day { flex-direction: column; }
    .cal-more { font-size: 10px; padding: 0; }
}

.dash-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dash-recent li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.dash-recent li:first-child { border-top: 0; padding-top: 0; }
.dash-recent li.is-deleted a { text-decoration: line-through; color: var(--muted); }
.dash-recent .tag { flex: none; min-width: 88px; text-align: center; }
.dash-recent-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-recent-main a { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.dash-recent-main a:hover { color: var(--orkhon); }

/* ------------------------------------------------------------------ Хуваалцах (ShareButton, js/share.js) */
.share-open { gap: 8px; }
.share-sheet { padding: 0; border: 0; margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(460px, 100vw); max-width: 100vw;
    background: var(--surface); color: var(--ink); box-shadow: -12px 0 40px rgba(0, 0, 0, .25); }
.share-sheet::backdrop { background: rgba(10, 20, 19, .55); }
.share-sheet[open] { animation: share-in .25s ease-out; }
@keyframes share-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.share-inner { display: flex; flex-direction: column; height: 100%; }
.share-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.share-head h2 { font-family: var(--font-display); font-size: 20px; }
.share-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.share-close:hover { background: var(--line); color: var(--ink); }
.share-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.share-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--tal); }
.share-card h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.share-card-head { display: flex; align-items: center; justify-content: space-between; }
.share-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.45; }
.share-text { width: 100%; min-height: 200px; resize: vertical; padding: 12px; border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 14px; line-height: 1.5; background: var(--surface); color: var(--ink); }
.share-copy { border: 0; background: transparent; color: var(--orkhon); font-weight: 700; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.share-copy:hover { background: var(--line); }
.btn-fb { background: #1877F2; color: #fff; border-color: #1877F2; gap: 8px; }
.btn-fb:hover { background: #0F65D8; color: #fff; }
.share-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.share-apps button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: center; }
.share-apps button:hover { border-color: var(--orkhon); }
.share-ico { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; flex: none; }
.share-card h3 .share-ico { width: 30px; height: 30px; font-size: 15px; }
.share-fb { background: #1877F2; font-family: Arial, sans-serif; }
.share-ms { background: linear-gradient(135deg, #0695FF, #A334FA 60%, #FF6968); }
.share-vb { background: #7360F2; }
.share-tg { background: #26A5E4; }
.share-ln { background: var(--ink); }
.share-more { background: #8A9592; }
.share-url { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; background: transparent; padding: 0; }
.share-toast { position: sticky; bottom: 0; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px;
    opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; }
.share-toast.is-on { opacity: 1; transform: none; }
@media (max-width: 599px) {
    /* Утсан дээр доороос гарах */
    .share-sheet { margin: auto 0 0; width: 100vw; height: auto; max-height: 92dvh; border-radius: 20px 20px 0 0; }
    .share-sheet[open] { animation-name: share-up; }
    @keyframes share-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
    .share-inner { max-height: 92dvh; }
    .share-text { min-height: 160px; }
}

/* ------------------------------------------------------------------ Тусламж (/help), HelpLink */
.title-row { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.title-row h1 { margin: 0; }
.auth-card .title-row { justify-content: space-between; }
.help-link { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
    color: var(--orkhon); background: var(--directory-bg); text-decoration: none; white-space: nowrap; }
.help-link:hover { background: var(--orkhon); color: #fff; }
.share-body > .help-link { align-self: flex-start; }

.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.help-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius-lg); background: var(--surface);
    border: 1px solid var(--border); color: var(--ink); text-decoration: none; }
.help-card:hover { border-color: var(--orkhon); box-shadow: 0 6px 18px rgba(19, 32, 30, .08); }
.help-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.help-card-text strong { font-size: 16px; }
.help-card-text small { color: var(--muted); font-size: 14px; line-height: 1.4; }
.help-quick { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; }
.help-quick h2 { font-family: var(--font-display); font-size: 18px; margin-bottom: 8px; }
.help-quick ul { margin: 0; padding-left: 20px; columns: 2 260px; column-gap: 32px; }
.help-quick li { padding: 4px 0; break-inside: avoid; }

.help-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; }
.help-toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.help-toc a { padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.help-toc a:hover { background: var(--line); color: var(--orkhon); }
.help-toc .help-toc-other { color: var(--muted); }
.help-toc-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px 10px 4px; }
.help-toc-title:first-child { padding-top: 0; }
.help-article { max-width: 760px; min-width: 0; }
.help-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.help-head h1 { margin: 0; }
.help-section { scroll-margin-top: 84px; padding: 20px 0; border-top: 1px solid var(--line); line-height: 1.65; }
.help-section:first-of-type { border-top: 0; }
.help-section h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 10px; position: relative; }
.help-anchor { position: absolute; left: -22px; color: var(--border); text-decoration: none; opacity: 0; }
.help-section h2:hover .help-anchor { opacity: 1; }
.help-section:target h2 { color: var(--orkhon); }
.help-section p { margin: 0 0 10px; }
.help-section ul, .help-section ol { margin: 0 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.help-note { padding: 10px 14px; border-radius: 12px; background: var(--ads-bg); font-size: 14px; }
.help-pages { padding: 20px 0; border-top: 1px solid var(--line); }
.help-pages h2 { font-family: var(--font-display); font-size: 18px; margin-bottom: 10px; }
.help-page-links { display: flex; flex-wrap: wrap; gap: 8px; }
.help-page-links .btn { gap: 6px; }
.help-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.help-nav a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.help-nav a:hover { border-color: var(--orkhon); }
.help-nav small { color: var(--muted); font-size: 12px; }
.help-nav-next { grid-column: 2; text-align: right; }
@media (max-width: 899px) {
    .help-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .help-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .help-toc a { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
    .help-toc-title, .help-toc .help-toc-other { display: none; }
    .help-anchor { display: none; }
}
/* Гарын авлагын дэлгэцийн зураг (wwwroot/help/*.jpg, утасны дэлгэц) */
.help-shot { margin: 14px 0 18px; display: inline-flex; flex-direction: column; gap: 6px; max-width: 340px; vertical-align: top; margin-right: 16px; }
.help-shot img { width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(19, 32, 30, .1); background: var(--surface); }
.help-shot figcaption { font-size: 13px; color: var(--muted); line-height: 1.45; }
@media (max-width: 599px) { .help-shot { max-width: 100%; margin-right: 0; } }

/* Толгойн цэсний "Тусламж": таблетын өргөнд багтахгүй тул зөвхөн том дэлгэцэнд (доод цэсэнд үргэлж бий) */
@media (max-width: 1099px) { .main-nav .nav-help { display: none; } }
