:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-weak: #e8efff;
  --ok: #15803d;   --ok-bg: #e7f6ec;
  --err: #b91c1c;  --err-bg: #fdecec;
  --warn: #b45309; --warn-bg: #fdf3e2;
  --gray-bg: #eef1f5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 "Segoe UI", Roboto, "Noto Sans", system-ui, sans-serif; }
a { color: var(--accent); }
h2 { margin: 0; font-size: 22px; }
h3 { margin: 0 0 14px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.err-text { color: var(--err); min-height: 1em; margin: 8px 0 0; font-weight: 500; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }

/* ---------- товч ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; height: 36px; padding: 0 14px; border-radius: 9px;
       border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
       text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d4ed8; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--gray-bg); color: var(--text); }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); background: var(--err-bg); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; height: 42px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.chip:hover, .chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }

/* ---------- маягт ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; height: 36px; outline: none; min-width: 0; }
textarea { height: auto; padding: 10px; width: 100%; resize: vertical; font-family: Consolas, monospace; font-size: 13px; }
select[size] { height: auto; padding: 4px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; color: #334155; }
.field input, .field select { width: 100%; }
.field small { font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; flex-direction: row; margin: 10px 0; }
.field.check { align-self: end; margin: 0 0 9px; }
.field.check input { width: 16px; flex: none; }

/* ---------- нэвтрэх ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 50% -10%, #dbe6ff, var(--bg)); }
.login-card { width: 100%; max-width: 360px; background: var(--surface); border-radius: 18px; padding: 32px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login-card h1 { margin: 6px 0 0; font-size: 22px; }
.login-card p { margin: 0; }
.login-card .field { text-align: left; }
.login-card input { height: 44px; font-size: 20px; letter-spacing: 6px; text-align: center; }
.logo { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; flex: none; }
.logo.lg { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto; }

/* ---------- толгой ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: -2px; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
.tabs a:hover { background: var(--gray-bg); color: var(--text); }
.tabs a.on { background: var(--accent-weak); color: var(--accent); }
.top-actions { display: flex; gap: 6px; }
.banner { background: var(--warn-bg); color: var(--warn); padding: 10px 24px; font-weight: 500; border-bottom: 1px solid #f5dcb0; }
.banner a { color: inherit; font-weight: 700; }

main { padding: 24px; max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.toolbar > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.toolbar > label.grow { flex: 1; min-width: 200px; }
.toolbar .actions { margin-left: auto; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; align-self: center; margin-top: 16px; }

.seg { display: inline-flex; background: var(--gray-bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg.sub { margin: 4px 0 12px; }

/* ---------- статистик ---------- */
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; display: flex; gap: 10px; align-items: baseline; }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi b { display: block; font-size: 26px; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.kpi small { color: var(--muted); }
.kpi.hl { background: var(--accent); border-color: var(--accent); color: #fff; }
.kpi.hl span, .kpi.hl small { color: #dbe6ff; }

/* ---------- хүснэгт ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 290px); min-height: 160px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; z-index: 1; }
tbody tr:hover { background: #f6f9ff; }
tbody tr.clickable { cursor: pointer; }
tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--line-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-family: Consolas, monospace; font-size: 13px; }
td.empty { text-align: center; color: var(--muted); padding: 40px; }
td .btn + .btn { margin-left: 4px; }
tr.inactive td { color: var(--muted); }
#setForm { grid-column: 1 / -1; max-width: 860px; }
table.plain { margin: 12px 0; table-layout: fixed; }
table.plain th:first-child { width: 28%; }
table.plain th { position: static; background: transparent; padding: 6px 8px; }
table.plain td { padding: 6px 8px; border: 0; }
table.plain input { width: 100%; }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.muted { background: var(--gray-bg); color: var(--muted); }
.badge.blue { background: var(--accent-weak); color: var(--accent); }

/* ---------- тохиргоо ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.box .btn { align-self: flex-start; }
code.path { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; word-break: break-all; }

/* ---------- цонх ---------- */
dialog { border: 0; border-radius: 16px; padding: 24px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(15, 23, 42, .25); color: var(--text); }
dialog.wide { width: min(820px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog h3 { font-size: 18px; margin: 0; }
dialog p { margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span2 { grid-column: span 2; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
#impPreview table { font-size: 12.5px; }
#impPreview th, #impPreview td { padding: 5px 8px; }
#impPreview .table-wrap { max-height: 220px; min-height: 0; }
.result-box { padding: 12px 14px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-weight: 500; }
.result-box.err { background: var(--err-bg); color: var(--err); }
.result-box ul { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }

/* ---------- мэдэгдэл ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s; background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 500; z-index: 50; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--err); }


.print-only { display: none; }

/* ---------- компани, хэлтэс ---------- */
.ver-warn { position: sticky; top: 0; z-index: 20; background: var(--err); color: #fff; padding: 12px 24px; font-size: 14px; line-height: 1.5; }
.banner-inline { background: var(--warn-bg); color: var(--warn); border: 1px solid #f5dcb0; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; }
.org-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; align-items: start; }
.org-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.org-box-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.org-box-head h3 { margin: 0; font-size: 16px; }
.org-box-head p { margin: 2px 0 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.org-items { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 330px); min-height: 80px; overflow: auto; }
.org-items li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name actions" "meta actions"; column-gap: 12px; row-gap: 2px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.org-items li:last-child { border-bottom: 0; }
.org-items li.similar { background: var(--warn-bg); }
.org-items .org-name { grid-area: name; min-width: 0; word-break: break-word; }
.org-items .org-meta { grid-area: meta; }
.org-items .row-actions { grid-area: actions; }
.org-items li.org-empty { display: block; color: var(--muted); padding: 24px 16px; text-align: center; }
@media (max-width: 900px) { .org-cols { grid-template-columns: 1fr; } .org-items { max-height: none; } }
.warn-text { color: var(--warn); font-weight: 600; }
.lbl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini-link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.mini-link:hover { text-decoration: underline; }
.field select:disabled { background: var(--surface-2); color: var(--muted); }
.hint-box a { color: inherit; font-weight: 700; }
.hint-box { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-weak); color: #1e3a8a; font-size: 13px; }
.hint-box.warn { background: var(--warn-bg); color: var(--warn); }
.hint-box.err { background: var(--err-bg); color: var(--err); }
.hint-box ul { margin: 6px 0; padding-left: 18px; }
#impOrgs:empty { display: none; }

/* ---------- хэвлэх ---------- */
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .topbar, .banner, .toolbar, .page-head .actions, .seg, #toast, dialog { display: none !important; }
  main { padding: 0; max-width: none; }
  .print-only { display: block; }
  .table-wrap { max-height: none; overflow: visible; border: 0; }
  th { position: static; }
  tfoot td { position: static; }
  .kpi { border: 1px solid #ccc; }
  .kpi.hl { background: #fff; color: #000; }
  .kpi.hl span, .kpi.hl small { color: #555; }
  .print-head { margin-bottom: 10px; }
  .print-head h2 { font-size: 18px; }
}

@media (max-width: 760px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .tabs { order: 3; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
  main { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .settings-grid { grid-template-columns: 1fr; }
  .toolbar > label { flex: 1 1 140px; }
  .toolbar .actions { margin-left: 0; }
  .table-wrap { max-height: none; }
}

/* ---------- салбар хоолны цэгүүд ---------- */
.wide-box { grid-column: 1 / -1; }
code.code { font-family: Consolas, monospace; font-size: 14px; font-weight: 700; letter-spacing: 1px; background: var(--accent-weak); color: var(--accent); padding: 3px 8px; border-radius: 6px; user-select: all; }
.dl-box { display: flex; flex-direction: column; gap: 4px; background: var(--accent-weak); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.dl-box code.code { background: #fff; }
td .btn + .btn, td a.btn + .btn { margin-left: 4px; }

/* ---------- ирц ---------- */
.roster-stat { display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.roster-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ok-text { color: var(--ok); }
.err-text-inline { color: var(--err); }
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 6px 0; }

/* ---------- дуу ---------- */
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.sound-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sound-card p { margin: 0; }
.sound-card audio { width: 100%; height: 36px; }
.sound-file { display: flex; flex-direction: column; gap: 2px; word-break: break-word; }
.sound-default { padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 8px; text-align: center; }
.row.wrap { flex-wrap: wrap; }

/* ---------- эрх ---------- */
body:not(.role-admin) .admin-only { display: none !important; }
body.role-viewer .edit-only { display: none !important; }
body.scoped .all-sites { display: none !important; }
.user-chip { display: flex; flex-direction: column; line-height: 1.15; padding: 0 8px; text-align: right; }
.user-chip b { font-size: 13px; }
.user-chip small { color: var(--muted); font-size: 11.5px; }
.audit-detail { white-space: normal; display: inline-block; max-width: 640px; color: #334155; }
#aTable td { vertical-align: top; }
.login-card #loginUser, .login-card #pin { letter-spacing: normal; font-size: 16px; text-align: left; height: 42px; }

/* ---------- карт уншуулж бүртгэх ---------- */
.scan-ico { display: inline-block; width: 22px; height: 16px; flex: none; border-radius: 3px; border: 2px solid currentColor; position: relative; }
.scan-ico::after { content: ""; position: absolute; left: 2px; right: 2px; top: 3px; height: 3px; background: currentColor; }
.scan-tip { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; padding: 8px 12px; border-radius: 10px;
  background: var(--accent-weak); color: var(--accent); font-size: 13px; max-width: 640px; }
.scan-tip b { font-weight: 700; }
.scan-field input { height: 50px; font-size: 20px; font-family: Consolas, "Courier New", monospace; letter-spacing: 1px; }
.scan-field input:placeholder-shown { font-family: inherit; font-size: 15px; letter-spacing: 0; }
.scan-field input:focus:placeholder-shown { animation: scanPulse 1.4s ease-in-out infinite; }
@keyframes scanPulse { 0%, 100% { box-shadow: 0 0 0 3px var(--accent-weak); } 50% { box-shadow: 0 0 0 7px var(--accent-weak); } }
.scan-msg { display: block; margin-top: 4px; font-size: 12.5px; }
.scan-msg.ok { color: var(--ok); }
.scan-msg.err { color: var(--err); }

/* ---------- хоолны цаг (24 цаг) ---------- */
.hhmm { width: 110px; text-align: center; font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.hhmm:invalid:not(:placeholder-shown) { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }

/* бусад сайтын хоолны тоо (тайлан) харах эрхгүй сайтын хэрэглэгчид цэгийн сонголт харагдахгүй */
body.scoped:not(.all-reports) .rep-sites { display: none !important; }

/* ---------- өгсөн тоо ---------- */
.plan-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ps-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 14px; }
.ps-card span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ps-card b { display: block; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ps-card b small { font-size: 16px; color: var(--muted); font-weight: 600; }
.ps-card em { position: absolute; right: 16px; top: 12px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.ps-bar { height: 6px; border-radius: 99px; background: var(--gray-bg); margin-top: 8px; overflow: hidden; }
.ps-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s; }
.ps-card.done .ps-bar i { background: var(--ok); }
.ps-card.done em { color: var(--ok); }
.plan-wrap { max-height: calc(100vh - 360px); min-height: 240px; }
.plan-table th, .plan-table td { padding: 5px 14px; }
.plan-table th.pc-h { text-align: center; }
.plan-table th.pc-h small { display: block; font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.plan-table td.dept { font-weight: 600; white-space: nowrap; }
.plan-table tbody tr:nth-child(even) td { background: var(--surface-2); }
.plan-table tbody tr:hover td { background: var(--accent-weak); }
.plan-table tbody tr:focus-within td { background: #fff8e1; }
.pc-in { display: flex; align-items: center; justify-content: center; gap: 8px; }
.plan-table .plan-in { width: 62px; height: 32px; padding: 0 6px; text-align: center; font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.plan-table .plan-in::-webkit-outer-spin-button, .plan-table .plan-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.plan-table .plan-in:placeholder-shown { background: transparent; border-style: dashed; }
.pc-card { display: inline-block; min-width: 32px; padding: 2px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 700; text-align: center;
  background: var(--gray-bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-card.ok { background: var(--ok-bg); color: var(--ok); }
.pc-card.under { background: var(--warn-bg); color: var(--warn); }
.pc-card.over { background: var(--err-bg); color: var(--err); }
.pc-card.extra { background: var(--accent-weak); color: var(--accent); }
.plan-table .pc-tot { display: inline-block; min-width: 62px; text-align: center; font-size: 17px; }
.plan-legend .pc-card { min-width: 0; padding: 0 7px; font-size: 11.5px; }
.plan-dirty { align-self: center; color: var(--warn); font-weight: 700; font-size: 13px; }

/* ---------- тайлан: өгсөн тоо / карт ---------- */
.pm-table { font-variant-numeric: tabular-nums; }
.pm-table th { text-align: center; white-space: nowrap; }
.pm-table thead th.pm-grp { background: #fff7c2; color: #1f2937; border-bottom: 1px solid var(--line); }
.pm-table thead th.pm-grp.alt, .pm-table thead tr:nth-child(2) th.alt { background: #fdeea0; }
.pm-table thead tr:nth-child(2) th { background: #fffbe0; color: #475569; font-size: 11px; }
.pm-table td { padding: 6px 8px; }
.pm-table td.alt { background: rgba(148, 163, 184, .07); }
.pm-table .pm-date { font-weight: 700; white-space: nowrap; vertical-align: middle; }
.pm-table .pm-date small { display: block; color: var(--muted); font-weight: 500; }
.pm-table .pm-meal { white-space: nowrap; font-weight: 600; }
.pm-table tr.pm-day td { border-top: 2px solid var(--line-2); }
.pm-table .pm-plan { color: #475569; }
.pm-table .pm-card { font-weight: 700; }
.pm-table .pm-card.over { color: var(--err); }
.pm-table .pm-card.under { color: var(--warn); }
.pm-table .pm-tot { background: var(--accent-weak); }

/* ---------- шөнийн хоол, ашиглахгүй хоол ---------- */
.badge.night { background: #ede9fe; color: #6d28d9; }
.meal-on { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
tr.meal-off td { color: var(--muted); }
tr.meal-off .hhmm { opacity: .45; }

/* ирцийн олон холбоос */
#rUrl { width: 100%; height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; font-family: Consolas, monospace; font-size: 12.5px; line-height: 1.5; }
.toolbar label.plan-only { flex-direction: row; align-items: center; gap: 8px; align-self: flex-end; height: 36px; white-space: nowrap; font-size: 13.5px; color: var(--text); }

/* өгсөн тоо: өдөр солих */
.date-nav { display: flex; align-items: center; gap: 4px; }
.date-nav .btn { height: 36px; min-width: 34px; padding: 0 8px; font-size: 18px; line-height: 1; }
#pDate.past-day { background: var(--warn-bg); border-color: #f3d39b; }

/* тайлан: сарын тайлан (MEALLOG) татах */
.month-dl { display: flex; align-items: center; gap: 6px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--line, #e5e7eb); }
.month-dl input[type="month"] { height: 36px; padding: 0 8px; }
@media (max-width: 640px) { .month-dl { border-right: 0; padding-right: 0; flex-wrap: wrap; } }
