:root{font-family:system-ui,sans-serif;color:#122d3a;background:#f6f6f0;font-size:15px}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
header{background:#173a4a;color:white}
.head,main{max-width:1360px;margin:auto;padding:24px clamp(16px,4vw,56px)}
.head,.toolbar,.aside-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{font-size:.72rem;font-weight:750;letter-spacing:.14em;color:#91d7e7}
h1{font-size:clamp(1.5rem,3vw,2.35rem);margin:5px 0 0;letter-spacing:-.04em}
h2{font-size:1rem;margin:0}
.identity{display:flex;align-items:end;flex-wrap:wrap;gap:12px}
#upload{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px;background:white;border:1px solid #d4e1e7;border-radius:12px;padding:8px 12px}
#scanProgress,#scanErrors,#photoQueueDetails{grid-column:1/-1}
#scanProgress{width:100%;height:8px;accent-color:#24596d}
#scanErrors{margin:0;padding-inline-start:20px;font-size:.86rem;color:#8a4405;overflow-wrap:anywhere}
label{display:grid;gap:5px;font-weight:650;font-size:.84rem}
.file{min-width:0}
input,select,button{font:inherit}
input:not([type=checkbox]),select{width:100%;min-height:39px;border:1px solid #a5bbb1;border-radius:6px;padding:7px 9px;background:#fff;color:inherit}
button{cursor:pointer;border:1px solid #cddbd3;border-radius:7px;padding:9px 13px;background:white;color:inherit;font-weight:660}
button:disabled{cursor:default;opacity:.55}
button:not(:disabled):hover{border-color:#7babba;background:#edf5f8}
button.primary:not(:disabled):hover{background:#18475c;color:white}
button[aria-pressed=true]{background:#e0eff4;border-color:#8ab6c4}
.primary{background:#24596d;border-color:#24596d;color:white;min-height:39px}
.head .primary{background:#d8eef4;color:#122d3a;border-color:#d8eef4}
#feedback,#issues,#rowNotes,#confirmStatus,#counts{font-size:.86rem;line-height:1.45}
#draftStatus{font-size:.84rem;color:#4a6876;margin:4px 0 10px}
#draftStatus.needs-review{color:#8a4405}
#feedback:empty,#issues:empty,#confirmStatus:empty{display:none}
#files{display:flex;flex-wrap:wrap;gap:6px;margin:14px 0}
#files button[aria-current=true]{background:#deedf1;border-color:#8cbecb}
.workspace{display:grid;grid-template-columns:minmax(340px,1.1fr) minmax(320px,1fr);gap:14px;align-items:start}
.results,aside{background:white;border:1px solid #d8e3dc;border-radius:12px;padding:16px;min-width:0}
.results .identity label{flex:1 1 145px}
.toolbar{margin:16px 0 8px;flex-wrap:wrap}
.check{display:flex;align-items:center;gap:6px}
.table{overflow:auto;overscroll-behavior:contain;scroll-padding-top:40px}
.results{display:flex;flex-direction:column;height:var(--review-height,calc(100dvh - 235px));min-height:230px}
.results-tools{min-height:0;overflow:auto;flex:0 1 auto;scrollbar-width:thin}
.results .table{flex:1 0 130px;min-height:0}
table{border-collapse:collapse;width:100%;white-space:nowrap;font-variant-numeric:tabular-nums}
td,th{text-align:left;padding:8px;border-bottom:1px solid #e1e9e3}
thead{position:sticky;top:0;background:#f1f6f3}
tbody tr{cursor:pointer}
tbody tr[aria-selected=true]{background:#e5f0f4}
.cell-day{border:0;padding:0 6px;background:transparent;min-width:32px;text-decoration:underline}
td:last-child{font-size:.78rem}
.needs-review{color:#8a4405;font-weight:700}
.calculated-exit,#confirm input.calculated-exit{color:#24596d;font-weight:700;text-decoration:underline dotted;text-underline-offset:3px}
aside{position:sticky;top:12px}
#preview{background:#edf2ef;border-radius:6px;margin:12px 0;padding:7px}
#preview:not(:has(#alignmentCanvas:not([hidden]))){overflow:auto;max-height:48dvh}
#source{display:block;max-width:100%;max-height:530px;margin:auto}
#crop{width:100%;height:auto;display:block}
#crop,#grids:not([hidden]){width:var(--scan-zoom,100%)}
#preview[style] #source{width:var(--scan-zoom);max-width:none;max-height:none}
#crop[hidden],#source[hidden]{display:none}
.aside-top a{color:#175c4b;font-size:.84rem}
#confirm .identity label{flex:1 1 80px}
#confirm>label{margin-top:10px}
#confirm p{margin:8px 0}
@media(max-width:820px){.workspace{grid-template-columns:1fr}aside{position:static}.results{height:auto}.results .table{flex:auto;max-height:55dvh}}

.actions{display:flex;flex-wrap:wrap;align-items:end;gap:8px;margin:9px 0}
#cornerHint{font-size:.87rem;margin:10px 0}
#jump:not([hidden]){display:flex;gap:9px;align-items:end;margin-top:10px}
#jump select{min-width:90px}
#grids:not([hidden]){display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}
#grids figure{margin:0}
#grids figcaption{font-size:.83rem;margin:0 0 5px;font-weight:650}
#grids img{display:block;width:100%;border:1px solid #cddbd3}
.workspace.aligning{display:block}
.workspace.aligning>.results{display:none}
.workspace.aligning aside{position:static}
#alignmentCanvas:not([hidden]){display:block;width:100%;height:auto;cursor:crosshair}
#confirm button:focus-visible,.cell-day:focus-visible{outline:2px solid #24596d;outline-offset:3px}

.brand-lockup{display:flex;align-items:center;gap:12px}
.asiya-logo{display:block;flex:none;border-radius:7px;object-fit:contain;background:white;padding:3px}
#dropZone{position:relative;border:1px dashed #83aab5;border-radius:8px;background:#f3f8f9}
#dropZone label{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;min-height:38px;padding:5px 12px;cursor:pointer;gap:3px 12px}
#dropZone label span{font-weight:500}
#dropZone input{position:absolute;width:1px;height:1px;min-height:0;padding:0;border:0;clip-path:inset(50%);overflow:hidden}
#dropZone.dragging,#dropZone:focus-within{background:#e1f1f6;outline:2px solid #40a7c2;outline-offset:2px}
#photoQueue:not([hidden]){flex:0 0 100%;display:flex;flex-wrap:wrap;gap:6px;padding:0;margin:0;list-style:none}
#photoQueue li{display:flex;align-items:center;gap:7px;max-width:100%;padding:3px 6px 3px 10px;background:#edf4f6;border-radius:6px}
#photoQueue li span{min-width:0;overflow-wrap:anywhere;font-size:.86rem}
#photoQueue li button{padding:4px 7px;font-size:.83rem}
.passport-input{display:flex;flex:1 1 255px;gap:6px;align-items:end}
.passport-input button{flex:none;min-height:39px}
#passportStatus{margin:8px 0 5px;font-size:.85rem;color:#4a6876}
#passportCrop:not([hidden]){display:block;width:100%;max-width:510px;border:1px solid #d7e1df;border-radius:6px}
@media(max-width:440px){.asiya-logo{width:38px;height:38px}.brand-lockup{gap:7px}.head{gap:7px}.head .primary{padding:7px 9px}.passport-input{flex-wrap:wrap}}

#passportDialog{width:min(940px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:16px;border:1px solid #cddde0;border-radius:10px;color:#122d3a}
#passportDialog::backdrop{background:#122d3a99}
#passportBoxCanvas{display:block;width:auto;max-width:100%;max-height:calc(100dvh - 218px);height:auto;margin:auto;cursor:crosshair;touch-action:none}
#passportBoxStatus{font-size:.9rem}

html[dir=rtl]{background:#f2f6fa;font-family:Arial,"Noto Sans Hebrew",sans-serif}
html[dir=rtl] header{position:sticky;top:0;z-index:10;background:#173a4a;box-shadow:0 2px 8px #16354b20}
html[dir=rtl] h1{letter-spacing:normal}
html[dir=rtl] td,html[dir=rtl] th{text-align:start}
html[dir=rtl] td:nth-child(n+2):nth-child(-n+5){direction:ltr;text-align:right}
html[dir=rtl] aside{top:88px;max-height:calc(100dvh - 104px);overflow:auto}
.head{padding-block:12px}
.head h1{font-size:clamp(1.25rem,3vw,1.8rem)}
.header-tools{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.head input[type=month]{width:auto;max-width:155px;color:#fff;color-scheme:dark;background:#21485a;border-color:#7c9aa6}
.icon-button{width:39px;height:39px;display:grid;place-items:center;padding:0;border:1px solid #7c9aa6;border-radius:7px;color:white;background:transparent;cursor:pointer}
.icon-button:hover,button.icon-button:not(:disabled):hover{background:#285269}
.icon-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#excelMenu{position:relative}
#excelMenu summary::-webkit-details-marker{display:none}
.excel-actions{position:absolute;inset-inline-end:0;top:calc(100% + 6px);min-width:205px;display:grid;gap:4px;padding:5px;background:white;color:#173a4a;border:1px solid #cddbd3;border-radius:8px;box-shadow:0 8px 20px #122d3a24}
.excel-actions button{text-align:start}
.signed-in-name{font-size:.86rem;color:#e1edf6;max-width:16ch;overflow:hidden;text-overflow:ellipsis}
.login-page{min-height:100vh;display:grid;place-items:center;padding:16px}
.login-card{width:min(100%,430px);margin:0;padding:26px;background:white;border:1px solid #d8e3ec;border-radius:16px;box-shadow:0 12px 38px #173a4a14}
.login-card img{display:block;margin:0 auto 12px;object-fit:contain}
.login-card h1,.login-card>p{text-align:center}
.login-card form{display:grid;gap:15px}
.login-card button{width:100%}
@media(max-width:820px){html[dir=rtl] aside{position:static;max-height:none;overflow:visible}.head{padding-block:12px}.header-tools{gap:5px}}
@media(max-width:620px){.head{flex-wrap:wrap}.header-tools{justify-content:flex-start}.head input[type=month]{min-width:0}#dropHint{font-size:.76rem}}
@media(max-width:480px){.signed-in-name{display:none}.header-tools button{padding:6px;font-size:.8rem}.head h1{font-size:1.12rem}.head .primary{padding:6px}}
.employee-search-label{margin-top:15px;max-width:520px}
.identity-details{border-block:1px solid #e0e9ec;margin:12px 0;padding:8px 0}
.identity-details summary{color:#24596d;cursor:pointer;font-size:.86rem;font-weight:650}
.identity-details[open] #passportCrop{margin-top:8px}
.passport-parts{margin-top:8px;max-width:520px}
.passport-parts summary{cursor:pointer}
.passport-parts form{display:flex;align-items:end;flex-wrap:wrap;gap:8px;margin:8px 0}
.passport-parts label{flex:1 1 120px}
.search-status{font-size:.84rem;color:#4a6876;margin:6px 0}
.employee-search-results{margin:6px 0;padding:0;list-style:none;max-height:210px;overflow:auto}
.employee-search-results button{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px;width:100%;text-align:start}
.employee-search-results li+li{margin-top:4px}

#files{align-items:end;gap:8px;min-width:0}
#files label{flex:1 1 240px;max-width:520px;min-width:0}
#files select{min-width:0;text-overflow:ellipsis}
#sheetPosition{font-size:.85rem;padding-block:7px;color:#4a6876}
#photoQueueDetails:not([hidden]){flex:0 0 100%;min-width:0}
#photoQueueDetails summary,#hoursColumnOptions summary{cursor:pointer;color:#24596d;font-size:.88rem;font-weight:650}
#photoQueue{max-height:140px;overflow:auto}
#photoQueueDetails[open] #photoQueue{margin-top:8px}
#hoursColumnOptions{margin-block:10px}
#calculatedHours{background:#edf5f8;padding:8px 10px;border-radius:6px}
.workspace.preview-floating{display:block}
.workspace.preview-floating #scanPanel{position:fixed;z-index:15;width:min(820px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow:auto;box-shadow:0 18px 58px #122d3a36;border-color:#8ab6c4}
.preview-floating #previewHandle{cursor:move;touch-action:none;user-select:none}
#resizePreview{display:none}
.preview-floating #resizePreview{display:block;position:sticky;bottom:0;margin-inline-start:auto;width:26px;height:26px;background:linear-gradient(135deg,transparent 50%,#8ab6c4 50%,#8ab6c4 58%,white 58%,white 66%,#8ab6c4 66%);cursor:nwse-resize;touch-action:none}
#learningRefreshStatus{font-size:.84rem;color:#24596d}
.gallery-view{display:flex;align-items:center;gap:6px}
#galleryCards.gallery-list{grid-template-columns:1fr}
.gallery-list .gallery-report{flex-direction:row;align-items:center;flex-wrap:wrap}
.gallery-list .gallery-card{grid-template-columns:64px minmax(120px,1fr) repeat(3,auto);align-items:center;gap:10px}
.gallery-list .gallery-card img{height:48px}
.gallery-list .gallery-report-actions{border-top:0}
#cameraDialog{width:min(620px,calc(100vw - 24px));border:1px solid #cddde0;border-radius:10px;color:#122d3a;padding:16px}
#cameraDialog::backdrop{background:#122d3a99}
#cameraPreview{display:block;width:100%;max-height:58dvh;margin-top:8px;background:#edf5f8}
@media(max-width:620px){#upload{grid-template-columns:1fr 1fr}#dropZone{grid-column:1/-1}.gallery-list .gallery-card{grid-template-columns:48px minmax(0,1fr)}.gallery-list .gallery-card img{grid-row:span 4}}
.row-options{margin-top:8px;color:#24596d;font-size:.85rem}
.row-options summary{cursor:pointer;font-weight:650}
.row-options label{margin-top:7px}
#duplicateNotice{font-size:.83rem}
.gallery-head{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin-bottom:16px}
.gallery-head input{width:min(100%,340px)}
.gallery-head select{width:auto;max-width:100%}
.passport-match{color:#175c4b}
.gallery-head a{color:#24596d}
#galleryCards{display:grid;grid-template-columns:repeat(auto-fill,minmax(175px,1fr));gap:12px}
.gallery-report{min-width:0;display:flex;flex-direction:column;background:#fff;border:1px solid #cddbd3;border-radius:8px}
.gallery-card{min-width:0;display:grid;gap:5px;text-align:start;padding:9px;background:transparent;border:0;flex:1}
.gallery-card img{display:block;width:100%;height:140px;object-fit:cover;object-position:top;border-radius:4px;background:#edf2ef}
.gallery-card strong{overflow-wrap:anywhere}
.gallery-card span{font-size:.83rem;font-weight:500}
.gallery-report-actions{display:flex;flex-wrap:wrap;gap:4px;padding:6px;border-top:1px solid #e0e9ec}
.gallery-report-actions button{font-size:.78rem;padding:5px 7px;flex:1}
.danger-text{color:#932e2e}
#removeSheetDialog{width:min(420px,calc(100% - 24px));border:1px solid #cddde0;border-radius:10px;color:#122d3a;padding:18px}
#removeSheetDialog::backdrop{background:#122d3a99}
#removeSheetName{font-weight:700;overflow-wrap:anywhere}
.danger-button,.danger-button:not(:disabled):hover{color:white;background:#932e2e;border-color:#932e2e}

.reader-home-link{color:#fff;text-underline-offset:.2em;font-size:.875rem}
.reader-login-links{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-top:1rem}
#readerInstallHelp{width:min(27rem,calc(100% - 2rem));border:1px solid #b3c5cc;border-radius:.7rem;padding:1.25rem}
#readerInstallHelp::backdrop{background:#0d2436aa}
#readerInstallHelp form{margin-top:1rem}
