/* Unicold - Quản lý thiết bị & bảo trì */
:root {
    --brand: #00a3e0;
    --brand-600: #0088bd;
    --brand-50: #e6f6fc;
    --navy: #0f2a44;
    --navy-2: #163a5c;
    --bg: #f3f5f8;
    --surface: #ffffff;
    --border: #e2e7ee;
    --border-strong: #cfd7e2;
    --text: #1d2939;
    --muted: #667085;
    --green: #12805c; --green-bg: #e3f5ee;
    --amber: #a15c07; --amber-bg: #fdf1dc;
    --red: #c0322b; --red-bg: #fdeceb;
    --blue: #1f5fbf; --blue-bg: #e8effb;
    --gray: #475467; --gray-bg: #eef1f5;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --sidebar-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; color: var(--text); }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, "SF Mono", Menlo, monospace; font-size: 13px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 4px } .mt-2 { margin-top: 8px } .mt-3 { margin-top: 16px } .mt-4 { margin-top: 24px }
.mb-2 { margin-bottom: 8px } .mb-3 { margin-bottom: 16px }
.hidden { display: none !important; }
.pre-line { white-space: pre-line; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: var(--sidebar-w); background: var(--navy); color: #c9d6e3;
    display: flex; flex-direction: column;
    transition: transform .2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand img { height: 30px; background: #fff; border-radius: 6px; padding: 3px 6px; }
.sidebar-brand span { font-size: 12px; line-height: 1.3; color: #9fb3c8; }
.nav { padding: 10px 10px 20px; overflow-y: auto; flex: 1; }
.nav-section { margin: 14px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7890a8; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px; color: #d4e0ec; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .count { margin-left: auto; background: #f59e0b; color: #1d2939; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    height: 58px; padding: 0 24px;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar .menu-toggle { display: none; }
.topbar-spacer { flex: 1; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--brand-50); color: var(--brand-600); font-weight: 700; font-size: 13px;
}
.user-meta { line-height: 1.2; }
.user-meta strong { display: block; font-size: 13px; }
.user-meta span { font-size: 12px; color: var(--muted); }
main.content { padding: 24px; max-width: 1400px; width: 100%; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.backdrop { display: none; }

@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 35; }
    .main { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .topbar .menu-toggle { display: inline-flex; }
    main.content { padding: 16px; }
    .user-meta { display: none; }
}

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-body { padding: 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 2px; line-height: 1.2; }
.stat .hint { font-size: 12.5px; margin-top: 4px; }
.stat.accent-red .value { color: var(--red); }
.stat.accent-amber .value { color: var(--amber); }
.stat.accent-green .value { color: var(--green); }
.stat.accent-blue .value { color: var(--brand-600); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: #f9fafb; white-space: nowrap; }
.table tbody tr:hover { background: #fafbfd; }
.table tbody tr:last-child td { border-bottom: none; }
.table .cell-title { font-weight: 600; color: var(--text); }
.table .cell-sub { font-size: 12.5px; color: var(--muted); }
.table td > svg { width: 18px; height: 18px; vertical-align: middle; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

dl.details { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { dl.details { grid-template-columns: 1fr; gap: 2px; } dl.details dd { margin-bottom: 8px; } }

/* ---------- Badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { color: var(--green); background: var(--green-bg); }
.badge-amber { color: var(--amber); background: var(--amber-bg); }
.badge-red { color: var(--red); background: var(--red-bg); }
.badge-blue { color: var(--blue); background: var(--blue-bg); }
.badge-gray { color: var(--gray); background: var(--gray-bg); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--gray-bg); color: var(--gray); font-size: 12px; margin: 1px 2px 1px 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 14px; border-radius: 8px;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f5f7fa; text-decoration: none; }
.btn:focus-visible, .input:focus-visible { outline: 3px solid rgba(0, 163, 224, .35); outline-offset: 1px; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #0e6b4c; }
.btn-danger { color: var(--red); border-color: #f1c4c1; }
.btn-danger:hover { background: var(--red-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 30px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field label, .label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field .req { color: var(--red); }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field .error { font-size: 12.5px; color: var(--red); margin-top: 4px; }
.input, select.input, textarea.input {
    width: 100%; min-height: 38px; padding: 8px 11px;
    border: 1px solid var(--border-strong); border-radius: 8px; background: #fff;
    font: inherit; color: var(--text);
}
textarea.input { min-height: 84px; resize: vertical; }
.input.is-invalid { border-color: var(--red); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border); background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.filters .input { width: auto; min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tabs a { padding: 12px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand-600); border-color: var(--brand); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: var(--green-bg); border-color: #b5e3d0; color: #0b5b41; }
.alert-error { background: var(--red-bg); border-color: #f4c7c3; color: #8f231d; }
.alert-warning { background: var(--amber-bg); border-color: #f3d9a7; color: #7a4506; }
.alert-info { background: var(--blue-bg); border-color: #c5d6f3; color: #1b4a91; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert > svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span.page { min-width: 32px; height: 32px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 6px; border: 1px solid var(--border); color: var(--text); font-weight: 500; }
.pagination a:hover { background: #f5f7fa; text-decoration: none; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .disabled { opacity: .45; }

/* ---------- Checklist (thực hiện bảo trì) ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); align-items: start; }
.checklist-item:last-child { border-bottom: none; }
.checklist-item .no { width: 28px; height: 28px; border-radius: 50%; background: var(--gray-bg); color: var(--gray); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.checklist-item.is-pass .no { background: var(--green-bg); color: var(--green); }
.checklist-item.is-fail .no { background: var(--red-bg); color: var(--red); }
.checklist-item .ci-content { font-weight: 600; }
.checklist-item .guide { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.checklist-item .note { margin-top: 8px; min-height: 34px; }
.checklist-item .extra-input { font-weight: 600; }
.result-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.result-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.result-toggle label { padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); user-select: none; margin: 0; }
.result-toggle label + input + label { border-left: 1px solid var(--border-strong); }
.result-toggle input:focus-visible + label { outline: 3px solid rgba(0,163,224,.35); outline-offset: -3px; }
.result-toggle input[value="pass"]:checked + label { background: var(--green); color: #fff; }
.result-toggle input[value="fail"]:checked + label { background: var(--red); color: #fff; }
@media (max-width: 640px) {
    .checklist-item { grid-template-columns: 28px minmax(0, 1fr); }
    .checklist-item .result-col { grid-column: 2; }
    .result-toggle label { padding: 10px 18px; }
}
.progress { height: 8px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); transition: width .2s; }

/* ---------- Signature pad ---------- */
.sig-box { border: 1.5px dashed var(--border-strong); border-radius: 10px; background: #fff; position: relative; touch-action: none; }
.sig-box canvas { display: block; width: 100%; height: 190px; cursor: crosshair; border-radius: 10px; }
.sig-box .sig-hint { position: absolute; inset: auto 0 12px; text-align: center; color: #b0b8c4; pointer-events: none; font-size: 13px; }
.sig-box .sig-line { position: absolute; left: 10%; right: 10%; bottom: 40px; border-bottom: 1px solid #e5e9ef; pointer-events: none; }
.sig-preview { display: inline-flex; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.sig-preview img { max-height: 80px; max-width: 260px; }
.sig-options { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }

@media (min-width: 1101px) { .sticky-desktop { position: sticky; top: 74px; } }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12px; color: var(--muted); }

.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.file-list li:last-child { border-bottom: none; }
.file-list .thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--gray-bg); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--gray); flex: none; }
.file-list .meta { min-width: 0; flex: 1; }
.file-list .meta a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ---------- Modal (dialog) ---------- */
dialog.modal { border: none; border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
dialog.modal .card-head { border-bottom: 1px solid var(--border); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(135deg, #0f2a44 0%, #164a73 60%, #0088bd 100%); }
.auth-card { width: min(400px, 100%); background: #fff; border-radius: 14px; padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card .logo { display: block; height: 46px; margin: 0 auto 8px; }
.auth-card h1 { text-align: center; font-size: 18px; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }
.auth-card .btn { width: 100%; height: 42px; }

/* =====================================================================
   MOBILE
   ===================================================================== */
.bottom-nav, .mobile-bar, .filters-toggle, .topbar-brand { display: none; }

@media (max-width: 960px) {
    .topbar-brand { display: flex; align-items: center; }
    .topbar-brand img { height: 26px; }

    /* Thanh điều hướng dưới màn hình */
    .bottom-nav {
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        background: var(--surface); border-top: 1px solid var(--border);
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 10px rgba(16, 24, 40, .06);
    }
    .bottom-nav a, .bottom-nav button {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 6px 2px; border: 0; background: none; font: inherit;
        font-size: 11px; font-weight: 600; color: var(--muted); position: relative; cursor: pointer;
    }
    .bottom-nav a:hover { text-decoration: none; }
    .bottom-nav svg { width: 22px; height: 22px; }
    .bottom-nav .active { color: var(--brand-600); }
    .bottom-nav .count { position: absolute; top: 2px; left: calc(50% + 6px); background: #f59e0b; color: #1d2939; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 8px; }
    body.has-bottom-nav main.content { padding-bottom: 84px; }
}

@media (max-width: 720px) {
    body { font-size: 15px; }
    h1 { font-size: 19px; }
    main.content { padding: 12px; }
    .page-head { margin-bottom: 14px; gap: 10px; }
    .page-head > .btn, .page-head .actions { width: 100%; }
    .page-head .actions .btn { flex: 1 1 auto; }
    .card-head { padding: 12px 14px; }
    .card-body { padding: 14px; }
    .form-actions { padding: 12px 14px; }
    .form-actions .btn { flex: 1; }
    .btn { height: 40px; }
    .btn-sm { height: 34px; }
    .btn-sm.btn-icon { width: 34px; }
    /* Chống iOS tự phóng to khi nhập liệu */
    .input, select.input, textarea.input { font-size: 16px; min-height: 42px; }
    .alert { padding: 10px 12px; }

    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat { padding: 12px 14px; }
    .stat .value { font-size: 22px; }
    .stat .label, .stat .hint { font-size: 12px; }

    /* Bộ lọc thu gọn */
    .filters { padding: 12px 14px; gap: 8px; }
    .filters .input { min-width: 0; width: 100%; flex: 1 1 100%; }
    .filters .grow { flex: 1 1 0; min-width: 0; }
    .filters > .input:not(.grow) { display: none; }
    .filters.open > .input:not(.grow) { display: block; flex: 1 1 calc(50% - 4px); }
    .filters-toggle { display: inline-flex; }
    .filters > button:not(.filters-toggle) { order: 5; }
    .filters.open > button:not(.filters-toggle) { flex: 1 1 100%; }

    /* Bảng danh sách -> dạng thẻ */
    table.table-cards thead { display: none; }
    table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: 100%; }
    table.table-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
    table.table-cards tbody tr:hover { background: none; }
    table.table-cards td { padding: 3px 0; border: 0; text-align: left !important; white-space: normal; }
    table.table-cards td[data-label]:not([data-label=""]):not(:first-child) {
        display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: baseline; text-align: right !important;
    }
    table.table-cards td[data-label]:not([data-label=""]):not(:first-child)::before {
        content: attr(data-label); grid-column: 1; grid-row: 1 / span 5; color: var(--muted); font-size: 12px; font-weight: 600;
        text-transform: uppercase; letter-spacing: .02em; text-align: left;
    }
    table.table-cards td[data-label]:not([data-label=""]):not(:first-child) > * { grid-column: 2; justify-self: end; }
    table.table-cards td:first-child .cell-sub { display: inline; margin-left: 6px; }
    table.table-cards td:first-child { padding-bottom: 6px; }
    table.table-cards td:first-child::before { display: none; }
    table.table-cards td:first-child { display: block !important; font-size: 15px; }
    table.table-cards td:last-child:empty { display: none; }
    table.table-cards td.cell-actions { display: flex !important; flex-wrap: wrap; gap: 6px; justify-content: flex-start; padding-top: 8px; }
    table.table-cards td.cell-actions::before { display: none; }
    table.table-cards td.cell-actions .btn { flex: 1 1 auto; }
    table.table-cards td.cell-actions form.inline { display: contents; }
    table.table-cards td.empty { text-align: center !important; }
    table.table-cards td.empty::before { display: none; }

    .pagination { justify-content: center; }
    .pagination > span.muted { width: 100%; text-align: center; }

    dialog.modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }

    /* Checklist trên điện thoại */
    .checklist-item { padding: 12px 14px; gap: 10px; }
    .result-toggle { display: flex; width: 100%; }
    .result-toggle label { flex: 1; text-align: center; padding: 11px 8px; font-size: 15px; }
    .sig-box canvas { height: 170px; }

    /* Thanh thao tác cố định ở trang checklist */
    .mobile-bar {
        display: flex; align-items: center; gap: 8px;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
        background: var(--surface); border-top: 1px solid var(--border);
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 10px rgba(16, 24, 40, .08);
    }
    .mobile-bar .mb-progress { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
    .mobile-bar .mb-progress .progress { margin-top: 4px; }
    body.has-mobile-bar main.content { padding-bottom: 90px; }
    body.has-mobile-bar .bottom-nav { display: none; }
}
#sign-card, #approve { scroll-margin-top: 70px; }
@media (min-width: 721px) { .table td:has(> .cell-title) { min-width: 180px; } .table td.nowrap:has(> .cell-title) { min-width: 0; } }

/* Chọn cách ký */
.seg { display: flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.seg label { flex: 1; text-align: center; padding: 9px 8px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg label + label { border-left: 1px solid var(--border-strong); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--brand-50); color: var(--brand-600); }
.seg label:has(input:focus-visible) { outline: 3px solid rgba(0, 163, 224, .35); outline-offset: -3px; }
.paper-steps { margin: 0 0 12px; padding-left: 20px; }
.paper-steps li { margin-bottom: 8px; }
.mb-0 { margin-bottom: 0; }
