/* Админ/порталын шинэ функцуудын (сертификатын шалгуур, компанийн портал, шалгалтын засварлагч, мэдэгдэл, тайлан) загвар.
   Нийтлэг өнгө, фонт, хэмжээг app.css-ийн :root хувьсагчаас авна. */

.table-muted { color: var(--muted); font-size: 13px; }
.layout-flash { margin: 0 0 16px; }

/* Маягтын жижиг хэсгүүд */
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox-label input { width: 18px; height: 18px; margin: 0; flex: none; }
.inline-fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.inline-fieldset legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.inline-fieldset small { flex-basis: 100%; color: var(--muted); }
.inline-grid { display: grid; grid-template-columns: minmax(160px, 220px) minmax(200px, 1fr) auto; gap: 12px; align-items: end; }
.row-editor { margin-top: 8px; }
.row-editor > summary, .quotation-builder > summary { cursor: pointer; color: var(--focus-ring); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.row-editor[open] > .admin-form, .quotation-builder[open] > .admin-form { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.enrollment-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.employee-picker { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; max-height: 320px; overflow: auto; display: grid; gap: 6px; }
.employee-picker legend { font-weight: 600; padding: 0 4px; }
.employee-picker small { color: var(--muted); }

/* Мэдэгдэл */
.notification-list { list-style: none; margin: 0; padding: 0; }
.notification-item { display: flex; justify-content: space-between; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.notification-item p { margin: 4px 0; }
.notification-item small { color: var(--muted); }
.notification-item.unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-right: 8px; vertical-align: middle; }

/* KPI ба анхаарах жагсаалт */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi small { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: 12px; }
.kpi strong { font-family: var(--font-head); font-size: 32px; line-height: 1.1; color: var(--ink); }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi.warn { border-left: 4px solid var(--amber); }
.kpi.danger { border-left: 4px solid #ad4638; }
.attention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.attention-list li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.attention-list small { color: var(--muted); }
.org-matrix-status.status-expiring { background: #fff5df; color: #8b671b; }
.matrix-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.row-highlight td { background: #fffbeb; }

/* Сертификат */
.certificate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.certificate-card h2 { margin: 10px 0; font-size: 18px; }
.certificate-card dl, .request-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; }
.certificate-card dt, .request-meta dt { color: var(--muted); font-weight: 600; }
.certificate-card dd, .request-meta dd { margin: 0; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.check-list .ok { color: #168057; }
.check-list .fail { color: #ad4638; }

/* Шалгалт */
.course-module.inactive, .lesson-admin-list li.inactive, .category-admin-list li.inactive { opacity: .6; }

/* Хичээл, ангилал */
.lesson-admin-list, .category-admin-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.lesson-admin-list > li, .category-admin-list > li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.lesson-admin-list small, .category-admin-list small { color: var(--muted); }

/* Суралцагчийн явцын алхам */
.enrollment-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
.enrollment-steps li { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #eef1f5; color: var(--muted); }
.enrollment-steps li.step-done { background: #e7f7ef; color: #168057; }
.enrollment-steps li.step-done::before { content: "✓ "; }
.enrollment-steps li.step-current { background: var(--navy); color: #fff; }
.enrollment-row.cancelled { opacity: .65; }

/* Үйлчилгээний хүсэлт ба үнийн санал */
.service-request-card { margin-bottom: 16px; }
.quotation-lines input { width: 100%; min-width: 90px; }
.quotation-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.quotation-summary small { display: block; color: var(--muted); }
.quotation-summary .inline-form input { max-width: 220px; }

/* Тайлан */
.report-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.report-tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; min-height: 36px; display: inline-flex; align-items: center; }
.report-tabs a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.report-totals { display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 600; }
.audit-details { max-width: 420px; white-space: pre-wrap; font-size: 12px; background: var(--paper); padding: 8px; border-radius: 6px; }
.pager { display: flex; gap: 16px; justify-content: center; margin: 16px 0; }

/* QPay */
.qpay-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.qpay-amount strong { display: block; font-family: var(--font-head); font-size: 34px; color: var(--ink); margin: 6px 0; }
.qpay-amount small { color: var(--muted); font-weight: 600; }
.qpay-banks ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.qpay-banks a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; text-align: center; text-decoration: none; color: var(--ink); font-size: 13px; min-height: 44px; }
.qpay-banks img { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; }
.qpay-qr { text-align: center; }
.qpay-qr img { width: min(240px, 80%); height: auto; }
.qpay-check { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qpay-check small { color: var(--muted); }
/* Гар утсан дээр QR уншуулах боломжгүй тул банкны апп-уудыг эхэнд харуулна. */
@media (max-width: 700px) {
  .qpay-layout { display: flex; flex-direction: column; }
  .qpay-banks { order: -1; }
  .inline-grid { grid-template-columns: 1fr; }
}

@media print {
  .admin-sidebar, .portal-sidebar, .site-header, footer, .enrollment-actions form { display: none !important; }
}

/* QR ирц: проектор/бүтэн дэлгэцийн горимд QR томоор, хугацаа ба бүртгүүлсэн тоо харагдана. */
.attendance-qr-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.attendance-qr-card:fullscreen { background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 32px; }
.attendance-qr-card:fullscreen .attendance-qr-image { width: min(70vh, 80vw); height: auto; image-rendering: pixelated; }
.attendance-qr-card:fullscreen .attendance-qr-meta { font-size: 28px; justify-content: center; }
.attendance-qr-card.qr-expired .attendance-qr-image { opacity: .15; }
