/* حساب الفرق بين تاريخين — v1.0.0 */
.hao-date-calculator{
 --hao-green:#0B5B4A;--hao-green-dark:#073F35;--hao-orange:#FF681A;--hao-orange-dark:#E9570D;
 --hao-ink:#0B2530;--hao-text:#56656A;--hao-muted:#7A878B;--hao-surface:#FFFFFF;--hao-surface-2:#FAFBF9;
 --hao-soft-green:#EFF7F0;--hao-soft-orange:#FFF3E5;--hao-soft-blue:#EEF6FC;--hao-border:#E4E8E5;--hao-border-strong:#CAD5D1;
 --hao-danger:#B42318;--hao-danger-soft:#FFF1F0;--hao-success:#0B5B4A;--hao-shadow:0 20px 55px rgba(7,63,53,.10);--hao-shadow-soft:0 10px 28px rgba(11,37,48,.06);
 font-family:"Tajawal",Arial,sans-serif;direction:rtl;color:var(--hao-ink);line-height:1.65;width:100%;max-width:100%;box-sizing:border-box;
}
.hao-date-calculator *{box-sizing:border-box}.hao-date-calculator .screen-reader-text{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.hao-date-calculator button,.hao-date-calculator input,.hao-date-calculator select{font:inherit}.hao-date-calculator button{appearance:none;-webkit-appearance:none}
.hao-date-intro{text-align:center;margin-bottom:18px}.hao-date-intro p{margin:0;color:var(--hao-muted);font-size:14px}.hao-date-intro h2{margin:4px 0;font-size:28px;line-height:1.3}
.hao-date-startup{margin:0 0 12px;padding:10px 12px;border-radius:11px;background:var(--hao-soft-orange);color:var(--hao-orange-dark);font-size:13px;text-align:center}
.hao-date-mode-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:5px;border:1px solid var(--hao-border);border-radius:15px;background:var(--hao-surface-2);margin-bottom:16px}
.hao-date-mode{min-height:48px;border:0!important;border-radius:11px!important;background:transparent!important;color:var(--hao-muted)!important;font-weight:850!important;cursor:pointer!important;padding:9px 12px!important}
.hao-date-mode.is-active{background:var(--hao-green)!important;color:#fff!important;box-shadow:0 8px 18px rgba(11,91,74,.12)!important}
.hao-date-form{display:flex;flex-direction:column;gap:16px}.hao-date-panel[hidden]{display:none!important}
.hao-date-pair{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:14px;align-items:stretch}
.hao-date-card{min-width:0;padding:18px;border:1px solid var(--hao-border);border-radius:18px;background:var(--hao-surface);box-shadow:var(--hao-shadow-soft)}
.hao-date-card-head{display:flex;align-items:center;gap:10px;margin-bottom:14px;font-size:18px}.hao-date-badge{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--hao-soft-green);color:var(--hao-green);font-weight:900}
.hao-date-card:nth-child(3) .hao-date-badge{background:var(--hao-soft-orange);color:var(--hao-orange-dark)}
.hao-date-label{display:block;margin:0 0 6px;color:var(--hao-ink);font-size:13px;font-weight:800}.hao-date-calculator input,.hao-date-calculator select{width:100%;height:50px;border:1px solid var(--hao-border-strong);border-radius:12px;background:var(--hao-surface);color:var(--hao-ink);padding:0 13px;outline:none;font-size:15px;transition:border-color .16s ease,box-shadow .16s ease}
.hao-date-calculator input:focus,.hao-date-calculator select:focus{border-color:var(--hao-green);box-shadow:0 0 0 3px rgba(11,91,74,.10)}
.hao-date-segmented{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:4px;border-radius:13px;background:var(--hao-surface-2);border:1px solid var(--hao-border);margin-bottom:13px}.hao-date-segment{min-height:44px;border:1px solid transparent!important;border-radius:10px!important;background:transparent!important;color:var(--hao-muted)!important;font-weight:800!important;cursor:pointer!important;padding:8px 12px!important}.hao-date-segment.is-active{background:var(--hao-green)!important;color:#fff!important;border-color:var(--hao-green)!important}.hao-date-calendar-native{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.hao-date-fields{display:grid;grid-template-columns:.85fr 1.35fr 1fr;gap:9px}.hao-date-field{min-width:0}.hao-date-field-error{display:block;min-height:16px;margin-top:4px;color:var(--hao-danger);font-size:11px;line-height:1.45;font-weight:700}.hao-date-range{margin:7px 0 0;color:var(--hao-muted);font-size:11px;line-height:1.65}.hao-date-card.has-error{border-color:#F0B5AF;background:linear-gradient(180deg,var(--hao-surface),var(--hao-danger-soft))}
.hao-date-swap-wrap{display:flex;align-items:center;justify-content:center}.hao-date-swap{width:56px!important;height:56px!important;min-width:56px!important;min-height:56px!important;border-radius:999px!important;border:1px solid #F2CDAE!important;background:var(--hao-soft-orange)!important;color:var(--hao-orange-dark)!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;line-height:1!important;padding:0!important;font-size:24px!important;font-weight:900!important;cursor:pointer!important;box-shadow:0 8px 20px rgba(233,87,13,.09)!important}.hao-date-swap span{display:inline-flex;align-items:center;justify-content:center;line-height:1}.hao-date-swap:hover{background:#FFE6D0!important;transform:rotate(180deg)}
.hao-date-count-rule{display:grid;grid-template-columns:.8fr 1.2fr;gap:16px;align-items:center;padding:16px;border:1px solid var(--hao-border);border-radius:16px;background:var(--hao-surface-2)}.hao-date-count-rule p{margin:2px 0 0;color:var(--hao-muted);font-size:12px}.hao-date-rule-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}.hao-date-rule{min-height:64px;border:1px solid var(--hao-border)!important;border-radius:13px!important;background:var(--hao-surface)!important;color:var(--hao-ink)!important;padding:9px 12px!important;cursor:pointer!important;text-align:right!important}.hao-date-rule strong,.hao-date-rule small{display:block}.hao-date-rule small{margin-top:2px;color:var(--hao-muted);font-size:10px}.hao-date-rule.is-active{background:var(--hao-soft-green)!important;border-color:var(--hao-green)!important}.hao-date-rule.is-active strong{color:var(--hao-green-dark)}
.hao-date-business-options{padding:18px;border:1px solid var(--hao-border);border-radius:18px;background:var(--hao-surface-2)}.hao-date-advanced-head,.hao-date-custom-head{display:flex;align-items:center;justify-content:space-between;gap:14px}.hao-date-advanced-head h3,.hao-date-custom-head h4{margin:2px 0 0}.hao-date-kicker{display:block;color:var(--hao-orange-dark);font-size:12px;font-weight:850}.hao-date-source-chip{padding:6px 10px;border-radius:999px;background:var(--hao-soft-green);color:var(--hao-green-dark);font-size:11px;font-weight:850}.hao-date-business-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}.hao-date-setting-card,.hao-date-custom-block{padding:15px;border:1px solid var(--hao-border);border-radius:14px;background:var(--hao-surface)}.hao-date-setting-card h4,.hao-date-custom-block h4{margin:0 0 5px;font-size:15px}.hao-date-setting-card p,.hao-date-custom-block p,.hao-date-note{margin:0;color:var(--hao-muted);font-size:11px;line-height:1.65}.hao-date-weekdays{display:flex;flex-wrap:wrap;gap:7px;margin-top:11px}.hao-date-weekday input{position:absolute;opacity:0;pointer-events:none}.hao-date-weekday span{display:block;padding:7px 9px;border:1px solid var(--hao-border);border-radius:999px;background:var(--hao-surface-2);font-size:11px;font-weight:750;cursor:pointer}.hao-date-weekday input:checked+span{background:var(--hao-green);color:#fff;border-color:var(--hao-green)}.hao-date-toggle-row{display:flex;align-items:flex-start;gap:9px;font-size:12px;font-weight:750}.hao-date-toggle-row input{width:18px;height:18px;flex:0 0 auto;margin-top:3px}.hao-date-custom-block{margin-top:12px}.hao-date-mini-btn{border:1px solid var(--hao-border-strong)!important;border-radius:999px!important;background:var(--hao-surface)!important;color:var(--hao-green-dark)!important;font-size:11px!important;font-weight:850!important;padding:7px 11px!important;cursor:pointer!important}.hao-date-custom-list{display:flex;flex-direction:column;gap:8px;margin-top:10px}.hao-date-custom-row{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center}.hao-date-custom-row.is-range{grid-template-columns:1fr 1fr auto}.hao-date-custom-row input{height:42px}.hao-date-remove{width:36px;height:36px;border-radius:50%!important;border:1px solid #F0C6A3!important;background:var(--hao-soft-orange)!important;color:var(--hao-orange-dark)!important;cursor:pointer!important;font-weight:900!important}
.hao-date-base-card{max-width:680px;margin:0 auto}.hao-date-operation-card{margin-top:14px;padding:18px;border:1px solid var(--hao-border);border-radius:18px;background:var(--hao-surface-2)}.hao-date-operation{max-width:520px;margin:0 auto 16px}.hao-date-duration-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.hao-date-duration-grid label span{display:block;margin-bottom:5px;font-size:12px;font-weight:800}.hao-date-duration-grid input{text-align:center}
.hao-date-global-error{margin:0;padding:10px 12px;border:1px solid #F3C1BC;border-radius:11px;background:var(--hao-danger-soft);color:var(--hao-danger);font-size:13px;font-weight:750;text-align:center}.hao-date-global-error[hidden]{display:none!important}.hao-date-primary{min-height:58px;border:1px solid var(--hao-orange)!important;border-radius:16px!important;background:var(--hao-orange)!important;color:#fff!important;font-size:19px!important;font-weight:900!important;cursor:pointer!important;box-shadow:0 10px 24px rgba(255,104,26,.16)!important}.hao-date-primary:hover{background:var(--hao-orange-dark)!important;border-color:var(--hao-orange-dark)!important}.hao-date-contract{margin:4px 0 0;color:var(--hao-muted);font-size:13px;line-height:1.85;text-align:center}
.hao-date-output{margin-top:18px;padding:26px;border:1px solid var(--hao-border);border-radius:20px;background:var(--hao-surface);box-shadow:var(--hao-shadow)}.hao-date-output[hidden]{display:none!important}.hao-date-result-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:14px}.hao-date-result-title{margin:2px 0 0;font-size:clamp(27px,2vw,36px);line-height:1.25;font-weight:900;outline:none}.hao-date-result-rule{padding:7px 11px;border-radius:999px;background:var(--hao-soft-green);color:var(--hao-green-dark);font-size:11px;font-weight:850;white-space:nowrap}.hao-date-summary{padding:14px 16px;border-radius:14px;background:var(--hao-soft-green);color:var(--hao-green-dark);font-size:17px;font-weight:850;text-align:center;margin-bottom:14px}.hao-date-main-result{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hao-date-main-box{padding:20px;border-radius:16px;background:linear-gradient(135deg,var(--hao-green),var(--hao-green-dark));color:#fff;text-align:center}.hao-date-main-box.is-orange{background:linear-gradient(135deg,var(--hao-orange),var(--hao-orange-dark))}.hao-date-main-box span{display:block;font-size:13px;opacity:.85;font-weight:750}.hao-date-main-box strong{display:block;margin-top:4px;font-size:clamp(26px,2.1vw,38px);line-height:1.45;font-weight:900}.hao-date-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;margin-top:12px}.hao-date-stat{padding:14px 10px;border:1px solid var(--hao-border);border-radius:13px;background:var(--hao-surface-2);text-align:center}.hao-date-stat span{display:block;color:var(--hao-muted);font-size:11px;font-weight:750}.hao-date-stat strong{display:block;margin-top:4px;color:var(--hao-ink);font-size:16px;line-height:1.55;font-weight:900;overflow-wrap:anywhere}.hao-date-details{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.hao-date-detail-card{padding:16px;border:1px solid var(--hao-border);border-radius:14px;background:var(--hao-surface-2)}.hao-date-detail-card h4{margin:0 0 10px;font-size:16px}.hao-date-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.hao-date-detail{padding:10px;border:1px solid var(--hao-border);border-radius:10px;background:var(--hao-surface)}.hao-date-detail span{display:block;color:var(--hao-muted);font-size:10px;font-weight:750}.hao-date-detail strong{display:block;margin-top:3px;font-size:13px;line-height:1.65}.hao-date-audit{margin-top:12px;padding:14px;border:1px dashed var(--hao-border-strong);border-radius:13px;background:var(--hao-surface-2)}.hao-date-audit h4{margin:0 0 8px}.hao-date-audit-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.hao-date-audit-item{padding:8px 10px;border-radius:10px;background:var(--hao-surface);font-size:11px;color:var(--hao-text)}.hao-date-breakdown-list{margin:8px 0 0;padding:0;list-style:none}.hao-date-breakdown-list li{padding:5px 0;border-bottom:1px solid var(--hao-border);font-size:12px}.hao-date-breakdown-list li:last-child{border-bottom:0}.hao-date-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:14px}.hao-date-action{min-height:46px;border:1px solid var(--hao-border-strong)!important;border-radius:999px!important;background:var(--hao-surface)!important;color:var(--hao-green-dark)!important;font-size:13px!important;font-weight:850!important;cursor:pointer!important}.hao-date-action:hover{background:var(--hao-soft-green)!important;border-color:var(--hao-green)!important}.hao-date-action-primary{background:var(--hao-green)!important;color:#fff!important;border-color:var(--hao-green)!important}.hao-date-action-reset{color:var(--hao-orange-dark)!important}.hao-date-status{margin:0;text-align:center;color:var(--hao-success);font-size:12px;font-weight:750}.hao-date-status.has-message{margin-top:9px;padding:7px 10px;border-radius:10px;background:var(--hao-soft-green)}
@media(max-width:1000px){.hao-date-pair{grid-template-columns:1fr}.hao-date-swap-wrap{margin:-4px 0}.hao-date-swap{transform:rotate(90deg)}.hao-date-swap:hover{transform:rotate(270deg)}.hao-date-business-grid{grid-template-columns:1fr}.hao-date-duration-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.hao-date-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.hao-date-actions{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767px){.hao-date-mode-tabs{grid-template-columns:1fr}.hao-date-card{padding:15px}.hao-date-fields{grid-template-columns:.8fr 1.2fr}.hao-date-field-year{grid-column:1/-1}.hao-date-count-rule{grid-template-columns:1fr}.hao-date-rule-options{grid-template-columns:1fr}.hao-date-duration-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hao-date-output{padding:16px}.hao-date-result-head{flex-direction:column}.hao-date-result-rule{white-space:normal}.hao-date-main-result{grid-template-columns:1fr}.hao-date-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.hao-date-details{grid-template-columns:1fr}.hao-date-actions{grid-template-columns:1fr 1fr}.hao-date-action-reset{grid-column:1/-1}.hao-date-audit-list{grid-template-columns:1fr}.hao-date-custom-row.is-range{grid-template-columns:1fr}.hao-date-custom-row.is-range .hao-date-remove{justify-self:center}.hao-date-summary{font-size:15px}}
@media(max-width:420px){.hao-date-fields,.hao-date-stats,.hao-date-detail-grid,.hao-date-duration-grid,.hao-date-actions{grid-template-columns:1fr}.hao-date-field-year,.hao-date-action-reset{grid-column:auto}.hao-date-result-title{font-size:24px}.hao-date-main-box strong{font-size:25px}}
html.hao-dark .hao-date-calculator{--hao-ink:#F4F8F6;--hao-text:#C5D0CD;--hao-muted:#9AAEAA;--hao-surface:#102122;--hao-surface-2:#0D1C1D;--hao-soft-green:#173532;--hao-soft-orange:#382820;--hao-soft-blue:#132B35;--hao-border:#29413D;--hao-border-strong:#3B5B54;--hao-danger:#FF8C86;--hao-danger-soft:#351F1E;--hao-success:#7DD6C2;--hao-shadow:0 24px 65px rgba(0,0,0,.28);--hao-shadow-soft:0 10px 30px rgba(0,0,0,.2);color-scheme:dark}html.hao-dark .hao-date-mode.is-active,html.hao-dark .hao-date-segment.is-active{background:#16735F!important}html.hao-dark .hao-date-primary{color:#fff!important}
@media(prefers-reduced-motion:reduce){.hao-date-calculator *,.hao-date-calculator *::before,.hao-date-calculator *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
