/* =============================================================================
   Khuôn giao diện chung WCM (DESIGN_SYSTEM.md bản 2) — 2026-09-23
   App gốc: WCM-Store-Management-Analytics. Mọi giá trị dưới đây lấy từ đó.
   Tailwind v3 của app này dựng lúc deploy (npm run build) và nạp TRƯỚC file này,
   nên quy tắc ở đây thắng khi cùng độ đặc hiệu. Phần trung hoà nội dung gắn #view-root.
   ========================================================================== */
:root {
  --paper: #F2F6FC; --surface: #FFFFFF; --surface-2: #F6F8FC; --tile: #F1F5FA; --foot: #F9FAFD;
  --line: #E7EDF6; --line-strong: #D3DEEC; --grid: #EEF2F8;
  --ink: #26364A; --ink-2: #5D6B7E; --faint: #8593A5;
  --win: #E81C24; --win-deep: #C4161D; --win-soft: #FDECEC;
  --sky: #4A84F4; --sky-ink: #2D5FC4; --sky-wash: #EAF1FE;
  --mint: #16B884; --mint-ink: #0F7C5A; --mint-wash: #E2F6EE;
  --amber: #F6AA2A; --amber-ink: #8A6008; --amber-wash: #FEF3DE;
  --rose: #F24B64; --rose-ink: #C42A3E; --rose-wash: #FDE8EC;
  --menu-shadow: 0 16px 40px -16px rgba(38, 54, 74, .28), 0 2px 6px rgba(38, 54, 74, .06);
  --rail: 276px; --rail-mini: 80px; --ease: cubic-bezier(.32, .08, .24, 1);
}

.mc-body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: 'Hanken Grotesk', system-ui, sans-serif; font-size: 14px; }
.mc-icon14 { width: 14px; height: 14px; flex: none; }
.mc-icon16 { width: 16px; height: 16px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Màn đăng nhập (§4.9) ---- */
.mc-login { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--paper); overflow-y: auto; }
.mc-login.hidden { display: none; }
.mc-login__card { width: min(430px, 100%); padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px -32px rgba(38, 54, 74, .35); }
.mc-login__logo { display: block; height: 40px; width: auto; margin: 0 0 18px -6px; }
.mc-login__title { margin: 0; font-size: 20px; font-weight: 600; color: var(--ink); }
.mc-login__desc { margin: 6px 0 20px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.mc-login__label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.mc-login__field { display: flex; align-items: center; gap: 8px; padding: 0 11px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; }
.mc-login__field:focus-within { border-color: var(--win); box-shadow: 0 0 0 3px rgba(232, 28, 36, .12); }
.mc-login__icon { width: 16px; height: 16px; flex: none; color: var(--faint); }
.mc-login__input { flex: 1; min-width: 0; padding: 12px 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); }
.mc-login__error { margin: 9px 0 0; padding: 8px 10px; border-radius: 9px; background: var(--rose-wash); color: var(--rose-ink); font-size: 12.5px; font-weight: 500; }
.mc-login__error.hidden { display: none; }
.mc-login__card .mc-login__submit { box-sizing: border-box; width: 100%; height: 44px; margin-top: 14px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
/* Cao đúng 44px như ô nhập/nút của app kho (DESIGN_SYSTEM.md §4.9). */
.mc-login__field { box-sizing: border-box; height: 44px; }
.mc-login__input { height: 100%; padding: 0 !important; }
/* Nút hiện/ẩn mật khẩu — cùng thông số .wcm-auth-toggle của app kho/khảo sát/hiệu suất. */
.mc-login__toggle { flex: none; width: 32px; height: 32px; margin-right: -5px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #8593A5; cursor: pointer; }
.mc-login__toggle:hover { background: #F1F5FA; color: #26364A; }
.mc-login__toggle svg { width: 16px; height: 16px; }
.mc-login__toggle[aria-pressed="true"] .pw-eye, .mc-login__toggle:not([aria-pressed="true"]) .pw-eye-off { display: none; }

/* ---- Nút (§4.3) ---- */
.mc-btn-primary, .mc-btn-secondary, .mc-btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.mc-btn-primary { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--win); color: #fff; font-size: 13px; font-weight: 600; }
.mc-btn-primary:hover { background: var(--win-deep); }
.mc-btn-secondary { min-height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.mc-btn-secondary:hover { background: var(--tile); color: var(--ink); }
.mc-btn-secondary.hidden { display: none; }
.mc-btn-danger { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: #C42A3E; color: #fff; font-size: 13px; font-weight: 600; }
.mc-btn-danger:hover { background: #A8223A; }
:is(.mc-btn-primary, .mc-btn-secondary, .mc-btn-danger):disabled { opacity: .5; cursor: not-allowed; }
.mc-btn-primary.is-busy { opacity: .6; pointer-events: none; }
.mc-iconbtn { display: grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.mc-iconbtn:hover { background: var(--tile); color: var(--ink); }
.mc-link { padding: 0; border: 0; background: none; color: var(--sky-ink); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }

/* ---- Thanh bên (§3) ---- */
.mc-rail { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; width: var(--rail); background: var(--surface); border-right: 1px solid var(--line); overflow-x: hidden; transition: width .3s var(--ease), transform .3s var(--ease); }
.mc-shell { margin-left: var(--rail); min-height: 100vh; transition: margin-left .3s var(--ease); }
.mc-rail__head { display: flex; align-items: center; gap: 8px; height: 64px; flex: none; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); transition: padding .3s var(--ease); }
.mc-rail__logo { display: block; height: 34px; width: auto; max-width: none; margin-left: -6px; }
.mc-rail__toggle { display: grid; place-items: center; width: 30px; height: 30px; flex: none; margin-left: auto; border: 0; border-radius: 8px; background: transparent; color: var(--faint); cursor: pointer; }
.mc-rail__toggle:hover { background: var(--tile); color: var(--ink); }
.mc-rail__toggleicon { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.mc-rail__nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.mc-rail__group { margin: 16px 0 4px; padding: 0 12px; font-size: 12px; font-weight: 500; line-height: 18px; color: var(--faint); white-space: nowrap; }
.mc-rail__group:first-child { margin-top: 0; }
.mc-nav { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; margin-bottom: 2px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; white-space: nowrap; cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.mc-nav:hover { background: var(--tile); color: var(--ink); }
.mc-nav__icon { width: 16px; height: 16px; flex: none; color: var(--faint); }
.mc-nav__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mc-nav__tag { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--tile); color: var(--faint); font-size: 11px; font-weight: 500; }
.mc-nav.is-active { background: var(--sky-wash); color: var(--sky-ink); font-weight: 600; }
.mc-nav.is-active .mc-nav__icon { color: var(--sky-ink); }
/* Thu gọn: dải icon 80px; nhãn nhóm giữ chiều cao (vạch mảnh) để mục menu không nhảy (§1 quy tắc 9). */
.mc-rail.is-collapsed { width: var(--rail-mini); }
.mc-shell.is-railed { margin-left: var(--rail-mini); }
.mc-rail.is-collapsed .mc-rail__head { padding: 0 25px; }
.mc-rail.is-collapsed :is(.mc-rail__logo, .mc-nav__label, .mc-nav__tag) { display: none; }
.mc-rail.is-collapsed .mc-rail__toggleicon { transform: scaleX(-1); }
.mc-rail.is-collapsed .mc-rail__group { position: relative; color: transparent; overflow: hidden; }
.mc-rail.is-collapsed .mc-rail__group::after { content: ''; position: absolute; left: 12px; right: 12px; top: 50%; border-top: 1px solid var(--line); }
.mc-rail-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(38, 54, 74, .32); }
.mc-rail-backdrop.hidden { display: none; }
.mc-only-mobile { display: none; }

/* ---- Topbar (§3) ---- */
.mc-topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 18px 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.mc-topbar__title { margin: 0; min-width: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-topbar__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.mc-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.mc-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.mc-role { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--tile); color: var(--ink-2); }
.mc-role[data-role="admin"] { background: var(--win-soft); color: var(--win); }
.mc-role:empty { display: none; }

/* ---- Vùng nội dung ---- */
.mc-main { padding: 24px; }
.mc-main > * + * { margin-top: 16px; }
#view-root > * + * { margin-top: 0; }

/* ---- Đầu trang, bộ lọc, menu (§4.1–4.4) ---- */
.mc-pagehead { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.mc-pagehead__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mc-pagehead__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mc-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 3px 9px; border-radius: 999px; background: var(--tile); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.mc-pagehead__h { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.mc-pagehead__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.mc-pagehead__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mc-pagehead__filters.is-collapsed, .mc-pagehead__filters.is-off { display: none; }
.mc-filtertoggle, .mc-actionsbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.mc-filtertoggle.hidden { display: none; }
.mc-actionsbtn { padding: 0 12px; }
.mc-filtertoggle:hover, .mc-actionsbtn:hover { background: var(--tile); color: var(--ink); }
.mc-filtertoggle__chev { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.mc-filtertoggle[aria-expanded="false"] .mc-filtertoggle__chev { transform: rotate(-90deg); }
.mc-filtertoggle__count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--sky); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.mc-filtertoggle__count.hidden { display: none; }

.mc-field { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.mc-field:hover { background: var(--foot); }
.mc-field:focus-within, .mc-field:focus-visible, .mc-field[aria-expanded="true"] { border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-wash); outline: none; }
.mc-field__icon { width: 14px; height: 14px; flex: none; color: var(--faint); }
.mc-field__text { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.mc-field__chev { width: 14px; height: 14px; flex: none; color: var(--faint); }
.mc-field--search { cursor: text; }
.mc-field__input { width: 170px; height: 32px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); }
.mc-field__input::placeholder { color: var(--faint); font-weight: 400; }
.mc-select { height: 32px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }

/* Ô chọn nhiều giá trị — bảng thả xuống */
.mc-multi { position: relative; flex: none; }
.mc-multi__panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; width: 264px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--menu-shadow); }
.mc-multi__panel.hidden { display: none; }
.mc-multi__list { max-height: 280px; overflow: auto; }
.mc-multi__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; }
.mc-multi__item:hover { background: var(--tile); }
.mc-multi__item--reset { color: var(--ink-2); }
.mc-multi__sep { height: 1px; margin: 4px 6px; background: var(--line); }
.mc-check { display: grid; place-items: center; width: 16px; height: 16px; flex: none; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: #fff; }
.mc-check.is-on { border-color: var(--sky); background: var(--sky); }
.mc-check svg { width: 12px; height: 12px; }

.mc-menuwrap { position: relative; }
.mc-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 264px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--menu-shadow); }
.mc-menu.hidden { display: none; }
.mc-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; text-decoration: none; cursor: pointer; }
.mc-menu__item:hover, .mc-menu__item:focus-visible { background: var(--tile); outline: none; }
.mc-menu__icon { width: 16px; height: 16px; flex: none; color: var(--faint); }
.mc-menu__item--danger, .mc-menu__item--danger .mc-menu__icon { color: var(--rose-ink); }
.mc-menu__item--danger:hover { background: var(--rose-wash); }
.mc-menu__sep { height: 1px; margin: 4px 6px; background: var(--line); }
.mc-menu__note { padding: 6px 10px 8px; color: var(--faint); font-size: 12px; white-space: normal; line-height: 1.45; }

/* ---- Thẻ số (§4.5) ---- */
.mc-kpis { display: grid; gap: 12px; }
.mc-kpis--auto { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.mc-kpi { min-width: 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.mc-kpi--link { cursor: pointer; transition: border-color .15s var(--ease); }
.mc-kpi--link:hover { border-color: var(--line-strong); background: var(--foot); }
.mc-kpi__label { font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--ink-2); }
.mc-kpi__value { margin-top: 4px; font-size: 24px; font-weight: 600; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-kpi__unit { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.mc-kpi__hint { margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--faint); }

/* ---- Thẻ nội dung / biểu đồ (§4.6) ---- */
.mc-card { min-width: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.mc-card--flush { padding: 0; overflow: hidden; }
.mc-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.mc-card--flush > .mc-card__head { margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mc-card__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.mc-card__icon { width: 16px; height: 16px; flex: none; color: var(--faint); }
.mc-card__desc { margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.mc-card__aside { font-size: 12px; color: var(--ink-2); }
.mc-subtitle { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.mc-note { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--ink-2); font-size: 12px; font-weight: 500; line-height: 1.55; }
.mc-note strong { color: var(--ink); font-weight: 600; }
.mc-caption { margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--faint); }
.mc-tile { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.mc-tile__label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.mc-tile__value { margin-top: 4px; font-size: 16px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.mc-tile__text { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.mc-list { margin: 0; padding-left: 18px; list-style: disc; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.mc-list li + li { margin-top: 4px; }
.mc-list strong { color: var(--ink); font-weight: 600; }
.mc-muted { color: var(--faint) !important; }

/* Chip: nhãn xám; chip trạng thái chỉ khi trạng thái có nghĩa (§4.8) */
.mc-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--tile); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.mc-tag svg { width: 12px; height: 12px; }
.mc-status { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.mc-status--bad { background: var(--rose-wash); color: var(--rose-ink); }
.mc-status--warn { background: var(--amber-wash); color: var(--amber-ink); }
.mc-status--ok { background: var(--mint-wash); color: var(--mint-ink); }
.mc-status--muted { background: var(--tile); color: var(--ink-2); }

/* ---- Bảng (§4.8) ---- */
.mc-tablewrap { overflow-x: auto; }
.mc-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--ink); }
.mc-table thead th { position: sticky; top: 0; z-index: 1; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.mc-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.mc-table tbody tr:last-child td { border-bottom: 0; }
.mc-table tbody tr:hover td { background: #FAFCFE; }
.mc-table .is-right { text-align: right; }
.mc-table .is-center { text-align: center; }
.mc-table__empty { padding: 36px 14px !important; text-align: center; color: var(--faint); }
.mc-card .mc-tablewrap { border: 1px solid var(--line); border-radius: 10px; }
.mc-card--flush .mc-tablewrap { border: 0; border-radius: 0; }
.mc-code { font-weight: 600; color: var(--ink); }
.mc-sub { font-size: 12px; color: var(--ink-2); }
.mc-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--foot); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.mc-pager__btns { display: flex; gap: 6px; }
.mc-pager__btn { padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.mc-pager__btn:hover:not(:disabled) { background: var(--tile); color: var(--ink); }
.mc-pager__btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Trạng thái rỗng, đang tải (§4.10) ---- */
.mc-empty { padding: 40px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 14px; text-align: center; }
.mc-empty__icon { display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 50%; background: var(--tile); color: var(--faint); }
.mc-empty__icon svg { width: 20px; height: 20px; }
.mc-empty__title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.mc-empty__text { max-width: 560px; margin: 6px auto 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.mc-empty .mc-btn-secondary { margin-top: 14px; }
.mc-loading { padding: 64px 0; text-align: center; font-size: 13px; color: var(--faint); }

/* Vùng thả file */
.mc-drop { position: relative; display: block; padding: 36px 20px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.mc-drop:hover, .mc-drop.is-over { border-color: var(--sky); background: var(--sky-wash); }
.mc-drop__icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--faint); }
.mc-drop__icon svg { width: 20px; height: 20px; }

/* ---- Thông báo (§4.10) ---- */
.mc-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.mc-toast { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--mint); border-radius: 10px; box-shadow: 0 14px 36px -12px rgba(38, 54, 74, .3); color: var(--ink); font-size: 13px; font-weight: 500; }
.mc-toast--error { border-left-color: var(--rose); }
.mc-toast--warn { border-left-color: var(--amber); }
.mc-toast svg { width: 16px; height: 16px; flex: none; color: var(--faint); }

/* ---- Hộp thoại (§4.10) ---- */
.mc-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(38, 54, 74, .38); }
.mc-modal__card { width: 100%; max-width: 440px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--menu-shadow); }
.mc-modal__title { margin: 0 0 6px; font-size: 18px; font-weight: 600; color: var(--ink); }
.mc-modal__text { margin: 0 0 16px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.mc-modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.mc-modal__error { margin: 8px 0 0; font-size: 12.5px; font-weight: 500; color: var(--rose-ink); }
.mc-modal__error.hidden { display: none; }
.mc-input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; outline: none; }
.mc-input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-wash); }
.mc-input:disabled { background: var(--tile); color: var(--ink-2); }
.mc-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }

/* ---- Báo cáo tổng hợp (bản in) ---- */
.mc-report { max-width: 960px; margin: 0 auto; }
.mc-report__paper { padding: 36px 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); }
.mc-report__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.mc-report__logo { display: block; height: 34px; width: auto; margin-left: -5px; }
.mc-report__title { margin: 10px 0 0; font-size: 20px; font-weight: 600; color: var(--ink); }
.mc-report__meta { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); text-align: right; }
.mc-report__h { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
.mc-report__section + .mc-report__section { margin-top: 26px; }
.mc-report p { font-size: 13.5px; line-height: 1.65; }

/* ---- Trung hoà markup cũ trong nội dung (§1 quy tắc 1–2) ----
   Lưới an toàn cho utility còn sót: không in hoa, đậm tối đa 700, không bóng,
   cỡ chữ tối thiểu 12px, chữ và nền màu về trung tính. Chip trạng thái thật (.mc-status)
   giữ màu. Màu tươi chỉ còn trong biểu đồ. */
#view-root .uppercase { text-transform: none; }
#view-root :is(.tracking-wide, .tracking-wider, .tracking-widest, .tracking-tight) { letter-spacing: 0; }
#view-root :is(.font-black, .font-extrabold) { font-weight: 700; }
#view-root [class*="shadow"] { box-shadow: none; }
#view-root :is(.text-\[10px\], .text-\[11px\]) { font-size: 12px; }
#view-root :is(.text-wcm-red, .text-wcm-darkred, .text-blue-600, .text-blue-700, .text-rose-600, .text-rose-700, .text-rose-800, .text-amber-700, .text-amber-800, .text-amber-900, .text-emerald-700, .text-sky-900, .text-orange-700):not(.mc-status) { color: var(--ink); }
#view-root :is(.bg-amber-50, .bg-rose-50, .bg-emerald-50, .bg-sky-50, .bg-red-50):not(.mc-status) { background: var(--surface-2); border-color: var(--line); }
#view-root .border-slate-200, #view-root .border-slate-100 { border-color: var(--line); }
#view-root .border-slate-300 { border-color: var(--line-strong); }
#view-root details > summary { color: var(--ink); }

@media (max-width: 1023px) {
  .mc-rail { transform: translateX(-105%); width: var(--rail); }
  .mc-rail.is-open { transform: translateX(0); }
  .mc-rail.is-collapsed { width: var(--rail); }
  .mc-rail.is-collapsed :is(.mc-rail__logo, .mc-nav__label, .mc-nav__tag) { display: revert; }
  .mc-rail.is-collapsed .mc-rail__head { padding: 0 12px 0 16px; }
  .mc-shell, .mc-shell.is-railed { margin-left: 0; }
  .mc-only-mobile { display: grid; }
  .mc-rail__toggle { display: none; }
}
@media (max-width: 767px) {
  .mc-main { padding: 16px; }
  .mc-hide-sm { display: none; }
  .mc-topbar { padding: 0 12px; }
  .mc-pagehead__title { flex-wrap: wrap; }
  .mc-pagehead__h { font-size: 16px; }
  .mc-report__paper { padding: 20px; }
  .mc-report__head { flex-direction: column; }
  .mc-report__meta { text-align: left; }
}
@media print {
  .mc-rail, .mc-topbar, .mc-pagehead { display: none !important; }
  .mc-shell { margin-left: 0 !important; }
  .mc-main { padding: 0 !important; }
  .mc-card, .mc-report__paper { border-color: #E7EDF6 !important; }
}
@media (prefers-reduced-motion: reduce) {
  .mc-rail, .mc-shell, .mc-rail__toggleicon, .mc-filtertoggle__chev { transition: none; }
}
.mc-table--compact { font-size: 12.5px; }
.mc-table--compact thead th, .mc-table--compact tbody td { padding: 8px 8px; }
.mc-table--compact thead th:first-child, .mc-table--compact tbody td:first-child { padding-left: 12px; }

/* Lớp "Đang cập nhật số liệu…" (DESIGN_SYSTEM.md §4.10) — cùng thông số app bảo trì:
   nền trang mờ nhẹ phía sau, thẻ trắng nhỏ ở giữa, vòng quay xanh 18px. */
.wcm-loading { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(244, 247, 251, .7); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.wcm-loading.hidden { display: none !important; }
.wcm-loading__card { display: flex; align-items: center; gap: 12px; padding: 15px 20px; background: #FFFFFF; border-radius: 14px; font-size: 13px; font-weight: 600; color: #26364A; }
.wcm-loading__spinner { flex: none; width: 18px; height: 18px; border: 2.5px solid #E7EDF6; border-top-color: #4A84F4; border-radius: 50%; animation: wcm-loading-spin .7s linear infinite; }
@keyframes wcm-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wcm-loading__spinner { animation-duration: 2s; } }
@media print { .wcm-loading { display: none !important; } }
