/* ═══════════════════════════════════════════════════════════════
   HSPIM CMS — Админ панелийн загвар v2.5
   ═══════════════════════════════════════════════════════════════ */
:root {
  --navy: #0D1240; --navy-2: #141A55; --brand: #10069F; --blue: #2E5BFF; --sky: #EBF0FF; --teal: #00B2A9;
  --ink: #14162E; --muted: #5F6480; --line: #E4E6EF; --bg: #F4F5FA; --card: #fff;
  --ok: #17A673; --warn: #E0A100; --danger: #D03B3B;
  --radius: 14px; --shadow: 0 1px 3px rgba(13,18,64,.06), 0 8px 24px -12px rgba(13,18,64,.12);
  --sb-w: 264px; --font: 'Inter', system-ui, sans-serif; --font-head: 'Manrope', var(--font);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14.5px; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; }
button { font-family: inherit; cursor: pointer; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--ink); }
a { color: var(--brand); }
svg { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--sky); padding: 1px 6px; border-radius: 6px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent; border-radius: 10px; padding: 10px 18px; font-weight: 600; transition: .18s; white-space: nowrap; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--blue); box-shadow: 0 8px 18px -8px rgba(46,91,255,.6); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--brand); }
.btn-danger { background: #FCE9E9; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 1.5px solid transparent; border-radius: 9px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); position: relative; }
.icon-btn:hover { background: var(--sky); color: var(--brand); }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; }
.badge { background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 1px 6px; min-width: 18px; text-align: center; line-height: 16px; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--sky); color: var(--brand); white-space: nowrap; }
.pill.ok { background: #E1F5EE; color: var(--ok); }
.pill.off { background: #F1F1F4; color: var(--muted); }
.pill.warn { background: #FDF2DC; color: #A96D00; }
.pill.danger { background: #FCE9E9; color: var(--danger); }
.pill.navy { background: var(--navy); color: #fff; }

/* ── Login ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(120% 120% at 20% 10%, #1A2270 0%, var(--navy) 55%, #070A28 100%); }
.login-card { background: #fff; border-radius: 20px; padding: 44px 40px 32px; width: 410px; max-width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-logo img { height: 52px; }
.login-card h1 { font-family: var(--font-head); font-size: 23px; color: var(--navy); margin: 14px 0 4px; }
.login-card p { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.login-back { display: block; text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); text-decoration: none; }
.err-note { background: #FCE9E9; color: #B42323; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; margin-top: 12px; display: none; }
.err-note.on { display: block; }

/* ── Fields ── */
.field { margin-bottom: 14px; min-width: 0; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--navy); }
.field > label small { color: var(--muted); font-weight: 400; }
.field input[type=text], .field input[type=url], .field input[type=number], .field input[type=password], .field input[type=email], .field input[type=date], .field input[type=datetime-local],
.field textarea, .field select, .input { width: 100%; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; transition: .18s; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus, .rte:focus-within { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(46,91,255,.12); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
/* Switch (toggle) — `.field > label` дүрмээс (display:block) хамгаалж өндөр specificity-тэй бичив (v2.7.0) */
.toggle, .field > label.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--navy); user-select: none; margin: 0; min-height: 24px; line-height: 1.3; }
.field > label.toggle { margin-top: 26px; }
.toggle input { position: absolute; left: 0; top: 50%; width: 40px; height: 22px; margin: -11px 0 0; opacity: 0; cursor: pointer; }
.toggle i { display: inline-block; width: 40px; height: 22px; background: #D6D9E6; border-radius: 20px; position: relative; transition: background .2s; flex: 0 0 40px; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle input:checked + i { background: var(--ok); }
.toggle input:checked + i::after { left: 21px; }
.toggle input:focus-visible + i { box-shadow: 0 0 0 4px rgba(46,91,255,.22); }
.toggle span { min-width: 0; }
.color-field { display: flex; gap: 10px; align-items: center; }
.color-field input[type=color] { width: 46px; height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.full { grid-column: 1 / -1; }
.lang-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1.5px solid var(--line); }
.lang-tabs button { background: none; border: 0; padding: 8px 16px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1.5px; }
.lang-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.lang-pane[data-lang] { display: none; }
.lang-pane.on { display: block; }

/* Image field */
.img-field { display: flex; gap: 12px; align-items: flex-start; }
.img-field .prev { width: 120px; height: 80px; border-radius: 10px; background: var(--sky) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A9B4E0' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center/32px no-repeat; object-fit: contain; border: 1.5px solid var(--line); flex: none; }
.img-field .prev.has { background: var(--sky); }
.img-field .ctl { flex: 1; min-width: 0; }
.img-field .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
/* Icon field */
.icon-field { display: flex; gap: 10px; align-items: center; }
.icon-field .ic-prev { width: 42px; height: 42px; border-radius: 10px; background: var(--sky); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--line); flex: none; }
.icon-field .ic-prev svg { width: 22px; height: 22px; }
/* Gallery field */
.gal-field .gal-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.gal-field .gal-item { position: relative; width: 96px; height: 72px; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--line); background: var(--sky); cursor: grab; }
.gal-field .gal-item img { width: 100%; height: 100%; object-fit: cover; }
.gal-field .gal-item button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(13,18,64,.75); color: #fff; font-size: 11px; line-height: 1; }
.gal-field .gal-item.dragover { outline: 2px dashed var(--blue); }

/* ── Shell ── */
.shell { display: none; min-height: 100vh; }
.shell.on { display: grid; grid-template-columns: var(--sb-w) 1fr; }
.sidebar { background: var(--navy); color: #A9B4E0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.sb-brand { display: flex; gap: 12px; align-items: center; color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 15px; padding: 22px 20px 16px; text-decoration: none; }
.sb-brand img { height: 34px; }
.sb-brand span { line-height: 1.15; } .sb-brand b { color: #7FE3DC; } .sb-brand small { display: block; font-size: 10.5px; color: #6F7BB0; font-weight: 600; letter-spacing: .06em; }
.sb-nav { flex: 1; padding: 6px 12px 16px; }
.sb-group { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6F7BB0; padding: 16px 12px 6px; }
.sb-nav a { display: flex; align-items: center; gap: 11px; color: #B5BEE3; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; text-decoration: none; transition: .15s; }
.sb-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-nav a.on { background: var(--blue); color: #fff; box-shadow: 0 6px 16px -8px rgba(46,91,255,.8); }
.sb-nav a svg { width: 17px; height: 17px; opacity: .9; }
.sb-nav a .badge { margin-left: auto; }
.sb-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sb-user { color: #fff; font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.sb-user .av { width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.sb-user small { display: block; color: #8E9AD0; font-size: 11.5px; }
.sb-actions { display: flex; gap: 8px; }
.sb-actions .btn { flex: 1; background: rgba(255,255,255,.06); color: #C4CCE8; border-color: rgba(255,255,255,.12); }
.sb-actions .btn:hover { background: rgba(255,255,255,.14); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 26px; position: sticky; top: 0; z-index: 30; }
.crumbs { font-size: 13px; color: var(--muted); flex: 1; }
.crumbs b { color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.global-search { position: relative; }
.global-search input { width: 280px; padding: 8px 12px 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); }
.global-search input:focus { outline: none; border-color: var(--blue); background: #fff; }
.gs-results { position: absolute; top: 42px; right: 0; width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: none; max-height: 360px; overflow-y: auto; z-index: 40; }
.gs-results.on { display: block; }
.gs-results a { display: block; padding: 10px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); font-size: 13px; }
.gs-results a:hover { background: var(--sky); }
.gs-results a small { color: var(--muted); display: block; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 26px 30px 6px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-head); font-size: 24px; color: var(--navy); }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.content { padding: 18px 30px 40px; }

/* ── Cards / tables ── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.card + .card { margin-top: 18px; }
.card h3 { font-family: var(--font-head); font-size: 16px; color: var(--navy); margin-bottom: 4px; }
.card .sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, 1fr); } .g-3 { grid-template-columns: repeat(3, 1fr); } .g-2 { grid-template-columns: repeat(2, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.kpi { display: flex; gap: 14px; align-items: center; }
.kpi .ic { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--sky); color: var(--brand); flex: none; }
.kpi .ic svg { width: 22px; height: 22px; }
.kpi b { font-family: var(--font-head); font-size: 26px; color: var(--navy); display: block; line-height: 1.1; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.tbl-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; overflow-y: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 13px 16px; border-bottom: 1px solid var(--line); background: #FAFBFE; font-weight: 700; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FAFBFE; }
td small, .muted { color: var(--muted); font-size: 12.5px; }
.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--sky); display: block; }
.thumb.contain { object-fit: contain; padding: 4px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { text-align: center; color: var(--muted); padding: 56px 20px; }
.empty b { display: block; font-size: 16px; color: var(--navy); margin-bottom: 6px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 200px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { background: #fff; border: 1.5px solid var(--line); border-radius: 20px; padding: 7px 16px; font-weight: 600; font-size: 13px; color: var(--muted); }
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.drag-handle { cursor: grab; color: #B9BFD6; display: inline-flex; }
.drag-handle:active { cursor: grabbing; }
tr.dragging { opacity: .4; }
tr.drop-before td { box-shadow: inset 0 3px 0 var(--blue); }
tr.drop-after td { box-shadow: inset 0 -3px 0 var(--blue); }
.progress { height: 20px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--blue); border-radius: 6px; min-width: 2px; transition: width .6s ease; }

/* ── Menu tree ── */
.menu-tree { list-style: none; }
.menu-tree li { margin-bottom: 6px; }
.menu-tree .mi { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.menu-tree .mi.dragging { opacity: .4; }
.menu-tree .mi.drop-into { border-color: var(--teal); background: #E9FAF8; }
.menu-tree .mi.drop-before { box-shadow: 0 -3px 0 var(--blue); }
.menu-tree .mi.drop-after { box-shadow: 0 3px 0 var(--blue); }
.menu-tree .mi .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--sky); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.menu-tree .mi .ic svg { width: 16px; height: 16px; }
.menu-tree .mi .tt { flex: 1; min-width: 0; }
.menu-tree .mi .tt b { display: block; font-size: 14px; }
.menu-tree .mi .tt small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.menu-tree .mi.off { opacity: .55; }
.menu-tree ul { list-style: none; margin: 6px 0 4px 46px; padding-left: 14px; border-left: 2px dashed var(--line); }
.menu-tree .mi.feature .ic { background: var(--navy); color: #fff; }
.menu-tree .mi.cta .ic { background: var(--teal); color: #fff; }

/* ── Media grid ── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: .15s; position: relative; }
.media-item:hover, .media-item.sel { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,91,255,.15); }
.media-item .im { height: 110px; background: repeating-conic-gradient(#F1F2F7 0 25%, #fff 0 50%) 0 0/16px 16px; display: flex; align-items: center; justify-content: center; }
.media-item .im img { max-width: 100%; max-height: 100%; object-fit: contain; }
.media-item .im .ft { font-weight: 800; color: var(--muted); font-size: 13px; letter-spacing: .06em; }
.media-item .nm { font-size: 11.5px; padding: 7px 9px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-item .del { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(13,18,64,.75); color: #fff; font-size: 12px; opacity: 0; transition: .15s; }
.media-item:hover .del { opacity: 1; }
.dropzone { border: 2px dashed #C9CFE6; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 14px; background: #fff; transition: .15s; }
.dropzone.over { border-color: var(--blue); background: var(--sky); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.icon-grid button { background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--ink); font-size: 10px; overflow: hidden; }
.icon-grid button:hover, .icon-grid button.sel { border-color: var(--blue); background: var(--sky); color: var(--brand); }
.icon-grid button svg { width: 22px; height: 22px; }
.icon-grid button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Rich text editor ── */
.rte { border: 1.5px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: #FAFBFE; position: sticky; top: 0; z-index: 2; }
.rte-bar button, .rte-bar select { background: none; border: 1px solid transparent; border-radius: 6px; height: 30px; min-width: 30px; padding: 0 7px; color: var(--ink); font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; }
.rte-bar button:hover { background: var(--sky); color: var(--brand); }
.rte-bar button.on { background: var(--navy); color: #fff; }
.rte-bar button svg { width: 15px; height: 15px; }
.rte-bar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
.rte-area { min-height: 260px; max-height: 60vh; overflow-y: auto; padding: 16px 18px; outline: none; font-size: 15px; line-height: 1.65; }
.rte-area:empty::before { content: attr(data-placeholder); color: #A9AEC4; }
.rte-area h1, .rte-area h2, .rte-area h3 { font-family: var(--font-head); color: var(--navy); margin: 18px 0 8px; line-height: 1.25; }
.rte-area h1 { font-size: 26px; } .rte-area h2 { font-size: 22px; } .rte-area h3 { font-size: 18px; }
.rte-area p, .rte-area ul, .rte-area ol, .rte-area blockquote, .rte-area table { margin-bottom: 12px; }
.rte-area ul, .rte-area ol { padding-left: 24px; }
.rte-area a { color: var(--brand); text-decoration: underline; }
.rte-area img { max-width: 100%; height: auto; border-radius: 8px; }
.rte-area img.sel { outline: 3px solid var(--blue); }
.rte-area blockquote { border-left: 4px solid var(--brand); padding: 8px 16px; background: var(--bg); color: var(--muted); }
.rte-area table { border-collapse: collapse; width: 100%; }
.rte-area td, .rte-area th { border: 1px solid var(--line); padding: 6px 10px; min-width: 40px; }
.rte-area iframe { max-width: 100%; }
.rte-html { width: 100%; min-height: 260px; padding: 14px; border: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; resize: vertical; display: none; }
.rte.src .rte-area { display: none; } .rte.src .rte-html { display: block; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; background: rgba(13,18,64,.55); display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto; z-index: 100; backdrop-filter: blur(2px); }
.modal-card { background: #fff; border-radius: 18px; width: 860px; max-width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,.35); display: flex; flex-direction: column; max-height: calc(100vh - 60px); }
.modal.picker .modal-card { width: 960px; }
.modal-card.narrow { width: 520px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 26px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-family: var(--font-head); color: var(--navy); font-size: 18px; }
.modal-body { padding: 22px 26px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--line); background: #FAFBFE; border-radius: 0 0 18px 18px; }
.modal-foot .left { margin-right: auto; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--navy); color: #fff; padding: 13px 22px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transform: translateY(10px); transition: .3s; z-index: 300; pointer-events: none; max-width: 420px; }
.toast.on { opacity: 1; transform: none; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* Settings groups */
.set-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.set-group { display: none; } .set-group.on { display: block; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 0; margin-top: 10px; display: flex; justify-content: flex-end; gap: 10px; }

/* Survey results */
.res-q { background: #fff; border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.res-q h4 { font-family: var(--font-head); color: var(--navy); font-size: 15px; margin-bottom: 12px; }
.res-bar { margin-bottom: 9px; }
.res-bar .lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; color: var(--muted); }
.res-bar .lbl b { color: var(--navy); }

/* Widgets preview */
.mini-chart { height: 120px; }

@media (max-width: 1100px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-3 { grid-template-columns: 1fr 1fr; } .g-2-1 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell.on { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sb-w); z-index: 60; transform: translateX(-100%); transition: .25s; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .sidebar.open { transform: none; }
  .global-search input { width: 150px; }
  .content, .page-head { padding-left: 16px; padding-right: 16px; }
  .g-4, .g-3, .g-2, .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .modal { padding: 10px; }
}

/* ═══ ОНУХ судалгаа (v2.7.0) ═══ */
.onuh-flow { margin-bottom: 18px; border-left: 4px solid var(--ok); }
.onuh-flow-head h3 { margin: 8px 0 4px; }
.onuh-flow-head .sub { max-width: 900px; margin-bottom: 14px; }
.onuh-flow.compact .onuh-flow-head .sub { margin-bottom: 12px; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; }
.flow .step { display: grid; gap: 3px; padding: 12px 14px 12px 50px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; position: relative; transition: .15s; }
.flow .step:hover { border-color: var(--blue); background: var(--sky); }
.flow .step i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-style: normal; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.flow .step > b { font-size: 13.5px; color: var(--navy); }
.flow .step span { font-size: 12.5px; color: var(--muted); }
.flow .arr { align-self: center; color: var(--muted); font-size: 20px; font-weight: 700; }
.flow-map { margin-top: 14px; font-size: 13px; }
.flow-map summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.flow-map table { margin-top: 10px; width: 100%; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; border-collapse: separate; border-spacing: 0; }
.flow-map td { padding: 8px 12px; font-size: 13px; }
.flow-map td:first-child { font-weight: 600; color: var(--navy); width: 38%; }
.flow-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.sub-filters .input { min-width: 0; width: auto; padding: 8px 10px; font-size: 13px; }
.sub-filters input[name=q] { min-width: 190px; flex: 1; }
.sub-filters .date-f { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.sc-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; flex-wrap: wrap; }
.sc-head .spacer { flex: 1; }
.sc-groups { display: grid; gap: 12px; margin-bottom: 16px; }
.sc-group { border: 1.5px solid var(--line); border-top: 4px solid var(--gc); border-radius: 12px; padding: 10px 12px 6px; }
.sc-group h4 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--navy); margin-bottom: 6px; }
.sc-group h4 i { width: 10px; height: 10px; border-radius: 50%; background: var(--gc); }
.sc-group h4 small { color: var(--muted); font-weight: 500; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 6px; border-radius: 8px; }
.sc-row:nth-child(even) { background: #FAFBFE; }
.sc-row.miss { background: #FCE9E9; box-shadow: inset 3px 0 0 var(--danger); }
.sc-lbl { font-size: 13.5px; min-width: 0; }
.sc-lbl b { color: var(--muted); margin-right: 4px; }
.sc-seg { display: inline-flex; gap: 4px; flex: none; }
.sc-seg label { position: relative; cursor: pointer; }
.sc-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sc-seg span { display: inline-flex; width: 34px; height: 32px; align-items: center; justify-content: center; border: 1.5px solid var(--line); border-radius: 8px; font-weight: 800; font-size: 13.5px; color: var(--muted); background: #fff; transition: .12s; }
.sc-seg label:hover span { border-color: var(--gc); color: var(--navy); }
.sc-seg input:checked + span { background: var(--gc); border-color: var(--gc); color: #fff; }
.sc-seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(46,91,255,.3); }
.onuh-group { padding: 16px 18px; }
.onuh-group .og-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.onuh-group .og-head .spacer { flex: 1; }
.onuh-group .og-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.onuh-group .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gc) 20%, transparent); flex: none; }
.onuh-group .tbl-wrap { box-shadow: none; border: 1px solid var(--line); }
.region-checks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 12px; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.region-checks label { display: flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.csv-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.csv-err { margin-top: 10px; max-height: 220px; overflow-y: auto; font-size: 12.5px; background: #FCE9E9; color: #8A1F1F; border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; }
  .flow .arr { transform: rotate(90deg); justify-self: center; }
  .sc-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .region-checks { grid-template-columns: 1fr 1fr; }
}
.sub-date { white-space: nowrap; }
.sub-date .muted { white-space: normal; display: inline-block; max-width: 140px; }

/* ═══ Switch карт (v2.8.0) — нэр + төлөвийн тайлбартай ойлгомжтой унтраалга ═══ */
.field-switch { align-self: end; }
.switch-card, .field > label.switch-card { position: relative; display: flex; margin: 0; font-size: inherit; font-weight: inherit; align-items: center; gap: 12px; min-height: 48px; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; user-select: none; transition: border-color .15s, background .15s; }
.switch-card:hover { border-color: #C5CAE0; }
.switch-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch-card .sw { flex: 0 0 42px; width: 42px; height: 24px; border-radius: 24px; background: #C9CEDF; position: relative; transition: background .2s; }
.switch-card .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch-card .sw-text { display: grid; gap: 1px; min-width: 0; line-height: 1.3; }
.switch-card .sw-text b { font-size: 13.5px; font-weight: 700; color: var(--navy); }
.switch-card .sw-state { font-size: 12px; color: var(--muted); }
.switch-card .sw-state::before { content: attr(data-off); }
.switch-card input:checked ~ .sw-text .sw-state::before { content: attr(data-on); }
.switch-card input:checked ~ .sw-text .sw-state { color: #0E8A55; font-weight: 600; }
.switch-card input:checked + .sw { background: var(--ok); }
.switch-card input:checked + .sw::after { transform: translateX(18px); }
.switch-card:has(input:checked) { border-color: rgba(46,212,122,.55); background: #F1FBF6; }
.switch-card input:focus-visible + .sw { box-shadow: 0 0 0 4px rgba(46,91,255,.25); }
.field-switch .hint { margin-top: 6px; }

/* ═══ Хуучин сайтын медиа импорт (v2.9.0) ═══ */
.wp-imp { margin-bottom: 18px; border-left: 4px solid var(--blue); }
.wp-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; }
.wp-head h3 { margin-bottom: 4px; }
.wp-head .sub { max-width: 820px; }
.wp-stat { text-align: right; flex: none; }
.wp-stat b { display: block; font-family: var(--font-head); font-size: 30px; color: var(--navy); line-height: 1; }
.wp-stat span { font-size: 12px; color: var(--muted); }
.wp-actions { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.wp-actions .date-f { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.wp-bar { height: 10px; background: var(--bg); border-radius: 10px; overflow: hidden; margin-top: 14px; }
.wp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--ok)); transition: width .4s; }
.wp-res { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wp-logos { margin: 10px 0 0 18px; font-size: 13px; display: grid; gap: 3px; }
.wp-fail { margin-top: 10px; font-size: 12.5px; }
.wp-fail summary { cursor: pointer; font-weight: 700; color: var(--danger); }
.wp-fail > div { padding: 3px 0; border-bottom: 1px solid var(--line); }
.media-item .im { position: relative; }
.media-item .im video { width: 100%; height: 100%; object-fit: cover; background: #111; }
.media-item .ft.vid { position: absolute; inset: auto 8px 8px auto; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }

/* ═══ v3.0.0 — олон сонголт, тийм/үгүй/мэдэхгүй, Excel импорт ═══ */
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.chk { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 13px; }
.chk:has(input:checked) { border-color: var(--blue); background: var(--sky); }
.tri { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tri label { cursor: pointer; }
.tri input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tri span { display: inline-block; padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tri input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.tri input:focus-visible + span { box-shadow: 0 0 0 3px rgba(46,91,255,.3); }
.x-sum .pill.navy { background: #E8EBFA; color: var(--navy); }
.x-sum .pill.warn { background: #FFF4DB; color: #8A5A00; }
#xBar { margin-top: 12px; }
