.hidden{display:none!important}
body{font-family:"Segoe UI",Tahoma,Arial,sans-serif}
.topbar h1{font-weight:700;line-height:1.25;letter-spacing:0}
.topbar span{line-height:1.4}
.welcome h2{font-size:clamp(18px,2.4vw,25px);font-weight:700;line-height:1.45;letter-spacing:0;margin:7px 0 9px;max-width:600px}
.welcome p{line-height:1.75}
.brand strong{font-size:14px;font-weight:700;line-height:1.45;white-space:normal}
.brand small{line-height:1.5}
.section-head h2{font-weight:700;line-height:1.4}
.login-screen{min-height:100vh;background:radial-gradient(circle at 20% 20%,#315b9c 0,#14213d 46%,#0d172d 100%);display:flex;align-items:center;justify-content:center;padding:25px}
.login-card{width:min(440px,100%);background:#fff;border-radius:18px;padding:34px 38px;text-align:center;box-shadow:0 25px 80px #07132980}
.login-logo-wrap{width:105px;height:105px;margin:0 auto 18px;padding:7px;border-radius:50%;background:#fff;box-shadow:0 5px 20px #1527431c}
.login-logo{width:100%;height:100%;object-fit:contain;border-radius:50%}
.login-kicker{color:#b48618;font-size:12px;margin:0 0 10px;font-weight:bold}
.login-card h1{font-size:23px;color:#14213d;margin:0 0 8px;line-height:1.5}
.login-card h2{font-size:17px;color:#2563eb;margin:0 0 15px}
.login-description{color:#718096;font-size:12px;line-height:1.8;margin:0 0 24px}
.login-form{text-align:right}
.login-form label{display:flex;flex-direction:column;gap:7px;color:#596579;font-size:12px;margin-bottom:14px}
.login-form input{height:42px;border:1px solid #dce3ed;border-radius:7px;padding:0 12px;outline:0}
.login-form input:focus{border-color:#2563eb;box-shadow:0 0 0 3px #2563eb14}
.login-button{width:100%;height:43px;margin-top:4px}
.login-error{display:none;color:#c24155;background:#fff0f2;border:1px solid #ffd1d8;border-radius:6px;padding:9px;text-align:center;font-size:11px}
.login-error.visible{display:block}
.login-hint{display:block;color:#8b96a8;font-size:10px;margin-top:17px}
.login-credit{margin:20px 0 0;padding-top:16px;border-top:1px solid #eef1f5;color:#8591a3;font-size:11px}
.login-credit strong{color:#2563eb;font-weight:700}
.brand-logo{width:43px;height:43px;border-radius:50%;object-fit:contain;background:#fff;padding:2px}
.logout-button{display:block;background:transparent;color:#b7c3d9;padding:8px 0 0;font-size:11px}
.logout-button:hover{color:#fff}
.sidebar-foot .dev-credit{display:block;color:#9fb0cc;font-weight:700;margin-top:5px}
.field-label{display:block;color:#53637a;font-weight:700;margin-bottom:1px}
.status-badge{display:inline-block;padding:4px 8px;border-radius:999px;background:#fff4df;color:#a66c00;font-size:10px}
.status-badge.done{background:#e8f8ef;color:#16804a}
.status-badge.returned{background:#fff0f2;color:#bf3e54}
.archive-count{display:inline-block;background:#e8f0ff;color:#285fc4;border-radius:999px;padding:4px 8px;font-size:10px}
.record-documents{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}
.record-document{display:inline-flex;align-items:center;gap:6px;background:#f3f6fb;color:#526176;border:1px solid #e2e8f1;border-radius:6px;padding:6px 8px;font-size:11px}
.record-document button{background:transparent;color:#2563eb;font-size:10px;padding:0}
.record-history{display:grid;gap:0;max-height:220px;overflow:auto;padding:2px 5px}
.history-item{display:flex;gap:11px;position:relative;padding:0 0 16px}
.history-item:not(:last-child)::before{content:"";position:absolute;right:5px;top:12px;bottom:0;width:1px;background:#dce5f1}
.history-dot{position:relative;z-index:1;flex:0 0 11px;width:11px;height:11px;margin-top:3px;border-radius:50%;background:#3b82f6;box-shadow:0 0 0 3px #e8f0ff}
.history-item strong{display:block;color:#34445d;font-size:11px;font-weight:600;line-height:1.7}
.history-item small{display:block;color:#8591a3;font-size:10px;margin-top:3px}
.history-empty{color:#8591a3;font-size:11px;margin:2px 0}
.action-modal{max-width:650px}
.archive-action{border:0;cursor:pointer}
.print-record-btn{display:inline-flex;align-items:center;gap:6px;background:#2563eb;color:#fff;padding:8px 11px;border-radius:7px;font-size:11px;font-weight:700;white-space:nowrap;box-shadow:0 2px 6px #2563eb2b}
.print-record-btn:hover{background:#1d4ed8}
.print-record-btn svg{width:15px;height:15px;flex:0 0 15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.attachment-list{max-height:360px;overflow:auto}
.print-options{display:grid;gap:10px;margin:12px 0 20px}
.print-options label{display:flex;align-items:flex-start;gap:10px;padding:12px;border:1px solid #e1e7f0;border-radius:8px;cursor:pointer}
.print-options label:has(input:checked){border-color:#8db2f5;background:#f5f8ff}
.print-options input{margin-top:4px;accent-color:#2563eb}
.print-options strong,.print-options small{display:block}
.print-options strong{font-size:12px;color:#243650}
.print-options small{font-size:10px;color:#718096;line-height:1.7;margin-top:4px}
.prepared-by{display:flex;flex-direction:column;gap:7px;color:#53637a;font-size:11px}
.prepared-by input{height:38px;border:1px solid #dce3ed;border-radius:6px;padding:8px}
.teal{background:#e5f8f7;color:#168c88}
.rose{background:#fff0f2;color:#c54c66}
.archive-toolbar{display:flex;gap:10px;background:#fff;padding:14px;border:1px solid #e7ebf2;border-radius:11px;margin-bottom:15px}
.archive-toolbar select{border:1px solid #dde3ec;border-radius:7px;padding:0 10px;color:#596579;min-width:180px}
.archive-note{color:#718096;font-size:11px}
.column-tools{display:flex;align-items:center;gap:12px;margin:0 0 12px}
.column-picker{position:relative;z-index:2}
.column-picker summary{display:inline-block;list-style:none;cursor:pointer}
.column-picker summary::-webkit-details-marker{display:none}
.column-picker-panel{position:absolute;top:calc(100% + 8px);right:0;width:min(850px,90vw);padding:16px;background:#fff;border:1px solid #dce3ed;border-radius:10px;box-shadow:0 12px 35px #14213d24}
.column-picker-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:10px;border-bottom:1px solid #edf0f5;color:#243650;font-size:12px}
.column-picker-actions>div{display:flex;gap:12px;flex-wrap:wrap}
.column-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 14px;padding:13px 0}
.column-options label{display:flex;align-items:center;gap:7px;color:#526176;font-size:11px;cursor:pointer}
.column-options input{accent-color:#2563eb}
.records-table{min-width:100%;width:max-content;table-layout:auto}
.records-table th,.records-table td{text-align:center;vertical-align:middle;white-space:normal;overflow-wrap:anywhere;word-break:normal;max-width:180px}
.records-table thead th{position:sticky;top:0;z-index:2;background:#eaf1ff;color:#173b70;font-size:11px;font-weight:700;padding:9px 8px;box-shadow:0 1px 0 #cbd8ee}
.records-table td{font-size:12px;font-weight:600;color:#334155;padding:8px 9px;line-height:1.5}
.records-table .record-column-ministry{max-width:200px}
.records-table .record-column-entity,.records-table .record-column-currentUser,.records-table .record-column-notes,.records-table .record-column-managerNote{max-width:220px}
.records-table .record-column-sourceSequence,.records-table .record-column-attachments{max-width:100px}
.records-table .record-column-phone,.records-table .record-column-nationalId,.records-table .record-column-previousPhone,.records-table .record-column-previousNationalId{min-width:112px;max-width:135px;white-space:nowrap;overflow-wrap:normal}
.records-table .record-column-actions{min-width:116px;white-space:nowrap}
.record-row-actions{display:flex;flex-wrap:nowrap;justify-content:center;align-items:center;gap:4px}
.record-row-actions .action-btn{cursor:pointer;font-size:10px;padding:5px 7px;white-space:nowrap;margin:0}
.record-row-actions .action-label{font-size:10px}
.record-row-actions svg,.document-preview-button svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.record-row-actions svg{width:14px;height:14px}
.document-preview-button svg{width:15px;height:15px}
.record-row-actions .action-icon-btn{display:inline-flex;align-items:center;justify-content:center;position:relative;width:25px;height:25px;padding:0;border:1px solid #e3ebfa;border-radius:7px;background:#f3f7ff;color:#2457a6;transition:background .15s ease,color .15s ease,border-color .15s ease}
.record-row-actions .action-icon-btn:hover{background:#e3edfd;border-color:#cfe0fb}
.record-row-actions .action-icon-btn.delete{background:#fdeef0;border-color:#f8dde1;color:#df4f63}
.record-row-actions .action-icon-btn.delete:hover{background:#fbdde2;border-color:#f4c9d0}
.record-row-actions .action-count{position:absolute;top:-5px;inset-inline-start:-5px;min-width:14px;height:14px;padding:0 3px;border-radius:8px;background:#2457a6;color:#fff;font-size:8px;line-height:14px;font-weight:700;text-align:center}
.record-download-modal{width:min(480px,94vw)}
.record-download-note{color:#718096;font-size:12px;line-height:1.7;margin:0 0 16px}
.record-download-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.record-download-option{display:flex;align-items:center;justify-content:center;gap:10px;min-height:70px;padding:12px;border:1px solid #e1e7f0;border-radius:9px;background:#f8fafc;color:#243650;cursor:pointer}
.record-download-option:hover{background:#edf3fb}
.record-download-option>span{padding:6px 7px;border-radius:5px;font-size:10px;font-weight:800}
.record-download-option.excel>span{background:#e5f5eb;color:#167544}
.record-download-option.pdf>span{background:#fff0f0;color:#b42332}
.record-download-option strong{font-size:12px}
.document-preview-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;cursor:pointer}
.document-preview-modal{width:min(1400px,97vw);max-width:97vw;padding:18px}
.document-preview-content{min-height:240px;max-height:86vh;display:flex;align-items:center;justify-content:center;overflow:auto;background:#f3f6fb;border:1px solid #e2e8f1;border-radius:8px;padding:10px}
.document-preview-frame{width:100%;height:82vh;border:0;background:#fff}
.document-preview-image{max-width:100%;max-height:82vh;width:auto;object-fit:contain}
.document-preview-spreadsheet{width:100%;border-collapse:collapse;background:#fff}
.document-preview-spreadsheet th,.document-preview-spreadsheet td{border:1px solid #dce3ed;padding:7px;text-align:right;white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px}
.document-preview-spreadsheet th{position:sticky;top:0;background:#eaf1ff;color:#173b70}
.document-preview-text{width:100%;max-height:82vh;overflow:auto;margin:0;padding:14px;background:#fff;color:#243650;text-align:right;white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.8 Tahoma,"Segoe UI",sans-serif}
.document-preview-unavailable{color:#718096;font-size:13px;text-align:center;line-height:1.8}
.recordsView .table-wrap,#recordsView .table-wrap{max-height:min(65vh,620px);overflow:auto}
.records-table .notes-cell{white-space:normal;min-width:0;max-width:180px;overflow-wrap:anywhere;line-height:1.5}
.records-pagination{display:flex;justify-content:space-between;align-items:center;padding:12px 4px;color:#718096;font-size:12px}
.records-pagination>div{display:flex;gap:8px}
.user-management-grid{display:grid;grid-template-columns:minmax(280px,380px) minmax(0,1fr);gap:18px;align-items:start;margin-top:18px}
.user-form-card{display:grid;gap:12px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:20px;box-shadow:var(--shadow)}
.user-form-card h3{margin:0;color:var(--navy);font-size:16px}
.user-form-card>label{display:flex;flex-direction:column;gap:6px;color:#526176;font-size:12px}
.user-form-card>label input:not([type=checkbox]),.user-form-card>label select{height:36px;border:1px solid #dce3ed;border-radius:6px;padding:7px;background:#fff;color:var(--ink)}
.user-form-card .permission-list{display:grid;grid-template-columns:1fr 1fr;gap:9px;border:1px solid #e7ebf2;border-radius:8px;padding:12px}
.user-form-card .permission-list legend{padding:0 5px;color:var(--navy);font-size:12px;font-weight:bold}
.user-form-card .permission-list label,.user-form-card .user-active{display:flex;align-items:center;gap:6px;color:#526176;font-size:11px}
.user-form-card .permission-list input,.user-active input{accent-color:#2563eb}
.user-form-card .optional{display:inline;color:#718096}
.users-table-card{min-width:0}
.nav-item[hidden],#resetUserForm[hidden]{display:none}
.undertaking-search-card{max-width:760px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:22px;box-shadow:var(--shadow)}
.undertaking-search-form>label,.undertaking-matches>label{display:block;margin-bottom:8px;color:var(--navy);font-size:13px;font-weight:700}
.undertaking-search-row{display:flex;gap:10px}
.undertaking-search-row input,.undertaking-matches select{height:42px;min-width:0;flex:1;border:1px solid #dce3ed;border-radius:7px;padding:9px 12px;background:#fff;color:var(--ink);outline:0}
.undertaking-search-row input:focus,.undertaking-matches select:focus{border-color:var(--blue);box-shadow:0 0 0 2px #2563eb16}
.undertaking-result{margin-top:17px;padding:13px;border-radius:8px;background:#f5f8fc;color:#43536b;font-size:13px;line-height:1.7}
.undertaking-matches{margin-top:14px}
.undertaking-matches[hidden]{display:none}
.undertaking-actions{margin-top:16px}
.undertaking-actions button:disabled{opacity:.5;cursor:not-allowed}
.undertaking-search-card>.archive-note{display:block;margin:14px 0 0;line-height:1.7}
.undertaking-fields{margin-top:18px;padding-top:16px;border-top:1px solid #e7ebf2}
.undertaking-fields[hidden]{display:none}
.undertaking-fields h3{margin:0;color:var(--navy);font-size:14px}
.undertaking-fields>p{margin:5px 0 13px;color:#718096;font-size:11px}
.undertaking-fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.undertaking-fields-grid label{display:flex;min-width:0;flex-direction:column;gap:5px;color:#53637a;font-size:11px;font-weight:700}
.undertaking-fields-grid input{height:38px;min-width:0;border:1px solid #dce3ed;border-radius:7px;padding:8px 10px;color:var(--ink);font:inherit;font-size:12px;font-weight:400}
.undertaking-fields-grid input:focus{border-color:var(--blue);outline:0;box-shadow:0 0 0 2px #2563eb16}
.backup-card-danger{border-color:#f3d3d7}
.backup-card-danger h3{color:#a52d3c}
.danger-button{background:#b83245;color:#fff;border-radius:7px;padding:10px 16px;font-size:12px;font-weight:700}
.danger-button:hover{background:#982637}
.danger-button:focus-visible{outline:3px solid #f5a7b1;outline-offset:2px}
@media(max-width:900px){.user-management-grid{grid-template-columns:1fr}}
.records-page-size{display:flex;align-items:center;gap:8px}
.records-page-size select{height:32px;padding:0 8px;border:1px solid #dce3ed;border-radius:6px;background:#fff;color:#526176}
.records-pagination button:disabled{opacity:.5;cursor:not-allowed}
input[type=file]{padding:8px!important;background:#fbfcfe!important}
@media(max-width:600px){.login-card{padding:28px 22px}.column-picker-panel{position:fixed;top:15vh;right:5vw;max-height:70vh;overflow:auto}.column-options{grid-template-columns:repeat(2,minmax(0,1fr))}.column-picker-actions{align-items:flex-start;flex-direction:column}}
@media(max-width:600px){.undertaking-fields-grid{grid-template-columns:1fr}.undertaking-search-row{flex-direction:column}}
.record-document svg{width:14px;height:14px;flex:0 0 14px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.laws-toolbar{flex-wrap:wrap}
.laws-table .law-sortable{cursor:pointer;user-select:none}
.laws-table .law-sortable .sort-indicator{display:inline-block;min-width:10px;margin-inline-start:3px;color:#9aa7ba;font-size:9px}
.laws-table .law-sortable.active{color:#285fc4}
.laws-table .law-sortable.active .sort-indicator{color:#285fc4}
.law-title-button{background:transparent;padding:0;color:var(--navy);font-weight:700;font-size:12px;text-align:right}
.law-title-button:hover{color:var(--blue);text-decoration:underline}
.law-badge{display:inline-block;background:#eaf1ff;color:#285fc4;border-radius:999px;padding:3px 9px;font-size:10px}
.law-file-badge{display:inline-flex;align-items:center;gap:5px;background:#f3f6fb;color:#526176;border:1px solid #e2e8f1;border-radius:6px;padding:4px 8px;font-size:10px}
.law-file-badge svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.law-no-file{color:#aab4c4}
.record-documents .law-remove-file{display:inline-flex;flex-direction:row;align-items:center;gap:6px;color:#9c3b48;font-size:11px}
.law-meta{display:flex;flex-wrap:wrap;gap:12px 22px;margin-bottom:16px}
.law-meta-item{display:flex;flex-direction:column;gap:3px;min-width:90px}
.law-meta-item span{color:var(--muted);font-size:10px}
.law-meta-item strong{color:var(--navy);font-size:13px}
.law-summary{white-space:pre-wrap;background:#f7f9fc;border:1px solid #e7ebf2;border-radius:9px;padding:14px;color:#41506a;font-size:12px;line-height:1.9;min-height:20px}
.ministry-delegation-label{display:block}
.ministry-delegation-label span{display:flex;align-items:center;gap:8px;color:var(--navy);font-size:12px}
.ministry-delegation-label small{display:block;color:var(--muted);font-weight:400;margin-top:3px;font-size:11px}
.delegation-badge{display:inline-flex;align-items:center;gap:5px;background:#e7f6ec;color:#18794e;border:1px solid #b7e0c8;border-radius:999px;padding:3px 10px;font-size:11px;font-weight:700}
.delegation-badge.no{background:#eef1f5;color:#667085;border-color:#dbe1ea}
.ministry-law-row{display:flex;align-items:center;gap:10px;padding:9px 4px;border-bottom:1px solid #eef1f5;flex-wrap:wrap}
.ministry-law-row>span{color:var(--muted);font-size:12px}
.ministry-law-row .record-row-actions{margin-inline-start:auto}

/* استعلام على موظف - دفعات وزارة العمل */
.archive-toolbar{flex-wrap:wrap}
.ghost.with-icon{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.ghost.with-icon svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.employee-query-btn{display:inline-flex;align-items:center;gap:6px;background:#2563eb;color:#fff;padding:8px 11px;border-radius:7px;font-size:11px;font-weight:700;white-space:nowrap}
.employee-query-btn:hover{background:#1d4ed8}
.employee-detail-table{min-width:0;width:100%}
.employee-detail-table th,.employee-detail-table td{border:1px solid #cbd3df;padding:8px 10px;font-size:12px;text-align:right;vertical-align:top}
.employee-detail-table th{width:34%;background:#f8fafc;color:#40516a;font-weight:700}
#laborStatus{margin:0 0 12px}

/* بحث عام في الشريط العلوي */
.global-search{position:relative;display:flex;align-items:center;gap:7px;flex:1;max-width:520px;margin:0 22px;height:40px;padding:0 12px;border:1px solid #dde3ec;border-radius:9px;background:#fff}
.global-search:focus-within{border-color:#9bbcf5;box-shadow:0 0 0 3px #2563eb12}
.global-search .search-icon{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:#74849a;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.global-search input{border:0;outline:0;width:100%;background:transparent;color:var(--ink);font-size:13px}
.global-search-results{position:absolute;top:calc(100% + 7px);right:0;left:0;background:#fff;border:1px solid var(--line);border-radius:11px;box-shadow:0 22px 60px #10203b2b;max-height:62vh;overflow:auto;z-index:7;padding:7px}
.global-search-results[hidden]{display:none}
.gs-group{padding:7px 11px 3px;color:#8591a3;font-size:11px;font-weight:700}
.gs-item{display:block;width:100%;text-align:right;background:transparent;border-radius:8px;padding:9px 11px;color:var(--ink);font-size:13px;cursor:pointer}
.gs-item:hover,.gs-item:focus-visible{background:#eef4ff;outline:0}
.gs-item span{display:block}
.gs-item small{display:block;color:#718096;font-size:11px;margin-top:3px}
.gs-empty{padding:15px;text-align:center;color:#718096;font-size:12px}
@media(max-width:900px){.global-search{margin:0 12px}}
@media(max-width:600px){.global-search{display:none}}
