/*
 * VisaFlow — bản port nguyên văn design-prototype/styles.css
 * Toàn bộ rule được scope dưới .vf để cách ly khỏi Bootstrap của app.
 * Chỉ giữ những primitive dùng trong ApplicantListV2 (list + offcanvas + modal + workflow),
 * bỏ layout sidebar/main/brand/nav/channels/intake/pp-tabs không dùng ở trang này.
 */

:root {
    /* Palette */
    --vf-nav-bg: #101728;
    --vf-nav-bg-2: #0b101d;

    --page-bg: #f3f5f9;
    --card-bg: #ffffff;
    --border: #e5e9f0;
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-soft: #9ca3af;

    --primary: #2563eb;
    --primary-soft: #eff4ff;
    --green: #16a34a;
    --green-soft: #ecfdf3;
    --amber: #d97706;
    --amber-soft: #fef6e7;
    --red: #dc2626;
    --red-soft: #fdecec;
    --purple: #7c3aed;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
    --shadow-pop: 0 20px 45px rgba(16, 24, 40, 0.22);
}

.vf, .vf * { box-sizing: border-box; }

.vf {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    font-size: 14px;
}

/* ---------- Page header ---------- */
.vf .page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 18px;
}
.vf .page-head h1 { font-size: 22px; margin: 0 0 4px; font-weight: 700; }
.vf .page-head p { margin: 0; color: var(--text-muted); font-size: 13px; }
.vf .page-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Buttons ---------- */
.vf .btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 15px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    background: #fff; color: var(--text);
    text-decoration: none;
}
.vf .btn i { font-size: 15px; }
.vf .btn-primary { background: var(--primary); color: #fff; }
.vf .btn-primary:hover { background: #1d4ed8; }
.vf .btn-light { background: #fff; border-color: var(--border); color: var(--text); }
.vf .btn-light:hover { background: #f8fafc; }
.vf .btn-sm { padding: 6px 11px; font-size: 12px; }
.vf .btn-danger-soft { background: var(--red-soft); color: var(--red); }
.vf .btn-ghost { background: transparent; color: var(--text-muted); }
.vf .btn-ghost:hover { background: #f1f5f9; }

/* ---------- Cards ---------- */
.vf .card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.vf .card-pad { padding: 18px; }

/* Filter bar */
.vf .filter-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}
.vf .field label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-muted); margin-bottom: 6px;
}
.vf .input, .vf .select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 13px; color: var(--text);
    background: #fff;
}
.vf .input:focus, .vf .select:focus { outline: none; border-color: var(--primary); }
.vf .input-icon { position: relative; }
.vf .input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-soft); }
.vf .input-icon .input { padding-left: 34px; }

/* Table */
.vf .table-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; }
.vf .table-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.vf .table-head .count { color: var(--text-muted); font-size: 12px; }
.vf .list-meta { margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.vf .pagination { border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; color: var(--text-muted); font-size: 12px; }
.vf .pagination > div { display: inline-flex; gap: 4px; }
.vf .pagination button:disabled { cursor: default; opacity: .4; }
.vf table { width: 100%; border-collapse: collapse; }
.vf thead th {
    text-align: left; font-size: 11.5px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    background: #fafbfd;
}
.vf tbody td { padding: 13px 14px; border-bottom: 1px solid #f1f4f8; font-size: 13px; vertical-align: middle; }
.vf tbody tr:hover { background: #fafbff; }
.vf .applicant-name { font-weight: 600; }
.vf .entity-counts { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.vf .entity-counts i { width: 3px; height: 3px; border-radius: 50%; background: var(--text-soft); }
.vf .muted { color: var(--text-muted); }
.vf .mono { font-family: 'Consolas', monospace; font-size: 12.5px; }

/* Badges */
.vf .badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; line-height: 1.4;
}
.vf .badge i { font-size: 11px; }
.vf .b-blue { background: var(--primary-soft); color: var(--primary); }
.vf .online-status-cell { display: grid; gap: 4px; min-width: 0; }
.vf .online-status-badges { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.vf .online-status-badges .ms-1 { margin-left: 0 !important; }
.vf .b-green { background: var(--green-soft); color: var(--green); }
.vf .inbox-page { max-width: 1440px; }
.vf .inbox-page .page-head { margin-bottom: 18px; }
.vf .inbox-filters { margin-bottom: 12px; }
.vf .inbox-filters .filter-grid { grid-template-columns: minmax(260px, 1fr) 210px auto; margin-bottom: 0; }
.vf .inbox-unread { display: inline-flex; align-items: end; gap: 7px; padding-bottom: 9px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.vf .inbox-unread input,
.vf .inbox-select-all input,
.vf .inbox-row > input { accent-color: var(--primary); }
.vf .inbox-unread span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 11px; }
.vf .inbox-toolbar { display: flex; align-items: center; gap: 12px; min-height: 42px; margin-bottom: 10px; }
.vf .inbox-select-all { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.vf .inbox-bulk { display: flex; align-items: center; gap: 7px; margin-left: auto; font-size: 12px; color: var(--text-muted); }
.vf .inbox-workspace { display: grid; grid-template-columns: minmax(360px, .85fr) minmax(440px, 1.15fr); gap: 12px; min-height: 620px; }
.vf .inbox-list { overflow: hidden auto; max-height: calc(100vh - 280px); padding: 6px; }
.vf .inbox-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.vf .inbox-row:last-child { border-bottom: 0; }
.vf .inbox-row:hover { background: #fafbff; }
.vf .inbox-row.selected { background: var(--primary-soft); }
.vf .inbox-row.unread { box-shadow: inset 3px 0 0 var(--primary); }
.vf .inbox-row > input { margin-top: 4px; }
.vf .inbox-row-main { display: grid; min-width: 0; gap: 4px; }
.vf .inbox-row-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.vf .inbox-row-main small { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.vf .inbox-row-meta { display: flex; align-items: center; min-width: 0; gap: 5px; color: var(--text-muted); font-size: 11px; }
.vf .inbox-row-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf .inbox-row-meta time { margin-left: auto; white-space: nowrap; }
.vf .inbox-preview { display: flex; min-width: 0; flex-direction: column; overflow: hidden; }
.vf .inbox-preview-empty { display: grid; flex: 1; place-content: center; gap: 10px; color: var(--text-muted); text-align: center; }
.vf .inbox-preview-empty i { color: var(--text-soft); font-size: 36px; }
.vf .inbox-preview-head { display: flex; justify-content: space-between; gap: 14px; padding: 18px; border-bottom: 1px solid var(--border); }
.vf .inbox-preview-head h2 { margin: 8px 0 0; font-size: 17px; overflow-wrap: anywhere; }
.vf .inbox-preview-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: #fafbfd; }
.vf .inbox-preview-meta div { display: grid; min-width: 0; gap: 3px; }
.vf .inbox-preview-meta span { color: var(--text-muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.vf .inbox-preview-meta b, .vf .inbox-preview-meta small { overflow-wrap: anywhere; }
.vf .inbox-preview-meta small { color: var(--text-muted); font-size: 11px; }
.vf .inbox-preview-body { flex: 1; min-height: 360px; background: #f7f8fa; }
.vf .inbox-preview-body iframe { display: block; width: 100%; height: 100%; min-height: 460px; border: 0; background: #fff; }
.vf .inbox-preview-body pre { margin: 0; padding: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Agent management ---------- */
.vf .agent-management-page { max-width: 1440px; }
.vf .agent-key-alert { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid #f5d28d; border-radius: 8px; background: var(--amber-soft); }
.vf .agent-key-alert div { display: grid; gap: 2px; }
.vf .agent-key-alert span { color: var(--amber); font-size: 12px; }
.vf .agent-key-alert code { max-width: 58%; padding: 5px 8px; overflow: auto; border: 1px solid #f5d28d; border-radius: 5px; background: #fffaf0; color: #7c4a03; white-space: nowrap; }
.vf .agent-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.vf .agent-stat { display: flex; align-items: center; gap: 12px; padding: 14px; }
.vf .agent-stat > i { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 18px; }
.vf .agent-stat.amber > i { background: var(--amber-soft); color: var(--amber); }
.vf .agent-stat div { display: grid; gap: 2px; }
.vf .agent-stat span { color: var(--text-muted); font-size: 11.5px; }
.vf .agent-stat b { font-size: 20px; line-height: 1.1; }
.vf .agent-workspace { display: grid; gap: 14px; align-items: start; }
.vf .agent-control-stack { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 10px; min-width: 0; }
.vf .agent-section { overflow: hidden; }
.vf .agent-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 11px 14px 9px; border-bottom: 1px solid var(--border); }
.vf .agent-section-actions, .vf .agent-machine-actions { display: flex !important; align-items: center; gap: 7px; }
.vf .agent-section-head h2, .vf .agent-monitor h2 { margin: 0; font-size: 15px; font-weight: 700; }
.vf .agent-section-head p { margin: 3px 0 0; color: var(--text-muted); font-size: 11px; }
.vf .agent-empty { padding: 14px; margin: 0; color: var(--text-muted); font-size: 12px; text-align: center; }
.vf .agent-machine-list, .vf .agent-pending-list, .vf .agent-key-list { padding: 2px 10px 8px; }
.vf .agent-machine, .vf .agent-pending, .vf .agent-key-row { display: grid; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid #f1f4f8; }
.vf .agent-machine:last-child, .vf .agent-pending:last-child, .vf .agent-key-row:last-child { border-bottom: 0; }
.vf .agent-machine { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.vf .agent-machine-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 6px; background: var(--green-soft); color: var(--green); }
.vf .agent-machine div, .vf .agent-pending > div:first-child, .vf .agent-key-row > div { display: grid; min-width: 0; gap: 3px; }
.vf .agent-machine b, .vf .agent-pending b, .vf .agent-key-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.vf .agent-machine small, .vf .agent-pending small, .vf .agent-key-row small { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.vf .agent-pending { grid-template-columns: minmax(0, 1fr) auto; }
.vf .agent-pending code { overflow: hidden; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.vf .agent-pending > div:last-child { display: flex; gap: 7px; }
.vf .agent-upload { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 14px; }
.vf .agent-upload input[type=file] { padding: 5px; }
.vf .agent-upload div { min-width: 0; color: var(--text-muted); font-size: 12px; }
.vf .agent-upload b { display: block; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.vf .agent-upload small { margin-left: 5px; color: var(--text-muted); font-weight: 400; }
.vf .agent-create-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; padding: 9px 14px; border-bottom: 1px solid var(--border); background: #fafbfd; }
.vf .agent-key-row { grid-template-columns: minmax(0, 1fr) auto 100px auto; }
.vf .agent-key-row time { color: var(--text-muted); font-size: 11.5px; text-align: right; }
.vf .agent-monitor { display: flex; flex-direction: column; overflow: hidden; }
.vf .agent-monitor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 14px; border-bottom: 1px solid var(--border); }
.vf .agent-monitor-head span { display: block; margin-bottom: 5px; color: var(--green); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.vf .agent-monitor-head span i { margin-right: 4px; }
.vf .agent-log-empty { display: grid; flex: 1; place-content: center; gap: 8px; min-height: 280px; padding: 30px; color: var(--text-muted); text-align: center; font-size: 12px; }
.vf .agent-log-empty i { color: var(--text-soft); font-size: 32px; }
.vf .agent-log-empty b { color: var(--text); font-size: 13px; }
.vf .agent-log-stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 12px; padding: 12px; }
.vf .agent-log { display: grid; grid-template-rows: auto 1fr; height: 380px; overflow: hidden; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; }
.vf .agent-log { margin-bottom: 0; }
.vf .agent-log header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: #fafbfd; color: var(--text); font-size: 12px; font-weight: 700; }
.vf .agent-log header i { color: var(--primary); }
.vf .agent-log-title { display: flex; align-items: center; min-width: 0; gap: 8px; }
.vf .agent-log-title > i { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 6px; background: var(--primary-soft); }
.vf .agent-log-title span { display: grid; min-width: 0; gap: 1px; }
.vf .agent-log-title b, .vf .agent-log-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf .agent-log-title small { color: var(--text-muted); font-size: 10.5px; font-weight: 400; }
.vf .agent-log-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 5px; }
.vf .agent-log-actions .icon-action { width: 26px; height: 26px; }
.vf .agent-log-waiting { display: grid; align-content: center; justify-items: center; gap: 8px; min-height: 0; padding: 20px; color: var(--text-muted); text-align: center; font-size: 12px; }
.vf .agent-log-waiting i { color: var(--text-soft); font-size: 24px; }
.vf .agent-log pre { min-height: 0; height: auto; margin: 0; overflow: auto; padding: 12px; background: #111827; color: #d1d5db; font: 11px/1.55 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 1199px) {
    .vf .agent-stats { grid-template-columns: repeat(2, 1fr); }
    .vf .agent-log-stack { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
}

@media (max-width: 899px) {
    .vf .inbox-filters .filter-grid { grid-template-columns: minmax(0, 1fr) minmax(190px, .6fr) auto; }
    .vf .inbox-workspace { display: block; min-height: 0; }
    .vf .inbox-list { max-height: none; }
    .vf .inbox-preview { display: none; }
    .vf .inbox-preview.open { display: flex; position: fixed; z-index: 1060; inset: 0; border-radius: 0; }
    .vf .inbox-preview.open .inbox-preview-body { min-height: 0; overflow: auto; }
    .vf .inbox-preview.open .inbox-preview-body iframe { min-height: 100%; }
    .vf .agent-control-stack { grid-template-columns: 1fr; }
    .vf .agent-log-stack { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 767px) {
    .vf .inbox-page .page-head .btn { width: 100%; }
    .vf .inbox-filters { padding: 14px; }
    .vf .inbox-filters .filter-grid { grid-template-columns: 1fr; gap: 12px; }
    .vf .inbox-unread { align-items: center; padding-bottom: 0; }
    .vf .inbox-toolbar { flex-wrap: wrap; gap: 8px; }
    .vf .inbox-toolbar .muted { flex: 1; text-align: right; }
    .vf .inbox-bulk { width: 100%; margin-left: 0; padding-top: 8px; border-top: 1px solid var(--border); }
    .vf .inbox-bulk .btn { flex: 1; justify-content: center; min-height: 38px; }
    .vf .inbox-row { grid-template-columns: auto minmax(0, 1fr); padding: 12px 10px; }
    .vf .inbox-row > .badge { grid-column: 2; justify-self: start; }
    .vf .inbox-row-meta { flex-wrap: wrap; }
    .vf .inbox-row-meta > span:first-child { max-width: 100%; }
    .vf .inbox-row-meta time { margin-left: 0; }
    .vf .inbox-preview-head { padding: 14px; }
    .vf .inbox-preview-meta { grid-template-columns: 1fr; gap: 10px; padding: 12px 14px; }
    .vf .inbox-preview-body pre { padding: 14px; }
    .vf .agent-key-alert { align-items: stretch; flex-direction: column; }
    .vf .agent-key-alert code { max-width: 100%; }
    .vf .agent-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .vf .agent-stat { padding: 11px; gap: 9px; }
    .vf .agent-stat > i { width: 32px; height: 32px; font-size: 15px; }
    .vf .agent-stat b { font-size: 17px; }
    .vf .agent-section-head { padding: 14px; }
    .vf .agent-section-head .btn { flex: 0 0 auto; }
    .vf .agent-machine { grid-template-columns: auto minmax(0, 1fr) auto; }
    .vf .agent-machine .btn { grid-column: 2 / -1; justify-content: center; }
    .vf .agent-pending, .vf .agent-upload { grid-template-columns: 1fr; }
    .vf .agent-pending > div:last-child { justify-content: stretch; }
    .vf .agent-pending > div:last-child .btn, .vf .agent-upload .btn { flex: 1; justify-content: center; }
    .vf .agent-create-form { grid-template-columns: 1fr; padding: 14px; }
    .vf .agent-key-row { grid-template-columns: minmax(0, 1fr) auto auto; }
    .vf .agent-key-row time { display: none; }
    .vf .agent-log-stack { grid-template-columns: 1fr; }
}
.vf .b-amber { background: var(--amber-soft); color: var(--amber); }
.vf .b-red { background: var(--red-soft); color: var(--red); }
.vf .b-gray { background: #f1f4f8; color: #64748b; }
.vf .b-purple { background: #f3ecff; color: var(--purple); }
.vf .days-pill { background: var(--amber-soft); color: var(--amber); }

/* ---------- Modal ---------- */
.vf.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: flex-start; justify-content: center;
    padding: 48px 16px;
    z-index: 1080; overflow-y: auto;
}
.vf.modal-overlay.open { display: flex; }
.vf .modal {
    position: relative; visibility: visible;
    display: block; width: 100%; height: auto; inset: auto;
    background: #fff; max-width: 640px;
    border-radius: 16px; box-shadow: var(--shadow-pop);
    overflow: hidden;
}
.vf .modal.narrow { max-width: 560px; }
.vf .modal-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vf .modal-head h2 { margin: 0 0 3px; font-size: 17px; font-weight: 700; }
.vf .modal-head .sub { font-size: 12.5px; color: var(--text-muted); }
.vf .modal-close { background: none; border: none; font-size: 18px; color: var(--text-soft); cursor: pointer; line-height: 1; }
.vf .modal-body { padding: 18px 20px; max-height: 64vh; overflow-y: auto; }
.vf .modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Document preview modal */
.vf .modal.preview { max-width: 880px; }
.vf .doc-preview-body { padding: 0; max-height: 78vh; overflow-y: auto; background: #f1f5f9; }
.vf .doc-preview-scroll { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px; }
.vf .doc-preview-scroll img { max-width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shadow-pop); background: #fff; }
.vf .doc-preview-page { max-width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shadow-pop); background: #fff; }
.vf .doc-preview-loading, .vf .doc-preview-error { color: var(--text-muted); font-size: 13px; padding: 24px; text-align: center; }
.vf .doc-preview-error { color: var(--red); }
.vf .doc-preview-unsupported { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; color: var(--text-muted); }
.vf .doc-preview-unsupported i { font-size: 40px; color: var(--text-soft); }

.vf .summary-row { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 16px; }
.vf .summary-row b { color: var(--text); }

.vf .section-title { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.vf .section-title h4 { margin: 0; font-size: 13.5px; font-weight: 700; }

/* Document tiles grid */
.vf .doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.vf .doc-tile {
    border: 1px solid var(--border); border-radius: 12px; padding: 12px;
    display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
}
.vf .doc-tile:hover { border-color: var(--primary); background: var(--primary-soft); }
.vf .doc-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.vf .doc-ic.blue { background: var(--primary-soft); color: var(--primary); }
.vf .doc-ic.green { background: var(--green-soft); color: var(--green); }
.vf .doc-ic.amber { background: var(--amber-soft); color: var(--amber); }
.vf .doc-ic.purple { background: #f3ecff; color: var(--purple); }
.vf .doc-ic.red { background: var(--red-soft); color: var(--red); }
.vf .doc-tile .dt-name { font-weight: 600; font-size: 13px; }
.vf .doc-tile .dt-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* Attempt list */
.vf .attempt {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 14px; margin-bottom: 10px;
}
.vf .attempt .a-when { font-size: 12px; color: var(--text-muted); min-width: 92px; }
.vf .attempt .a-code { font-family: 'Consolas', monospace; font-size: 12px; color: var(--text); }
.vf .attempt .a-actions { margin-left: auto; }

/* Info boxes */
.vf .info-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.vf .info-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.vf .info-box .lbl { font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
.vf .info-box .val { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }

.vf .alert-red {
    background: var(--red-soft); border: 1px solid #f6cccc;
    border-radius: 12px; padding: 12px 14px; margin-bottom: 16px;
    font-size: 12.5px; color: #991b1b;
}
.vf .alert-red b { color: #7f1d1d; }
.vf .alert-info {
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: 12px; padding: 10px 12px;
    font-size: 12.5px; color: #1e40af;
    display: flex; align-items: center; gap: 6px;
}


/* Override rows */
.vf .ovr-row {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--border); border-radius: 12px;
    padding: 11px 14px; margin-bottom: 10px;
}
.vf .ovr-row .file-ic { width: 34px; height: 34px; border-radius: 8px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-size: 16px; }
.vf .ovr-row .f-name { font-weight: 600; font-size: 13px; }
.vf .ovr-row .f-meta { font-size: 11.5px; color: var(--text-muted); }
.vf .ovr-row .r-actions { margin-left: auto; display: flex; gap: 6px; }

/* Library grid */
.vf .lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.vf .lib-tile { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; }
.vf .lib-tile.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.vf .lib-thumb { height: 96px; background: #f1f4f8; display: grid; place-items: center; color: var(--text-soft); font-size: 30px; }
.vf .lib-thumb.pdf { background: #fef2f2; color: var(--red); }
.vf .lib-thumb.img { background: #eff6ff; color: var(--primary); }
.vf .lib-meta { padding: 9px 10px; }
.vf .lib-meta .ln { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vf .lib-meta .ls { font-size: 11px; color: var(--text-muted); }
.vf .lib-caption { margin-top: 14px; font-size: 12px; color: var(--text-muted); }
.vf .lib-caption b { color: var(--text); }

/* ---------- Kebab dropdown ---------- */
.vf .kebab { position: relative; display: inline-block; }
.vf .kebab-btn {
    border: 1px solid var(--border); background: #fff; color: var(--text-muted);
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
    display: inline-grid; place-items: center; font-size: 15px;
}
.vf .kebab-btn:hover { background: #f8fafc; color: var(--text); }
.vf .kebab-menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow-pop); padding: 6px; min-width: 210px; z-index: 30;
    display: none;
}
.vf .kebab.open .kebab-menu { display: block; }
.vf .kebab-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 8px;
    font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap;
    background: none; border: none; width: 100%; text-align: left;
}
.vf .kebab-item:hover { background: #f4f6fb; }
.vf .kebab-item i { font-size: 15px; width: 18px; text-align: center; color: var(--text-muted); }
.vf .kebab-item.danger, .vf .kebab-item.danger i { color: var(--red); }
.vf .kebab-item.success, .vf .kebab-item.success i { color: var(--green); }
.vf .kebab-sep { height: 1px; background: var(--border); margin: 5px 2px; }

/* ---------- Tabs: các lần xin visa ---------- */
.vf .app-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.vf .app-tab {
    border: 1px solid var(--border); background: #fff; border-radius: 999px;
    padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--text-muted);
    cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.vf .app-tab .cnt { background: #eef1f6; color: var(--text-muted); border-radius: 999px; padding: 0 7px; font-size: 11px; }
.vf .app-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.vf .app-tab.active .cnt { background: #dbe6ff; color: var(--primary); }

.vf .app-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; }
.vf .app-meta b { color: var(--text); }

/* ---------- Channel group (lượt nộp theo kênh) ---------- */
.vf .channel-group { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.vf .cg-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: #fafbfd; border-bottom: 1px solid var(--border);
}
.vf .cg-head .cg-title { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.vf .cg-head .cg-title i { color: var(--primary); }
.vf .cg-head.embassy .cg-title i { color: var(--green); }
.vf .sub-row {
    display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center;
    padding: 11px 14px; border-bottom: 1px solid #f1f4f8;
}
.vf .sub-row:last-child { border-bottom: none; }
.vf .sub-row .s-date { font-size: 12px; color: var(--text-muted); }
.vf .sub-row .s-main { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.vf .sub-row .s-code { font-family: 'Consolas', monospace; font-size: 11.5px; color: var(--text-muted); }
.vf .sub-row .s-actions { display: flex; align-items: center; gap: 6px; }
.vf .cg-foot { padding: 10px 14px; }
.vf .submission-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); background: #fafbfd; }
.vf .submission-editor[hidden] { display: none; }
.vf .submission-editor .full { grid-column: 1 / -1; }
.vf .submission-editor-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Timeline (lịch sử trạng thái) ---------- */
.vf .timeline { list-style: none; margin: 0; padding: 4px 0 0 4px; }
.vf .timeline li { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--border); }
.vf .timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.vf .timeline li::before {
    content: ""; position: absolute; left: -6px; top: 2px;
    width: 10px; height: 10px; border-radius: 50%; background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.vf .timeline li.red::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.vf .timeline li.green::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.vf .tl-head { display: flex; align-items: center; gap: 8px; }
.vf .tl-head .tl-status { font-weight: 600; font-size: 13px; }
.vf .tl-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.vf .history-filter { display: inline-flex; padding: 2px; border-radius: 6px; background: #eef1f6; }
.vf .history-filter button { border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); padding: 5px 7px; font-size: 11px; cursor: pointer; }
.vf .history-filter button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-card); }
.vf .history-stream { display: none; }
.vf .history-stream.active { display: block; }
.vf .history-code { margin-left: auto; color: var(--text-muted); font-family: Consolas, monospace; font-size: 10.5px; }

/* Source badge nhỏ */
.vf .src { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.vf .src.machine { background: #eef2ff; color: #4f46e5; }
.vf .src.human { background: #ecfdf3; color: var(--green); }

/* Sub-tabs (Tài liệu / Lượt nộp) */
.vf .seg { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.vf .seg button {
    border: none; background: none; padding: 7px 16px; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.vf .seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-card); }

/* Form thêm lượt nộp */
.vf .add-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; background: #fafbfd; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-top: 6px; }
.vf .add-form .full { grid-column: 1 / -1; }

/* Radio list tài khoản eVISA */
.vf .acc-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf0f4; background: #fff; text-align: left; color: var(--text); cursor: pointer; }
.vf .acc-row.selected { border-color: var(--primary); background: var(--primary-soft); }
.vf .acc-row > i { color: var(--text-soft); font-size: 17px; }
.vf .acc-row.selected > i { color: var(--primary); }
.vf .acc-row > span { display: grid; gap: 2px; }
.vf .acc-row b { font-size: 12.5px; }
.vf .acc-row small { color: var(--text-muted); font-size: 11.5px; }
.vf .acc-row em { margin-left: auto; font-style: normal; }

.vf .code-box { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.vf .code-box input {
    flex: 1; font-size: 20px; font-weight: 700; text-align: center; letter-spacing: 3px;
    border: 1px solid var(--border); border-radius: 10px; padding: 12px;
}

/* ---------- Warning badge (Chưa gán evisa) ---------- */
.vf .warn-pill { background: #fff4e5; color: #b45309; border: 1px dashed #f0b968; }

/* ---------- Offcanvas (Chuẩn bị & nộp) ---------- */
.vf.oc-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,0.4);
    display: none; z-index: 1060;
}
.vf.oc-overlay.open { display: block; }
.vf .offcanvas {
    visibility: visible;
    position: fixed; top: 0; right: 0; left: auto; bottom: auto; height: 100vh; width: 560px; max-width: 94vw;
    background: #fff; box-shadow: var(--shadow-pop); z-index: 1061;
    display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .2s ease;
    border: none;
}
.vf.oc-overlay.open .offcanvas { transform: translateX(0); }
.vf .oc-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; }
.vf .oc-head h2 { margin: 0 0 3px; font-size: 17px; font-weight: 700; }
.vf .oc-head .sub { font-size: 12.5px; color: var(--text-muted); }
.vf .oc-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.vf .oc-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; }

.vf .current-application { margin: -2px 0 16px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfd; }
.vf .case-breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11.5px; }
.vf .case-breadcrumb i { color: var(--text-soft); font-size: 12px; }
.vf .case-breadcrumb i:first-child, .vf .case-breadcrumb i:nth-of-type(3) { color: var(--primary); font-size: 14px; }
.vf .current-application-main { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 7px; }
.vf .current-application-main > div { display: grid; gap: 2px; }
.vf .current-application-main span { color: var(--text-muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.vf .current-application-main b { font-size: 14px; }
.vf .current-application-main small { color: var(--text-muted); font-size: 11.5px; }
.vf .case-switcher { position: relative; flex-shrink: 0; }
.vf .case-switcher summary { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); background: #fff; cursor: pointer; list-style: none; }
.vf .case-switcher summary::-webkit-details-marker { display: none; }
.vf .case-switcher[open] summary { color: var(--primary); border-color: var(--primary); }
.vf .case-switcher > div { position: absolute; right: 0; top: 36px; z-index: 10; min-width: 228px; padding: 5px; border: 1px solid var(--border); border-radius: 7px; background: #fff; box-shadow: var(--shadow-pop); }
.vf .case-switcher button { display: block; width: 100%; padding: 8px 9px; border: 0; border-radius: 5px; background: transparent; text-align: left; color: var(--text); cursor: pointer; font-size: 11.5px; }
.vf .case-switcher button:hover { background: var(--primary-soft); color: var(--primary); }
.vf .case-switcher-sep { height: 1px; margin: 4px 3px; background: var(--border); }
.vf .case-switcher .case-new { color: var(--primary); font-weight: 600; }
.vf .case-switcher-row { display: flex; align-items: center; gap: 2px; }
.vf .case-switcher-row > button:first-child { flex: 1; }
.vf .case-switcher-row.is-current > button:first-child { font-weight: 700; color: var(--primary); }
.vf .case-switcher-row .case-del { width: 28px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; color: var(--text-muted); }
.vf .case-switcher-row .case-del:hover { background: #fde8e8; color: #c0392b; }

.vf .workspace-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 18px; }
.vf .workspace-tab { border: none; border-bottom: 2px solid transparent; background: none; padding: 9px 10px; color: var(--text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.vf .workspace-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.vf .workspace-tab span { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: #eef1f6; font-size: 10.5px; }
.vf .workspace-tab .tab-readiness { margin-left: 2px; padding: 0 5px; font-weight: 700; }
.vf .workspace-tab .tab-readiness.warning { background: var(--amber-soft); color: #a16207; }
.vf .workspace-tab .tab-readiness.complete { background: var(--green-soft); color: var(--green); }
.vf .workspace-view { display: none; }
.vf .workspace-view.active { display: block; }
.vf .sync-choice { display: flex; gap: 9px; align-items: flex-start; margin-top: 14px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.vf .sync-choice input { margin-top: 2px; }
.vf .sync-choice small { display: block; margin-top: 3px; color: var(--text-muted); }
.vf .agent-state { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.vf .agent-state i { grid-row: span 2; color: var(--text-soft); font-size: 17px; }
.vf .agent-state small { color: var(--text-muted); }
.vf .agent-state.clickable { width: 100%; text-align: left; background: #ecfdf3; border-color: #a6e9c1; cursor: pointer; transition: background .15s, box-shadow .15s; }
.vf .agent-state.clickable:hover:not(:disabled) { background: #d7f7e3; box-shadow: 0 1px 4px rgba(16,124,58,.18); }
.vf .agent-state.clickable:disabled { cursor: default; opacity: .75; }
.vf .agent-state.ready { background: #ecfdf3; border-color: #a6e9c1; }
.vf .agent-state.ready i, .vf .agent-state.ready b { color: #107c3a; }
.vf .agent-schedule-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.vf .agent-schedule-row .agent-schedule-time { flex: 1 1 auto; font-size: 12px; }
.vf .agent-schedule-row .agent-schedule-btn { flex: 0 0 auto; white-space: nowrap; }
.vf .document-level { display: flex; align-items: center; gap: 7px; margin: 12px 0 8px; font-size: 11.5px; color: var(--text-muted); }
.vf .document-level .lv-tag { padding: 2px 8px; border-radius: 999px; font-size: 10.5px; }
.vf .doc-tile { position: relative; }
.vf .doc-tile .icon-action { margin-left: auto; }
.vf .icon-action { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text-muted); cursor: pointer; }
.vf .icon-action:hover { color: var(--primary); border-color: var(--primary); }
.vf .icon-action.danger:hover { color: var(--red); border-color: var(--red); }
.vf .submission-override { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.vf .submission-override small { display: block; color: var(--text-muted); margin-top: 3px; }
.vf .document-context { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfd; margin-bottom: 10px; font-size: 12.5px; }
.vf .document-context > div { display: grid; gap: 3px; }
.vf .document-context small { color: var(--text-muted); }
.vf .document-context .lv-tag { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; }
.vf .document-manager { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.vf .thumb-tile { display: grid; grid-template-columns: 1fr; gap: 0; min-width: 0; padding: 7px; border-radius: 8px; cursor: default; }
.vf .thumb-tile:hover { background: #fff; }
.vf .thumb-tile .icon-action { position: absolute; top: 12px; right: 12px; margin: 0; opacity: 0; }
.vf .thumb-tile:hover .icon-action, .vf .thumb-tile:focus-within .icon-action { opacity: 1; }
.vf .doc-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1.38 / 1; overflow: hidden; border-radius: 5px; color: #fff; font-size: 29px; }
.vf .doc-thumb::after { content: ""; position: absolute; inset: auto 9px 8px; height: 2px; background: rgba(255,255,255,.55); box-shadow: 0 -7px 0 rgba(255,255,255,.28); }
.vf .doc-thumb span { position: absolute; top: 7px; left: 7px; padding: 2px 4px; border-radius: 3px; background: rgba(15,23,42,.52); color: #fff; font-family: Consolas, monospace; font-size: 8px; font-weight: 700; }
.vf .passport-thumb { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.vf .portrait-thumb { background: linear-gradient(135deg, #2563eb, #7dd3fc); }
.vf .portrait-thumb::before { content: ""; position: absolute; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.3); }
.vf .portrait-thumb i { position: relative; z-index: 1; }
.vf .vaccine-thumb { background: linear-gradient(135deg, #16a34a, #86efac); }
.vf .stay-thumb { background: linear-gradient(135deg, #d97706, #fcd34d); }
.vf .flight-thumb { background: linear-gradient(135deg, #0f766e, #67e8f9); }
.vf .empty-thumb { border: 1px dashed #e29393; background: var(--red-soft); color: var(--red); }
.vf .empty-thumb::after { display: none; }
.vf .doc-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; padding: 7px 1px 1px; min-width: 0; }
.vf .doc-caption .dt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.vf .doc-caption .dt-meta { flex-shrink: 0; font-size: 10px; }
.vf .doc-tile.missing { border-style: dashed; }
.vf .doc-tile.missing .dt-meta { color: var(--red); }
.vf .submission-context { border-color: #f4dcae; background: var(--amber-soft); }
.vf .override-manager { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.vf .submission-override-panel { margin: -1px 10px 10px; padding: 12px; border: 1px solid #f0b968; border-radius: 0 0 8px 8px; background: #fffaf0; }
.vf .submission-override-panel[hidden] { display: none; }
.vf .submission-override-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.vf .submission-override-head > div { display: grid; gap: 4px; }
.vf .submission-override-head b { font-size: 12.5px; }
.vf .submission-override-head small { color: var(--text-muted); font-size: 11.5px; }
.vf .override-count { display: inline-grid; min-width: 16px; height: 16px; place-items: center; margin-left: 3px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-weight: 700; }
.vf .thumb-tile.inherited { border-style: dashed; }
.vf .thumb-tile.overridden { border-color: #e9c26b; box-shadow: inset 0 2px 0 var(--amber); }
.vf .thumb-tile.inherited .dt-meta { color: var(--text-muted); }
.vf .thumb-tile.overridden .dt-meta { color: var(--amber); font-weight: 700; }
@media (max-width: 420px) { .vf .document-manager, .vf .override-manager { grid-template-columns: repeat(2, 1fr); } }
.vf .inline-error { display: none; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 12px; border: 1px solid #f6cccc; border-radius: 8px; background: var(--red-soft); color: #991b1b; font-size: 12px; }
.vf .inline-error.show { display: flex; }
.vf .inline-error .btn { margin-left: auto; flex-shrink: 0; }
.vf .account-picker { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.vf .account-picker-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.vf .account-picker-head > div { display: grid; gap: 2px; font-size: 12.5px; }
.vf .account-picker-head small { color: var(--text-muted); font-size: 11.5px; }
.vf .account-filters { display: grid; grid-template-columns: 1fr 150px; gap: 8px; padding: 10px 12px; background: #fafbfd; border-bottom: 1px solid var(--border); }
.vf .account-search { position: relative; }
.vf .account-search i { position: absolute; left: 10px; top: 9px; color: var(--text-soft); }
.vf .account-search .input { padding-left: 30px; }
.vf .account-results { max-height: 250px; overflow-y: auto; }
.vf .account-results-foot { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 11.5px; }
.vf .provision-form { margin-top: 12px; border: 1px solid var(--primary); border-radius: 8px; padding: 12px; background: #fbfdff; }
.vf .provision-status { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-items: start; margin-top: 12px; padding: 12px; border: 1px solid #f0b968; border-radius: 8px; background: #fffaf0; font-size: 12px; }
.vf .provision-status[hidden] { display: none; }
.vf .provision-status-icon { grid-row: span 2; color: #b45309; font-size: 19px; }
.vf .provision-status > div:nth-child(2) { display: grid; gap: 3px; }
.vf .provision-status small { color: var(--text-muted); line-height: 1.45; }
.vf .provision-status-actions { grid-column: 2; margin-top: 4px; }
.vf .provision-head { display: flex; justify-content: space-between; gap: 10px; }
.vf .provision-head > div { display: grid; gap: 2px; font-size: 12.5px; }
.vf .provision-head small, .vf .provision-copy { color: var(--text-muted); font-size: 11.5px; }
.vf .mode-switch { display: flex; margin: 12px 0; padding: 3px; border-radius: 7px; background: #eef1f6; }
.vf .mode-switch button { flex: 1; border: 0; border-radius: 5px; padding: 7px 8px; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.vf .mode-switch button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-card); }
.vf .provision-intro { display: flex; gap: 10px; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 12px; }
.vf .registration-fields, .vf .manual-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.vf .registration-fields .full { grid-column: 1 / -1; }
.vf .provider-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; margin-top: 12px; }
.vf .provider-note { display: flex; gap: 7px; padding-bottom: 8px; color: var(--text-muted); font-size: 11.5px; }
.vf .provision-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.vf .provision-copy { margin: 0 0 12px; }
@media (max-width: 520px) { .vf .account-filters, .vf .registration-fields, .vf .manual-fields, .vf .provider-fields { grid-template-columns: 1fr; } .vf .provision-intro { align-items: flex-start; flex-direction: column; } }
.vf .resubmit-context { display: none; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 11px 12px; border: 1px solid #f4dcae; border-radius: 8px; background: var(--amber-soft); color: #805109; font-size: 12.5px; }
.vf .resubmit-context i { font-size: 17px; }
.vf .resubmit-context span { display: block; margin-top: 3px; color: #92600a; }
.vf .resubmit-context.show { display: flex; }

/* Stepper */
.vf .stepper { display: flex; align-items: center; gap: 4px; margin-bottom: 18px; }
.vf .step { display: flex; align-items: center; gap: 8px; flex: 1; }
.vf .step.clickable { cursor: pointer; }
.vf .step.clickable:hover .dot { border-color: var(--primary); }
.vf .step .dot {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center; font-size: 13px; font-weight: 700;
    background: #eef1f6; color: var(--text-muted); border: 2px solid transparent;
}
.vf .step.active .dot { background: var(--primary); color: #fff; }
.vf .step.done .dot { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.vf .step .st-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.vf .step.active .st-label { color: var(--text); }
.vf .step .st-line { flex: 1; height: 2px; background: var(--border); }
.vf .step.done .st-line { background: var(--green); }
.vf .stepper.resubmit .step.step-b { display: none; }

.vf .step-panel { display: none; }
.vf .step-panel.active { display: block; }
.vf .step-hint { background: var(--primary-soft); border-radius: 12px; padding: 12px 14px; font-size: 12.5px; color: #1e40af; margin-bottom: 14px; display: flex; gap: 8px; }
.vf .step-hint.warn { background: #fff4e5; color: #92600a; }
.vf .step-hint i { font-size: 15px; }

/* Ready state */
.vf .ready-box { text-align: center; padding: 24px 12px; }
.vf .ready-box .r-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 28px; margin: 0 auto 12px; }
.vf .ready-box h3 { margin: 0 0 6px; font-size: 16px; }
.vf .ready-box p { margin: 0; color: var(--text-muted); font-size: 13px; }

/* ---------- Document ownership levels ---------- */
.vf .lv-tag.passport { background: #f3ecff; color: var(--purple); }
.vf .lv-tag.application { background: var(--primary-soft); color: var(--primary); }
.vf .lv-tag.submission { background: var(--amber-soft); color: var(--amber); }

/* ---------- Intake form (ApplicantIntake) ---------- */
.vf .intake-wrap { max-width: 920px; margin: 0 auto; }
.vf .topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.vf .topbar .back { color: var(--text-muted); text-decoration: none; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.vf .topbar .back:hover { color: var(--text); }

.vf .ai-drop {
    border: 2px dashed #b9c4d6; border-radius: 14px; padding: 22px; text-align: center;
    background: linear-gradient(180deg, #f8fbff, #fff); margin-bottom: 18px;
}
.vf .ai-drop .ai-ic { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg,#3b82f6,#7c3aed); color: #fff; display: grid; place-items: center; font-size: 22px; margin: 0 auto 10px; }
.vf .ai-drop h3 { margin: 0 0 12px; font-size: 15px; }

/* Cac section co the thu gon (details.intake-section) */
.vf .intake-sections { margin-bottom: 14px; }
.vf .intake-section { margin-bottom: 14px; }
.vf .intake-section > summary {
    list-style: none; cursor: pointer; padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-size: 14px;
}
.vf .intake-section > summary::-webkit-details-marker { display: none; }
.vf .intake-section > summary::after { content: "\203A"; transform: rotate(90deg); font-size: 20px; color: var(--text-soft); transition: transform .15s; }
.vf .intake-section[open] > summary::after { transform: rotate(-90deg); }
.vf .intake-section > .card-body { padding: 4px 18px 18px; border-top: 1px solid var(--border); }

.vf .own-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin-bottom: 8px; }
.vf .own-head .lv-tag { padding: 2px 8px; border-radius: 999px; font-size: 10.5px; }

.vf .intake-actions {
    position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border);
    padding: 14px 0; display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px;
}

/* ---------- ApplicantListV2 responsive list ---------- */
@media (max-width: 899px) {
    .vf .filter-grid { grid-template-columns: 1.4fr 1fr; }

    .vf .applicant-list-table,
    .vf .applicant-list-table tbody,
    .vf .applicant-list-table tr,
    .vf .applicant-list-table td { display: block; }
    .vf .applicant-list-table thead { display: none; }
    .vf .applicant-list-table tbody { padding: 0 12px 12px; }
    .vf .applicant-list-table tbody tr {
        padding: 14px; margin-bottom: 8px; border: 1px solid var(--border);
        border-radius: 8px; background: #fff;
    }
    .vf .applicant-list-table tbody tr:hover { background: #fff; }
    .vf .applicant-list-table tbody td { padding: 0; border: 0; text-align: left !important; }
    .vf .applicant-list-table tbody td:nth-child(1) { margin: 0 42px 8px 0; font-size: 11.5px; }
    .vf .applicant-list-table tbody td:nth-child(2) { margin-bottom: 12px; }
    .vf .applicant-list-table tbody td:nth-child(3) { margin-bottom: 12px; }
    .vf .applicant-list-table tbody td:nth-child(4),
    .vf .applicant-list-table tbody td:nth-child(5) {
        display: grid; grid-template-columns: 64px minmax(0, 1fr);
        gap: 8px; align-items: start; margin: 8px 0;
    }
    .vf .applicant-list-table tbody td:nth-child(4)::before { content: "Online"; }
    .vf .applicant-list-table tbody td:nth-child(5)::before { content: "ĐSQ"; }
    .vf .applicant-list-table tbody td:nth-child(4)::before,
    .vf .applicant-list-table tbody td:nth-child(5)::before {
        padding-top: 3px; color: var(--text-muted); font-size: 11px;
        font-weight: 700; text-transform: uppercase;
    }
    .vf .applicant-list-table tbody td:nth-child(6) { display: inline-block; margin: 8px 0 12px; }
    .vf .applicant-list-table tbody td:nth-child(7) { border-top: 1px solid var(--border); padding-top: 12px; }
    .vf .applicant-list-table tbody td:nth-child(7) > div { display: flex !important; }
    .vf .applicant-list-table tbody td:nth-child(7) .btn { flex: 1; justify-content: center; min-height: 40px; }
    .vf .applicant-list-table tbody td:nth-child(7) .kebab { flex: 0 0 auto; }
    .vf .applicant-list-table .kebab-btn { width: 40px; height: 40px; }
    .vf .applicant-list-table .kebab-menu { bottom: calc(100% + 6px); top: auto; }
}

@media (max-width: 767px) {
    .vf .page-head { display: grid; gap: 14px; margin-bottom: 14px; }
    .vf .page-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .vf .page-head .btn { justify-content: center; min-height: 44px; }
    .vf .filter-card { padding: 14px; }
    .vf .filter-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 0; }
    .vf .table-head { align-items: flex-start; gap: 8px; padding: 14px 14px 10px; }
    .vf .table-head .count { max-width: 132px; text-align: right; line-height: 1.35; }
    .vf .applicant-list-table tbody { padding-right: 10px; padding-left: 10px; }
    .vf .applicant-list-table tbody td:nth-child(4),
    .vf .applicant-list-table tbody td:nth-child(5) { grid-template-columns: 58px minmax(0, 1fr); }
    .vf .applicant-list-table .kebab-btn { width: 42px; height: 42px; }
    .vf .pager { padding: 12px 14px; }
    .vf .pager .btn { min-height: 40px; }
}

/* ---------- VisaWorkspacePanel responsive ---------- */
@media (max-width: 767px) {
    .vf .visa-workspace-panel { inset: 0; width: auto; max-width: none; }
    .vf .visa-workspace-panel .oc-head,
    .vf .visa-workspace-panel .oc-body,
    .vf .visa-workspace-panel .oc-foot { padding-right: 14px; padding-left: 14px; }
    .vf .visa-workspace-panel .case-breadcrumb { flex-wrap: wrap; }
    .vf .visa-workspace-panel .current-application-main > div { min-width: 0; }
    .vf .visa-workspace-panel .workspace-tabs {
        overflow-x: auto; margin-right: -14px; margin-left: -14px;
        padding: 0 14px; scrollbar-width: thin;
    }
    .vf .visa-workspace-panel .workspace-tab { flex: 0 0 auto; white-space: nowrap; }
    .vf .visa-workspace-panel .section-title { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
    .vf .visa-workspace-panel .section-title h4 { flex: 1 1 130px; padding-top: 6px; }
    .vf .visa-workspace-panel .sub-row { grid-template-columns: 1fr; gap: 7px; }
    .vf .visa-workspace-panel .sub-row .s-date { order: 1; }
    .vf .visa-workspace-panel .sub-row .s-main { order: 2; min-width: 0; }
    .vf .visa-workspace-panel .sub-row .s-actions { order: 3; flex-wrap: wrap; }
    .vf .visa-workspace-panel .sub-row .s-actions .btn { min-height: 36px; }
    .vf .visa-workspace-panel .submission-editor,
    .vf .visa-workspace-panel .add-form { grid-template-columns: 1fr; }
    .vf .visa-workspace-panel .submission-editor .full,
    .vf .visa-workspace-panel .submission-editor-actions,
    .vf .visa-workspace-panel .add-form .full { grid-column: auto; }
    .vf .visa-workspace-panel .submission-editor-actions { justify-content: stretch; }
    .vf .visa-workspace-panel .submission-editor-actions .btn { flex: 1; justify-content: center; }
    .vf .visa-workspace-panel .agent-schedule-row { align-items: stretch; flex-direction: column; }
    .vf .visa-workspace-panel .agent-schedule-btn { justify-content: center; min-height: 42px; }
    .vf .visa-workspace-panel .oc-foot .btn { min-height: 42px; }
    .vf .visa-workspace-panel .oc-foot .btn:last-child { margin-left: auto; }
}

/* ---------- Workflow applicant lists responsive ---------- */
@media (max-width: 899px) {
    .vf .online-applicant-table,
    .vf .online-applicant-table tbody,
    .vf .online-applicant-table tr,
    .vf .online-applicant-table td,
    .vf .embassy-applicant-table,
    .vf .embassy-applicant-table tbody,
    .vf .embassy-applicant-table tr,
    .vf .embassy-applicant-table td,
    .vf .approved-visa-applicant-table,
    .vf .approved-visa-applicant-table tbody,
    .vf .approved-visa-applicant-table tr,
    .vf .approved-visa-applicant-table td,
    .vf .completed-applicant-table,
    .vf .completed-applicant-table tbody,
    .vf .completed-applicant-table tr,
    .vf .completed-applicant-table td { display: block; }

    .vf .online-applicant-table thead,
    .vf .embassy-applicant-table thead,
    .vf .approved-visa-applicant-table thead,
    .vf .completed-applicant-table thead { display: none; }

    .vf .online-applicant-table tbody,
    .vf .embassy-applicant-table tbody,
    .vf .approved-visa-applicant-table tbody,
    .vf .completed-applicant-table tbody { padding: 0 12px 12px; }

    .vf .online-applicant-table tbody tr,
    .vf .embassy-applicant-table tbody tr,
    .vf .approved-visa-applicant-table tbody tr,
    .vf .completed-applicant-table tbody tr {
        padding: 14px; margin-bottom: 8px; border: 1px solid var(--border);
        border-radius: 8px; background: #fff;
    }

    .vf .online-applicant-table tbody td,
    .vf .embassy-applicant-table tbody td,
    .vf .approved-visa-applicant-table tbody td,
    .vf .completed-applicant-table tbody td { padding: 0; border: 0; text-align: left !important; }

    .vf .online-applicant-table tbody td:first-child,
    .vf .embassy-applicant-table tbody td:first-child,
    .vf .approved-visa-applicant-table tbody td:first-child,
    .vf .completed-applicant-table tbody td:first-child { margin-bottom: 8px; font-size: 11.5px; }

    .vf .online-applicant-table tbody td:nth-child(2),
    .vf .embassy-applicant-table tbody td:nth-child(2),
    .vf .approved-visa-applicant-table tbody td:nth-child(2),
    .vf .completed-applicant-table tbody td:nth-child(2) { margin-bottom: 12px; }

    .vf .online-applicant-table tbody td:nth-child(n + 3):not(:last-child),
    .vf .embassy-applicant-table tbody td:nth-child(n + 3):not(:last-child),
    .vf .approved-visa-applicant-table tbody td:nth-child(n + 3):not(:last-child),
    .vf .completed-applicant-table tbody td:nth-child(n + 3):not(:last-child) {
        display: grid; grid-template-columns: 112px minmax(0, 1fr);
        gap: 8px; align-items: start; margin: 8px 0;
    }

    .vf .online-applicant-table tbody td:nth-child(3)::before { content: "Mã hồ sơ"; }
    .vf .online-applicant-table tbody td:nth-child(4)::before { content: "Tài khoản eVISA"; }
    .vf .online-applicant-table tbody td:nth-child(5)::before { content: "Ngày nộp"; }
    .vf .online-applicant-table tbody td:nth-child(6)::before { content: "Trạng thái Online"; }
    .vf .embassy-applicant-table tbody td:nth-child(3)::before { content: "Ngày sinh"; }
    .vf .embassy-applicant-table tbody td:nth-child(4)::before { content: "Ngày nộp ĐSQ"; }
    .vf .embassy-applicant-table tbody td:nth-child(5)::before { content: "Ngày in visa"; }
    .vf .embassy-applicant-table tbody td:nth-child(6)::before { content: "Trạng thái ĐSQ"; }
    .vf .approved-visa-applicant-table tbody td:nth-child(3)::before { content: "Mã hồ sơ"; }
    .vf .approved-visa-applicant-table tbody td:nth-child(4)::before { content: "Ngày in visa"; }
    .vf .approved-visa-applicant-table tbody td:nth-child(5)::before { content: "Trạng thái"; }
    .vf .completed-applicant-table tbody td:nth-child(3)::before { content: "Ngày hoàn tất"; }
    .vf .completed-applicant-table tbody td:nth-child(4)::before { content: "Kết quả"; }

    .vf .online-applicant-table tbody td:nth-child(n + 3):not(:last-child)::before,
    .vf .embassy-applicant-table tbody td:nth-child(n + 3):not(:last-child)::before,
    .vf .approved-visa-applicant-table tbody td:nth-child(n + 3):not(:last-child)::before,
    .vf .completed-applicant-table tbody td:nth-child(n + 3):not(:last-child)::before {
        padding-top: 3px; color: var(--text-muted); font-size: 11px;
        font-weight: 700; text-transform: uppercase;
    }

    .vf .online-applicant-table tbody td:last-child,
    .vf .embassy-applicant-table tbody td:last-child,
    .vf .approved-visa-applicant-table tbody td:last-child,
    .vf .completed-applicant-table tbody td:last-child { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }

    .vf .online-applicant-table tbody td:last-child > div,
    .vf .approved-visa-applicant-table tbody td:last-child > div,
    .vf .completed-applicant-table tbody td:last-child > div {
        display: flex !important; flex-wrap: wrap; gap: 8px !important;
    }

    .vf .online-applicant-table tbody td:last-child .btn,
    .vf .embassy-applicant-table tbody td:last-child .btn,
    .vf .approved-visa-applicant-table tbody td:last-child .btn,
    .vf .completed-applicant-table tbody td:last-child .btn { flex: 1 1 128px; justify-content: center; min-height: 40px; }
}
