:root{--primary:#4f46e5;--primary-dark:#4338ca;--ink:#17243c;--muted:#718096;--line:#e7ebf3;--bg:#f5f7fb;--white:#fff;--sidebar:#111a30;--shadow:0 5px 28px rgba(30,41,59,.045);--radius:16px}
*{box-sizing:border-box}html{font-size:14px}body{margin:0;color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);line-height:1.5}a{color:var(--primary);text-decoration:none}button,input,textarea,select{font:inherit}button{cursor:pointer}h1,h2,h3,p{margin-top:0}h1{font-size:29px;letter-spacing:-.95px;font-weight:750;margin-bottom:7px}h2{font-size:16px;letter-spacing:-.2px;margin-bottom:10px}h3{font-size:14px}strong{font-weight:700}small{font-size:12px}label{display:block;font-weight:620;font-size:13px;margin-bottom:7px}p{margin-bottom:12px}.muted{color:var(--muted)}.tiny{font-size:11px}.hint{font-size:12px;color:#738098;line-height:1.65}.hint a{font-weight:700}.eyebrow{color:var(--primary);font-size:11px;letter-spacing:1.3px;font-weight:750;margin-bottom:9px}.required{color:#dc4567}.hidden{display:none!important}.mt-24{margin-top:24px}.full-width{grid-column:1/-1}
.app-body{min-height:100vh}.sidebar{position:fixed;top:0;left:0;bottom:0;width:246px;background:var(--sidebar);color:#fff;z-index:10;display:flex;flex-direction:column;padding:27px 15px 17px;box-shadow:5px 0 22px rgba(14,24,52,.06)}.brand{display:flex;align-items:center;gap:11px;color:#fff!important;font-size:23px;font-weight:800;letter-spacing:-1px;padding:1px 13px 37px}.brand-icon{height:36px;width:36px;display:inline-flex;align-items:center;justify-content:center;color:white;background:linear-gradient(140deg,#817bff,#4f46e5);border-radius:11px;font-size:24px;flex-shrink:0}.brand-accent{color:#8d8bff}.brand small{display:block;font-size:8px;letter-spacing:1.45px;color:#8b98b5;font-weight:700;margin-top:-5px}.nav-caption{font-size:10px;letter-spacing:1.1px;font-weight:700;color:#7283a5;margin:4px 13px 14px}.nav-link{color:#a8b4cf;display:flex;align-items:center;gap:11px;padding:12px 13px;border-radius:9px;font-size:13px;font-weight:570;margin-bottom:4px;transition:all .18s}.nav-link:hover{background:#1d2a49;color:#fff}.nav-link.active{background:#33316e;color:#fff;box-shadow:inset 3px 0 #9895ff}.nav-ico{font-size:17px;color:#8896b6;min-width:18px;text-align:center}.nav-link.active .nav-ico{color:#c2c0ff}.sidebar-bottom{margin-top:auto;border-top:1px solid #2a3451;padding:20px 5px 0;display:flex;gap:10px;align-items:center}.avatar{background:linear-gradient(140deg,#dddafe,#9ba2ee);color:#3e388a;border-radius:12px;display:grid;place-items:center;width:40px;height:40px;font-weight:800;flex:0 0 auto}.avatar.small{width:34px;height:34px;font-size:12px;border-radius:10px}.avatar.huge{width:65px;height:65px;border-radius:18px;font-size:23px}.identity{overflow:hidden}.identity strong{display:block;font-size:12px;color:#f6f7fb;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.identity span{display:block;color:#8290ad;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.main-area{margin-left:246px;min-height:100vh}.topbar{height:76px;border-bottom:1px solid var(--line);background:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 35px}.breadcrumb{font-size:13px;color:#8190a7}.breadcrumb span{padding:0 11px;color:#c4cbdb}.topbar-actions{display:flex;align-items:center;gap:10px}.topbar-actions form{margin:0}.content-wrap{max-width:1540px;margin:0 auto;padding:32px 35px 70px}
.btn{border-radius:10px;padding:11px 16px;display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;text-align:center;border:1px solid transparent;font-size:13px;font-weight:700;transition:background .16s,transform .16s;text-decoration:none}.btn:hover{transform:translateY(-1px)}.btn:disabled{opacity:.55;cursor:not-allowed;transform:none}.btn-primary{background:var(--primary);color:#fff!important;box-shadow:0 4px 12px rgba(79,70,229,.14)}.btn-primary:hover{background:var(--primary-dark)}.btn-secondary{background:#fff;border:1px solid #dce2ec;color:#45546f}.btn-secondary:hover,.btn-ghost:hover{background:#f5f6fc}.btn-ghost{color:#63708a;background:transparent}.btn-danger{background:#fff1f3;color:#c52c4a;border-color:#ffd5dd}.btn-danger:hover{background:#ffe6ec}.btn-dashed{background:#f9faff;border:1px dashed #c5c9e9;color:#625acf}.btn-dashed:hover{background:#f1f1ff}.btn-sm{padding:8px 12px;font-size:12px}.btn-block{width:100%}.btn.large{padding:15px 16px;font-size:14px}.page-title-row{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:25px}.page-title-row .muted{margin-bottom:0}.card{background:var(--white);border:1px solid #e9edf5;border-radius:var(--radius);box-shadow:var(--shadow);padding:24px}.alert{padding:14px 17px;border-radius:11px;margin-bottom:20px;font-size:13px}.alert-success{background:#eaf9f2;color:#177451;border:1px solid #c5eedd}.alert-error{background:#fff1f2;color:#ad3348;border:1px solid #ffdce1}.validation{color:#c92e4a;font-size:12px;line-height:1.8}.validation:empty{display:none}.form-stack{display:flex;flex-direction:column;gap:17px}.input{display:block;width:100%;background:#fff;outline:none;padding:11px 12px;color:#26344b;border:1px solid #dbe1ec;border-radius:9px;min-width:0;transition:border-color .15s,box-shadow .15s}.input:focus{border-color:#7972f7;box-shadow:0 0 0 3px #f0eeff}.input::placeholder{color:#9ba7bb}textarea.input{resize:vertical}.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.thin-divider{height:1px;background:var(--line);margin:26px 0}
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:17px;margin-bottom:23px}.stat-card{padding:21px 21px 20px;background:#fff;border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow);display:flex;flex-direction:column;color:var(--ink);position:relative}.stat-card:hover{border-color:#c8cbff}.stat-icon{display:grid;place-items:center;width:37px;height:37px;border-radius:11px;font-size:20px;margin-bottom:18px}.purple{color:#6654ce;background:#f0edff}.blue{color:#2a7bd7;background:#e9f4ff}.red{color:#d45570;background:#fff0f3}.green{color:#23a17a;background:#e6faf0}.stat-label{font-size:12px;color:#6e7b91}.stat-card strong{font-size:30px;letter-spacing:-.7px;line-height:1.35}.stat-card small{color:#a1aabd}.card-table{padding:0;overflow:hidden}.card-header{padding:21px 24px;display:flex;align-items:center;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line)}.card-header h2{margin:0 0 4px}.card-header p{margin:0;font-size:12px}.search-line{display:flex;gap:7px}.search-line .input{min-width:230px}.table-responsive{overflow-x:auto}.data-table{border-collapse:collapse;width:100%;text-align:left}.data-table th{font-size:10px;letter-spacing:.8px;font-weight:750;color:#8391a8;background:#fafbfe;padding:14px 22px;white-space:nowrap}.data-table td{border-top:1px solid #f0f2f7;padding:18px 22px;font-size:12px;vertical-align:middle}.data-table tr:hover td{background:#fcfcff}.doc-cell{display:flex;align-items:center;gap:12px;min-width:200px}.file-icon{width:38px;height:43px;display:grid;place-items:center;border-radius:8px;background:#fff0f2;color:#d84e69;font-weight:800;font-size:10px}.doc-title{color:#25344d;font-weight:700;font-size:12px}.doc-title:hover,.link-action:hover{color:var(--primary)}.progress-caption{font-size:11px;color:#68738c}.progress{height:5px;border-radius:5px;background:#edf0f5;min-width:80px;margin-top:6px;overflow:hidden}.progress span{display:block;height:100%;background:var(--primary);border-radius:6px}.status{font-size:11px;border-radius:100px;padding:6px 9px;white-space:nowrap;font-weight:700}.status.success{color:#199268;background:#e5f7ef}.status.danger{color:#c64061;background:#fff0f2}.status.pending{color:#a97819;background:#fff5e5}.link-action{font-size:12px;font-weight:700;white-space:nowrap}.empty-state{text-align:center;padding:40px 12px;color:#8b99b1}.empty-state span{font-size:40px}.empty-state h3{margin-top:10px;color:#53637e}.empty-state p{margin:0}
.auth-body{background:radial-gradient(circle at 15% 5%,#d5d4ff 0,transparent 35%),radial-gradient(circle at 95% 95%,#d5e7ff 0,transparent 35%),#f6f8fc;min-height:100vh}.auth-area{min-height:100vh;display:grid;place-items:center}.auth-wrap{width:min(100%,700px);padding:25px}.auth-card{background:#fff;border:1px solid #edf0f7;border-radius:22px;padding:42px;box-shadow:0 20px 70px rgba(40,52,92,.08);max-width:460px;margin:auto}.auth-card.wide{max-width:680px}.auth-logo{font-weight:800;font-size:25px;margin-bottom:8px;letter-spacing:-1px;display:flex;align-items:center;gap:7px}.auth-logo .brand-accent{margin-left:-7px}.auth-subtitle{letter-spacing:1.2px;color:#9b9fc8;font-size:9px;font-weight:800;margin-bottom:30px}.auth-card h1{font-size:27px;margin-bottom:6px}.auth-card>.muted{margin-bottom:25px}.auth-footer{text-align:center;font-size:12px;color:#76839a;margin-top:25px;margin-bottom:0}.auth-footer a{font-weight:750}
.work-grid{display:grid;grid-template-columns:minmax(320px,385px) minmax(0,1fr);gap:19px;align-items:start}.workflow-panel{padding:24px}.section-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:18px}.section-head h2{margin:0 0 2px}.section-head p{font-size:12px;margin:0}.step-number{width:27px;height:27px;display:grid;place-items:center;border-radius:8px;background:#eeedff;color:var(--primary);font-size:12px;font-weight:800;flex:none}.file-input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0}.file-drop{background:#fafbff;border:1.5px dashed #cfd6eb;border-radius:11px;padding:18px;display:flex;align-items:center;flex-direction:column;cursor:pointer;text-align:center;margin:0;gap:3px}.file-drop:hover{border-color:var(--primary);background:#f6f5ff}.file-drop strong{font-size:12px}.file-drop small{font-weight:400;color:#8b97ac;overflow-wrap:anywhere}.upload-symbol{font-size:29px;color:#7770ef;line-height:1.2}.signature-choices{display:grid;grid-template-columns:1fr 1fr;gap:9px}.choice{display:flex;align-items:flex-start;gap:8px;border:1px solid #dce2ec;border-radius:10px;padding:12px 10px;cursor:pointer;margin:0}.choice:has(input:checked){background:#f5f3ff;border-color:#746eed}.choice.disabled{opacity:.38;cursor:not-allowed}.choice input{accent-color:var(--primary);margin-top:3px}.choice strong{font-size:11px;display:block}.choice small{color:#8d99aa;display:block;font-size:10px}.pdf-panel{padding:0;overflow:hidden}.pdf-panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:21px 23px;border-bottom:1px solid var(--line)}.pdf-panel-header h2{margin-bottom:2px}.pdf-panel-header p{font-size:11px;margin:0}.page-controls{display:flex;align-items:center;gap:8px;white-space:nowrap;color:#6e7b93;font-weight:700;font-size:12px}.page-controls .btn{font-size:20px;line-height:1;padding:5px 11px}.pdf-viewport{background:#e8ebf1;min-height:600px;max-height:calc(100vh - 255px);overflow:auto;display:flex;justify-content:flex-start;align-items:center;flex-direction:column;padding:23px 16px}.page-stage{position:relative;background:#fff;box-shadow:0 5px 25px rgba(25,35,60,.19);margin:auto;flex-shrink:0}.page-stage canvas{display:block;width:100%;height:100%}.signature-overlay{position:absolute;border:1.5px dashed #645ff0;background:rgba(119,112,249,.09);cursor:grab;touch-action:none;user-select:none;z-index:2}.signature-overlay:active{cursor:grabbing}.signature-overlay img{width:100%;height:100%;object-fit:fill;display:block;pointer-events:none;user-select:none}.resize-handle{position:absolute;width:17px;height:17px;right:-4px;bottom:-4px;background:#665dec;border:2px solid #fff;border-radius:4px;cursor:nwse-resize;touch-action:none;box-shadow:0 2px 5px #7a79ae}.pdf-placeholder{display:flex;justify-content:center;align-items:center;flex-direction:column;color:#96a1b5;text-align:center;margin:auto;padding:70px 12px}.pdf-placeholder h3{color:#6f7e94}.pdf-placeholder p{max-width:250px;font-size:12px}.placeholder-paper{font-size:70px;color:#c2c9d6}.pdf-footer{padding:13px 20px;text-align:center;color:#8e98ab;font-size:11px;border-top:1px solid var(--line)}.pdf-footer span{margin:0 12px}.signer-list{display:flex;flex-direction:column;gap:7px;margin-bottom:12px}.chosen-signer{display:flex;align-items:center;gap:10px;border:1px solid #e7e9f2;background:#fbfcff;padding:10px;border-radius:9px}.order-badge{width:24px;height:24px;border-radius:50%;background:#e9e8ff;display:grid;place-items:center;color:var(--primary);font-weight:800;font-size:11px}.chosen-info{flex:1;min-width:0}.chosen-info strong,.chosen-info small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chosen-info strong{font-size:12px}.chosen-info small{font-size:10px;color:#8896a9}.chosen-actions{display:flex;gap:2px}.icon-button{border:0;background:transparent;color:#8b90a5;font-size:17px;padding:2px 4px}.icon-button:hover{color:var(--primary)}.icon-button:disabled{opacity:.25}.picker{border:1px solid #e3e7f1;border-radius:10px;padding:10px;margin:12px 0;background:#fff}.filter-row{margin:9px 0;gap:8px}.filter-row .input{font-size:11px;padding:9px 7px}.person-list{max-height:240px;overflow:auto}.person-option{width:100%;display:flex;align-items:center;text-align:left;gap:10px;border:0;border-bottom:1px solid #f0f1f5;background:#fff;padding:9px 5px}.person-option:hover{background:#f7f7ff}.person-option>span:nth-child(2){flex:1;min-width:0}.person-option strong,.person-option small{display:block}.person-option strong{font-size:11px;color:#26344b}.person-option small{font-size:10px;color:#8491a7}.choose-symbol{font-size:19px;color:#655deb}
.detail-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,360px);gap:19px;align-items:start}.detail-main{padding:0;overflow:hidden}.pdf-frame{width:100%;height:850px;display:block;border:0}.detail-side{display:flex;flex-direction:column;gap:17px}.detail-side .card h2{margin-bottom:16px}.info-list{margin:0}.info-list>div{display:flex;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid #edf0f6}.info-list>div:last-child{border:0}.info-list dt{color:#8793a8;font-size:12px}.info-list dd{font-size:12px;margin:0;text-align:right;overflow-wrap:anywhere;font-weight:650;max-width:62%}.step-timeline{list-style:none;padding:0;margin:0}.timeline-item{display:flex;gap:12px;position:relative;padding-bottom:23px}.timeline-item:not(:last-child):before{content:"";position:absolute;left:12px;top:27px;bottom:1px;width:1px;background:#e3e7ef}.timeline-bullet{height:25px;width:25px;display:grid;place-items:center;border:1px solid #dfe4ed;border-radius:50%;background:#fff;color:#8691a8;flex:0 0 auto;font-weight:750;font-size:11px}.timeline-item.done .timeline-bullet{background:#e4f9ee;color:#21916a;border-color:#c9efdf}.timeline-item.current .timeline-bullet{background:#f0edff;color:#5b50de;border-color:#cbc5ff}.timeline-item.rejected .timeline-bullet{background:#fff0f4;color:#ce4662;border-color:#ffd8df}.timeline-item strong,.timeline-item small{display:block}.timeline-item strong{font-size:12px}.timeline-item small{color:#8390a5;font-size:11px;margin-top:3px}.reason{font-size:11px;color:#b83b59;margin:6px 0 0}.reject-card textarea{margin-bottom:11px}.history-list{list-style:none;padding:0;margin:0}.history-list li{position:relative;border-left:2px solid #e7e7fb;padding:0 0 14px 12px;margin-bottom:10px}.history-list strong,.history-list small{display:block}.history-list strong{font-size:12px}.history-list small{color:#939db0;font-size:10px}.history-list p{font-size:11px;color:#66758c;margin:6px 0 0}
.profile-grid{display:grid;grid-template-columns:minmax(290px,400px) minmax(350px,1fr);gap:20px;align-items:start}.profile-identity{display:flex;align-items:center;gap:14px;padding-bottom:22px;margin-bottom:6px;border-bottom:1px solid var(--line)}.profile-identity h2{margin:0 0 4px;font-size:18px}.profile-identity p{font-size:12px;margin:0}.hint-box{background:#f2f3ff;color:#63648b;padding:15px;border-radius:10px;font-size:12px;line-height:1.7;margin-top:20px}.signature-upload{display:flex;flex-direction:column}.signature-preview{height:135px;display:grid;place-items:center;border:1px dashed #d8deea;border-radius:10px;margin-bottom:13px;background:#fafbff;color:#a4afbf;font-size:12px}.signature-preview img{max-width:86%;max-height:110px;object-fit:contain}.admin-top{margin-bottom:20px}.inline-form{display:flex;gap:9px;margin:16px 0}.inline-form .input{flex:1}.simple-list{padding:0;list-style:none;margin:0}.simple-list li{border-top:1px solid #eef0f6;padding:11px 3px;font-size:12px}.simple-list li span{color:#655fca;padding-right:9px}
@media(max-width:1200px){.work-grid{grid-template-columns:minmax(290px,360px) minmax(0,1fr)}.detail-grid{grid-template-columns:minmax(0,1fr) 310px}.stats-grid{gap:10px}.stat-card{padding:16px}.topbar{padding:0 22px}.content-wrap{padding:25px 22px}}@media(max-width:980px){.sidebar{width:70px;padding:20px 8px}.brand{padding:0 8px 32px}.brand>span:not(.brand-icon),.nav-caption,.nav-link:not(.active){font-size:0}.nav-link{font-size:0;justify-content:center;padding:14px 6px}.nav-link .nav-ico{font-size:20px}.sidebar-bottom .identity{display:none}.sidebar-bottom{justify-content:center}.main-area{margin-left:70px}.work-grid,.detail-grid,.profile-grid{grid-template-columns:1fr}.pdf-viewport{max-height:750px}.stats-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:620px){.sidebar{position:static;width:100%;height:auto;flex-direction:row;overflow:auto;align-items:center;padding:10px}.brand{padding:0 8px 0 0}.brand .brand-icon{height:32px;width:32px}.sidebar-bottom,.nav-caption,.sidebar .nav-link:nth-of-type(n+4){display:none}.nav-link{margin:0;padding:7px}.main-area{margin-left:0}.topbar{height:64px;padding:0 15px}.breadcrumb{display:none}.content-wrap{padding:17px 13px 35px}.page-title-row{align-items:start;flex-direction:column}.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.card{padding:18px}.pdf-panel,.card-table,.detail-main{padding:0}.pdf-panel-header{padding:15px}.pdf-viewport{min-height:430px;padding:15px 8px}.signature-choices,.grid-2{grid-template-columns:1fr}.auth-card{padding:25px}.card-header{flex-direction:column;align-items:stretch}.search-line .input{min-width:0;flex:1}.topbar-actions .btn{padding:8px}.data-table th,.data-table td{padding:13px 11px}}

/* Tài khoản — dành riêng cho quản trị viên */
.admin-create-card{max-width:870px}
.admin-create-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.user-role{display:inline-flex;align-items:center;padding:5px 10px;border-radius:100px;font-size:11px;font-weight:800}
.role-admin{background:#eeedff;color:#5149b5}
.role-staff{background:#eef6f7;color:#467482}

/* Danh mục phòng ban và chức vụ: chỉnh sửa và xóa trực tiếp */
.org-header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.org-header h2{margin-bottom:0}
.org-total{font-size:12px;color:#718096;background:#f5f7fb;padding:5px 10px;border-radius:20px;white-space:nowrap}
.org-list{padding:0;margin:14px 0 0;list-style:none;max-height:420px;overflow-y:auto}
.org-item{border-top:1px solid #eef0f6;padding:12px 0;display:flex;align-items:center;gap:8px}
.org-item:first-child{border-top:0}
.org-edit-form{display:flex;align-items:center;gap:8px;flex:1;min-width:0}
.org-item-main{flex:1;min-width:0}
.org-item-main .input{font-size:12px;padding:9px 11px}
.org-members{font-size:11px;display:block;color:#7e8ba2;margin-top:4px}
.org-delete-form{margin:0}
.org-edit-form .btn,.org-delete-form .btn{flex-shrink:0}
.org-empty{padding:20px 5px;text-align:center;color:#8b99b1;font-size:12px}
@media(max-width:1250px){.org-item{flex-wrap:wrap}.org-edit-form{flex-basis:100%}.org-delete-form{margin-left:auto}}
@media(max-width:620px){.org-edit-form{flex-wrap:wrap}.org-item-main{flex-basis:100%}}

/* SignFlow 2: vòng ký, thu hồi và trung tâm 'Văn bản của tôi' */
.my-doc-tabs{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:20px}
.tab-caption{font-weight:800;color:#536179;font-size:12px;margin-right:8px}
.tab-pill{display:inline-flex;align-items:center;border-radius:10px;padding:10px 13px;font-size:12px;font-weight:700;color:#5c6780;background:#fff;border:1px solid #e0e6f0}
.tab-pill:hover{color:var(--primary);border-color:#bbbaf5}
.tab-pill.active{color:#534cd2;background:#f2f0ff;border-color:#c7c2fb}
.reason-excerpt{margin-top:7px;border-left:3px solid #e99aa8;background:#fff5f6;color:#a8324e;padding:7px 9px;font-size:11px;line-height:1.5;max-width:350px;white-space:normal;overflow-wrap:anywhere}
.status.neutral{background:#eef1f7;color:#61718a}
.workflow-progress-head{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:12px;color:#40516c}
.workflow-progress-head span{font-size:11px;color:#7e8ba0;font-weight:700}
.workflow-progress{margin:9px 0 12px;height:7px}
.workflow-location{font-size:12px;line-height:1.6;color:#58657f;padding:11px 12px;border-radius:9px;background:#f4f5ff;margin:0 0 18px}
.workflow-location strong{color:#4a47b8}
.workflow-overview .timeline-item:last-child{padding-bottom:0}
.workflow-overview .timeline-item.done .timeline-bullet{font-weight:800}
.workflow-actions{display:flex;flex-direction:column;gap:11px}
.workflow-actions h2,.workflow-actions p{margin:0}
.workflow-actions form{margin:0}
.workflow-actions .alert{margin:0}
@media(max-width:620px){.my-doc-tabs{gap:5px}.tab-caption{flex-basis:100%}.tab-pill{padding:8px 10px}.reason-excerpt{max-width:240px}}

.sidebar{overflow-y:auto;scrollbar-width:thin;scrollbar-color:#37435c transparent}
@media(max-width:620px){.sidebar .nav-link:nth-of-type(n+4){display:flex}.sidebar{overflow-x:auto;overflow-y:hidden}.sidebar .brand{flex:none}.sidebar .nav-link{flex:none}}

/* SignFlow 3 – phân loại và lọc danh sách */
.stats-grid.stats-five{grid-template-columns:repeat(5,minmax(0,1fr))}
.stats-five .stat-card{padding:17px}
.stats-five .stat-card strong{font-size:27px}
.stats-five .stat-card small{line-height:1.5;min-height:29px}
.document-filter-form{padding:18px 24px 20px;border-bottom:1px solid var(--line);background:#fafbff}
.document-filters{display:grid;grid-template-columns:minmax(190px,1.5fr) repeat(5,minmax(120px,1fr));gap:11px;align-items:end}
.filter-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.filter-field label{font-size:11px;font-weight:750;color:#63738f}
.document-filters .input{font-size:12px;padding:10px 9px;min-width:0}
.filter-actions{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin-top:15px}
.filter-hint{margin-left:auto;font-size:11px;color:#8591a5}
.document-type-label{display:inline-block;background:#f0f5ff;color:#5265aa;padding:5px 9px;border-radius:8px;font-size:11px;line-height:1.5;max-width:200px}
.document-pagination{padding:16px 22px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #e9eef6;font-size:12px}
.pagination-controls{display:flex;align-items:center;gap:10px}
.disabled-page{opacity:.4;pointer-events:none}
.type-management-card{max-width:950px;padding:0;overflow:hidden}
.type-management-body{padding:20px 24px}
.type-management-body .inline-form{max-width:740px;margin-top:0}
.type-list{max-height:none}
.type-list .org-item-main .input{font-size:13px}
@media(max-width:1450px){.document-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.stats-grid.stats-five{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:920px){.stats-grid.stats-five{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.document-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-search{grid-column:1/-1}.document-filter-form{padding:16px}.filter-hint{margin-left:0;flex-basis:100%}.document-pagination{flex-direction:column}.type-management-body{padding:16px}}

/* Phiên bản ký PDF giữ nguyên tỷ lệ ảnh, chỉ resize bằng góc chéo. */
.signature-overlay img{width:100%;height:100%;object-fit:contain;pointer-events:none}
.signature-overlay .resize-handle{cursor:nwse-resize;right:-5px;bottom:-5px;width:19px;height:19px}

/* Bộ đặt nhiều chữ ký: một trang có thể chứa cả chữ ký thường và nháy.
   Mỗi dấu chỉ cho kéo góc chéo để giữ nguyên tỷ lệ nguồn. */
.page-stage.stamp-ready{cursor:crosshair}
.signature-layer{position:absolute;inset:0;pointer-events:none;z-index:4}
.signature-layer .signature-overlay{pointer-events:auto;box-sizing:border-box;touch-action:none;user-select:none;
  border:2px dashed #5d56da;background:rgba(115,102,235,.06);cursor:grab;z-index:1}
.signature-layer .signature-overlay.selected{z-index:3;border:2px solid #4538da;
  box-shadow:0 0 0 2px rgba(96,79,224,.12);background:rgba(115,102,235,.07)}
.signature-layer .signature-overlay:active{cursor:grabbing}
.signature-layer .signature-overlay img{width:100%;height:100%;display:block;object-fit:contain;pointer-events:none}
.signature-badge{position:absolute;top:-19px;left:-2px;padding:2px 6px;border-radius:4px 4px 0 0;
  background:#5c54cc;color:white;font-size:10px;white-space:nowrap;pointer-events:none;line-height:14px}
.signature-remove{position:absolute;top:-13px;right:-13px;width:23px;height:23px;
  border:2px solid white;border-radius:50%;background:#cf3855;color:white;cursor:pointer;
  font-size:17px;font-weight:bold;line-height:17px;display:grid;place-items:center;padding:0;
  box-shadow:0 1px 6px #7776;touch-action:none;z-index:5}
.signature-layer .resize-handle{position:absolute;width:19px;height:19px;right:-9px;bottom:-9px;
  background:#6156dc;border:2px solid white;border-radius:5px;cursor:nwse-resize;
  touch-action:none;z-index:5;box-shadow:0 1px 5px #7776}
.pdf-editor-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 18px;background:#fafaff;border-top:1px solid #e4e6ef}
.pdf-editor-toolbar #signatureCount{font-size:12px;font-weight:700;color:#5956ae}
.pdf-editor-toolbar button:disabled{opacity:.45;cursor:not-allowed}


/* SignFlow: bộ đếm điều hướng, thẻ Tất cả văn bản và thông báo sự kiện */
.nav-link .nav-text{min-width:0;flex:1}
.nav-count{display:inline-flex;align-items:center;justify-content:center;min-width:23px;height:21px;
  margin-left:auto;padding:0 6px;border-radius:7px;background:#263552;border:1px solid #344566;
  font-size:11px;color:#c9d5ee;font-weight:750;line-height:1;font-variant-numeric:tabular-nums}
.nav-link.active .nav-count{color:#fff;background:#504b9b;border-color:#6d66c1}
.stats-grid.stats-six{grid-template-columns:repeat(6,minmax(0,1fr))}
.stats-six .stat-card{padding:17px}
.stats-six .stat-card strong{font-size:27px}
.stats-six .stat-card small{line-height:1.5;min-height:30px}
.notification-root{position:relative;z-index:30}
.notification-bell{width:40px;height:40px;border:1px solid #e4e8f3;background:#fff;border-radius:12px;
  display:grid;place-items:center;color:#40516c;cursor:pointer;position:relative}
.notification-bell:hover,.notification-bell[aria-expanded=true]{border-color:#b1adf7;background:#f6f5ff;color:#594bc9}
.notification-unread{position:absolute;right:-7px;top:-7px;min-width:19px;height:19px;border-radius:30px;
  display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;color:white;background:#e04466;
  padding:0 4px;box-shadow:0 0 0 2px white;line-height:1}
.notification-unread[hidden],.notification-panel[hidden]{display:none!important}
.notification-panel{position:absolute;top:calc(100% + 11px);right:0;width:min(410px,calc(100vw - 24px));
  background:#fff;border:1px solid #e0e5f0;box-shadow:0 17px 55px rgba(19,31,62,.19);border-radius:15px;overflow:hidden}
.notification-panel-header{padding:17px 18px;border-bottom:1px solid #eef1f7;display:flex;align-items:center;gap:10px;justify-content:space-between}
.notification-panel-header strong{display:block;font-size:15px;color:#233456}
.notification-panel-header small{display:block;font-size:11px;color:#8591a5;margin-top:3px}
.notification-read-all{cursor:pointer;color:#534cc7;background:none;border:0;font-size:11px;font-weight:700;padding:7px}
.notification-list{max-height:430px;overflow:auto}
.notification-item{display:flex;align-items:flex-start;text-decoration:none;gap:12px;padding:14px 18px;
  border-bottom:1px solid #f1f3f7;color:#25344d;font-size:12px;line-height:1.55}
.notification-item:hover{background:#f6f7fe}
.notification-item.is-unread{background:#f6f7ff}
.notification-item-icon{border-radius:11px;min-width:34px;height:34px;display:grid;place-items:center;background:#ebf0ff;color:#5d54c6;font-weight:bold;font-size:16px}
.notification-item[data-kind=returned] .notification-item-icon{background:#fff0f2;color:#ce4363}
.notification-item[data-kind=issued] .notification-item-icon{background:#e7f9f0;color:#21936d}
.notification-item-text{min-width:0;flex:1}
.notification-item-text strong{display:block;margin-bottom:3px;font-size:12px}
.notification-item-text p{margin:0 0 4px;color:#606f87;overflow-wrap:anywhere;font-size:11px}
.notification-item-text time{font-size:10px;color:#91a0b4}
.notification-dot{background:#6259d4;width:7px;height:7px;border-radius:100%;flex:0 0 auto;margin-top:8px}
.notification-empty{font-size:12px;text-align:center;color:#8290a4;padding:30px 12px}
.notification-toasts{position:fixed;right:20px;top:91px;z-index:80;width:min(370px,calc(100vw - 34px));display:flex;flex-direction:column;gap:10px;pointer-events:none}
.notification-toast{pointer-events:auto;background:#fff;border-radius:13px;border:1px solid #e0e4f0;
  box-shadow:0 12px 35px #1b2f5233;display:flex;align-items:flex-start;gap:11px;padding:15px;
  border-left:4px solid #6657dc;animation:notificationPop .2s ease-out}
.notification-toast[data-kind=returned]{border-left-color:#d9506f}
.notification-toast[data-kind=issued]{border-left-color:#25a178}
.notification-toast-body{flex:1;min-width:0}
.notification-toast strong{display:block;font-size:13px;color:#22334f;margin-bottom:5px}
.notification-toast p{font-size:12px;line-height:1.5;color:#63718a;margin:0 0 8px;overflow-wrap:anywhere}
.notification-toast a{font-size:11px;color:#584fd0;font-weight:700}
.notification-toast-close{background:none;border:0;font-size:21px;color:#8590a8;cursor:pointer;line-height:1}
@keyframes notificationPop{from{opacity:0;transform:translateY(-7px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:1540px){.stats-grid.stats-six{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1020px){.nav-link .nav-text{display:none}.nav-count{position:absolute;right:1px;top:0;min-width:17px;height:17px;font-size:9px;padding:0 3px}.nav-link{position:relative}}
@media(max-width:800px){.stats-grid.stats-six{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.nav-count{position:static;margin-left:2px}.notification-panel{right:-85px}.notification-toasts{top:74px;right:10px}.stats-six .stat-card{padding:13px}}

/* 7 thẻ tổng quan, gồm thêm "Đã ban hành"; không ép chữ trong màn hình trung bình. */
.stats-grid.stats-seven{grid-template-columns:repeat(4,minmax(0,1fr))}
.stats-seven .stat-card{padding:17px;min-width:0}
.stats-seven .stat-card strong{font-size:27px}
.stats-seven .stat-card small{line-height:1.5;min-height:30px}
@media(max-width:1100px){.stats-grid.stats-seven{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px){.stats-grid.stats-seven{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:360px){.stats-grid.stats-seven{grid-template-columns:1fr}}

/* Role selection and signer/leader action panels */
.role-change-form { display:flex; gap:7px; align-items:center; min-width:230px; }
.role-change-form .input { min-width:175px; }
.role-change-form .btn { white-space:nowrap; }
.decision-card { border:1px solid #f3c6cc; background:#fff9fa; }
.decision-card textarea { width:100%; margin:10px 0; }

/* Quản trị role theo loại văn bản ban hành */
.role-admin-card{margin-bottom:20px;padding:24px}.role-admin-card h2{margin:0 0 12px}
.role-type-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:9px;margin:12px 0 18px}
.role-type-option{display:flex;align-items:center;gap:9px;background:#f7f8fc;border:1px solid #e3e7f0;border-radius:10px;padding:11px 12px;font-size:12px;cursor:pointer}
.role-type-option input{width:16px;height:16px;accent-color:#6554d5}.role-new-name{max-width:450px}
.role-new-name label{display:block;margin-bottom:7px;font-weight:650;font-size:12px}
.role-section-title{display:block;font-size:12px;font-weight:700;margin-top:14px}
.role-grant-card{border-top:1px solid #e9edf5;padding:19px 0}.role-grant-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
@media(max-width:620px){.role-admin-card{padding:16px}.role-type-grid{grid-template-columns:1fr}}

/* Quyền thao tác độc lập theo role, bên dưới danh sách loại văn bản */
.role-capability-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:10px; margin:14px 0; }
.role-capability-options .role-type-option { align-items:flex-start; }

/* Công cụ chèn chữ trực tiếp trên PDF, chỉ render nếu được cấp claim riêng */
.pdf-text-tools{padding:12px 17px 14px;border-bottom:1px solid #e4e6ef;background:#fbfbff}
.pdf-tool-mode{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.pdf-tool-mode label{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border:1px solid #dfe4ee;background:white;border-radius:9px;font-weight:700;font-size:12px;cursor:pointer}
.pdf-tool-mode label:has(input:checked){background:#eeeafe;border-color:#8273e5;color:#5447b4}
.text-formatting{border:1px solid #e4e5f4;background:white;border-radius:10px;padding:13px}
.text-formatting>label{display:block;font-size:12px;font-weight:700;margin-bottom:6px}
.text-formatting textarea{width:100%;resize:vertical}
.text-format-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:11px 0}
.text-format-grid label{font-size:12px;font-weight:700;display:flex;flex-direction:column;gap:5px}
.text-color-input{padding:3px!important;height:39px}
.text-style-buttons{display:flex;gap:14px;flex-wrap:wrap;margin:10px 0;font-size:12px}
.text-style-buttons label{display:inline-flex;gap:6px;align-items:center;cursor:pointer}
.signature-layer .text-overlay{pointer-events:auto;position:absolute;box-sizing:border-box;overflow:visible;
 border:1px dashed #267f9c;background:rgba(105,187,210,.08);cursor:grab;touch-action:none;user-select:none}
.signature-layer .text-overlay.selected{border:2px solid #0782a3;background:rgba(105,187,210,.11);z-index:3}
.text-overlay-content{width:100%;height:100%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;
 line-height:1.3;pointer-events:none}
.text-badge{background:#097c9d}
.signature-layer .text-overlay .resize-handle{background:#0b839f}
@media(max-width:580px){.text-format-grid{grid-template-columns:1fr}}

/* Chữ ký PNG trong suốt: dùng nền ô caro để nhận ra vùng trong suốt ở preview. */
.signature-preview { background-color: #fff; background-image: linear-gradient(45deg,#eef1f6 25%,transparent 25%), linear-gradient(-45deg,#eef1f6 25%,transparent 25%), linear-gradient(45deg,transparent 75%,#eef1f6 75%), linear-gradient(-45deg,transparent 75%,#eef1f6 75%); background-size: 18px 18px; background-position: 0 0,0 9px,9px -9px,-9px 0; }
.signature-preview img { object-fit: contain; max-width: 100%; max-height: 180px; }

/* Tùy chỉnh nhận diện website và bản quyền. */
.main-area{display:flex;flex-direction:column}
.main-area>.content-wrap{width:100%;flex:1}
.site-copyright{text-align:center;padding:14px 20px 20px;color:#8591a7;font-size:12px;border-top:1px solid #e8edf5}
.site-brand-logo{width:38px;height:38px;object-fit:contain;background:white;border-radius:9px;flex:0 0 auto}
.brand .brand-text{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;overflow-wrap:anywhere;font-size:20px;line-height:1.25}
.brand .brand-text small{font-size:9px;letter-spacing:.7px;line-height:1.3;margin-top:3px}
.auth-logo .site-brand-logo{width:44px;height:44px}
.site-logo-preview{max-width:230px;max-height:130px;width:auto;height:auto;object-fit:contain;display:block;border:1px solid #e1e5ef;border-radius:12px;padding:10px;background:white;margin:10px 0}
.site-announcement{margin-bottom:18px;padding:18px 22px;border-left:3px solid var(--primary);white-space:pre-wrap}
.site-announcement strong{display:block;font-size:12px;letter-spacing:.5px;color:var(--primary);margin-bottom:8px}
.site-announcement p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}

/* Watermark/luồng: thông báo thu hồi dùng sắc vàng cam riêng, không lẫn thông báo trả về. */
.notification-item[data-kind=recalled] .notification-item-icon{background:#fff5e5;color:#ad6b0d}
.notification-toast[data-kind=recalled]{border-left-color:#c28a28}


/* Trang Thông tin riêng cạnh nút chuông, hiển thị mọi tài khoản đăng nhập. */
.topbar-info-link{display:inline-flex;align-items:center;gap:6px;font-weight:700;min-height:37px}
.topbar-info-link.is-active{border-color:#8273e5;background:#eeecff;color:#554bc0}
.information-page{max-width:1120px;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr);gap:22px;align-items:start}
.information-page h2{font-size:21px;line-height:1.4;color:#283550;margin:5px 0 8px}
.information-heading{display:flex;align-items:center;gap:18px;border-bottom:1px solid #e7ebf4;padding-bottom:22px;margin-bottom:22px}
.information-logo,.information-logo-fallback{width:70px;height:70px;flex:0 0 auto;object-fit:contain;background:#f7f7ff;border:1px solid #e4e5f4;border-radius:16px;padding:10px}
.information-logo-fallback{display:grid;place-items:center;font-size:33px;color:#6a61d5}
.information-heading .muted{margin:0}
.information-description,.information-notes p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.85;color:#485775;font-size:14px;margin:0}
.information-contacts{margin:20px 0;display:flex;flex-direction:column;gap:18px}
.information-contacts div{padding-bottom:13px;border-bottom:1px solid #eef0f6;min-width:0}
.information-contacts dt{font-size:12px;color:#8390a7;font-weight:700;margin-bottom:6px}
.information-contacts dd{font-size:14px;color:#2e405b;margin:0;overflow-wrap:anywhere}
.information-notes{margin-top:18px}.information-notes strong{display:block;margin-bottom:8px;color:#344765;font-size:13px}
.site-admin-fieldset{border-top:1px solid #e7ebf4;padding-top:20px;display:flex;flex-direction:column;gap:15px}
.site-admin-fieldset h2{font-size:18px;margin:0}.site-admin-fieldset h3{font-size:15px;margin:6px 0 0}
.site-admin-fieldset label{display:block;font-size:12px;font-weight:700;margin-bottom:7px}
.site-admin-fieldset .grid-2 label{margin-bottom:7px}
.page-admin-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:950px){.information-page{grid-template-columns:1fr}}
@media(max-width:620px){.topbar-info-link{padding:8px 10px}.topbar-actions{gap:6px}.information-heading{gap:12px}.information-logo,.information-logo-fallback{width:54px;height:54px}.site-admin-fieldset .grid-2{grid-template-columns:1fr}}

/* SignFlow 2026 — lọc thông báo và nhật ký hoạt động */
.notification-panel-filters{display:flex;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid #e9edf6}
.notification-panel-filters label{font-size:12px;font-weight:700;color:#495875;white-space:nowrap}
.notification-panel-filters .input{flex:1;min-width:0;padding:8px 11px;font-size:12px}
.notification-view-all{display:block;text-align:center;padding:13px;color:#594bc9;background:#fafaff;border-top:1px solid #e9edf6;font-size:12px;font-weight:700;text-decoration:none}
.notification-view-all:hover{background:#f1efff}
.notification-details{display:block;font-size:11px;line-height:1.45;color:#55627d;margin:2px 0;overflow-wrap:anywhere}
.notifications-page,.audit-page{padding:20px}
.notifications-page-header{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:15px;flex-wrap:wrap}
.notifications-page-header .audit-filters{display:flex;align-items:center;gap:10px}
.notifications-page-header .audit-filters label{font-size:12px;font-weight:700}
.notifications-page-header .audit-filters select{min-width:210px}
.notification-full-item{display:flex;align-items:flex-start;gap:14px;padding:15px;border:1px solid #e8ebf3;border-radius:10px;margin-bottom:10px;color:inherit;text-decoration:none}
.notification-full-item:hover{background:#f8f7ff}
.notification-full-item.is-unread{background:#f5f4ff;border-color:#d9d4ff}
.notification-full-item .notification-item-text{display:block;flex:1}
.notification-full-item .notification-item-text p{font-size:12px;margin:5px 0}
.notification-pagination{display:flex;gap:16px;align-items:center;justify-content:center;padding:14px 0}
.audit-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;margin-bottom:18px}
.audit-filter-grid label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:650}
.audit-filter-actions{display:flex;align-items:end;gap:8px;flex-wrap:wrap}
.audit-table-wrapper{overflow-x:auto}
.audit-table{width:100%;border-collapse:collapse;font-size:12px}
.audit-table th,.audit-table td{text-align:left;vertical-align:top;border-bottom:1px solid #e7eaf2;padding:11px 9px}
.audit-table th{font-weight:700;color:#445472;background:#f8f9fd}
.audit-table code{overflow-wrap:anywhere;font-size:11px}
.audit-table small{display:block;color:#8992a3}
@media(max-width:820px){.audit-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:550px){.audit-filter-grid{grid-template-columns:1fr}.notification-panel{width:min(410px,calc(100vw - 16px))}}
/* Audit retention and archived files */
.audit-storage-head{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:14px}
.audit-storage-head h2,.audit-archive-list h2{margin:0 0 8px;font-size:18px}
.audit-storage-head p{max-width:760px}
.audit-storage-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}
.audit-storage-stats>div{background:#f8f9fd;border:1px solid #e7eaf2;border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:6px}
.audit-storage-stats span{color:#69788c;font-size:12px}
.audit-storage-stats strong{font-size:20px;word-break:break-word}
.audit-archive-list{margin-top:18px}
@media(max-width:800px){.audit-storage-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){.audit-storage-stats{grid-template-columns:1fr}}

/* Thùng rác PDF */
.pdf-trash-count{border:1px solid #e7eaf2;background:#f8f9fd;border-radius:12px;padding:12px 18px;display:flex;flex-direction:column;gap:4px;white-space:nowrap}
.pdf-trash-count small{color:#69788c}
#pdf-trash .audit-table code{font-size:11px}
