/* lev.gover.mn — харанхуй мониторингийн консол. Нэг дэлгэц, хуудас скроллгүй; самбарууд дотроо гүйнэ. */
:root {
  --bg: #060B09; --panel: #0B1510; --panel2: #0F1D16; --line: #163A28; --line2: #1F4D35;
  --ink: #D7E6DC; --mute: #7FA891; --dim: #4E7460; --acc: #35FF8D; --acc2: #1FBF68; --warn: #FFB963; --bad: #FF6B6B;
  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --head: 'Orbitron', var(--sans);
  --r: 6px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; position: fixed; inset: 0; overflow: hidden; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); display: flex; flex-direction: column; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg, rgba(53,255,141,.025) 0 1px, transparent 1px 3px); }
a { color: var(--acc); text-decoration: none; } a:hover { text-decoration: underline; }
p { text-align: justify; margin: 0 0 .7em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- толгой ---- */
.top { position: relative; z-index: 2; flex: 0 0 56px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #0A1410, var(--bg)); }
.brand { font-family: var(--head); font-weight: 700; letter-spacing: .22em; font-size: 20px; color: var(--acc); display: flex; align-items: center; gap: 10px; text-shadow: 0 0 14px rgba(53,255,141,.45); }
.brand.big { font-size: 28px; justify-content: center; margin-bottom: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 4px rgba(53,255,141,.15), 0 0 12px var(--acc); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(53,255,141,.15), 0 0 12px var(--acc); } 50% { box-shadow: 0 0 0 7px rgba(53,255,141,.05), 0 0 4px var(--acc); } }
.tabs { display: flex; gap: 4px; justify-content: center; }
.tabs button { background: transparent; border: 1px solid transparent; border-radius: var(--r); padding: 7px 16px; color: var(--mute); cursor: pointer; letter-spacing: .02em; }
.tabs button:hover { color: var(--ink); border-color: var(--line); }
.tabs button.on { color: var(--acc); border-color: var(--line2); background: rgba(53,255,141,.06); }
.who { display: flex; justify-content: flex-end; align-items: center; gap: 10px; color: var(--mute); font-size: 13px; }
.who b { color: var(--ink); font-weight: 600; }

/* ---- үндсэн ---- */
#main { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; display: flex; }
.view { display: none; flex: 1 1 auto; min-height: 0; flex-direction: column; }
.view.on { display: flex; }
.two { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.col:last-child { border-right: 0; }
.bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: var(--panel); }
.bar-l { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.bar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lbl { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 12px; color: var(--acc); white-space: nowrap; }
.sub { font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 22px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.empty { color: var(--dim); text-align: center; padding: 60px 20px; }

/* ---- товч, талбар ---- */
.btn { background: rgba(53,255,141,.1); border: 1px solid var(--line2); color: var(--acc); border-radius: var(--r); padding: 7px 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: rgba(53,255,141,.18); border-color: var(--acc2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: var(--mute); border-color: var(--line); } .btn.ghost:hover { color: var(--ink); border-color: var(--line2); }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(255,107,107,.35); } .btn.danger:hover { background: rgba(255,107,107,.1); }
.btn.sm { padding: 3px 10px; font-size: 12px; }
.sel, input:not([type=checkbox]), select, textarea { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 10px; color: var(--ink); outline: none; width: 100%; }
.sel { width: auto; }
input:focus, select:focus, textarea:focus { border-color: var(--acc2); box-shadow: 0 0 0 3px rgba(53,255,141,.08); }
textarea { resize: vertical; min-height: 60px; }
.form label { display: block; margin: 0 0 12px; font-size: 13px; color: var(--mute); }
.form label > input, .form label > select, .form label > textarea, .form label > .chips { margin-top: 5px; }
.form .hint { display: block; font-size: 12px; color: var(--dim); }
.chk { display: flex !important; align-items: center; gap: 8px; color: var(--ink) !important; }
.chk input { width: 16px; height: 16px; accent-color: var(--acc); margin: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; }
.row input { flex: 1 1 140px; width: auto; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button { background: transparent; border: 0; border-right: 1px solid var(--line); padding: 8px; color: var(--mute); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: rgba(53,255,141,.1); color: var(--acc); }
.note { font-size: 13px; color: var(--mute); }
.err { color: var(--bad); font-size: 13px; min-height: 1.2em; text-align: left; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 12px; color: var(--mute); cursor: pointer; background: transparent; user-select: none; }
.chip.on { color: var(--acc); border-color: var(--acc2); background: rgba(53,255,141,.08); }
.chip.static { cursor: default; }

/* ---- жагсаалт ---- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: start; transition: border-color .15s; }
.item:hover { border-color: var(--line2); }
.item.sel { border-color: var(--acc2); background: rgba(53,255,141,.04); }
.item .t { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.item .m { grid-column: 1 / -1; font-size: 12px; color: var(--mute); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.item .s { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink); text-align: justify; opacity: .92; }
.item .a { display: flex; gap: 6px; }
.item mark { background: rgba(53,255,141,.22); color: #fff; padding: 0 2px; border-radius: 2px; }
.tag { display: inline-block; border: 1px solid var(--line2); border-radius: 3px; padding: 0 6px; font-size: 11px; letter-spacing: .04em; color: var(--acc); text-transform: uppercase; }
.tag.fb { color: #7FB2FF; border-color: rgba(127,178,255,.4); } .tag.x { color: #E6E6E6; border-color: rgba(230,230,230,.3); }
.st { font-size: 12px; } .st.ok { color: var(--acc2); } .st.bad { color: var(--bad); } .st.run { color: var(--warn); }
.log { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--mute); line-height: 1.6; }
.log div { border-bottom: 1px dashed var(--line); padding: 3px 0; display: grid; grid-template-columns: 150px 90px 110px 1fr; gap: 10px; }
.log b { color: var(--ink); font-weight: 500; }

/* ---- мэдээний тор ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--line2); transform: translateY(-1px); }
.card .img { aspect-ratio: 16 / 9; background: var(--panel2) center / cover no-repeat; border-bottom: 1px solid var(--line); position: relative; }
.card .img.none::after { content: 'LEV'; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--head); letter-spacing: .3em; color: var(--dim); font-size: 22px; }
.card .imp { position: absolute; top: 8px; left: 8px; display: flex; gap: 3px; }
.card .imp i { width: 6px; height: 6px; border-radius: 50%; background: var(--line2); } .card .imp i.on { background: var(--acc); box-shadow: 0 0 6px var(--acc); }
.card .b { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.card .m { font-size: 12px; color: var(--mute); display: flex; justify-content: space-between; gap: 10px; }
.card h3 { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 600; text-align: justify; }
.card p { font-size: 13.5px; margin: 0; color: var(--ink); opacity: .92; }
.card .why { font-size: 12.5px; color: var(--mute); border-left: 2px solid var(--line2); padding-left: 8px; text-align: justify; }
.card .f { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; padding-top: 6px; border-top: 1px dashed var(--line); }
.card .f a { font-weight: 600; }
.card .f .orig { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }

/* ---- модал, мэдэгдэл ---- */
.modal { position: fixed; inset: 0; z-index: 10; background: rgba(3,8,6,.8); backdrop-filter: blur(4px); display: grid; place-items: center; }
.modal .card { width: min(380px, 92vw); padding: 26px 26px 18px; border-color: var(--line2); }
.modal label { display: block; font-size: 13px; color: var(--mute); margin-bottom: 12px; } .modal label input { margin-top: 5px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 20; background: var(--panel2); border: 1px solid var(--line2); color: var(--ink); padding: 9px 18px; border-radius: var(--r); font-size: 13.5px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.toast.bad { border-color: var(--bad); color: var(--bad); }

@media (max-width: 900px) {
  .top { grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 10px; }
  .brand { font-size: 16px; letter-spacing: .16em; }
  .tabs { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; min-width: 0; }
  .tabs button { padding: 6px 9px; font-size: 13px; white-space: nowrap; flex: 0 0 auto; }
  .who { font-size: 12px; }
  .two { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .col { border-right: 0; border-bottom: 1px solid var(--line); }
  .bar { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .bar-l { flex-wrap: wrap; gap: 4px 10px; } .sub { white-space: normal; }
  .bar-r { width: 100%; justify-content: flex-start; } .bar-r .sel { flex: 1 1 auto; min-width: 0; }
  .scroll { padding: 12px; }
  .item { grid-template-columns: 1fr auto; } .item .m { gap: 4px 10px; }
  .grid { grid-template-columns: 1fr; }
  .log div { grid-template-columns: 1fr; gap: 0; }
}
code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--acc); background: rgba(53,255,141,.07); padding: 0 4px; border-radius: 3px; }

/* ---- суурь сайтын бүлэг ---- */
.group { border: 1px solid var(--line2); border-radius: var(--r); background: rgba(53,255,141,.03); }
.ghead { display: flex; align-items: baseline; gap: 12px; padding: 11px 14px; cursor: pointer; user-select: none; }
.ghead .sub { flex: 1 1 auto; white-space: normal; } .ghead .arrow { color: var(--acc); }
.gbody { display: flex; flex-direction: column; gap: 8px; padding: 0 10px 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.gbody .item { padding: 8px 12px; }
