/* IFS OPS Web — cùng bảng màu với Theme.cs của app OG (CHUAN_GIAO_DIEN.md) */
:root {
  --black: #111113; --yellow: #FACC15; --workspace: #F4F4F5; --surface: #fff;
  --text: #18181B; --sub: #52525B; --muted: #787882; --line: #E4E4E7; --soft: #EFEFF1; --hover: #F8F8F9;
  --mbs: #2563EB; --pt: #DB2777; --guests: #EA580C; --checkin: #059669; --contracts: #7C3AED;
  --other: #94A3B8;
  --good: #15803D; --warn: #A1530A; --warn-soft: #FEF5DC; --danger: #DC2626; --danger-soft: #FEECEC; --accent-soft: #FEF9E1;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --workspace: #0B0B0D; --surface: #18181B; --text: #F4F4F5; --sub: #A1A1AA; --muted: #8A8A94; --line: #2A2A2F;
    --soft: #222226; --hover: #1F1F23; --good: #4ADE80; --warn: #FBBF24; --warn-soft: #2A2110; --danger: #F87171; --danger-soft: #2A1414;
    --accent-soft: #24210F; --mbs: #60A5FA; --pt: #F472B6;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--workspace); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* thanh trên: nền đen, vàng chỉ để nhấn (như ribbon/top nav của app) */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 52px; background: var(--black); color: #fff; }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .02em; }
.logo { background: var(--yellow); color: var(--black); border-radius: 6px; padding: 1px 6px; }
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav button { background: none; border: 0; color: #B4B4BC; padding: 15px 10px 13px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
nav button.on { color: #fff; border-bottom-color: var(--yellow); }
.me { margin-left: auto; background: #28282C; border: 0; color: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { background: var(--yellow); color: var(--black); border-radius: 999px; padding: 0 6px; font-size: 12px; font-weight: 700; margin-left: 4px; }

main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.loading, .empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* nút: một Primary (đen) / màn hình; Secondary viền */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--black); border-color: var(--black); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--black); } }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--sub); text-decoration: underline; cursor: pointer; padding: 0; }

/* đăng nhập */
.auth { max-width: 380px; margin: 6vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.auth h1 { font-size: 20px; margin: 0 0 4px; }
.auth p.sub { color: var(--sub); margin: 0 0 18px; }
.tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 8px 0; border-bottom: 2px solid transparent; color: var(--sub); cursor: pointer; }
.tabs button.on { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
label.f { display: block; margin-bottom: 12px; font-size: 13px; color: var(--sub); }
label.f input, label.f select { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 15px; }
label.f input:focus, label.f select:focus { outline: 2px solid var(--yellow); outline-offset: 0; border-color: var(--black); }
.err { color: var(--danger); min-height: 20px; font-size: 13px; margin: 4px 0 8px; }
.auth .btn.primary { width: 100%; padding: 10px; }
.note { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--sub); }

/* dashboard */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.bar h1 { font-size: 20px; margin: 0; flex: 1 1 auto; }
.bar select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--surface); }
.meta { color: var(--muted); font-size: 13px; width: 100%; }
.stale { color: var(--warn); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; border-top: 3px solid var(--c, var(--black)); }
.card .k { font-size: 12.5px; color: var(--sub); }
.card .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.card .s { font-size: 12px; color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; margin: 0 0 10px; }
.panel h2 small { color: var(--muted); font-weight: 400; margin-left: 6px; }

.kpi { padding: 10px 0; border-top: 1px solid var(--line); }
.kpi:first-of-type { border-top: 0; }
.kpi .row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.kpi .name { font-weight: 600; }
.kpi .pair { font-variant-numeric: tabular-nums; color: var(--sub); font-size: 13.5px; }
.track { position: relative; height: 10px; background: var(--soft); border-radius: 999px; margin: 6px 0 4px; overflow: hidden; }
.track .fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--black); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .track .fill { background: #E4E4E7; } }
.track .pace { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--yellow); }
.lv { font-size: 12.5px; font-weight: 600; }
.lv.l2 { color: var(--good); } .lv.l1 { color: var(--text); } .lv.l0 { color: var(--warn); } .lv.l-1 { color: var(--danger); }
.fc { font-size: 12.5px; color: var(--muted); }

.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--sub); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.tbl-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--sub); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.mine td { background: var(--accent-soft); }
.team { display: inline-block; font-size: 11px; border-radius: 4px; padding: 0 5px; color: #fff; }
.team.Sale { background: var(--mbs); } .team.PT { background: var(--pt); }

/* chi tiết (như PDF nhân viên) */
.subtabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 0 0 12px; overflow-x: auto; }
.subtabs button { background: none; border: 0; padding: 8px 0; border-bottom: 2px solid transparent; color: var(--sub); cursor: pointer; white-space: nowrap; }
.subtabs button.on { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.subtabs .n { color: var(--muted); font-weight: 400; margin-left: 4px; }
.search { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--surface); min-width: 0; flex: 1 1 180px; }
.detail td { white-space: nowrap; }
.detail td.wrap { white-space: normal; min-width: 160px; }
tr.total td { font-weight: 700; background: var(--soft); border-bottom: 0; }
.ok { color: var(--good); font-weight: 600; }

/* dữ liệu nhập — kiểu Excel */
.xl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; overflow: auto; max-height: calc(100vh - 230px); min-height: 240px; }
.xl { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
.xl th, .xl td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px 8px; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.xl thead th { position: sticky; top: 0; z-index: 2; background: var(--soft); color: var(--text); font-size: 12px; text-align: left; }
.xl td.rn, .xl th.rn { position: sticky; left: 0; z-index: 1; background: var(--soft); color: var(--muted); text-align: right; min-width: 44px; }
.xl thead th.rn { z-index: 3; }
.xl td.n { text-align: right; font-variant-numeric: tabular-nums; }
.xl tbody tr:hover td { background: var(--accent-soft); }
.xl tbody tr:hover td.rn { background: var(--soft); }
.sheet-tabs { display: flex; gap: 2px; overflow-x: auto; background: var(--soft); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 0 6px; }
.sheet-tabs button { background: none; border: 0; padding: 8px 12px; font-size: 13px; color: var(--sub); cursor: pointer; white-space: nowrap; border-top: 2px solid transparent; }
.sheet-tabs button.on { background: var(--surface); color: var(--text); font-weight: 600; border-top-color: var(--black); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet-tabs button.on { border-top-color: var(--yellow); } }
.sheet-tabs .n { color: var(--muted); font-weight: 400; margin-left: 4px; }

/* báo cáo (như PDF) */
.rbar { margin-bottom: 4px; }
.rbar .ttl { flex: 1 1 auto; min-width: 0; }
.rbar .ttl h1 { font-size: 21px; margin: 0; line-height: 1.2; }
.rbar .ttl span { color: var(--sub); font-size: 13px; }
.rmeta { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.rmeta .live { color: var(--contracts); font-weight: 600; }
.chips { position: sticky; top: 52px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; margin: 0 0 6px; background: var(--workspace); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; }
.chips a:active { background: var(--soft); }
.rs { margin: 6px 0 22px; scroll-margin-top: 104px; }
.sh { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--st); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; }
.sh h2 { margin: 0; font-size: 18px; }
.sh small { color: var(--muted); font-size: 12.5px; }
.sh .no { width: 24px; height: 24px; border-radius: 50%; background: var(--black); color: #fff; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sh .no { background: var(--yellow); color: var(--black); } }
h3.sub { font-size: 15px; margin: 16px 0 8px; } h3.sub small { color: var(--muted); font-weight: 400; }

.rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.rc { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.rc.hero { grid-column: span 2; background: var(--accent-soft); border-color: var(--yellow); border-left-width: 3px; }
.rc .k { font-size: 12.5px; color: var(--sub); display: flex; align-items: center; gap: 6px; }
.rc .k i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.rc .v { font-size: 22px; font-weight: 700; margin: 2px 0 1px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc.hero .v { font-size: 30px; }
.rc .v .short { display: none; }
.rc .dl { font-size: 12.5px; font-weight: 600; } .rc .dl span { font-weight: 400; color: var(--muted); }
.rc .dl.up { color: var(--good); } .rc .dl.down { color: var(--danger); } .rc .dl.eq { color: var(--sub); }
.rc .pv, .rc .nt { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kgrid.one { grid-template-columns: minmax(0, 360px); }
.kc { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: var(--radius); padding: 10px 12px; }
.kc.lv2 { border-left-color: var(--good); } .kc.lv1 { border-left-color: var(--text); } .kc.lv0 { border-left-color: var(--warn); } .kc.lv-1 { border-left-color: var(--danger); }
.kc .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.kc .big { font-size: 24px; font-weight: 700; margin: 2px 0 0; }
.kc .pair { font-size: 12.5px; color: var(--sub); } .kc .fc { font-size: 12px; color: var(--muted); }

.grid2, .grid3 { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 2px; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.grid2 .panel, .grid3 .panel { margin-bottom: 10px; min-width: 0; }
.panel h3 { font-size: 14.5px; margin: 0 0 10px; } .panel h3 small { color: var(--muted); font-weight: 400; font-size: 12px; }
.legend i.dash { width: 14px; height: 0; border-top: 2px dashed var(--muted); border-radius: 0; vertical-align: 3px; }
.bl { padding: 5px 0; }
.bl .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.bl .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bl small { color: var(--muted); font-weight: 400; }
.bl .vv { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bl .bar { height: 7px; background: var(--soft); border-radius: 999px; margin-top: 4px; overflow: hidden; }
.bl .bar div { height: 100%; border-radius: 999px; }
.ratio { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.ratio:first-of-type { border-top: 0; }
.ratio b { display: block; font-size: 13.5px; font-weight: 600; } .ratio small { color: var(--muted); font-size: 12px; }
.ratio span { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.rt { font-size: 13.5px; }
table.rt th { background: var(--soft); }
table.sticky1 td:first-child, table.sticky1 th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.sticky1 th:first-child { background: var(--soft); }
table.sticky1 tr.total td:first-child { background: var(--soft); }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
details.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
details.person summary { display: flex; align-items: center; gap: 8px; padding: 11px 12px; cursor: pointer; list-style: none; }
details.person summary::-webkit-details-marker { display: none; }
details.person summary::after { content: "▾"; margin-left: 6px; color: var(--muted); }
details.person[open] summary::after { content: "▴"; }
details.person .nm { font-weight: 700; }
details.person .sv { margin-left: auto; font-size: 13.5px; color: var(--sub); white-space: nowrap; }
details.person .rcards, details.person .kgrid { padding: 0 12px; }

@media (max-width: 600px) {
  main { padding: 12px; }
  .top { gap: 10px; padding: 0 12px; }
  .brand span:last-child { display: none; }
  /* điện thoại: menu chuyển xuống thanh dưới đáy màn hình */
  nav#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--black); justify-content: space-around; gap: 0;
    padding: 0 4px env(safe-area-inset-bottom); border-top: 1px solid #28282C; overflow: visible; }
  nav button { flex: 1; padding: 11px 2px 10px; font-size: 12.5px; border-bottom: 0; border-top: 2px solid transparent; line-height: 1.2; }
  nav button.on { border-top-color: var(--yellow); }
  nav .badge { position: relative; top: -1px; }
  body { padding-bottom: 64px; }
  .me { margin-left: auto; max-width: 55vw; }
  #toast { bottom: 76px; }
  .rbar .ttl { flex-basis: 100%; }
  .rbar select { flex: 1; }
  .rcards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .rc { padding: 9px 10px; }
  .rc .v { font-size: 19px; }
  .rc.hero .v { font-size: 26px; }
  .rc .v .full { display: none; } .rc .v .short { display: inline; }
  .rc.hero .v .full { display: inline; } .rc.hero .v .short { display: none; }
  .rc .dl span { display: none; }
  .kgrid, .kgrid.one { grid-template-columns: 1fr; }
  .panel { padding: 12px; }
  .tbl-wrap { margin: 0 -12px; padding: 0 12px; }
  table.rt { font-size: 12.5px; }
  th, td { padding: 7px 6px; }
  .sh h2 { font-size: 16.5px; }
  details.person .sv { font-size: 12.5px; }
}

/* báo cáo nhân viên */
.pill2 { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 1px 8px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.kp .kpr { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.kp .kpr:first-of-type { border-top: 0; }
.kp .kk { font-weight: 600; display: flex; align-items: flex-start; gap: 7px; } .kp .kk i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.pfoot { padding: 0 12px 12px; }
.rbar #stBack { order: -1; }
td a[href^="tel:"] { color: inherit; }
@media (max-width: 600px) { .kp .kpr { grid-template-columns: 1fr; gap: 2px; } }

/* khách hàng */
.clist { padding: 4px 0; }
.clist h3 { padding: 10px 16px 0; }
.crow { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 16px; cursor: pointer; }
.crow:first-of-type { border-top: 0; }
.crow:hover { background: var(--hover); }
.crow.off { cursor: default; }
.crow .cn small, .crow .cm small { display: block; color: var(--muted); font-size: 12.5px; }
.crow .cm { grid-column: 1; font-size: 13px; color: var(--sub); }
.crow .cx { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.warnp { border-color: var(--warn-line, #EAB308); background: var(--warn-soft); }
.rq { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.rq:first-of-type { border-top: 0; }
.rq small { color: var(--muted); }
.rqa { display: flex; gap: 6px; align-items: center; }
.rqa select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--surface); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv span { color: var(--sub); } .kv b { font-weight: 600; word-break: break-word; } .kv a { color: inherit; }
.cnote { background: var(--soft); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; white-space: pre-wrap; margin: 12px 0 0; }
.ctr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.ctr summary { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.ctr summary::-webkit-details-marker { display: none; }
.ctr summary small { color: var(--muted); }
.ctr .cv { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctrb { padding: 0 12px 10px; } .ctrb .kv { margin-bottom: 8px; }
small.bad { color: var(--danger); } small.ok { color: var(--good); } .muted { color: var(--muted); }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.file:first-of-type { border-top: 0; }
.file img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.ficon { width: 56px; height: 56px; border-radius: 6px; background: var(--soft); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--sub); flex: none; }
.file .fi { flex: 1; min-width: 0; } .file .fi b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fi small { color: var(--muted); font-size: 12px; }
details.panel > summary { cursor: pointer; }
@media (max-width: 600px) { nav button { font-size: 11.5px; } .kv { grid-template-columns: 1fr; gap: 0; } .kv span { margin-top: 6px; font-size: 12px; } }

/* tài khoản (6.x web): lọc, mở rộng, hộp mật khẩu tạm */
.ufilter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ufilter select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--surface); }
.user .who > span { display: block; }
.user .anote { color: var(--warn); }
.umore { grid-column: 1 / -1; background: var(--soft); border-radius: 8px; padding: 12px; }
.uedit { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; align-items: end; }
.uedit .f { margin-bottom: 10px; }
.uact { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.ulog { margin-top: 10px; font-size: 13px; } .ulog small { color: var(--muted); } .ulog ul { margin: 6px 0 0; padding-left: 18px; color: var(--sub); }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; }
.mbox { background: var(--surface); color: var(--text); border-radius: 14px; padding: 20px; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow: auto; }
.mbox h3 { margin: 0 0 4px; font-size: 18px; } .mbox .sub { color: var(--sub); margin: 0 0 12px; font-size: 13.5px; }
.tp { background: var(--accent-soft); border: 1px dashed var(--yellow); border-radius: 10px; padding: 14px; text-align: center; }
.tp code { font-size: 26px; font-weight: 700; letter-spacing: .08em; font-family: ui-monospace, Consolas, monospace; }

/* tài khoản */
.user { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.user:first-of-type { border-top: 0; }
.user .who b { display: block; }
.user .who span { color: var(--muted); font-size: 13px; }
.user .ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; grid-column: 1 / -1; }
.user .ctl select, .user .ctl input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--surface); max-width: 100%; }
.pill { font-size: 12px; border-radius: 999px; padding: 1px 8px; background: var(--soft); color: var(--sub); }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.disabled { background: var(--danger-soft); color: var(--danger); }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--black); color: #fff; padding: 9px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; }

.menu { position: absolute; right: 16px; top: 48px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); min-width: 220px; padding: 6px; z-index: 20; }
.menu .hd { padding: 8px 10px; font-size: 13px; color: var(--sub); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--hover); }

@media (max-width: 560px) {
  .card .v { font-size: 19px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
