/* ACCGEN Wave H5 — Desktop Document Workspace 2026. Presentation-only; H1-H4 and mobile remain unchanged. */
.accgen-h5-desktop-intro{display:none}
@media(min-width:1051px){
#view-main-layout #view-templates #templates-user-state{--h5-ink:#153a53;--h5-muted:#6b8396;--h5-border:#dbe7ee;--h5-accent:#078c9b;box-sizing:border-box;min-width:0;max-width:1500px}
#view-main-layout #view-templates #templates-user-state>.templates-workspace-page-header{display:flex;flex-direction:column;align-items:flex-start;gap:7px;box-sizing:border-box;margin:0 0 22px;padding:0 0 21px;border-bottom:1px solid var(--h5-border)}
#view-main-layout #view-templates #templates-user-state>.templates-workspace-page-header h2{margin:0;color:var(--h5-ink);font-size:clamp(25px,2.4vw,33px);font-weight:850;letter-spacing:-.038em;line-height:1.26}
#view-main-layout #view-templates #templates-user-state>.templates-workspace-page-header h2::before{content:"TÀI LIỆU  /  TRÌNH TẠO";display:block;margin:0 0 9px;color:var(--h5-accent);font-size:10px;font-weight:850;letter-spacing:.13em;line-height:1.3}
#view-main-layout #view-templates #templates-user-state .accgen-h5-desktop-intro{display:block;max-width:900px;margin:0;color:var(--h5-muted);font-size:12.5px;line-height:1.65}
#view-main-layout #view-templates #templates-user-state>.templates-workspace-panel{box-sizing:border-box;min-width:0;max-width:100%}
#view-main-layout #view-templates #templates-user-state>.templates-workspace-panel>.template-detail-card{box-sizing:border-box;min-width:0;max-width:100%;padding:25px 26px 26px!important;border:1px solid var(--h5-border);border-radius:15px!important;background:#fff;box-shadow:0 9px 29px rgba(15,53,82,.055)!important}
#view-main-layout #view-templates #templates-user-state #templates-workspace-history-panel>.templates-history-card{margin-top:23px!important}
#view-main-layout #view-templates #templates-user-state #user-generate-tabs{display:flex;align-items:center;justify-content:flex-start;gap:8px!important;box-sizing:border-box;min-width:0;max-width:100%;margin:0 0 22px!important;padding:0 0 17px!important;border-bottom:1px solid #e8eef3!important}
#view-main-layout #view-templates #templates-user-state #user-generate-tabs>[role=tab]{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:43px;min-width:170px;margin:0;padding:10px 17px;border:1px solid #d4e2ec;border-radius:10px;background:#f4f8fb;color:#46667d;box-shadow:none;font-size:12.5px;font-weight:800;line-height:1.3;white-space:normal;transition:background-color .15s,border-color .15s,color .15s}
#view-main-layout #view-templates #templates-user-state #user-generate-tabs>[role=tab][aria-selected=true]{border-color:#87c9d4;background:#e9f8f9;color:#087385;box-shadow:inset 0 0 0 1px rgba(38,163,180,.12)}
#view-main-layout #view-templates #templates-user-state #user-generate-tabs>[role=tab]:hover:not(:disabled){border-color:#8dc7d3;background:#eff9fb}
#view-main-layout #view-templates #templates-user-state #user-generate-tabs>[role=tab]:focus-visible{outline:2px solid #17a3b1;outline-offset:2px}
#view-main-layout #view-templates #templates-user-state .user-generate-panel-heading{margin-bottom:19px!important;padding:0!important;border:0}
#view-main-layout #view-templates #templates-user-state .user-generate-panel-heading h3,#view-main-layout #view-templates #templates-user-state .templates-history-card>.page-header h3{margin:0!important;color:#1b435b;font-size:18px;font-weight:820;letter-spacing:-.025em;line-height:1.4}
#view-main-layout #view-templates #templates-user-state .templates-history-card>.page-header{margin-bottom:19px!important;padding:0 0 16px;border-bottom:1px solid #e6edf3}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-single>.templates-single-grid,#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch>.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:19px 21px;min-width:0}
#view-main-layout #view-templates #templates-user-state :is(#user-generate-panel-single,#user-generate-panel-batch) .form-group{box-sizing:border-box;min-width:0;max-width:100%;margin:0}
#view-main-layout #view-templates #templates-user-state :is(#user-generate-panel-single,#user-generate-panel-batch) .form-group>label{display:flex;align-items:center;gap:7px;min-width:0;margin:0 0 8px;color:#536c80;font-size:12.5px;font-weight:760;line-height:1.45}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-single>.templates-single-grid>.form-group>label::before{display:inline-flex;flex:0 0 24px;align-items:center;justify-content:center;width:24px;height:24px;border:1px solid #d5e8ed;border-radius:7px;background:#eaf7f9;color:#0a7891;font-size:10px;font-weight:850;font-variant-numeric:tabular-nums}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-single>.templates-single-grid>.form-group:nth-child(1)>label::before{content:"01"}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-single>.templates-single-grid>.form-group:nth-child(2)>label::before{content:"02"}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-single>.templates-single-grid>.form-group:nth-child(3)>label::before{content:"03"}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-single>.templates-single-grid>.form-group:nth-child(4)>label::before{content:"04"}
#view-main-layout #view-templates #templates-user-state :is(#user-generate-panel-single,#user-generate-panel-batch) .form-group>:is(input:not([type=hidden]),select),#view-main-layout #view-templates #templates-user-state :is(#user-generate-panel-single,#user-generate-panel-batch) .batch-range-row>input{box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:45px;margin:0;padding:9px 12px;border:1px solid #d2e1eb;border-radius:9px;background:#f9fbfd;color:#193e58;font-size:13.5px;line-height:1.45}
#view-main-layout #view-templates #templates-user-state :is(#user-generate-panel-single,#user-generate-panel-batch) :is(input,select):focus{outline:none;border-color:#36a8b5;box-shadow:0 0 0 3px rgba(17,165,182,.12);background:#fff}
#view-main-layout #view-templates #templates-user-state :is(#user-generate-panel-single,#user-generate-panel-batch) :is(input,select):focus-visible{outline:2px solid #0a98ab;outline-offset:1px}
#view-main-layout #view-templates #templates-user-state :is(#user-generate-panel-single,#user-generate-panel-batch) :is(input,select):disabled{background:#f0f5f8;border-color:#e1eaf0;color:#7e94a4}
#view-main-layout #view-templates #templates-user-state #user-generate-runtime-fields:not([hidden]){box-sizing:border-box;min-width:0;max-width:100%;margin-top:20px!important;padding:17px;border:1px dashed #aacbd8;border-radius:11px;background:#f7fbfd}
#view-main-layout #view-templates #templates-user-state .templates-single-actions{display:flex;justify-content:flex-end;gap:10px;box-sizing:border-box;margin:23px 0 0;padding:19px 0 0;border-top:1px solid #e9eff4}
#view-main-layout #view-templates #templates-user-state :is(#btn-user-generate,#btn-user-batch-generate){box-sizing:border-box;min-height:44px;min-width:177px;margin:0;padding:10px 19px;border:1px solid #0b779a;border-radius:9px;background:linear-gradient(105deg,#0d749e,#098e9a);color:#fff;font-size:12.5px;font-weight:820;box-shadow:0 4px 15px rgba(6,121,153,.13)}
#view-main-layout #view-templates #templates-user-state :is(#btn-user-generate,#btn-user-batch-generate):hover:not(:disabled){background:linear-gradient(105deg,#075f89,#087d8b)}
#view-main-layout #view-templates #templates-user-state :is(#btn-user-generate,#btn-user-batch-generate):disabled{opacity:.48;box-shadow:none;cursor:not-allowed}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-range-card{box-sizing:border-box;min-width:0;max-width:100%;margin:21px 0 17px;padding:15px 17px;border:1px solid #d7e8ef;border-radius:11px;background:#f6fafc}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-range-label{display:block;margin:0 0 9px;color:#34556d;font-size:12.5px;font-weight:800}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-range-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px;min-width:0}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-range-row>input{flex:1 1 260px;width:auto;min-width:180px;background:#fff}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-range-help{margin-top:9px;color:#6b8395;font-size:11.5px;line-height:1.55}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-list-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;min-width:0;margin:0 0 14px;padding:14px 16px;border:1px solid #e0eaf1;border-radius:11px;background:#fafcfe}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-list-toolbar>*{box-sizing:border-box;min-width:0;max-width:100%}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-list-toolbar .btn,#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-range-row>.btn{box-sizing:border-box;min-height:37px;margin:0;padding:8px 12px;border-radius:8px;font-size:11.5px;font-weight:760;white-space:normal}
#view-main-layout #view-templates #templates-user-state #templates-batch-scroll{box-sizing:border-box;width:100%;min-width:0;max-width:100%;border:1px solid #dce8f0!important;border-radius:12px!important;background:#fff;box-shadow:0 4px 16px rgba(15,53,82,.035);scrollbar-color:#cbdae5 transparent;scrollbar-width:thin}
#view-main-layout #view-templates #templates-user-state #templates-batch-table{width:100%;min-width:770px;border-collapse:separate;border-spacing:0;background:#fff}
#view-main-layout #view-templates #templates-user-state #templates-batch-table th{position:sticky;top:0;z-index:3;padding:13px 12px;border-bottom:1px solid #dce8f1;background:#f2f7fb;color:#5b758b;font-size:10.5px;font-weight:850;line-height:1.3;letter-spacing:.045em;text-transform:uppercase;white-space:nowrap}
#view-main-layout #view-templates #templates-user-state #templates-batch-table td{padding:12px;border-bottom:1px solid #eaf0f4;color:#395a71;font-size:12.5px;line-height:1.4;vertical-align:middle}
#view-main-layout #view-templates #templates-user-state #templates-batch-table tbody tr:nth-child(even){background:#fafcfe}
#view-main-layout #view-templates #templates-user-state #templates-batch-table tbody tr:hover{background:#f0f8fb}
#view-main-layout #view-templates #templates-user-state #templates-batch-table td:nth-child(3){color:#173f58;font-weight:700}
#view-main-layout #view-templates #templates-user-state #templates-batch-table .template-batch-sequence{box-sizing:border-box;max-width:140px;min-height:36px;border:1px solid #cfdfe9;border-radius:7px;background:#fff;color:#193f57;font-size:12.5px}
#view-main-layout #view-templates #templates-user-state #templates-batch-table input[type=checkbox]{width:17px;height:17px;accent-color:#0d91aa}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch>.form-actions{display:flex;justify-content:flex-end;gap:9px;min-width:0;margin-top:18px!important;padding:15px 0 0;border-top:1px solid #e9eff4}
#view-main-layout #view-templates #templates-user-state #templates-history-filter-modal .templates-history-filter-panel{box-sizing:border-box;min-width:0;max-width:100%;margin-bottom:16px;padding:17px 18px;border:1px solid #dce9f0;border-radius:12px;background:#f7fafc}
#view-main-layout #view-templates #templates-user-state .templates-history-filters{display:grid;grid-template-columns:1.15fr 1fr .85fr .8fr .8fr;gap:13px 14px;min-width:0}
#view-main-layout #view-templates #templates-user-state .templates-history-filters>.form-group{min-width:0;max-width:100%;margin:0}
#view-main-layout #view-templates #templates-user-state .templates-history-filters>.form-group>label{display:block;margin:0 0 7px;color:#547084;font-size:11.8px;font-weight:800;line-height:1.4}
#view-main-layout #view-templates #templates-user-state .templates-history-filters>.form-group>:is(input,select){box-sizing:border-box;width:100%;max-width:100%;min-width:0;min-height:42px;padding:8px 9px;border:1px solid #d2e0e9;border-radius:8px;background:#fff;color:#264a61;font-size:12.2px}
#view-main-layout #view-templates #templates-user-state .templates-history-filters>.form-group>:is(input,select):focus-visible{outline:2px solid #1c9bac;outline-offset:1px}
#view-main-layout #view-templates #templates-user-state .templates-history-filter-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin:16px 0 0!important}
#view-main-layout #view-templates #templates-user-state .templates-history-filter-actions .btn{box-sizing:border-box;min-height:39px;min-width:100px;margin:0;padding:8px 13px;border-radius:8px;font-size:11.8px;font-weight:760}
#view-main-layout #view-templates #templates-user-state .templates-history-bulk-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:9px;box-sizing:border-box;min-width:0;margin:0 0 14px;padding:12px 14px;border:1px solid #d8e9ee;border-radius:10px;background:#f3fafb}
#view-main-layout #view-templates #templates-user-state .templates-history-bulk-selection{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0}
#view-main-layout #view-templates #templates-user-state #templates-history-selected-count{color:#17677b;font-size:12px;font-weight:820}
#view-main-layout #view-templates #templates-user-state .templates-history-bulk-toolbar .btn{box-sizing:border-box;min-height:35px;margin:0;padding:7px 11px;border-radius:8px;font-size:11.2px;font-weight:760}
#view-main-layout #view-templates #templates-user-state .templates-history-table-wrap{box-sizing:border-box;width:100%;max-width:100%;max-height:min(61dvh,740px);overflow:auto!important;border:1px solid #dae7ef;border-radius:12px;background:#fff;box-shadow:0 5px 18px rgba(15,53,82,.035);scrollbar-width:thin;scrollbar-color:#c7d9e5 transparent}
#view-main-layout #view-templates #templates-user-state #templates-history-table{width:100%;min-width:1130px;table-layout:fixed;border-collapse:separate;border-spacing:0;background:#fff}
#view-main-layout #view-templates #templates-user-state #templates-history-table th{position:sticky;top:0;z-index:3;padding:14px 11px;border-bottom:1px solid #dce7ef;background:#f2f7fb;color:#5c768a;font-size:10px;font-weight:840;letter-spacing:.035em;line-height:1.35;text-transform:uppercase;white-space:nowrap}
#view-main-layout #view-templates #templates-user-state #templates-history-table td{padding:12px 11px;border-bottom:1px solid #ecf1f5;background:transparent;color:#415e73;font-size:12.2px;line-height:1.4;vertical-align:middle}
#view-main-layout #view-templates #templates-user-state #templates-history-table tbody tr:nth-child(even){background:#fafcfe}
#view-main-layout #view-templates #templates-user-state #templates-history-table tbody tr:hover{background:#edf7fb}
#view-main-layout #view-templates #templates-user-state #templates-history-table tbody tr:last-child td{border-bottom:0}
#view-main-layout #view-templates #templates-user-state #templates-history-table .templates-history-template-cell{color:#1a4561;font-weight:720}
#view-main-layout #view-templates #templates-user-state #templates-history-table .templates-history-actions{display:flex;flex-wrap:nowrap;align-items:center;gap:5px}
#view-main-layout #view-templates #templates-user-state #templates-history-table .templates-history-actions .btn{box-sizing:border-box;min-height:33px;min-width:0;margin:0!important;padding:6px 9px;border-radius:7px;font-size:10.5px;font-weight:760;white-space:nowrap}
#view-main-layout #view-templates #templates-user-state #templates-history-table .templates-history-actions .btn:focus-visible{outline:2px solid #169eae;outline-offset:1px}
#view-main-layout #view-templates #templates-user-state #templates-history-table .templates-history-select-checkbox{width:18px;height:18px;accent-color:#0a94ab}
#view-main-layout #view-templates #templates-user-state .templates-history-pagination{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;box-sizing:border-box;margin:15px 0 0!important;padding:2px 0}
#view-main-layout #view-templates #templates-user-state .templates-history-pagination>.btn{min-height:39px;min-width:100px;margin:0;padding:8px 12px;border:1px solid #d0e0eb;border-radius:9px;background:#f9fbfd;color:#2a617b;font-size:12px;font-weight:770}
#view-main-layout #view-templates #templates-user-state #templates-history-pagination #templates-history-page-info{padding:9px 15px;border:1px solid #dce8f0;border-radius:9px;background:#f5f9fc;color:#4a6981;font-size:12px;font-weight:800;font-variant-numeric:tabular-nums}
}
@media(min-width:1051px) and (max-width:1399px){
#view-main-layout #view-templates #templates-user-state .templates-history-filters{grid-template-columns:repeat(3,minmax(0,1fr))}
#view-main-layout #view-templates #templates-user-state .templates-history-table-wrap{max-height:65dvh}
}
@media(min-width:1051px) and (max-width:1180px){
#view-main-layout #view-templates #templates-user-state>.templates-workspace-panel>.template-detail-card{padding:20px 18px!important}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-list-toolbar{align-items:flex-start;padding:12px}
#view-main-layout #view-templates #templates-user-state .templates-history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(min-width:1051px) and (max-width:1399px){
#view-main-layout #view-templates #templates-user-state #templates-history-table th:last-child{position:sticky;right:0;z-index:5;box-shadow:-6px 0 12px rgba(19,57,79,.07)}
#view-main-layout #view-templates #templates-user-state #templates-history-table td:last-child:not([colspan]){position:sticky;right:0;z-index:2;background:#fff;box-shadow:-6px 0 12px rgba(19,57,79,.055)}
#view-main-layout #view-templates #templates-user-state #templates-history-table tbody tr:nth-child(even) td:last-child:not([colspan]){background:#fafcfe}
#view-main-layout #view-templates #templates-user-state #templates-history-table tbody tr:hover td:last-child:not([colspan]){background:#edf7fb}
}
@media(min-width:1051px) and (prefers-reduced-motion:reduce){#view-main-layout #view-templates #templates-user-state #user-generate-tabs>[role=tab]{transition:none}}

/* Wave H5.1 — desktop chooser and batch action layout correction.
   Only presentation. Keep original picker, selection and generation contracts. */
@media(min-width:1051px){
/* A content-sized side sheet instead of a full-height white void for 1-2 choices. */
.accgen-picker-panel:not([hidden]){inset:16px 16px auto auto!important;box-sizing:border-box;width:min(460px,calc(100vw - 32px))!important;height:auto!important;min-height:0!important;max-height:calc(100dvh - 32px)!important;border:1px solid #d6e4ee;border-radius:14px!important;box-shadow:0 17px 44px rgba(8,37,64,.23)}
.accgen-picker-panel .accgen-picker-header{flex:0 0 auto;min-width:0}
.accgen-picker-panel .accgen-picker-body{display:flex;flex:0 1 auto!important;flex-direction:column;align-items:stretch!important;justify-content:flex-start!important;min-width:0;min-height:0!important;max-height:calc(100dvh - 94px);overflow:hidden}
.accgen-picker-panel .accgen-picker-search,.accgen-picker-panel .accgen-picker-info{flex:0 0 auto!important;margin:0!important}
.accgen-picker-panel .accgen-picker-list{flex:0 1 auto!important;align-content:start!important;justify-content:stretch!important;min-width:0;min-height:0!important;max-height:min(55dvh,570px);margin:0!important;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#c3d8e8 transparent}
.accgen-picker-panel .accgen-picker-more{flex:0 0 auto!important;margin:0!important}
/* The batch selector keeps count, selection buttons and primary action in one compact row. */
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-list-toolbar{align-items:center!important;gap:10px 13px;padding:11px 13px!important}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-pagination-compact{flex:1 1 385px;min-width:0;justify-content:flex-start;gap:8px 13px}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-selection-compact{display:flex!important;flex:0 1 auto;align-items:center!important;justify-content:flex-end;flex-wrap:wrap;gap:8px 11px;width:auto!important;min-width:0;max-width:100%}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-selection-summary{display:flex;flex:0 0 auto;align-items:center;gap:7px;white-space:nowrap;font-size:12px}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-selection-buttons{display:flex!important;flex:0 1 auto;grid-template-columns:none!important;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px;width:auto!important;max-width:100%;min-width:0}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-selection-buttons>.btn{grid-column:auto!important;flex:0 0 auto;min-height:36px!important;min-width:0!important;width:auto!important;margin:0!important;padding:7px 11px!important;font-size:11.5px;line-height:1.3;white-space:nowrap}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-selection-buttons>#btn-user-batch-generate{grid-column:auto!important;min-height:37px!important;min-width:168px!important;width:auto!important;font-size:11.5px;font-weight:780}
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-selection-compact.accgen-context-sticky--pinned{display:flex!important;justify-content:space-between!important;align-items:center!important;flex-wrap:wrap;gap:8px 13px;padding:8px 11px!important;max-height:min(26dvh,115px);overflow-y:auto}
}

/* Wave H5.2 — center only the pinned batch selection bar in the desktop workspace.
   Reuse the H1 sidebar-width token; JS retains ownership of sticky lifecycle and top. */
@media(min-width:1051px){
#view-main-layout #view-templates #templates-user-state #user-generate-panel-batch .batch-selection-compact.accgen-context-sticky--pinned:not([hidden]){left:var(--accgen-h-sidebar-width,252px)!important;right:0!important;width:max-content!important;max-width:calc(100vw - var(--accgen-h-sidebar-width,252px) - 24px)!important;margin-left:auto!important;margin-right:auto!important;justify-content:center!important}
}
