/* Байгууллагууд — /organizations (итгэмжлэл + хамрах хүрээ) */
.og-empty { padding: 28px 0; }

/* ── Header + KPI ── */
.og-header { background: var(--bg-white); border-bottom: 1px solid var(--border-light); padding: 2.5rem 2rem; }
.og-header-inner { max-width: 1160px; margin: 0 auto; }
.og-header-title { font-size: 28px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }
.og-header-sub { font-size: 14.5px; color: var(--text-secondary); margin-top: 6px; max-width: 760px; line-height: 1.55; }

.og-kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 1.75rem; }
@media (max-width: 980px) { .og-kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .og-kpi-row { grid-template-columns: repeat(2, 1fr); } }
.og-kpi { display: flex; align-items: center; gap: 12px; background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 15px 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.og-kpi-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0; }
.og-kpi-ic.b { background: #E6F1FB; color: #0F4C81; }
.og-kpi-ic.g { background: #EAF3DE; color: #3B6D11; }
.og-kpi-ic.c { background: #EDE9FF; color: #534AB7; }
.og-kpi-ic.o { background: #FEF3E2; color: #854F0B; }
.og-kpi-ic.t { background: #E1F5F2; color: #0F766E; }
.og-kpi-val { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.og-kpi-lbl { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ── Filter bar ── */
.og-body { max-width: 1160px; margin: 0 auto; padding: 1.5rem 2rem 4rem; }
.og-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.og-search-wrap { position: relative; flex: 1; min-width: 240px; max-width: 520px; }
.og-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 17px; }
.og-search-input { width: 100%; padding: 11px 14px 11px 40px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; box-sizing: border-box; background: var(--bg-white); font-family: inherit; }
.og-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 76, 129, .1); }
.og-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.og-tab { padding: 10px 16px; border: 1px solid var(--border); background: var(--bg-white); border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; font-family: inherit; transition: all .15s; }
.og-tab:hover { border-color: var(--primary-border); color: var(--primary); }
.og-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.og-kinds { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; transition: opacity .15s; }
.og-kinds.dim { opacity: .5; }
.og-kinds-lbl { font-size: 12.5px; font-weight: 600; color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; margin-right: 2px; }
.og-kind { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 1px solid var(--border); background: var(--bg-white); border-radius: 100px; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); cursor: pointer; font-family: inherit; transition: all .15s; }
.og-kind i { font-size: 15px; }
.og-kind:hover { border-color: #99c3e8; color: var(--primary); }
.og-kind.active { background: #E6F1FB; border-color: #8ab8e0; color: #0F4C81; font-weight: 600; }
.og-total-label { font-size: 12.5px; color: var(--text-muted); display: block; margin-bottom: 12px; }

/* ── Skeleton ── */
.og-sk { display: block; background: var(--bg-secondary, #eef2f6); border-radius: 6px; animation: ogPulse 1.3s ease-in-out infinite; }
.og-sk-logo { width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0; }
.og-sk-logo.lg { width: 60px; height: 60px; }
@keyframes ogPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.og-sk-item { cursor: default !important; }
.og-sk-item:hover { box-shadow: none !important; transform: none !important; }

/* ── List ── */
.og-list { display: flex; flex-direction: column; gap: 12px; }
.og-item { display: flex; align-items: flex-start; gap: 16px; background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 16px 18px; transition: box-shadow .15s, transform .15s, border-color .15s; cursor: pointer; outline: none; }
.og-item:hover, .og-item:focus-visible { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: #b9d4ec; }
.og-logo { width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 700; overflow: hidden; }
.og-logo.lg { width: 60px; height: 60px; font-size: 24px; }
.og-logo.has { background: var(--bg-white); border: 1px solid var(--border-light); }
.og-logo img { width: 100%; height: 100%; object-fit: contain; }
.og-item-body { flex: 1; min-width: 0; }
.og-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.og-item-name { font-size: 15.5px; font-weight: 600; color: var(--text-primary); line-height: 1.35; }
.og-item-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.og-item-meta span, .og-item-meta a { display: inline-flex; align-items: center; gap: 5px; }
.og-item-meta a { color: var(--primary); text-decoration: none; }
.og-item-meta a:hover { text-decoration: underline; }
.og-item-meta i { font-size: 14px; }
.og-item-arrow { color: #cbd5e1; font-size: 20px; align-self: center; flex-shrink: 0; transition: color .15s, transform .15s; }
.og-item:hover .og-item-arrow { color: var(--primary); transform: translateX(2px); }
.og-badge { flex-shrink: 0; display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 100px; font-size: 11.5px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.og-badge.prov { background: #EAF3DE; color: #3B6D11; }
.og-badge.recv { background: #E6F1FB; color: #0F4C81; }
mark { background: #FFF1B8; color: inherit; padding: 0 1px; border-radius: 3px; }

/* Итгэмжлэл + хүрээний товч (жагсаалт дээр) */
.og-scope-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.og-accr { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px; font-size: 12px; border: 1px solid; }
.og-accr i { font-size: 14px; }
.og-accr b { font-weight: 700; }
.og-accr-exp { opacity: .85; margin-left: 2px; }
.og-accr.ok { background: #F0FAF4; border-color: #BFE5CC; color: #17703A; }
.og-accr.warn { background: #FFF8EB; border-color: #F5D9A6; color: #9A5B07; }
.og-accr.no { background: #FEF2F2; border-color: #F6C6C6; color: #B42318; }
.og-kc { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px; font-size: 12px; background: #F5F8FC; border: 1px solid #DCE6F2; color: #34557A; cursor: pointer; font-family: inherit; transition: all .15s; }
.og-kc i { font-size: 14px; }
.og-kc b { color: #0F4C81; }
.og-kc:hover { background: #E6F1FB; border-color: #8ab8e0; }
.og-noaccr { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; }
.og-match { margin-top: 9px; font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.og-match-i { display: inline-flex; align-items: center; gap: 4px; background: #FFFBEA; border: 1px solid #F3E3A3; color: #5C4A0B; padding: 2px 8px; border-radius: 6px; max-width: 100%; }
.og-match-i i { font-size: 13px; }

/* ── Pagination ── */
.og-pagination { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 2rem; flex-wrap: wrap; }
.og-pg { min-width: 38px; height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-white); font-size: 13.5px; color: var(--text-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.og-pg:hover:not(:disabled):not(.active) { background: var(--bg-secondary); }
.og-pg.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.og-pg:disabled { opacity: .4; cursor: default; }
.og-pg-sep { color: var(--text-muted); padding: 0 4px; }

/* ════════ Дэлгэрэнгүй цонх (зөвхөн хаах товч / Esc-ээр хаагдана) ════════ */
.og-modal-ov { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding: 28px 16px; overflow-y: auto; }
.og-modal-ov.open { display: flex; }
.og-modal { background: var(--bg-white); border-radius: 18px; width: 100%; max-width: 1080px; box-shadow: 0 30px 70px rgba(0, 0, 0, .3); animation: ogMdIn .2s ease; overflow: hidden; }
@keyframes ogMdIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.og-md-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--border-light); background: linear-gradient(180deg, #F5F9FD, #fff); }
.og-md-org { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.og-md-org-txt { min-width: 0; }
.og-md-name { font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.35; }
.og-md-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 7px; font-size: 12.5px; color: var(--text-muted); }
.og-md-meta span, .og-md-meta a { display: inline-flex; align-items: center; gap: 5px; }
.og-md-meta a { color: var(--primary); text-decoration: none; }
.og-md-meta a:hover { text-decoration: underline; }
.og-md-actions { display: flex; gap: 6px; flex-shrink: 0; }
.og-md-x, .og-md-share { width: 36px; height: 36px; border: 1px solid var(--border-light); background: var(--bg-white); border-radius: 10px; cursor: pointer; font-size: 18px; color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; transition: all .15s; }
.og-md-x:hover { background: #FEF2F2; color: #B42318; border-color: #F6C6C6; }
.og-md-share:hover { color: var(--primary); border-color: #8ab8e0; }
.og-md-share.ok { color: #17703A; border-color: #BFE5CC; background: #F0FAF4; }
.og-md-body { padding: 18px 22px 24px; }

.og-md-sec-t { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--text-primary); text-transform: uppercase; letter-spacing: .3px; margin: 6px 0 10px; }
.og-md-sec-t i { color: var(--primary); font-size: 17px; }
.og-md-all { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-white); color: var(--text-secondary); cursor: pointer; font-family: inherit; }
.og-md-all.on { background: #E6F1FB; border-color: #8ab8e0; color: #0F4C81; }

.og-md-accrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 20px; }
.og-acard { border: 1px solid var(--border-light); border-radius: 14px; padding: 14px 15px; background: var(--bg-white); cursor: pointer; transition: all .15s; display: flex; flex-direction: column; gap: 7px; outline: none; }
.og-acard:hover { border-color: #8ab8e0; box-shadow: var(--shadow-sm); }
.og-acard.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 76, 129, .12); }
.og-acard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.og-acard-no { font-size: 16px; font-weight: 700; color: var(--primary); display: inline-flex; align-items: center; gap: 5px; }
.og-st { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 100px; white-space: nowrap; }
.og-st.ok { background: #E7F6EC; color: #17703A; }
.og-st.warn { background: #FFF1D6; color: #9A5B07; }
.og-st.no { background: #FDE4E4; color: #B42318; }
.og-acard-std { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.og-acard-unit { font-size: 12px; color: var(--text-muted); }
.og-acard-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; }
.og-acard-grid span { color: var(--text-muted); }
.og-acard-grid b { color: var(--text-primary); font-weight: 600; }
.og-acard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border-light); font-size: 12px; color: var(--text-muted); }
.og-acard-foot span, .og-acard-foot a { display: inline-flex; align-items: center; gap: 4px; }
.og-acard-foot a { color: #B42318; text-decoration: none; font-weight: 600; }
.og-acard-foot a:hover { text-decoration: underline; }

.og-mtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.og-mtab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); background: var(--bg-white); border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; font-family: inherit; transition: all .15s; }
.og-mtab i { font-size: 16px; }
.og-mtab b { background: #EEF2F6; color: var(--text-secondary); font-size: 11.5px; padding: 1px 7px; border-radius: 100px; }
.og-mtab:hover { border-color: #8ab8e0; color: var(--primary); }
.og-mtab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.og-mtab.on b { background: rgba(255, 255, 255, .22); color: #fff; }
.og-md-search { position: relative; max-width: 420px; margin-bottom: 12px; }
.og-md-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; }
.og-md-search input { width: 100%; box-sizing: border-box; padding: 9px 12px 9px 36px; border: 1px solid var(--border); border-radius: 9px; font-size: 13.5px; outline: none; font-family: inherit; }
.og-md-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 76, 129, .1); }

.og-scope-cnt { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.og-ssec { background: #EEF4FB; color: #0F4C81; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .2px; padding: 8px 12px; border-radius: 8px; margin: 14px 0 6px; line-height: 1.45; }
.og-scat { font-size: 13px; font-weight: 700; color: var(--text-primary); padding: 8px 2px 4px; border-bottom: 2px solid #E6EDF5; margin: 6px 0 2px; }
.og-si { padding: 11px 4px 11px 12px; border-bottom: 1px solid #EEF2F6; border-left: 3px solid transparent; transition: background .12s, border-color .12s; }
.og-si:hover { background: #FAFCFF; border-left-color: #8ab8e0; }
.og-si-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); line-height: 1.45; }
.og-si-accr { font-size: 11px; font-weight: 700; color: #0F4C81; background: #E6F1FB; padding: 1px 7px; border-radius: 6px; margin-left: 4px; }
.og-si-lbl { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-right: 2px; }
.og-si-hs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 7px; }
.og-hs { font-size: 11.5px; color: #475569; background: #F5F7FA; border: 1px solid #E3E9F0; padding: 2px 8px; border-radius: 6px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.og-hs b { color: #0F4C81; font-family: ui-monospace, Consolas, monospace; }
.og-si-stds { margin-top: 7px; display: flex; flex-direction: column; gap: 4px; }
.og-std { display: grid; grid-template-columns: minmax(130px, 220px) minmax(0, 1fr); gap: 12px; font-size: 12.5px; line-height: 1.45; }
.og-std-c { font-weight: 600; color: var(--text-primary); word-break: break-word; }
.og-std-c.ln { color: #0F4C81; }
.og-std-t { color: var(--text-secondary); word-break: break-word; }
.og-si-stds.collapsed .og-std-more { display: none; }
.og-std-tg { align-self: flex-start; border: none; background: none; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 0; font-family: inherit; }
.og-std-tg .c { display: inline; }
.og-std-tg .o { display: none; }
.og-si-stds.collapsed .og-std-tg .c { display: none; }
.og-si-stds.collapsed .og-std-tg .o { display: inline; }

@media (max-width: 640px) {
  .og-item { gap: 12px; padding: 14px; }
  .og-item-top { flex-direction: column; gap: 6px; }
  .og-item-arrow { display: none; }
  .og-modal-ov { padding: 0; }
  .og-modal { border-radius: 0; min-height: 100%; }
  .og-md-head { padding: 16px; }
  .og-md-body { padding: 14px 16px 22px; }
  .og-std { grid-template-columns: 1fr; gap: 1px; }
}
