h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ================= Дизайн систем — брэндийн токенууд ================= */
/* LOOK CAMERA: хар цэнхэр (үндсэн) + улаан (accent) + цагаан. Өнгө/зай/радиусыг
   ЭНД төвлөрүүлж, нэг газраас удирдана. Бусад дүрэм эдгээр хувьсагчийг л дуудна. */
:root {
    --brand-primary: #10243f;        /* хар цэнхэр — толгойн туслах мөр, товч, холбоос */
    --brand-primary-dark: #0a1a30;   /* hover/идэвхтэй */
    --brand-primary-soft: #eef2f7;   /* цайвар навй өнгөт дэвсгэр */
    --brand-accent: #e11d2a;         /* улаан — сагс, хямдрал, CTA онцлол */
    --brand-accent-dark: #b91520;

    --ink: #16202e;                  /* үндсэн текст */
    --muted: #6b7280;                /* хоёрдогч текст */
    --faint: #9ca3af;                /* бүдэг текст */
    --line: #e5e7eb;                 /* хүрээ/зураас */
    --bg: #ffffff;
    --bg-soft: #f7f8fa;              /* зөөлөн дэвсгэр (карт thumb г.м.) */

    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(16,36,63,.06);
    --shadow-md: 0 6px 20px rgba(16,36,63,.10);
    --brand-header-bg: #ffffff;      /* лого мөрийн дэвсгэр (лого бараан тул цагаан) */
    --store-width: 1400px;           /* storefront контейнерийн дээд өргөн (том дэлгэцэд зай дүүргэнэ) */
}

/* ================= ItssShop админ (энгийн функциональ загвар) ================= */
body { font-family: "Inter", system-ui, "Segoe UI", Arial, sans-serif; margin: 0; color: var(--ink); -webkit-font-smoothing: antialiased; }

/* ================= Админ shell (sidebar + topbar) ================= */
/* Админ-д зориулсан өнгө: үндсэн товч цэнхэр, дэвсгэр цайвар саарал (storefront хөндөгдөхгүй). */
.admin-shell {
    --admin-blue: #2563eb; --admin-blue-dark: #1d4ed8; --admin-blue-soft: #eff6ff;
    --admin-navy: #0f1e36; --admin-bg: #f3f5f8;
    display: flex; min-height: 100vh;
}
.admin-nav-cb { display: none; }   /* sidebar toggle-ийн далд checkbox */

/* --- Зүүн sidebar (хар цэнхэр) --- */
.admin-sidebar {
    width: 210px; flex: 0 0 210px; background: var(--admin-navy); color: #c3cede;
    display: flex; flex-direction: column; position: sticky; top: 0; align-self: flex-start;
    height: 100vh; overflow-y: auto; transition: margin-left .2s ease;
}
.admin-brand { padding: 18px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-brand-link { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; }
.admin-brand-name { color: #fff; font-weight: 800; font-size: 20px; letter-spacing: .06em; }
.admin-brand-tag { color: var(--brand-accent); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; margin-top: 3px; }

.admin-nav { display: flex; flex-direction: column; padding: 8px 8px 4px; flex: 1; }
.admin-nav .nav-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #6b7fa0; padding: 14px 12px 6px; }
.admin-nav .nav-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 1px 0;
    color: #c3cede; text-decoration: none; font-size: 13.5px; border-radius: 6px;
    border-left: 3px solid transparent; transition: background .12s, color .12s;
}
.admin-nav .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav .nav-item.active { background: rgba(255,255,255,.10); color: #fff; border-left-color: var(--brand-accent); font-weight: 600; }
.admin-nav .nav-ic { width: 18px; text-align: center; opacity: .8; font-size: 13px; }
.admin-side-foot { border-top: 1px solid rgba(255,255,255,.08); }
.admin-store-link { display: block; padding: 12px 20px; color: #8ea2c0; text-decoration: none; font-size: 13px; }
.admin-store-link:hover { color: #fff; }
.admin-me { display: flex; align-items: center; gap: 10px; padding: 12px 16px 16px; }
.admin-me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.admin-me-text strong { color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-me-text small { color: #8ea2c0; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-avatar {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--admin-blue); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.admin-avatar.sm { width: 30px; height: 30px; font-size: 12px; }

/* --- Баруун талын их бие --- */
.admin-body { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--admin-bg); }
.admin-topbar { display: flex; align-items: center; gap: 14px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15; min-height: 58px; box-sizing: border-box; }
.admin-topbar form { margin: 0; }
.admin-spacer { flex: 1; }
.admin-burger { display: inline-flex; margin: 0; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink); padding: 6px 8px; border-radius: 6px; user-select: none; }
.admin-burger:hover { background: var(--admin-bg); }
.admin-search { display: flex; align-items: center; gap: 8px; flex: 0 1 380px; background: var(--admin-bg); border: 1px solid transparent; border-radius: 8px; padding: 0 12px; color: var(--muted); }
.admin-search:focus-within { border-color: var(--admin-blue); background: #fff; }
.admin-search svg { width: 16px; height: 16px; flex: 0 0 auto; }
.admin-search input { flex: 1; min-width: 0; border: none; background: transparent; padding: 9px 0; font-size: 14px; outline: none; color: var(--ink); }

.admin-bell { position: relative; display: inline-flex; color: #4b5563; padding: 6px; border-radius: 8px; }
.admin-bell:hover { background: var(--admin-bg); color: var(--ink); }
.admin-bell svg { width: 20px; height: 20px; }
.admin-bell-badge { position: absolute; top: 0; right: -2px; background: var(--brand-accent); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 8px; padding: 0 4px; box-shadow: 0 0 0 2px #fff; }

.admin-user-menu { position: relative; }
.admin-user-menu summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 4px 6px; border-radius: 8px; }
.admin-user-menu summary::-webkit-details-marker { display: none; }
.admin-user-menu summary:hover { background: var(--admin-bg); }
.admin-user-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.admin-user-menu .caret { color: var(--muted); font-size: 11px; }
.admin-user-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); padding: 6px; z-index: 30; }
.admin-user-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.admin-user-head strong { font-size: 14px; }
.admin-user-head small { color: var(--muted); font-size: 12px; }
.admin-user-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 6px; font-size: 14px; cursor: pointer; color: var(--ink); }
.admin-user-item:hover { background: var(--admin-bg); }

.admin-scrim { display: none; }
.admin-content { padding: 24px; width: 100%; max-width: 1440px; box-sizing: border-box; }
.admin-content > h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 18px; color: var(--ink); }
.admin-content > h1 + p, .admin-content > .muted { margin-top: -8px; }
.admin-content h2 { font-size: 17px; font-weight: 700; }

/* Админ дахь үндсэн товч — цэнхэр (storefront-ийн навй товч хөндөгдөхгүй). */
.admin-shell .btn-primary { background: var(--admin-blue); border-radius: 8px; font-weight: 600; }
.admin-shell .btn-primary:hover { background: var(--admin-blue-dark); }
.admin-shell .btn-primary:disabled { opacity: .6; cursor: default; }
.admin-shell .btn-ghost { border-radius: 8px; }

/* --- Desktop: hamburger sidebar-ыг хумина --- */
@media (min-width: 1024px) {
    .admin-nav-cb:checked ~ .admin-shell .admin-sidebar { margin-left: -210px; }
}

/* --- < 1024px: sidebar off-canvas, hamburger нээнэ --- */
@media (max-width: 1023.98px) {
    .admin-sidebar {
        position: fixed; top: 0; left: 0; z-index: 40; height: 100vh;
        transform: translateX(-100%); transition: transform .22s ease;
        box-shadow: 0 0 40px rgba(0,0,0,.3);
    }
    .admin-nav-cb:checked ~ .admin-shell .admin-sidebar { transform: translateX(0); }
    .admin-nav-cb:checked ~ .admin-shell .admin-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(16,36,63,.45); }
}
@media (max-width: 640px) {
    .admin-topbar { padding: 8px 12px; gap: 8px; }
    .admin-user-name, .admin-user-menu .caret { display: none; }
    .admin-content { padding: 16px; }
}

.admin-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 800px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-list, .admin-form { border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; background: #fff; }
.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f0f0f0; }
.tbl th { color: #6b7280; font-weight: 600; }
.tbl tr.sel { background: #eff6ff; }
.tbl .r { text-align: right; }
.tbl .nowrap { white-space: nowrap; }
.muted { color: #9ca3af; }

label { display: block; margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: #374151; }
label.chk { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.field { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.row-inline { display: flex; gap: 8px; }
.row-inline .field { flex: 1; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }

.btn-primary { background: var(--brand-primary); color: #fff; border: none; padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn-primary:hover { background: var(--brand-primary-dark); }
.btn-ghost { background: #fff; color: #374151; border: 1px solid #d1d5db; padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn-ghost.sm { padding: 5px 10px; }
.btn-link { background: none; border: none; color: var(--brand-primary); cursor: pointer; font-size: 13px; padding: 2px 6px; }
.btn-link.danger { color: #dc2626; }

.alert-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }

/* Login */
.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; border: 1px solid #e5e7eb; border-radius: 10px; padding: 28px; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .btn-primary { width: 100%; margin-top: 18px; padding: 10px; }
.p-3 { padding: 1rem; }

/* Attribute assignment (ангилалын шинж чанар) */
.sep { border: none; border-top: 1px solid #e5e7eb; margin: 20px 0 12px; }
.sm { font-size: 12px; }
.tbl .c { text-align: center; }
.field.mini { width: 70px; padding: 4px 6px; }
.btn-primary.sm { padding: 5px 10px; font-size: 13px; }
.assign-add { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.assign-add .field { flex: 1; min-width: 140px; }
.assign-add .field.mini { flex: 0 0 auto; }
.chk.sm { white-space: nowrap; }
.req { color: #dc2626; }
.role-list { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px 0; }
.role-list .chk { font-weight: 500; }

/* Барааны зураг */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.img-item { border: 1px solid #e5e7eb; border-radius: 6px; padding: 6px; background: #fff; }
.img-item.primary { border-color: var(--brand-primary); box-shadow: 0 0 0 1px var(--brand-primary) inset; }
.img-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 4px; display: block; }
.img-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: 4px; font-size: 12px; }
.img-actions .badge { color: var(--brand-primary); font-weight: 600; font-size: 12px; }
.img-move { display: inline-flex; }

/* ===== Компанийн тохиргоо ===== */
.settings-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .settings-cols { grid-template-columns: 1fr; } }

/* ===== Үнийн санал (форм) ===== */
.quote-list-card, .quote-form-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; background: #fff; margin-bottom: 20px; }
.q-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.q-add { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.q-add .field { flex: 1; min-width: 180px; }
.q-lines .field { width: 100%; }
.q-lines .field.mini { width: 70px; }
.q-lines .field.sm-num { width: 110px; }
.q-totals { margin-top: 12px; margin-left: auto; width: 300px; }
.q-totals > div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.q-totals .grand { border-top: 1px solid #d1d5db; font-weight: 700; font-size: 16px; padding-top: 8px; }
.print-link { margin-left: 12px; font-weight: 600; }

/* ===== Хэвлэх баримт (үнийн санал) ===== */
.doc-toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 20px; background: #f3f4f6; border-bottom: 1px solid #e5e7eb; }
.doc-toolbar .seg { display: inline-flex; border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; }
.doc-toolbar .seg button { border: none; background: #fff; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.doc-toolbar .seg button.on { background: var(--brand-primary); color: #fff; }
.t-btn { border: 1px solid #d1d5db; background: #fff; padding: 6px 14px; border-radius: 6px; cursor: pointer; }
.t-btn.ghost { color: #374151; }

.doc { max-width: 800px; margin: 24px auto; padding: 32px 40px; background: #fff; border: 1px solid #e5e7eb; color: #111827; }
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; }
.inv-co-name { font-size: 20px; font-weight: 700; }
.inv-co-line { color: #6b7280; font-size: 13px; }
.inv-title { font-size: 22px; font-weight: 800; letter-spacing: 1px; text-align: right; }
.inv-meta-t { margin-top: 8px; font-size: 13px; }
.inv-meta-t td { padding: 2px 6px; }
.inv-parties { display: flex; justify-content: space-between; gap: 24px; margin: 24px 0; }
.inv-lab { color: #6b7280; font-size: 12px; text-transform: uppercase; }
.inv-cust { font-weight: 600; font-size: 15px; }
.inv-purpose { color: #6b7280; font-size: 12px; margin-top: 4px; }
.inv-items { width: 100%; border-collapse: collapse; margin-top: 8px; }
.inv-items th, .inv-items td { padding: 8px 10px; border-bottom: 1px solid #eee; font-size: 14px; text-align: left; }
.inv-items th.r, .inv-items td.r { text-align: right; }
.inv-sum { margin-top: 16px; margin-left: auto; width: 320px; }
.inv-sum-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.inv-sum-row.total { border-top: 2px solid #111827; font-weight: 700; font-size: 16px; padding-top: 8px; }
.inv-note { margin-top: 16px; font-size: 13px; }
/* Дилерийн олголт/буцаалт баримт — гарын үсгийн мөр */
.inv-sign { display: flex; gap: 40px; margin-top: 44px; }
.inv-sign-col { flex: 1; }
.inv-sign-lab { font-weight: 600; font-size: 13px; margin-bottom: 34px; }
.inv-sign-line { border-bottom: 1px solid #111; }
.inv-sign-hint { color: #6b7280; font-size: 11.5px; margin-top: 4px; }
.inv-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid #eee; color: #6b7280; font-size: 12px; text-align: center; }

@media print {
    .no-print { display: none !important; }
    .doc { border: none; margin: 0; max-width: none; padding: 0; }
    body { background: #fff; }
}

/* ================= Storefront (хэрэглэгч тал) ================= */
/* LOOK CAMERA лого нь тунгалаг дэвсгэртэй, бараан текст + улаан нуман зурааст дугуй тэмдэг.
   Тиймээс лого мөрийн дэвсгэрийг цагаан (--brand-header-bg) байлгаснаар лого блендэж
   харагдана. Харин ДЭЭД ТУСЛАХ МӨР нь хар цэнхэр — брэндийн навй өнгийг тод илэрхийлнэ. */

/* Дээд туслах мөр — хар цэнхэр (утас/Facebook/ажилтан) */
.store-utility { background: var(--brand-primary); color: #cdd7e4; font-size: 12.5px; }
.store-utility-in { display: flex; align-items: center; gap: 18px; max-width: var(--store-width); margin: 0 auto; padding: 6px 20px; }
.store-utility .util-spacer { flex: 1; }
.store-utility a { color: #dfe6ef; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.store-utility a:hover { color: #fff; }
.store-utility .util-sep { color: #3a5273; }

.store-header { border-bottom: 1px solid var(--line); background: var(--brand-header-bg); position: sticky; top: 0; z-index: 20; }
.store-bar { display: flex; align-items: center; gap: 20px; max-width: var(--store-width); margin: 0 auto; padding: 12px 20px; }
.store-logo { display: inline-flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
.store-logo-img { display: block; height: 50px; width: auto; }
.store-search { display: flex; flex: 1; max-width: 560px; box-shadow: var(--shadow-sm); border-radius: 999px; overflow: hidden; border: 1.5px solid var(--line); transition: border-color .15s; }
.store-search:focus-within { border-color: var(--brand-primary); }
.store-search input { flex: 1; padding: 10px 18px; border: none; background: #fff; font-size: 14px; outline: none; }
.store-search .btn-primary { border-radius: 0; padding: 8px 22px; }
.store-staff { color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.store-staff:hover { color: var(--brand-primary); }

/* Толгойн сагс badge */
.cart-link { position: relative; display: inline-flex; align-items: center; text-decoration: none; font-size: 24px; line-height: 1; color: var(--brand-primary); flex: 0 0 auto; }
.cart-ico { display: inline-block; }
.cart-count { position: absolute; top: -6px; right: -10px; background: var(--brand-accent); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; padding: 0 4px; box-shadow: 0 0 0 2px #fff; }

/* Үнийн санал — захиалагч/дилер сонголт */
.q-customer { margin-bottom: 12px; }
.dealer-note { margin-top: 6px; color: #16a34a; font-size: 13px; font-weight: 600; }
.dealer-line { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-bottom: 3px; }
.q-totals .save-row { color: #16a34a; font-weight: 600; }

/* Нөөцийн ledger */
.btn-link.ok { color: #16a34a; }
.btn-link.warn { color: #b45309; }
.tbl .neg { color: #dc2626; font-weight: 600; }
.tbl .pos { color: #16a34a; font-weight: 600; }
.tbl .mismatch { color: #dc2626; font-weight: 700; }
.qbadge.s-fulfilled { background: #dcfce7; color: #166534; }
.qbadge.s-cancelled { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }

/* Тайлан — дилерийн борлуулалт */
.report-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 18px; }
.field.mini { width: auto; min-width: 110px; }
.stat-cards { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.stat-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 20px; background: #fff; min-width: 200px; }
.stat-label { color: #6b7280; font-size: 13px; margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 800; color: #111827; }
.tbl tfoot th { border-top: 2px solid #e5e7eb; font-weight: 700; }
.tbl tr.top-rank { background: #fefce8; }

/* Honeypot — хүн харахгүй нуугдмал талбар (спам шүүлт) */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Сагс хуудас (/cart) */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
@media (max-width: 760px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-row { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eee; }
.cart-thumb { width: 72px; height: 72px; border-radius: 6px; overflow: hidden; background: #f9fafb; display: flex; align-items: center; justify-content: center; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-name { font-weight: 600; color: #111827; text-decoration: none; }
.cart-name:hover { color: var(--brand-primary); }
.cart-qty { display: inline-flex; align-items: center; gap: 4px; }
.cart-qty button { width: 28px; height: 30px; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; cursor: pointer; font-size: 16px; }
.cart-qty input { width: 52px; height: 30px; text-align: center; border: 1px solid #d1d5db; border-radius: 6px; }
.cart-remove { border: none; background: none; color: #9ca3af; font-size: 16px; cursor: pointer; padding: 4px 8px; }
.cart-remove:hover { color: #dc2626; }
.cart-form { border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px; background: #fff; }
.cart-form label { display: block; font-size: 13px; color: #374151; margin-top: 8px; }
.cart-form .field { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; margin-top: 3px; font-size: 14px; }
.cart-form .btn-primary { margin-top: 14px; width: 100%; }
.store-nav { display: flex; flex-wrap: wrap; gap: 2px 6px; max-width: var(--store-width); margin: 0 auto; padding: 2px 12px; }
.store-nav a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; padding: 10px 12px; border-bottom: 2px solid transparent; transition: color .12s, border-color .12s; }
.store-nav a:hover { color: var(--brand-primary); border-bottom-color: var(--brand-accent); }
.nav-cat-ic { display: inline-flex; color: var(--muted); }
.store-nav a:hover .nav-cat-ic { color: var(--brand-primary); }
.nav-cat-ic svg { width: 15px; height: 15px; }

/* Хямдралтай бараа — толгойн мөрөнд сагсны хажууд, тод улаан pill CTA */
.header-sale { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; background: var(--brand-accent); color: #fff; font-weight: 700; font-size: 13.5px; padding: 9px 16px; border-radius: 999px; text-decoration: none; white-space: nowrap; transition: background .15s; }
.header-sale:hover { background: var(--brand-accent-dark); }
.header-sale svg { width: 16px; height: 16px; }
.store-main { max-width: var(--store-width); margin: 0 auto; padding: 28px 20px; min-height: 60vh; }

.store-footer { border-top: 3px solid var(--brand-primary); background: var(--bg-soft); color: var(--muted); padding: 36px 20px 24px; font-size: 13.5px; }
.store-foot-inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start; max-width: var(--store-width); margin: 0 auto; }
.store-foot-brand { display: flex; gap: 16px; align-items: flex-start; max-width: 560px; }
.store-foot-logo { height: 46px; width: auto; display: block; flex: 0 0 auto; }
.store-foot-info { line-height: 1.8; }
.store-foot-info a { color: var(--brand-primary); text-decoration: none; font-weight: 500; }
.store-foot-info a:hover { text-decoration: underline; }
.foot-company { font-weight: 700; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.store-foot-copy { text-align: center; color: var(--faint); margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); max-width: var(--store-width); margin-left: auto; margin-right: auto; }
.store-h1 { font-size: 24px; font-weight: 700; margin: 0 0 18px; letter-spacing: -.01em; }

/* Facebook Messenger floating товч — зөвхөн storefront (энэ класс MainLayout-д алга). */
.msgr-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: 56px; height: 56px; border-radius: 50%; background: #0084ff; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: transform .15s, box-shadow .15s; }
.msgr-fab:hover { transform: scale(1.06); box-shadow: 0 8px 26px rgba(0,0,0,.3); color: #fff; }
.msgr-fab svg { width: 30px; height: 30px; }
@media (max-width: 720px) {
    .msgr-fab { right: 14px; bottom: 14px; width: 50px; height: 50px; }
    .msgr-fab svg { width: 27px; height: 27px; }
}

/* ================= Storefront — алдаа / 404 хуудас ================= */
.err-page { max-width: 520px; margin: 60px auto; text-align: center; padding: 20px; }
.err-code { font-size: 72px; font-weight: 900; line-height: 1; color: var(--brand-primary); letter-spacing: -.03em; }
.err-title { font-size: 24px; font-weight: 700; margin: 8px 0 10px; }
.err-sub { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 22px; }
.err-ref { color: var(--faint); font-size: 12px; margin: 0 0 16px; }
.err-ref code { background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; }

/* ================= Storefront — нүүр (hero / итгэл / ангилал) ================= */
.home-sec { margin: 40px 0; }
.home-sec-title { font-size: 20px; font-weight: 700; margin: 0 0 18px; letter-spacing: -.01em; position: relative; padding-left: 14px; }
.home-sec-title::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px; border-radius: 3px; background: var(--brand-accent); }

/* Hero — хар цэнхэр дэвсгэр, улаан accent. Ирээдүйд зураг нэмэхэд доорх background-image
   мөрийг идэвхжүүлж, gradient-ийг зургийн дээр давхарлана (текст уншигдахуйц үлдэнэ). */
.hero {
    background: var(--brand-primary);
    /* background-image: linear-gradient(90deg, rgba(16,36,63,.92), rgba(16,36,63,.55)), url('/images/hero.jpg'); */
    background-size: cover; background-position: center;
    border-radius: var(--radius-lg); overflow: hidden; margin: 8px 0 34px;
    position: relative;
}
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(225,29,42,.35), transparent 70%); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; max-width: 620px; padding: 56px 40px; }
.hero-eyebrow { color: var(--brand-accent); font-weight: 700; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 12px; }
.hero-title { color: #fff; font-size: 38px; line-height: 1.15; font-weight: 800; margin: 0 0 14px; letter-spacing: -.02em; }
.hero-title .accent { color: #fff; border-bottom: 4px solid var(--brand-accent); }
.hero-sub { color: #c3cede; font-size: 16px; line-height: 1.6; margin: 0 0 26px; }
.hero-cta { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-accent); color: #fff; font-weight: 700; font-size: 15px; padding: 13px 28px; border-radius: 999px; text-decoration: none; transition: background .15s, transform .15s; }
.hero-cta:hover { background: var(--brand-accent-dark); transform: translateY(-1px); }

/* Итгэлийн мөр */
.trust-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 8px; }
.trust-item { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.trust-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; background: var(--brand-primary-soft); color: var(--brand-primary); display: flex; align-items: center; justify-content: center; }
.trust-ic svg { width: 22px; height: 22px; }
.trust-txt { display: flex; flex-direction: column; line-height: 1.35; }
.trust-txt strong { font-size: 14px; color: var(--ink); }
.trust-txt span { font-size: 12px; color: var(--muted); }

/* Ангиллын grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.cat-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s; }
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #cbd5e1; }
.cat-ic { width: 56px; height: 56px; border-radius: 14px; background: var(--brand-primary-soft); color: var(--brand-primary); display: flex; align-items: center; justify-content: center; }
.cat-ic svg { width: 28px; height: 28px; }
.cat-name { font-size: 14px; font-weight: 600; text-align: center; }

/* Бидний харилцагч — лого ижил өндөр, цайвар дэвсгэр, цэвэрхэн зайтай */
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.partner-item { display: flex; align-items: center; justify-content: center; height: 92px; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.partner-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.partner-item img { max-height: 56px; max-width: 100%; object-fit: contain; }
.partner-item .partner-name { color: var(--muted); font-weight: 600; font-size: 14px; text-align: center; }

/* Админ — харилцагчийн лого thumbnail / засварын лого */
.partner-thumb { height: 34px; max-width: 90px; object-fit: contain; display: block; }
.partner-logo-edit { display: flex; align-items: center; gap: 14px; margin: 8px 0 12px; }
.partner-logo-edit img { max-height: 56px; max-width: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; }

@media (max-width: 720px) {
    .hero-inner { padding: 40px 24px; }
    .hero-title { font-size: 28px; }
    .trust-row { grid-template-columns: 1fr 1fr; }
    .partner-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
    .partner-item { height: 76px; padding: 10px 12px; }
}
@media (max-width: 440px) {
    .trust-row { grid-template-columns: 1fr; }
}

/* auto-fill + minmax — өргөн ихсэх тусам багана нэмэгдэж зайг дүүргэнэ (том дэлгэцэд баруун тал
   хоосон үлдэхгүй; ~5-6 багана 1400px-д, жижиг дэлгэцэд буурна). */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.prod-card { border: 1px solid #eee; border-radius: 8px; padding: 10px; color: #111827; background: #fff; transition: box-shadow .15s; display: flex; flex-direction: column; }
.prod-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.prod-card-link { display: flex; flex-direction: column; flex: 1 1 auto; text-decoration: none; color: inherit; }
.btn-cart { margin-top: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--brand-primary); background: var(--brand-primary); color: #fff; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-cart:hover { background: var(--brand-primary-dark); }
.btn-cart:disabled { opacity: .7; cursor: default; }
.btn-cart.added { background: #16a34a; border-color: #16a34a; }
.prod-thumb { aspect-ratio: 1/1; background: #f9fafb; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.no-img { color: #cbd5e1; font-size: 13px; }

/* List харагдац (?view=list) — мөр бүр: зураг | нэр/бренд/нөөц | үнэ + сагс */
.prod-list { display: flex; flex-direction: column; gap: 10px; }
.prod-row { display: flex; align-items: center; gap: 14px; border: 1px solid #eee; border-radius: 8px; padding: 10px 14px; background: #fff; transition: box-shadow .15s; }
.prod-row:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.prod-row-link { display: flex; align-items: center; gap: 14px; flex: 1 1 auto; min-width: 0; text-decoration: none; color: inherit; }
.prod-row-thumb { width: 84px; height: 84px; flex: 0 0 auto; background: #f9fafb; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.prod-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-row-thumb .no-img { font-size: 11px; }
.prod-row-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.prod-row-info .prod-name { margin-top: 0; min-height: 0; }
.prod-row-info .prod-brand { min-height: 0; }
.prod-row-info .stock-flag { align-self: flex-start; }
.prod-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.prod-row-side .prod-price { margin-top: 0; padding-top: 0; min-height: 0; }
.prod-row-side .btn-cart { margin-top: 0; width: auto; padding: 7px 16px; white-space: nowrap; }
@media (max-width: 560px) {
    .prod-row { flex-wrap: wrap; }
    .prod-row-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
    .prod-row-thumb { width: 64px; height: 64px; }
}

/* Grid/List сэлгэгч */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-toggle .vt { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 30px; font-size: 15px; color: var(--muted); text-decoration: none; background: #fff; }
.view-toggle .vt + .vt { border-left: 1px solid var(--line); }
.view-toggle .vt:hover { color: var(--brand-primary); }
.view-toggle .vt.on { background: var(--brand-primary); color: #fff; }
.toolbar-right { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prod-name { font-size: 14px; margin-top: 8px; line-height: 1.3; min-height: 2.6em; }
.prod-brand { color: var(--faint); font-size: 12px; min-height: 1.2em; }
/* Үнэ доод талд наана — карт бүр адил өндөртэй болж, доорх сагсны товч ижил түвшинд зэрэгцэнэ. */
.prod-price { font-weight: 700; margin-top: auto; padding-top: 8px; min-height: 1.5em; display: flex; align-items: center; }
.prod-price.has-sale { min-height: 1.5em; }

/* Хямдралтай үнэ (карт ба дэлгэрэнгүйд хуваалцсан). Одоогийн үнэ тод, хуучин үнэ зурааст бүдэг,
   улаан хувийн тэмдэг. */
.has-sale { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.price-now { font-weight: 800; color: #dc2626; }
.price-old { text-decoration: line-through; color: #9ca3af; font-weight: 500; font-size: .85em; }
.price-badge { background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 4px; }
.pd-price.has-sale .price-badge { font-size: 13px; padding: 4px 8px; }

.store-cat { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
@media (max-width: 720px) { .store-cat { grid-template-columns: 1fr; } }
.facets { border: 1px solid #eee; border-radius: 8px; padding: 14px; background: #fff; }
.facet { margin-bottom: 14px; }
.facet-name { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.facet-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 0; color: var(--ink); text-decoration: none; }
.facet-opt:hover .facet-val { color: var(--brand-primary); }
.facet-opt .facet-count { color: var(--faint); font-size: 12px; margin-left: auto; }
/* Static SSR facet линкийн "checkbox" дүрс — жинхэнэ input биш (JS хэрэггүй) */
.fbox { width: 15px; height: 15px; flex: 0 0 auto; border: 1.5px solid #b6c2d1; border-radius: 4px; background: #fff; position: relative; }
.facet-opt.on .fbox { background: var(--brand-primary); border-color: var(--brand-primary); }
.facet-opt.on .fbox::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.facet-opt.on .facet-val { font-weight: 600; }
.facet-logo { height: 16px; max-width: 44px; object-fit: contain; flex: 0 0 auto; }

/* Идэвхтэй шүүлтийн tag мөр */
.filter-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.ft-label { color: var(--muted); font-size: 13px; }
.ftag { display: inline-flex; align-items: center; gap: 6px; background: #eef2f7; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 13px; text-decoration: none; transition: border-color .12s; }
.ftag:hover { border-color: var(--brand-accent); }
.ftag-x { font-weight: 700; color: var(--muted); }
.ftag:hover .ftag-x { color: var(--brand-accent); }
.ftag-clear { background: transparent; border-style: dashed; color: var(--muted); }

/* Storefront — эрэмбэ / хуудаслалт */
.store-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.store-sort { font-size: 13px; color: #6b7280; }
.store-sort select { margin-left: 6px; padding: 5px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
/* Эрэмбэ — static SSR линкүүд */
.sort-links { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 6px; }
.sort-links a { padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 13px; border: 1px solid transparent; transition: color .12s; }
.sort-links a:hover { color: var(--brand-primary); }
.sort-links a.on { color: var(--brand-primary); border-color: var(--brand-primary); background: #fff; font-weight: 600; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager .pg { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; cursor: pointer; font-size: 14px; color: #374151; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.pager .pg:hover:not(:disabled):not(.off) { border-color: var(--brand-primary); color: var(--brand-primary); }
.pager .pg.on { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.pager .pg:disabled, .pager .pg.off { opacity: .4; cursor: default; }

/* Админ Quotes — шүүлтүүр / хайлт */
.quote-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.quote-filters .seg { display: inline-flex; border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; flex-wrap: wrap; }
.quote-filters .seg button { border: none; border-left: 1px solid #e5e7eb; background: #fff; padding: 6px 12px; cursor: pointer; font-size: 13px; color: #374151; }
.quote-filters .seg button:first-child { border-left: none; }
.quote-filters .seg button.on { background: var(--brand-primary); color: #fff; }
.quote-search { display: flex; align-items: center; gap: 8px; }
.quote-search .field { width: 240px; max-width: 60vw; }

/* Барааны дэлгэрэнгүй */
.crumbs { display: flex; gap: 8px; font-size: 13px; color: #9ca3af; margin-bottom: 16px; }
.crumbs a { color: #6b7280; text-decoration: none; }
.pd { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 720px) { .pd { grid-template-columns: 1fr; } }
.pd-main { aspect-ratio: 1/1; background: #f9fafb; border: 1px solid #eee; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pd-main img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pd-thumbs img { width: 60px; height: 60px; object-fit: cover; border: 1px solid #e5e7eb; border-radius: 4px; cursor: pointer; }
.pd-thumbs img.on { border-color: var(--brand-primary); box-shadow: 0 0 0 1px var(--brand-primary) inset; }
.pd-price { font-size: 24px; font-weight: 800; margin: 12px 0; }
.pd-stock { margin: 2px 0 4px; }

/* Нөөцийн badge — карт/жагсаалт/дэлгэрэнгүйд нэг загвар */
.stock-flag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.stock-flag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock-flag.in { background: #ecfdf5; color: #059669; }
.stock-flag.out { background: #f3f4f6; color: #6b7280; }
.stock-flag.lg { font-size: 13.5px; padding: 4px 14px; }
/* Картын булангийн жижиг badge (зурган дээр) */
.stock-flag.corner { position: absolute; top: 8px; left: 8px; z-index: 1; font-size: 11px; padding: 1px 8px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.stock-flag.corner.in { background: #ecfdf5; }
.stock-flag.corner.out { background: #f3f4f6; }
.pd-brand { font-size: 14px; }
.pd-brand a { color: var(--brand-primary); text-decoration: none; }
.pd-spec { width: 100%; border-collapse: collapse; font-size: 14px; }
.pd-spec td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; }
.pd-spec td:first-child { color: #6b7280; width: 45%; }
.pd-desc { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }

/* ================= Админ хяналтын самбар ================= */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin: 8px 0 24px; }
.dash-card { position: relative; display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 18px 16px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; overflow: hidden; }
.dash-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-primary); opacity: .85; }
a.dash-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-card.warn { background: #fff5f5; border-color: #f7c4c4; }
.dash-card.warn::before { background: var(--brand-accent); }
.dash-ic { font-size: 18px; opacity: .55; position: absolute; top: 16px; right: 16px; }
.dash-num { font-size: 30px; font-weight: 800; line-height: 1; color: var(--brand-primary); }
.dash-card.warn .dash-num { color: var(--brand-accent); }
.dash-lab { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 8px; }
.dash-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.dash-recent { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.dash-recent .list-head { font-size: 15px; font-weight: 700; }

/* Үнийн саналын төлөв badge */
.qbadge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.qbadge.s-new { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.qbadge.s-seen { background: #eff6ff; color: var(--brand-primary-dark); border: 1px solid #bfdbfe; }
.qbadge.s-sent { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* ================= Storefront — холбоо/тухай ================= */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 640px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info h2, .about-box h2 { margin: 0 0 2px; font-size: 20px; }
.ci-sub { color: #9ca3af; font-size: 13px; margin-bottom: 12px; }
.ci-row { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 6px 0; }
.ci-ic { width: 22px; text-align: center; }
.ci-row a { color: var(--brand-primary); text-decoration: none; }
.contact-bank { background: #f9fafb; border: 1px solid #eee; border-radius: 10px; padding: 16px; }
.contact-bank h3 { margin: 0 0 10px; font-size: 15px; }
.bank-box { margin-bottom: 12px; font-size: 14px; }
.bank-lab { font-size: 11px; color: #9ca3af; text-transform: uppercase; margin-bottom: 2px; }
.contact-foot { margin-top: 20px; }
.contact-foot a, .about-lead a, .about-box a { color: var(--brand-primary); text-decoration: none; }
.about-box { max-width: 680px; }
.about-lead { font-size: 15px; line-height: 1.7; color: #374151; }
.about-contact { margin-top: 16px; padding-top: 12px; border-top: 1px solid #eee; }
.store-foot-links { display: flex; flex-direction: column; gap: 10px; }
.store-foot-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.store-foot-links a:hover { color: var(--brand-primary); }

/* Storefront толгой — мобайл дасан зохицол */
@media (max-width: 720px) {
    .store-utility-in { padding: 6px 14px; gap: 12px; }
    .store-bar { flex-wrap: wrap; gap: 12px 14px; padding: 10px 14px; }
    .store-search { order: 3; flex-basis: 100%; max-width: none; }
    .header-sale .hs-text { display: none; }   /* жижиг дэлгэцэд зөвхөн улаан icon (толгойд багтана) */
    .header-sale { padding: 9px 11px; }
    .store-logo-img { height: 42px; }
    .store-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 8px; }
    .store-nav a { white-space: nowrap; }
    .store-foot-inner { flex-direction: column; gap: 24px; }
}

/* ================= Storefront — үнэ авах хүсэлт ================= */
.pd-req { margin-top: 20px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.pd-req-btn { font-size: 15px; padding: 10px 20px; }
.pd-req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 8px 0; }
.pd-req label { display: block; font-size: 13px; color: #374151; }
.pd-req .field { width: 100%; padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; margin-top: 3px; font-size: 14px; }
.pd-req-actions { display: flex; gap: 10px; margin-top: 12px; }
.pd-req-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.pd-req-err { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 8px; }
.pd-req .validation-message { color: #dc2626; font-size: 12px; }
@media (max-width: 520px) { .pd-req-grid { grid-template-columns: 1fr; } }

/* Админ — аудитын бүртгэл (/admin/audit) */
.audit-act { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.audit-act.create { background: #ecfdf5; color: #047857; }
.audit-act.update { background: #eff6ff; color: #1d4ed8; }
.audit-act.delete { background: #fef2f2; color: #b91c1c; }
.audit-changes { max-width: 420px; font-size: 12.5px; }
.audit-chg { padding: 1px 0; word-break: break-word; }
.audit-changes details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
/* ================= Админ: Бараа (/admin/products) ================= */
.pa { --pa-blue: #2563eb; --pa-blue-soft: #eff6ff; }
.pa-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pa-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0; color: var(--ink); }
.pa-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.pa-actions { display: flex; gap: 10px; }
.pa-btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.pa-btn svg { width: 16px; height: 16px; }
.pa-btn.on { border-color: var(--pa-blue); color: var(--pa-blue); background: var(--pa-blue-soft); }
.pa-count { background: var(--pa-blue); color: #fff; border-radius: 9px; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; text-align: center; padding: 0 5px; }

.pa-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; }

/* Ангиллын карт — хэвтээ, багтахгүй бол гүйлгэнэ */
.pa-stats { display: flex; gap: 12px; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; -ms-overflow-style: none; }
.pa-stats::-webkit-scrollbar { display: none; }
.pa-stat {
    flex: 0 0 auto; min-width: 150px; display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; text-align: left; font: inherit;
    transition: border-color .12s, background .12s;
}
.pa-stat:hover { border-color: #c7d2fe; }
.pa-stat.on { border-color: var(--pa-blue); background: var(--pa-blue-soft); box-shadow: 0 0 0 1px var(--pa-blue) inset; }
.pa-stat-ic { width: 38px; height: 38px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pa-stat-ic svg { width: 20px; height: 20px; }
.pa-stat-ic.all { background: #eef2ff; color: #4f46e5; }
.pa-stat-txt { display: flex; flex-direction: column; line-height: 1.25; }
.pa-stat-txt span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pa-stat-txt strong { font-size: 18px; font-weight: 700; color: var(--ink); }

/* Ангиллын өнгөний палитр (карт icon + хүснэгтийн pill) */
.pa .c0 { --pc-bg: #eff6ff; --pc-fg: #1d4ed8; }
.pa .c1 { --pc-bg: #f0fdf4; --pc-fg: #15803d; }
.pa .c2 { --pc-bg: #fff7ed; --pc-fg: #c2410c; }
.pa .c3 { --pc-bg: #faf5ff; --pc-fg: #7e22ce; }
.pa .c4 { --pc-bg: #fdf2f8; --pc-fg: #be185d; }
.pa .c5 { --pc-bg: #ecfeff; --pc-fg: #0e7490; }
.pa .c6 { --pc-bg: #fefce8; --pc-fg: #a16207; }
.pa .c7 { --pc-bg: #f1f5f9; --pc-fg: #334155; }
.pa-stat-ic[class*=" c"] { background: var(--pc-bg); color: var(--pc-fg); }

/* Шүүлтүүр */
.pa-filters { padding: 14px 16px; margin-bottom: 14px; }
.pa-filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pa-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; border: 1px solid #d1d5db; border-radius: 8px; padding: 0 12px; color: var(--muted); background: #fff; }
.pa-search:focus-within { border-color: var(--pa-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pa-search svg { width: 16px; height: 16px; flex: 0 0 auto; }
.pa-search input { flex: 1; min-width: 0; border: none; outline: none; padding: 9px 0; font-size: 14px; background: transparent; }
.pa-select { height: 38px; padding: 0 30px 0 12px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; font-size: 14px; color: var(--ink); cursor: pointer; font-family: inherit; }
.pa-select:focus { outline: none; border-color: var(--pa-blue); }
select.pa-select, .pa-pop-btn { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; max-width: 220px; }
.pa-pop-wrap { position: relative; }
.pa-pop-btn { display: inline-flex; align-items: center; }
.pa-pop-btn.set { border-color: var(--pa-blue); color: var(--pa-blue); background-color: var(--pa-blue-soft); }
.pa-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); padding: 12px; width: 280px; }
.pa-pop-row { display: flex; align-items: center; gap: 8px; }
.pa-pop-row .field { flex: 1; }
.pa-pop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.pa-more { display: flex; flex-wrap: wrap; gap: 18px; padding-top: 12px; margin-top: 12px; border-top: 1px dashed var(--line); }
.pa-more label.chk { margin: 0; }

.pa-chips-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.pa-chips { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pa-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--pa-blue-soft); color: var(--pa-blue); border: 1px solid #bfdbfe; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 500; cursor: pointer; }
.pa-chip:hover { background: #dbeafe; }
.pa-chip span { font-size: 11px; }
.pa-clear { background: none; border: none; color: var(--pa-blue); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.pa-clear:hover { text-decoration: underline; }
.pa-found { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin-left: auto; white-space: nowrap; }

/* Бөөн үйлдлийн мөр */
.pa-bulk { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px; margin-bottom: 12px; background: var(--pa-blue-soft); border: 1px solid #bfdbfe; border-radius: 8px; font-size: 14px; }
.pa-bulk .danger { color: #dc2626; }
.pa-confirm { display: inline-flex; align-items: center; gap: 8px; color: #991b1b; font-weight: 500; }
.btn-danger { background: #dc2626; color: #fff; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn-danger.sm { padding: 5px 10px; font-size: 13px; }
.btn-danger:hover { background: #b91c1c; }

/* Хүснэгт */
.pa-table-card { overflow: hidden; }
.pa-empty { padding: 40px 16px; text-align: center; margin: 0; }
.pa-table-wrap { overflow-x: auto; }
.pa-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
.pa-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 11px 14px; background: #f9fafb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pa-table td { padding: 10px 14px; border-bottom: 1px solid #f1f3f5; vertical-align: middle; }
.pa-table tbody tr:hover { background: #fafbfc; }
.pa-table tr.sel { background: var(--pa-blue-soft); }
.pa-table tr.off .pa-prod-txt strong { color: var(--muted); }
.pa-table .r { text-align: right; }
.pa-table .nowrap { white-space: nowrap; }
.pa-check { width: 36px; }
.pa-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--pa-blue); }
.pa-prod { display: flex; align-items: center; gap: 12px; background: none; border: none; padding: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.pa-thumb { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 8px; border: 1px solid var(--line); background: #f9fafb; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; color: #cbd5e1; }
.pa-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pa-thumb svg { width: 24px; height: 24px; }
.pa-prod-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pa-prod-txt strong { font-weight: 600; color: var(--ink); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-prod:hover .pa-prod-txt strong { color: var(--pa-blue); }
.pa-prod-txt small { color: var(--faint); font-size: 12.5px; }
.pa-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--pc-bg, #f3f4f6); color: var(--pc-fg, #374151); }
.pa-pill.brand { background: #f3f4f6; color: #4b5563; }
.pa-price { font-weight: 600; color: var(--ink); }
.pa-old { display: block; color: var(--faint); text-decoration: line-through; font-size: 12px; }
.pa-stock { display: inline-block; min-width: 34px; text-align: center; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pa-stock.ok { background: #dcfce7; color: #166534; }
.pa-stock.low { background: #ffedd5; color: #c2410c; }
.pa-stock.out { background: #fee2e2; color: #b91c1c; }

/* Toggle switch */
.pa-switch { position: relative; display: inline-block; width: 38px; height: 22px; border-radius: 999px; background: #d1d5db; border: none; padding: 0; cursor: pointer; transition: background .15s; vertical-align: middle; }
.pa-switch > span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.pa-switch.on { background: var(--pa-blue); }
.pa-switch.on > span { transform: translateX(16px); }
.pa-switch:disabled { opacity: .6; cursor: progress; }

/* Мөрийн ⋮ цэс */
.pa-menu-wrap { position: relative; display: inline-block; }
.pa-dots { background: none; border: 1px solid transparent; border-radius: 6px; width: 30px; height: 30px; font-size: 18px; line-height: 1; cursor: pointer; color: #4b5563; }
.pa-dots:hover { background: #f3f4f6; border-color: var(--line); }
.pa-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 25; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); padding: 4px; min-width: 150px; text-align: left; }
.pa-menu > button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 6px; font-size: 14px; cursor: pointer; color: var(--ink); }
.pa-menu > button:hover { background: #f3f4f6; }
.pa-menu > button.danger { color: #dc2626; }
.pa-menu-confirm { padding: 8px; font-size: 13px; }
.pa-menu-confirm > div { display: flex; gap: 6px; margin-top: 8px; }
.pa-click-catcher { position: fixed; inset: 0; z-index: 20; }

/* Хуудаслалт */
.pa-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.pa-size { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.pa-size .pa-select { height: 34px; }
.pa-pager { display: flex; align-items: center; gap: 4px; }
.pa-pager .pg { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink); }
.pa-pager .pg:hover:not(:disabled) { border-color: var(--pa-blue); color: var(--pa-blue); }
.pa-pager .pg.on { background: var(--pa-blue); border-color: var(--pa-blue); color: #fff; font-weight: 600; }
.pa-pager .pg:disabled { opacity: .45; cursor: default; }
.pa-pager .pg-gap { padding: 0 4px; color: var(--muted); }

/* Drawer (баруунаас гулсаж гарна, хүснэгтийн дээр overlay) */
.pa-scrim { position: fixed; inset: 0; background: rgba(15,30,54,.35); z-index: 50; animation: pa-fade .15s ease; }
.pa-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 100vw; z-index: 51;
    background: #fff; box-shadow: -8px 0 30px rgba(15,30,54,.15); display: flex; flex-direction: column;
    animation: pa-slide .2s ease; outline: none;
}
@keyframes pa-slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes pa-fade { from { opacity: 0; } to { opacity: 1; } }
.pa-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.pa-drawer-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.pa-x { background: none; border: none; font-size: 16px; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.pa-x:hover { background: #f3f4f6; color: var(--ink); }
.pa-drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pa-drawer-body { flex: 1; overflow-y: auto; padding: 4px 20px 20px; }
.pa-drawer-body label { margin-top: 14px; }
.pa-drawer-body label.sub { margin-top: 8px; font-weight: 500; }
.pa-drawer-body .field { border-radius: 8px; }
.pa-drawer-body .field:focus { outline: none; border-color: var(--pa-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pa-drawer-body .validation-message { font-size: 12.5px; margin-top: 4px; }
.pa-drawer-body .alert-error { margin: 14px 0 0; }
.pa-drawer-body .row-inline .btn-ghost { white-space: nowrap; }
.pa-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pa-help { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.pa-help-inline { color: var(--muted); font-size: 12px; font-weight: 400; }
label.chk.pa-dealer { align-items: flex-start; margin-top: 16px; }
label.chk.pa-dealer input { margin-top: 3px; }
.pa-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 12px; border: 2px dashed #cbd5e1; border-radius: 8px; background: #f9fafb; color: var(--muted); text-align: center; font-size: 13px; transition: border-color .12s, background .12s; }
.pa-drop:hover, .pa-drop:focus-within { border-color: var(--pa-blue); background: var(--pa-blue-soft); }
.pa-drop.busy { opacity: .6; }
.pa-drop svg { width: 26px; height: 26px; color: #94a3b8; }
.pa-drop span { color: var(--ink); font-weight: 500; }
.pa-drop small { color: var(--faint); font-size: 12px; }
.pa-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pa-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.pa-preview { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pa-preview img { width: 100%; height: 100%; object-fit: cover; }
.pa-preview-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(15,23,42,.7); color: #fff; font-size: 11px; cursor: pointer; }
.pa-spec { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 12px; }
.pa-spec summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; }
label.pa-active-row { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding: 12px 0 0; border-top: 1px solid var(--line); cursor: pointer; }
.pa-switch-input { position: relative; display: inline-flex; }
.pa-switch-input input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pa-switch-input input:focus-visible + .pa-switch { box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
.pa-drawer-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fff; }
.pa-drawer-foot button { min-width: 100px; }

/* Toast */
.pa-toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 420px; padding: 12px 16px; border-radius: 8px; background: #0f172a; color: #fff; font-size: 14px; box-shadow: var(--shadow-md); animation: pa-fade .2s ease; border-left: 4px solid #22c55e; }
.pa-toast.err { border-left-color: #ef4444; }

@media (max-width: 640px) {
    .pa-drawer { width: 100vw; }
    .pa-actions { width: 100%; }
    .pa-actions .pa-btn { flex: 1; justify-content: center; }
    .pa-chips-row { flex-wrap: wrap; }
    .pa-found { margin-left: 0; width: 100%; justify-content: space-between; }
    select.pa-select { max-width: none; flex: 1 1 140px; }
    .pa-toast { left: 12px; right: 12px; bottom: 12px; }
}

/* ================= Админ: Захиалагч / Дилер ================= */
.ca-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ca-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ca-pill { height: 36px; padding: 0 14px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 14px; color: #374151; cursor: pointer; font-family: inherit; white-space: nowrap; }
.ca-pill:hover { border-color: #bfdbfe; }
.ca-pill.on { background: var(--pa-blue); border-color: var(--pa-blue); color: #fff; font-weight: 600; }
.ca-search { flex: 0 1 420px; }
.ca-table td { height: 44px; }
.ca-table .c, .cd-table .c { text-align: center; }
.ca-num { width: 36px; color: var(--muted); }
.ca-name { color: var(--ink); font-weight: 600; text-decoration: none; }
.ca-name:hover { color: var(--pa-blue); }
.ca-table tr.off .ca-name { color: var(--muted); }
.ca-view { display: inline-block; text-decoration: none; margin-right: 6px; vertical-align: middle; }
.ca-type { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.ca-type.dealer { background: #fee2e2; color: #dc2626; }
.ca-type.regular { background: #dbeafe; color: #1d4ed8; }
.ca-type.off { background: #f3f4f6; color: #6b7280; }

/* Дэлгэрэнгүй */
.cd-back { display: inline-flex; align-items: center; gap: 6px; color: var(--pa-blue); text-decoration: none; font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.cd-back svg { width: 16px; height: 16px; }
.cd-back:hover { text-decoration: underline; }
.cd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cd-title h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 26px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }
.cd-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: #4b5563; font-size: 14px; }
.cd-meta span { display: inline-flex; align-items: center; gap: 6px; }
.cd-meta svg { width: 15px; height: 15px; color: var(--muted); }
.cd-edit { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--pa-blue); background: var(--pa-blue-soft); border-color: #bfdbfe; }
.cd-edit svg { width: 15px; height: 15px; }

.cd-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.cd-card { display: flex; align-items: flex-start; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.cd-card > div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cd-card strong { font-size: 24px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-card span { color: #4b5563; font-size: 13.5px; }
.cd-card-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.cd-card-ic svg { width: 22px; height: 22px; }
.cd-card-ic.blue { background: #eff6ff; color: #2563eb; }
.cd-card-ic.green { background: #f0fdf4; color: #16a34a; }
.cd-card-ic.amber { background: #fffbeb; color: #d97706; }
.cd-delta { color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.cd-delta.up { color: #16a34a; font-weight: 500; }

.cd-tabs-card { overflow: hidden; }
.cd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.cd-tabs::-webkit-scrollbar { display: none; }
.cd-tab { display: inline-flex; align-items: center; gap: 8px; padding: 14px 16px; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font: inherit; font-size: 14px; color: #4b5563; cursor: pointer; white-space: nowrap; }
.cd-tab svg { width: 17px; height: 17px; }
.cd-tab:hover { color: var(--ink); }
.cd-tab.on { color: var(--pa-blue); border-bottom-color: var(--pa-blue); font-weight: 600; }
.cd-pane { padding: 16px 18px 20px; }
.cd-pane-title { font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.cd-pane .pa-table-wrap { border: 1px solid var(--line); border-radius: 8px; }
.cd-item { font-weight: 600; color: var(--ink); }
.cd-free { display: block; color: var(--faint); font-size: 12px; }
.muted-ink { color: #6b7280; }
.cd-note { margin-top: 10px; }
.cd-info { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0 0 24px; font-size: 14px; }
.cd-info dt { color: var(--muted); }
.cd-info dd { margin: 0; color: var(--ink); }
.cd-note-text { white-space: pre-line; }
.cd-year-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); margin-bottom: 12px; }
.cd-year-head .cd-pane-title { margin: 0; }

/* ===== Дилерийн бараа (/admin/dealers) ===== */
.dd-sub { font-size: 14px; font-weight: 600; color: #4b5563; margin: 18px 0 8px; }
.dd-lines { min-width: 0; margin-top: 10px; font-size: 13.5px; }
.dd-lines th, .dd-lines td { padding: 8px 8px; }
.dd-lines .field.mini { width: 90px; text-align: right; }
.dd-total { text-align: right; margin-top: 8px; font-size: 14px; color: #374151; }
.pa-drawer .row-inline { display: flex; gap: 8px; align-items: center; }
.pa-drawer .row-inline .field { flex: 1; min-width: 0; }
.pa-drawer .row-inline .field.mini { flex: 0 0 90px; }

@media (max-width: 900px) {
    .cd-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .ca-search { flex: 1 1 100%; }
    .cd-info { grid-template-columns: 1fr; gap: 2px; }
    .cd-info dd { margin-bottom: 8px; }
}

/* ===== Дилерийн портал (/diler) ===== */
.dp-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--admin-bg, #f3f4f6); }
.dp-top { background: #0f1e36; color: #fff; }
.dp-top-in { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 18px; min-height: 58px; flex-wrap: wrap; }
.dp-brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; padding: 8px 0; }
.dp-brand-name { color: #fff; font-weight: 800; font-size: 18px; letter-spacing: .06em; }
.dp-brand-tag { color: var(--brand-accent); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; margin-top: 2px; }
.dp-nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.dp-link { color: #c7d2e3; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
.dp-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.dp-link.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.dp-link.off { color: #6b7fa0; cursor: default; }
.dp-me { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dp-me-dealer { font-weight: 700; color: #fff; }
.dp-me-user { color: #8ea2c0; }
.dp-logout { margin: 0; }
.dp-logout .btn-link { color: #c7d2e3; }
.dp-spacer { flex: 1; }
.dp-main { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 22px 16px 40px; box-sizing: border-box; }
.dp-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 14px; border-top: 1px solid var(--line); }
.dp-page h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.dp-h2 { font-size: 17px; font-weight: 700; margin: 24px 0 10px; }
.dp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.dp-tile { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; text-decoration: none; color: var(--ink); }
.dp-tile:hover { border-color: var(--pa-blue, #2563eb); }
.dp-tile.off { color: var(--muted); background: #fafafa; }
.dp-tile-ic { font-size: 22px; }
.dp-tile span:last-child { font-size: 13px; color: var(--muted); }
.dp-empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.dp-table { min-width: 0; }
.dp-doc { margin-bottom: 12px; overflow: hidden; }
.dp-doc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dp-narrow { max-width: 480px; }
.dp-form { padding: 18px; }
.dp-form label { display: block; margin-top: 12px; font-size: 13px; font-weight: 600; }
.dp-form .btn-primary { margin-top: 16px; width: 100%; padding: 10px; }
.dp-login .login-card h1 { color: #0f1e36; }
.dd-logins { padding: 14px 18px; margin-bottom: 16px; }
.dd-logins-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dd-logins-head .cd-pane-title { margin: 0; }
.dd-login-list { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
@media (max-width: 640px) {
    .dp-top-in { padding: 8px 12px; }
    .dp-me { width: 100%; justify-content: space-between; }
}

/* ===== 3-р үе шат: борлуулалтын тайлан / буцаалтын хүсэлт ===== */
.dp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 16px; overflow-x: auto; }
.dp-tab { padding: 10px 14px; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font: inherit; font-size: 14px; color: #4b5563; cursor: pointer; white-space: nowrap; }
.dp-tab.on { color: var(--pa-blue, #2563eb); border-bottom-color: var(--pa-blue, #2563eb); font-weight: 600; }
.dp-h2.first { margin-top: 0; }
.dp-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.dp-form .dp-form-actions .btn-primary { width: auto; margin-top: 0; padding: 8px 16px; }
.dp-inline { margin: 10px 14px; }
.dp-notices { list-style: none; margin: 0; padding: 8px 16px; }
.dp-notices li { padding: 8px 0; border-bottom: 1px solid #f1f3f5; }
.dp-notices li:last-child { border-bottom: none; }
.dp-notices a { color: var(--pa-blue, #2563eb); text-decoration: none; }
.pa-drawer.wide { width: min(640px, 100vw); }
.dd-bad { color: #b91c1c; font-weight: 700; }
.admin-bell-menu summary { padding: 0; }
.admin-bell-menu summary::-webkit-detail-marker, .admin-bell-menu summary::marker { display: none; content: ""; }
.admin-bell-pop { min-width: 300px; }
.admin-bell-pop .admin-user-item { display: flex; justify-content: space-between; gap: 12px; text-decoration: none; }
.admin-bell-pop .admin-user-item b { min-width: 24px; text-align: right; }

/* ===== 4-р үе шат: мөнгө ===== */
.dd-credit { color: #15803d; }
.dd-overdue { color: #b91c1c; font-weight: 600; }
.dd-reminder.soft { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.dd-reminder.red { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.dd-close-pick { margin-bottom: 14px; }
.dd-close-pick .row-inline { align-items: center; }
.stmt { padding: 12px 14px; }
.stmt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.stmt-sum { min-width: 0; margin-bottom: 8px; }
.stmt-sum td { padding: 6px 8px; }
.stmt-sum tr.total td { border-top: 2px solid var(--line); }
.stmt-lines { min-width: 0; font-size: 13px; }
.stmt-empty { margin: 6px 0; }
.dp-stmt { margin-bottom: 16px; }
.dp-void td { text-decoration: line-through; color: var(--muted); }
.dp-void td:last-child { text-decoration: none; }
.dd-exposure { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: #4b5563; margin-top: 6px; }
.dd-exposure b { color: var(--ink); }
.dd-payform { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.dd-payform label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.dd-payform .dd-wide { grid-column: span 2; }
.dd-payform-btn { display: flex; align-items: flex-end; }
