/* HSVFE: giao diện hệ thống hồ sơ VFE, theo chuẩn nhận diện VFE (brand kit VFE-05, 13/11/2026) */
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url(/fonts/BeVietnamPro-Regular.ttf) format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url(/fonts/BeVietnamPro-Medium.ttf) format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url(/fonts/BeVietnamPro-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url(/fonts/BeVietnamPro-Bold.ttf) format("truetype"); }
@font-face { font-family: "Lora"; font-weight: 500; font-display: swap; src: url(/fonts/Lora-Medium.ttf) format("truetype"); }

:root {
  /* Màu thương hiệu VFE: navy chủ đạo, đỏ chỉ cho nút chính + điểm nhấn nhỏ, xanh phụ cho liên kết / tiến trình */
  --navy: #1b2350; --navy-hover: #343d69; --red: #c41c1c; --blue: #1f3da7;
  --ink: #242b40; --muted: #626a7c; --line: #dedfdc; --line-2: #ecebe7; --paper: #f7f6f2; --white: #fff;
  --head-bg: #f7f7f5; --tag-bg: #eef0f6; --note-bg: #f1f3f9;
  --green: #27634e; --green-bg: #eaf3ec; --amber: #805617; --amber-bg: #fff3d5;
  --gray-tag: #555d6d; --gray-tag-bg: #eeeeed; --red-text: #a61717; --red-bg: #fbeceb;
  --sans: "Be Vietnam Pro", Arial, sans-serif; --serif: "Lora", Georgia, serif;
  --r-btn: 5px; --r-card: 7px; --r-panel: 8px; --r-tag: 3px;
  --side: 220px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.65 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; text-wrap: balance; color: var(--navy); font-weight: 600; }
p { text-wrap: pretty; }
a { color: var(--blue); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.9px; text-transform: uppercase; color: var(--blue); margin-bottom: 8px; }
.boot { padding: 60px 20px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }
svg.i { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Khung: sidebar navy như admin VFE */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
.side { background: var(--navy); color: #d8dbea; padding: 28px 18px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: block; text-decoration: none; color: #fff; padding: 0 3px; }
.brand-logo { display: block; background: #fff; padding: 8px; border-radius: 4px; width: 150px; }
.brand-logo img { display: block; width: 100%; height: auto; }
.brand-sub { display: block; margin-top: 14px; font-size: 12px; line-height: 1.5; color: #d8dbea; }
.nav { margin-top: 30px; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 4px; color: #d8dbea; text-decoration: none; font-size: 12.5px; font-weight: 500; white-space: nowrap; min-height: 42px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: var(--navy-hover); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--red); }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 600; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 12px 4px; }
.side-foot { margin-top: auto; padding: 14px 4px 0; font-size: 12px; color: #b9bdd2; border-top: 1px solid rgba(255, 255, 255, .12); }
.side-foot b { color: #fff; display: block; font-size: 13px; font-weight: 600; }
.side-foot button { margin-top: 10px; background: none; border: 1px solid rgba(255, 255, 255, .28); color: #fff; border-radius: var(--r-btn); padding: 7px 12px; cursor: pointer; font-size: 12px; font-weight: 600; min-height: 36px; }
.main { min-width: 0; padding: 30px 32px 64px; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 27px; letter-spacing: -.7px; font-weight: 600; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Thành phần */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); }
.card-pad { padding: 22px 23px; }
.card h2 { font-size: 17px; font-weight: 600; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 22px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 17px; border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--white); color: var(--navy); font-weight: 600; font-size: 12.5px; line-height: 1.4; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #c4c6c2; background: #fbfbf9; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); }
.btn.cta { background: var(--red); border-color: var(--red); color: #fff; }
.btn.cta:hover { background: #a91818; border-color: #a91818; }
.btn.danger { color: var(--red-text); border-color: #ecc9c6; }
.btn.danger:hover { background: var(--red-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(27, 35, 80, .05); }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--r-tag); font-size: 11px; font-weight: 600; line-height: 1.5; background: var(--gray-tag-bg); color: var(--gray-tag); white-space: nowrap; }
.chip.navy { background: var(--tag-bg); color: var(--navy); }
.chip.red { background: var(--red-bg); color: var(--red-text); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.blue { background: var(--note-bg); color: var(--blue); }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: currentColor; }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); }
.note { border-left: 3px solid var(--blue); background: var(--note-bg); padding: 14px 18px; font-size: 12.5px; }
.note.warm { border-color: #b1832b; background: var(--amber-bg); }

/* Biểu mẫu */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--navy); min-width: 0; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=date], input[type=month], input[type=number], input[type=search], input[type=tel], select, textarea {
  width: 100%; min-width: 0; min-height: 42px; border: 1px solid #cdd0d6; border-radius: 4px; padding: 9px 11px; background: #fff; font-size: 13.5px; color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { background: #f6f6f3; color: var(--muted); }
textarea { resize: vertical; min-height: 76px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--navy); flex-shrink: 0; margin: 0; }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 400; font-size: 13px; color: var(--ink); cursor: pointer; min-height: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.filters select, .filters input:not([type=checkbox]) { width: auto; min-width: 130px; min-height: 38px; padding: 7px 10px; font-size: 13px; }
.filters input[type=search] { min-width: 220px; flex: 1; }

/* Bảng */
.table-wrap { overflow-x: auto; max-width: 100%; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 10px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); background: var(--head-bg); padding: 13px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 13px 13px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fafaf7; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.name-cell b { min-width: 150px; }
.name-cell b { display: block; font-weight: 600; color: var(--navy); text-wrap: pretty; }
.name-cell span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.bar { height: 6px; border-radius: 99px; background: #e9e9e5; overflow: hidden; min-width: 70px; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line-2); }

/* Ô số */
.stat { padding: 18px 20px; }
.stat .k { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--serif); font-size: 34px; font-weight: 500; color: var(--navy); margin-top: 4px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .v.red { color: var(--red); }
.stat .v.green { color: var(--green); }
.stat a { text-decoration: none; color: inherit; display: block; }
.stat:hover { border-color: #c4c6c2; }
.hbars { display: flex; flex-direction: column; gap: 11px; padding: 18px 22px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 200px) 1fr 40px; gap: 12px; align-items: center; font-size: 13px; }
.hbar:hover .lb { color: var(--blue); }
.hbar .lb { min-width: 0; text-wrap: pretty; line-height: 1.4; }
.hbar .tr { height: 10px; background: #ecebe6; border-radius: 99px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.hbar .n { text-align: right; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }

/* Hồ sơ chi tiết */
.case-head { padding: 22px 23px; display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; }
.case-head h1 { font-size: 27px; letter-spacing: -.7px; font-weight: 600; }
.case-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.case-meta b { color: var(--ink); font-weight: 600; }
.progress-big { min-width: 230px; }
.progress-big .bar { height: 8px; margin-top: 8px; }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); padding: 0 23px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; padding: 13px 0; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--navy); }
.tabs button.on { color: var(--navy); font-weight: 600; border-bottom-color: var(--red); }
.tabs button .chip { font-size: 10px; padding: 1px 6px; }
.tab-body { padding: 22px 23px; }
.phase { margin-bottom: 22px; }
.phase-h { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; margin-bottom: 8px; color: var(--navy); }
.phase-h .cnt { font-weight: 500; color: var(--muted); font-size: 12px; }
.step { border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 6px; background: #fff; }
.step-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 11px 14px; cursor: pointer; }
.step-row:hover { background: #fcfcfa; border-radius: var(--r-card); }
.step-row .t { font-weight: 500; color: var(--ink); text-wrap: pretty; }
.step-row .sub { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.step-row .due { text-align: right; font-size: 12.5px; white-space: nowrap; }
.step.done .t { color: var(--muted); text-decoration: line-through; text-decoration-color: #c2c4c9; }
.step.late { border-color: #ecc9c6; border-left: 3px solid var(--red); }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 1.6px solid #b8bcc6; background: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; margin-top: 1px; }
.tick:hover { border-color: var(--navy); }
.step.done .tick { background: var(--green); border-color: var(--green); }
.step.done .tick::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.step.doing .tick { border-color: var(--amber); background: var(--amber-bg); }
.step.skip .tick { border-style: dashed; }
.step.skip .t { color: var(--muted); }
.step-detail { border-top: 1px solid var(--line-2); padding: 14px 16px 16px 54px; display: grid; gap: 14px; }
.guide { white-space: pre-wrap; border-left: 3px solid var(--blue); background: var(--note-bg); padding: 12px 16px; font-size: 13px; color: var(--ink); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.anchors { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; background: #fbfaf7; border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px 18px; margin-bottom: 20px; }
.anchors .ah { grid-column: 1 / -1; font-weight: 600; font-size: 13.5px; color: var(--navy); }
.feed { display: flex; flex-direction: column; gap: 10px; }
.msg { border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; background: #fff; }
.msg.system { background: #fbfaf7; border-style: dashed; }
.msg.portal { border-left: 3px solid var(--blue); }
.msg .h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg .h b { color: var(--navy); font-size: 13px; font-weight: 600; }
.msg .b { white-space: pre-wrap; text-wrap: pretty; }
.docs-cat { margin-bottom: 18px; }
.docs-cat h3 { font-size: 13.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.doc { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 6px; background: #fff; flex-wrap: wrap; }
.doc .nm { font-weight: 500; color: var(--navy); flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.drop { border: 1.6px dashed #c4c6c2; border-radius: var(--r-panel); padding: 18px; text-align: center; color: var(--muted); background: #fff; }
.drop.over { border-color: var(--blue); background: var(--note-bg); }
.iv { border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; margin-bottom: 8px; background: #fff; }
.iv .h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.iv .h b { color: var(--navy); }
.iv-count { display: flex; gap: 6px; margin: 8px 0 16px; }
.iv-count i { width: 30px; height: 6px; border-radius: 99px; background: #e2e2de; }
.iv-count i.on { background: var(--blue); }

/* Hộp thoại */
.dlg-bg { position: fixed; inset: 0; background: rgba(27, 35, 80, .42); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.dlg { background: #fff; border-radius: var(--r-panel); width: 100%; max-width: 720px; box-shadow: 0 18px 50px rgba(27, 35, 80, .22); }
.dlg.narrow { max-width: 460px; }
.dlg-h { padding: 18px 23px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dlg-h h2 { font-size: 19px; }
.dlg-b { padding: 20px 23px; }
.dlg-f { padding: 14px 23px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; min-width: 36px; min-height: 36px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: var(--r-btn); font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 80; max-width: calc(100vw - 32px); text-align: center; }
#toast.on { opacity: 1; }
#toast.err { background: var(--red-text); }

/* Đăng nhập */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--paper); }
.login-art { background: var(--navy); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 320px; height: 320px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255, 255, 255, .03), 0 0 0 120px rgba(255, 255, 255, .025); }
.login-art .brand-logo { width: 174px; }
.login-art h2 { color: #fff; font-family: var(--serif); font-weight: 500; font-size: 38px; letter-spacing: -1px; line-height: 1.2; max-width: 440px; }
.login-art p { color: #c9cde0; max-width: 420px; margin: 14px 0 0; }
.login-art .eyebrow { color: #aab6f0; }
.login-art small { color: #9aa0bd; font-size: 11px; position: relative; z-index: 1; }
.login-box { display: grid; place-items: center; padding: 40px 24px; }
.login .card { width: 100%; max-width: 420px; padding: 32px 30px; }
.login h1 { font-size: 24px; letter-spacing: -.5px; margin: 0 0 6px; }
.login .card > p { color: var(--muted); margin: 0 0 20px; }
.login form { display: grid; gap: 14px; }
.login form p { margin: 0; }
.login .btn { min-height: 46px; }
.code-input { font-size: 26px !important; letter-spacing: .4em; text-align: center; font-weight: 600; color: var(--navy) !important; }

/* Mẫu quy trình */
.tpl-phase { border: 1px solid var(--line); border-radius: var(--r-panel); margin-bottom: 14px; background: #fff; }
.tpl-phase-h { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2); background: var(--head-bg); border-radius: var(--r-panel) var(--r-panel) 0 0; }
.tpl-step { padding: 12px 14px; border-bottom: 1px solid var(--line-2); display: grid; gap: 8px; }
.tpl-step:last-child { border-bottom: 0; }
.tpl-line { display: grid; grid-template-columns: 1fr 170px auto; gap: 8px; align-items: center; }
.rule-ed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.rule-ed select, .rule-ed input { width: auto; min-height: 34px; padding: 5px 8px; font-size: 12.5px; }
.rule-ed input[type=number] { width: 72px; }
.mini { font-size: 12px; color: var(--muted); }

/* Cổng học viên: kiểu trang công khai VFE (header trắng, logo, tiêu đề Lora) */
.portal-top { background: #fff; border-bottom: 1px solid var(--line); }
.portal-top-in { max-width: 920px; margin: 0 auto; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.portal-top img { width: 150px; height: auto; display: block; }
.portal-top .who { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
.portal-top .who b { color: var(--navy); font-weight: 600; }
.portal-main { max-width: 920px; margin: 0 auto; padding: 26px 18px 64px; display: grid; gap: 18px; }
.portal-main h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; letter-spacing: -1px; line-height: 1.2; }
.portal-foot { max-width: 920px; margin: 0 auto; padding: 0 18px 30px; font-size: 10.5px; color: var(--muted); }
.portal-foot a { color: var(--muted); }
.todo-item { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r-card); background: #fff; }
.todo-item b { color: var(--navy); font-weight: 600; }
.todo-item > div { flex: 1; min-width: 0; }
.todo-item > .btn, .todo-item > .chip { flex-shrink: 0; white-space: nowrap; }
.tl { display: grid; gap: 2px; }
.tl-step { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: start; font-size: 13.5px; padding: 5px 0; }
.tl-step .s { width: 15px; height: 15px; border-radius: 50%; border: 1.6px solid #b8bcc6; margin-top: 4px; }
.tl-step.done .s { background: var(--green); border-color: var(--green); }
.tl-step.doing .s { background: var(--amber-bg); border-color: var(--amber); }
.tl-step.done .tx { color: var(--muted); }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } .main { padding: 26px 24px 60px; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 262px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; position: sticky; top: 0; z-index: 30; }
  .topbar img { width: 120px; height: auto; display: block; }
  .topbar button { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); color: var(--navy); border-radius: var(--r-btn); padding: 8px 12px; min-height: 44px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
  .main { padding: 20px 16px 60px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .step-detail { padding-left: 16px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .tpl-line { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 110px 1fr 34px; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 26px 22px; gap: 18px; }
  .login-art h2 { font-size: 26px; }
  .login-art p, .login-art small { display: none; }
  .login-art .brand-logo { width: 135px; }
  .login-box { place-items: start center; padding: 24px 16px 40px; }
  .tabs { padding: 0 16px; gap: 22px; }
  .tab-body, .case-head, .card-pad { padding: 18px 16px; }
  .card-head, .filters, .pager { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 520px) {
  body { font-size: 13px; }
  .g4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 14px 14px; }
  .stat .v { font-size: 28px; }
  .page-head h1, .case-head h1 { font-size: 23px; }
  .portal-main h1 { font-size: 27px; }
  .portal-top img { width: 125px; }
  .todo-item { flex-direction: column; }
  .filters input[type=search] { min-width: 100%; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 36px; }
}
