/* =====================================================================
   ECM Групп — Дизайны систем (Royal Blue & Gold)
   ===================================================================== */
:root {
    --blue: #1D428A;
    --navy: #0F2654;
    --gold: #FFC72C;
    --gold-hover: #F5B800;
    --sky: #0284C7;
    --green: #059669;
    --amber: #D97706;
    --bg: #FFFFFF;
    --bg-soft: #F4F7FB;
    --line: #E2E8F0;
    --line-strong: #CBD5E1;
    --ink: #0F172A;
    --text: #334155;
    --muted: #64748B;
    --on-dark: #DCE6F5;
    --on-dark-muted: #93A9CF;
    --danger: #B91C1C;
    --radius: 12px;
    --font-head: 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --shadow: 0 14px 32px rgba(15, 38, 84, .12);
    --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font-body); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); margin: 0; letter-spacing: -0.02em; font-weight: 700; }
h1 { line-height: 1.2; }
/* FocusOnNavigate нь h1-д фокус өгдөг — хулганаар шилжихэд шар хүрээ харагдуулахгүй */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus { outline: none; }
a { color: var(--blue); }
a:hover { color: var(--navy); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .container { padding: 0 20px; } }

/* ---------- Boot / error ---------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.boot-bar { width: 180px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.boot-bar span { display: block; height: 100%; background: var(--blue); transition: width .2s; }
.boot-text { font-size: 14px; color: var(--muted); }
.route-site .boot-admin, .route-admin .boot-site { display: none; }
html { scrollbar-gutter: stable; }
#blazor-error-ui { background: #FEF3C7; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .8rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .6rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-body); font-weight: 600; font-size: 15px; padding: 12px 20px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 44px; transition: background .15s, border-color .15s; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--gold); color: var(--blue); font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: var(--gold-hover); color: var(--blue); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover:not(:disabled) { background: var(--navy); color: #fff; }
.btn-outline { background: #fff; border-color: var(--blue); color: var(--blue); }
.btn-outline:hover:not(:disabled) { background: var(--bg-soft); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-soft); }
.btn-light-outline { background: transparent; border: 1.5px solid #fff; color: #fff; }
.btn-light-outline:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-danger { background: #fff; border-color: #FECACA; color: var(--danger); }
.btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover:not(:disabled) { background: var(--bg-soft); }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.input, .field input:not([type=checkbox]), .field select, .field textarea {
    font-family: var(--font-body); font-size: 15px; font-weight: 400; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; background: #fff; width: 100%;
}
.field textarea { resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); border-color: var(--blue); }
.validation-message { color: var(--danger); font-size: 13px; font-weight: 500; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex-grow: 1; }

.alert { border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-ok { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-info { background: var(--bg-soft); color: var(--text); }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill-new { background: #FEF3C7; color: #92400E; }
.pill-contacted { background: #DBEAFE; color: #1E40AF; }
.pill-demo_scheduled, .pill-published { background: #D1FAE5; color: #065F46; }
.pill-closed, .pill-draft, .pill-archived, .pill-hidden { background: #F1F5F9; color: #475569; }
.pill-scheduled { background: #EDE9FE; color: #5B21B6; }
.lang-chip { font-size: 11px; font-weight: 700; padding: 3px 6px; border-radius: 4px; background: #F1F5F9; color: var(--muted); }
.lang-chip.on { background: #DBEAFE; color: #1E40AF; }
.muted { color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--blue); text-transform: uppercase; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   НИЙТИЙН САЙТ
   ===================================================================== */
.site-header { background: var(--blue); position: sticky; top: 0; z-index: 50; padding-top: var(--safe-top); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; }
.brand-mark img { width: 32px; height: 32px; }
.brand-text { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: #fff; letter-spacing: .04em; }
.brand-text span { color: var(--gold); }
.site-nav { display: flex; gap: 26px; font-size: 15px; font-weight: 500; }
.site-nav a { color: #fff; text-decoration: none; padding: 6px 0 6px; border-bottom: 3px solid transparent; }
.site-nav a:hover { color: var(--gold); }
.site-nav a.active { border-bottom-color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle { display: flex; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; overflow: hidden; }
.lang-toggle button { border: 0; background: transparent; color: #fff; padding: 9px 11px; font-weight: 600; font-size: 13px; cursor: pointer; font-family: var(--font-body); }
.lang-toggle button.on { background: var(--gold); color: var(--blue); }
.dropdown { position: relative; }
.dropdown-toggle { color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font-body); }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border-radius: 14px; box-shadow: 0 24px 48px rgba(15,38,84,.18); padding: 8px; min-width: 280px; z-index: 60; }
.dropdown-menu .dm-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); padding: 8px 12px 4px; }
.dropdown-menu a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; }
.dropdown-menu a:hover { background: var(--bg-soft); }
.dropdown-menu a b { display: block; color: var(--ink); font-weight: 600; }
.dropdown-menu a small { color: var(--muted); }
.login-icon { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.login-icon:hover { background: rgba(255,255,255,.1); color: var(--gold); }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 8px; border: 0; background: var(--gold); color: var(--blue); font-size: 22px; cursor: pointer; }
@media (max-width: 1100px) {
    .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
    .site-nav { display: none; width: 100%; flex-direction: column; gap: 0; padding-bottom: 14px; order: 3; }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
    .header-actions .dropdown { display: none; }
}

.hero { background: var(--blue); color: #fff; }
.hero .container { padding-top: 80px; padding-bottom: 96px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.hero-text { flex: 1 1 520px; min-width: 0; }
.badge { display: inline-block; border: 1px solid var(--gold); color: var(--gold); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 600; letter-spacing: .08em; }
.hero h1 { color: #fff; font-weight: 700; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.12; margin-top: 24px; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { font-size: 18px; line-height: 1.65; color: var(--on-dark); margin: 24px 0 0; max-width: 620px; }
.hero .row { margin-top: 32px; gap: 14px; }
.hero-panel { flex: 1 1 400px; min-width: 0; background: var(--navy); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.hero-panel .label { font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--on-dark-muted); }
.hero-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hero-tile { background: var(--blue); border-radius: 12px; padding: 16px; color: #fff; text-decoration: none; }
.hero-tile:hover { color: #fff; outline: 2px solid var(--gold); }
.hero-tile small { display: block; font-size: 12px; color: var(--on-dark-muted); }
.hero-tile b { display: block; font-family: var(--font-head); font-size: 18px; margin-top: 6px; }

.page-hero { background: var(--navy); color: #fff; }
.page-hero .container { padding-top: 56px; padding-bottom: 64px; }
.crumbs { font-size: 14px; color: var(--on-dark-muted); }
.crumbs b { color: var(--gold); font-weight: 500; }
.page-hero h1 { color: #fff; font-weight: 700; font-size: clamp(30px, 4vw, 46px); margin-top: 16px; }
.page-hero p { font-size: 18px; line-height: 1.6; color: var(--on-dark); margin: 14px 0 0; max-width: 700px; }

.section { padding: 88px 0; }
.section.soft { background: var(--bg-soft); }
.section h2 { font-size: clamp(26px, 3vw, 38px); margin-top: 12px; }
.section .lead { font-size: 17px; line-height: 1.6; margin: 14px 0 0; max-width: 720px; }
@media (max-width: 640px) { .section { padding: 56px 0; } }

.metrics { border-bottom: 1px solid var(--line); }
.metrics .container { padding-top: 40px; padding-bottom: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.metric b { display: block; font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em; font-size: 40px; color: var(--blue); }
.metric i { display: block; width: 32px; height: 4px; background: var(--gold); border-radius: 2px; margin: 6px 0 8px; }
.metric span { font-size: 15px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin-top: 40px; }
.card { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 12px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-top-color: var(--gold); }
.card h3 { font-size: 20px; }
.card p { font-size: 15px; line-height: 1.6; margin: 0; flex-grow: 1; }
.mono { width: 44px; height: 44px; border-radius: 10px; color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.tag { align-self: flex-start; background: var(--bg-soft); color: var(--blue); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.dot-list { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.dot-list div { display: flex; gap: 10px; font-size: 14px; line-height: 1.5; }
.dot-list div::before { content: ''; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }

.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 32px; }
.tab { font-family: var(--font-body); font-size: 15px; font-weight: 600; padding: 11px 18px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line-strong); background: #fff; color: var(--blue); }
.tab.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.feature-panel { margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 40px; display: flex; flex-wrap: wrap; gap: 40px; }
.feature-panel > div { flex: 1 1 380px; min-width: 0; }
.feature-panel h3 { font-size: 30px; color: var(--blue); margin-top: 8px; }
.mod { display: flex; gap: 12px; align-items: center; background: var(--bg-soft); border-radius: 10px; padding: 14px 16px; font-size: 15px; font-weight: 500; color: var(--ink); margin-bottom: 10px; }
.mod::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
@media (max-width: 640px) { .feature-panel { padding: 22px; } }

.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 36px; }
.values h3 { font-size: 19px; margin-top: 10px; }
.values p { font-size: 15px; line-height: 1.6; margin: 8px 0 0; }
.cta-band { background: var(--navy); border-radius: 20px; padding: 48px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.cta-band h2 { color: #fff; font-size: 30px; margin: 0; }
.cta-band p { color: var(--on-dark); margin: 10px 0 0; }

.timeline { border-left: 2px solid var(--line); padding-left: 28px; margin-left: 8px; }
.tl-item { position: relative; padding-bottom: 28px; }
.tl-item::before { content: ''; position: absolute; left: -38px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--tl, var(--blue)); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.tl-item b { display: block; font-family: var(--font-head); font-weight: 800; font-size: 26px; color: var(--blue); }
.tl-item strong { display: block; color: var(--ink); margin-top: 4px; }
.tl-item span { display: block; font-size: 15px; margin-top: 4px; }
.split { display: flex; flex-wrap: wrap; gap: 56px; }
.split > * { flex: 1 1 400px; min-width: 0; }

.co-block { display: flex; flex-wrap: wrap; gap: 40px; padding: 64px 0; border-bottom: 1px solid var(--line); }
.co-panel { flex: 1 1 320px; min-width: 0; border-radius: 16px; padding: 32px; color: #fff; display: flex; flex-direction: column; gap: 14px; }
.co-panel h2 { color: #fff; font-size: 32px; margin: 0; }
.co-panel .motto { font-family: var(--font-head); font-weight: 600; font-size: 18px; }
.co-panel a { color: #fff; font-weight: 600; text-decoration: none; margin-top: auto; }
.co-body { flex: 2 1 520px; min-width: 0; }
.co-body .card { padding: 20px; }

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 32px; }
.news-card { text-decoration: none; color: inherit; }
.news-cover { height: 170px; border-radius: 10px; background: var(--bg-soft); background-size: cover; background-position: center; }
.article { max-width: 760px; margin: 0 auto; font-size: 17px; line-height: 1.75; color: #1E293B; }
.article h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.2; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 36px; }
.pager button { min-width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-family: var(--font-body); }
.pager button.on { background: var(--blue); color: #fff; border-color: var(--blue); }

.contact-card { border: 1px solid var(--line); border-radius: 12px; padding: 22px; border-left: 4px solid var(--c, var(--blue)); }
.contact-card h3 { font-size: 17px; }
.contact-card div { font-size: 15px; line-height: 1.8; margin-top: 8px; }
.form-card { background: var(--bg-soft); border-radius: 16px; padding: 36px; }
@media (max-width: 640px) { .form-card { padding: 22px; } .cta-band { padding: 28px; } }

.site-footer { background: var(--navy); color: #CBD5E1; font-size: 14px; }
.site-footer .container { padding-top: 56px; padding-bottom: 24px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.footer-cols b { color: #fff; display: block; margin-bottom: 10px; }
.footer-cols a { display: block; color: #CBD5E1; text-decoration: none; padding: 4px 0; }
.footer-cols a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid #22396B; margin-top: 32px; padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.install-btn { background: transparent; border: 1px dashed rgba(255,255,255,.5); color: #fff; border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-body); }

/* =====================================================================
   АДМИН
   ===================================================================== */
.admin { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--bg-soft); }
.sidebar { flex: 0 0 260px; background: var(--navy); color: #CBD5E1; padding: calc(22px + var(--safe-top)) 14px 28px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brand { padding: 0 8px 20px; }
.sidebar .brand small { display: block; font-size: 12px; color: var(--on-dark-muted); font-family: var(--font-body); letter-spacing: 0; font-weight: 400; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--on-dark-muted); padding: 14px 12px 6px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 500; color: #CBD5E1; }
.side-link:hover { background: var(--blue); color: #fff; }
.side-link.active { background: var(--blue); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-link .count { margin-left: auto; background: var(--gold); color: var(--blue); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.admin-main { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: var(--gold); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.admin-content { padding: 28px 32px 48px; max-width: 1240px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.page-head p { color: var(--muted); }
.page-head p { margin: 6px 0 0; font-size: 15px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; }
.panel-body { padding: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.kpi small { font-size: 13px; color: var(--muted); }
.kpi b { display: block; font-family: var(--font-head); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); margin: 8px 0 4px; }
.kpi.dark { background: var(--blue); border-color: var(--blue); }
.kpi.dark small, .kpi.dark span { color: var(--on-dark); }
.kpi.dark b { color: var(--gold); }
.cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.cols > .main { flex: 3 1 520px; min-width: 0; }
.cols > .side { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 12px; background: #F8FAFC; font-weight: 600; }
.table td { padding: 13px 12px; border-top: 1px solid #F1F5F9; vertical-align: middle; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #F8FAFC; }
.seg { display: flex; gap: 4px; background: var(--bg-soft); border-radius: 10px; padding: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-family: var(--font-body); font-weight: 600; font-size: 14px; color: #475569; cursor: pointer; }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(15,38,84,.12); }
.lang-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 20px; gap: 24px; }
.lang-tabs button { border: 0; background: transparent; padding: 15px 2px; font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.lang-tabs button.on { color: var(--blue); box-shadow: inset 0 -3px 0 var(--gold); }
.list-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border: 0; border-bottom: 1px solid #F1F5F9; background: #fff; text-align: left; font-family: var(--font-body); }
.list-item.on { background: var(--bg-soft); box-shadow: inset 3px 0 0 var(--gold); }
.list-item.drag-over { box-shadow: inset 0 3px 0 var(--blue); }
.list-item .grip { color: #94A3B8; cursor: grab; user-select: none; }
.list-item .sel { flex-grow: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; text-align: left; font-family: var(--font-body); }
.list-item .sel:hover { background: #F8FAFC; }
.color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.swatch.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.toggle { width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); border: 0; position: relative; cursor: pointer; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--blue); }
.toggle.on::after { left: 21px; }
.module-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.module-row .grow { flex-grow: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; font-size: 14px; }
.detail-grid small { display: block; color: var(--muted); font-size: 12px; }
.detail-grid b { color: var(--ink); }
.login { display: flex; flex-wrap: wrap; min-height: 100vh; }
.login-art { flex: 1 1 480px; background: var(--blue); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-art h1 { color: #fff; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; max-width: 520px; margin-top: 16px; }
.login-form { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-form form { width: 100%; max-width: 400px; }
@media (max-width: 860px) {
    .sidebar { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; padding: calc(12px + var(--safe-top)) 12px 12px; gap: 6px; }
    .sidebar .brand { width: 100%; padding-bottom: 8px; }
    .side-label { display: none; }
    .side-link { padding: 8px 10px; font-size: 13px; }
    .topbar, .admin-content { padding-left: 16px; padding-right: 16px; }
    .login-art { padding: 32px 24px; }
}

/* ---------- Текст засварлагч (Quill 2) ---------- */
.rich-editor { border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; font-weight: 400; }
.rich-editor .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line); background: #F8FAFC; font-family: var(--font-body); padding: 8px; }
.rich-editor .ql-container.ql-snow { border: 0; font-family: var(--font-body); font-size: 16px; }
.rich-editor .ql-editor { min-height: 340px; line-height: 1.7; color: #1E293B; padding: 18px 20px; }
.rich-editor .ql-editor.ql-blank::before { color: #94A3B8; font-style: normal; left: 20px; }
.rich-editor .ql-editor h2 { font-size: 24px; margin: 18px 0 8px; }
.rich-editor .ql-editor h3 { font-size: 19px; margin: 16px 0 6px; }
.rich-editor .ql-editor img { max-width: 100%; border-radius: 8px; }
.rich-editor .ql-snow .ql-stroke { stroke: #334155; }
.rich-editor .ql-snow .ql-fill { fill: #334155; }
.rich-editor .ql-snow button:hover .ql-stroke, .rich-editor .ql-snow .ql-active .ql-stroke { stroke: var(--blue); }
.rich-editor .ql-snow button:hover .ql-fill, .rich-editor .ql-snow .ql-active .ql-fill { fill: var(--blue); }
.upload-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 14px; border: 2px dashed var(--line-strong); border-radius: 10px; background: #F8FAFC; text-align: center; font-size: 14px; color: var(--blue); cursor: pointer; }
.upload-drop:hover { border-color: var(--blue); }
.upload-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-drop .muted { font-size: 12px; font-weight: 400; }

/* ---------- Нийтийн мэдээний агуулга (Quill-ийн гаралт) ---------- */
.article h2 { font-size: 26px; margin: 28px 0 10px; }
.article h3 { font-size: 20px; margin: 24px 0 8px; }
.article p { margin: 0 0 14px; }
.article img { max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0; }
.article blockquote { margin: 18px 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--gold); color: var(--text); }
.article ul, .article ol { padding-left: 1.5em; margin: 0 0 14px; }
.article li[data-list="bullet"] { list-style-type: disc; }
.article li[data-list="ordered"] { list-style-type: decimal; }
.article .ql-ui { display: none; }
.article .ql-align-center { text-align: center; }
.article .ql-align-right { text-align: right; }
.article .ql-align-justify { text-align: justify; }
.article a { text-decoration: underline; }
