@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700;800&display=swap');
:root{--bg:#f4f7fb;--ink:#102033;--muted:#66758a;--line:#e4eaf1;--card:#fff;--navy:#0b1220;--accent:#167d7f;--accent2:#20a4a6;--soft:#eaf7f6;--danger:#c73737;--shadow:0 16px 42px rgba(14,30,50,.08)}
*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;font-family:"Tajawal",system-ui,sans-serif;color:var(--ink);background:radial-gradient(circle at 85% 0%,#e8f6f5 0,transparent 26%),var(--bg);min-height:100vh}.shell{min-height:100vh}.topbar{height:84px;padding:0 clamp(18px,4vw,56px);display:flex;align-items:center;justify-content:space-between;background:rgba(255,255,255,.92);backdrop-filter:blur(14px);border-bottom:1px solid rgba(226,234,242,.9);position:sticky;top:0;z-index:20}.brand{display:flex;align-items:center;gap:14px}.brand-mark{width:46px;height:46px;border-radius:15px;background:linear-gradient(145deg,var(--navy),#1c334f);display:grid;place-items:center;box-shadow:0 10px 24px rgba(11,18,32,.18)}.brand-mark svg{width:24px;fill:#70e0d8}.brand h1{font-size:18px;margin:0;font-weight:800}.brand p{font-size:12px;margin:3px 0 0;color:var(--muted)}.status-chip{display:flex;align-items:center;gap:8px;border:1px solid #dce8e7;background:#f8fcfb;color:#365b5a;border-radius:999px;padding:9px 13px;font-size:12px;font-weight:700}.dot{width:8px;height:8px;border-radius:50%;background:#2eb67d;box-shadow:0 0 0 5px rgba(46,182,125,.1)}.content{width:min(1380px,calc(100% - 32px));margin:28px auto 48px}.hero-card{background:linear-gradient(120deg,#0b1220 0%,#13263d 65%,#18384a 100%);border-radius:26px;padding:30px 34px;color:#fff;display:flex;align-items:center;justify-content:space-between;gap:28px;box-shadow:0 22px 60px rgba(11,18,32,.18);position:relative;overflow:hidden}.hero-card:after{content:"";position:absolute;width:260px;height:260px;border:48px solid rgba(78,210,199,.09);border-radius:50%;left:-90px;top:-110px}.eyebrow{display:inline-block;font-size:12px;color:#79d9d2;font-weight:800;letter-spacing:.04em;margin-bottom:9px}.hero-copy h2{font-size:clamp(23px,3vw,36px);margin:0 0 9px;line-height:1.3}.hero-copy p{margin:0;color:#b9c8d7;max-width:720px;line-height:1.8}.hero-stat{min-width:170px;border:1px solid rgba(255,255,255,.13);border-radius:20px;padding:18px 20px;background:rgba(255,255,255,.06);backdrop-filter:blur(10px);display:flex;flex-direction:column}.hero-stat span{font-size:12px;color:#a9bdcf}.hero-stat strong{font-size:24px;margin:4px 0;color:#7fe0d9}.hero-stat small{color:#c9d5df}.workspace{display:grid;grid-template-columns:370px minmax(0,1fr);gap:22px;margin-top:22px}.panel{background:var(--card);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow)}.form-panel{padding:24px}.results-panel{padding:24px;min-width:0}.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px}.panel-head>div:first-child{display:flex;align-items:center;gap:10px}.step{font-size:11px;font-weight:800;color:var(--accent);background:var(--soft);border:1px solid #d2efed;padding:5px 8px;border-radius:8px}.panel h3{font-size:18px;margin:0}form{display:flex;flex-direction:column;gap:15px}label{display:flex;flex-direction:column;gap:8px;font-size:13px;font-weight:700;color:#304359}input{width:100%;height:46px;border:1px solid #dce4ed;border-radius:13px;background:#fbfcfe;padding:0 14px;font:inherit;color:var(--ink);outline:none;transition:.2s}input:focus{border-color:#54bebb;box-shadow:0 0 0 4px rgba(32,164,166,.09);background:white}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}.input-unit{position:relative}.input-unit input{padding-left:45px}.input-unit span{position:absolute;left:13px;top:14px;font-size:12px;color:#718097}.advanced{border:1px dashed #d7e1eb;border-radius:13px;padding:12px 14px;background:#fcfdff}.advanced summary{cursor:pointer;color:#52647a;font-size:13px;font-weight:700}.advanced label{margin-top:13px}.primary-btn,.ghost-btn,.small-btn{font-family:inherit;border:0;cursor:pointer;font-weight:800}.primary-btn{height:50px;border-radius:14px;background:linear-gradient(135deg,var(--accent),var(--accent2));color:white;font-size:15px;box-shadow:0 10px 22px rgba(22,125,127,.24);display:flex;align-items:center;justify-content:center;gap:9px;transition:.2s}.primary-btn:hover{transform:translateY(-1px);box-shadow:0 14px 26px rgba(22,125,127,.3)}.primary-btn:disabled{opacity:.55;cursor:not-allowed;transform:none}.ghost-btn{height:44px;border-radius:13px;background:#fff2f2;color:var(--danger);border:1px solid #f2d2d2}.hidden{display:none!important}.btn-icon{font-size:20px}.small-btn{background:#f4f7fa;color:#40546a;border:1px solid #dce4ed;border-radius:10px;padding:8px 12px}.small-btn:disabled{opacity:.45;cursor:not-allowed}.actions{display:flex;gap:8px}.progress-card{background:#f8fafc;border:1px solid #e4eaf1;border-radius:16px;padding:16px;margin-bottom:18px}.progress-top{display:flex;justify-content:space-between;align-items:center;font-size:13px}.progress-track{height:7px;border-radius:99px;background:#e6edf3;margin:12px 0 8px;overflow:hidden}.progress-bar{height:100%;width:0;background:linear-gradient(90deg,var(--accent),#58d5c9);border-radius:99px;will-change:width}.progress-card p{margin:0;font-size:12px;color:var(--muted)}.table-wrap{overflow:auto;max-height:540px;border:1px solid #edf1f5;border-radius:14px}table{width:100%;border-collapse:collapse;min-width:720px}thead{position:sticky;top:0;background:#f8fafc;z-index:2}th,td{text-align:right;padding:13px 14px;border-bottom:1px solid #edf1f5;font-size:13px}th{font-size:12px;color:#637289;font-weight:800}tbody tr:hover{background:#fbfdfd}.phone{direction:ltr;text-align:right;font-weight:700;color:#22415f}.map-link{color:var(--accent);font-weight:800;text-decoration:none}.empty-row td{text-align:center;padding:62px 20px}.empty-row td>div,.empty-row strong,.empty-row span{display:block}.empty-icon{font-size:38px;color:#9db0c2;margin-bottom:8px}.empty-row span{color:#8a98aa;font-size:12px;margin-top:5px}.history-panel{margin-top:22px;padding:22px 24px}.history-list{display:grid;gap:10px}.history-item{display:grid;grid-template-columns:minmax(220px,1.35fr) 90px 80px minmax(170px,.8fr) 64px 42px;align-items:center;gap:12px;padding:13px 14px;border:1px solid #e7edf3;border-radius:14px;background:#fcfdfe}.history-main{min-width:0;display:flex;flex-direction:column;gap:4px}.history-item strong{font-size:13px}.history-item span{font-size:12px;color:var(--muted)}.state-badge{justify-self:start;padding:6px 9px;border-radius:8px;background:#edf8f7;color:#267977;font-weight:800;font-size:11px}.delete-btn{border:0;background:#fff0f0;color:#b93a3a;border-radius:9px;width:34px;height:34px;cursor:pointer}.history-empty{padding:18px;color:#8493a5;text-align:center;border:1px dashed #dce5ee;border-radius:12px}footer{text-align:center;color:#8391a2;font-size:12px;padding:26px 0 8px}.toast{position:fixed;left:24px;bottom:24px;background:#102033;color:white;padding:12px 16px;border-radius:12px;box-shadow:0 12px 28px rgba(0,0,0,.18);font-size:13px;opacity:0;transform:translateY(12px);pointer-events:none;transition:.25s;z-index:50}.toast.show{opacity:1;transform:translateY(0)}
@media(max-width:900px){.workspace{grid-template-columns:1fr}.hero-card{align-items:flex-start}.hero-stat{min-width:145px}.content{width:min(100% - 20px,1380px)}.topbar{padding:0 14px}.status-chip{display:none}.history-item{grid-template-columns:1fr 1fr 80px}.history-item span:nth-child(2){display:none}.history-item .state-badge{justify-self:end}}
@media(max-width:580px){.topbar{height:72px}.brand-mark{width:40px;height:40px}.brand h1{font-size:15px}.brand p{font-size:10px}.hero-card{padding:22px;border-radius:20px;display:block}.hero-copy h2{font-size:23px}.hero-stat{margin-top:18px;width:100%}.form-panel,.results-panel,.history-panel{padding:17px;border-radius:18px}.two-col{grid-template-columns:1fr 1fr}.results-head{align-items:flex-start}.table-wrap{max-height:480px}.history-item{grid-template-columns:1fr auto}.history-item span,.history-item .delete-btn{display:none}.toast{left:12px;right:12px;bottom:12px;text-align:center}}

/* v3: force Western/English numerals and smoother real progress */
.latin-num,.phone,input[type=number],[dir=ltr]{font-variant-numeric:tabular-nums;unicode-bidi:plaintext}
.progress-numbers{display:flex;align-items:center;gap:12px;direction:ltr;font-variant-numeric:tabular-nums}
#progressPct{min-width:42px;font-weight:900;color:var(--accent);text-align:left}
#statusCount{color:var(--muted);min-width:66px;text-align:left}
input[type=number]{text-align:left}

.field-hint{display:block;margin-top:8px;font-size:12px;line-height:1.7;color:#64748b;font-weight:500}.form-panel input#location{font-variant-numeric:tabular-nums;letter-spacing:.15px}

/* v5: clearer numeric controls and optional-search affordance */
.optional-label{font-size:11px;color:#167d7f;background:#edf9f8;border:1px solid #cdebea;border-radius:999px;padding:2px 7px;margin-inline-start:6px;vertical-align:middle}
.big-number-field input,.big-number-input{height:56px!important;font-size:21px!important;font-weight:800!important;letter-spacing:.2px!important;background:#fff!important}
.big-number-field span{top:18px!important;font-size:13px!important;font-weight:800!important}
@media(max-width:580px){.big-number-field input,.big-number-input{height:54px!important;font-size:20px!important}}


/* v6: persistent history downloads + HTML export */
.history-note{margin:-10px 0 16px;color:var(--muted);font-size:12px;line-height:1.7}.history-downloads{display:flex;gap:6px;flex-wrap:wrap}.history-downloads a{display:inline-flex;align-items:center;justify-content:center;min-width:44px;padding:7px 8px;border-radius:9px;text-decoration:none;font-size:11px;font-weight:800;background:#f1f6f8;color:#36566b;border:1px solid #dce6ec}.history-downloads a.html{background:#edf8f7;color:var(--accent);border-color:#cde8e5}.history-downloads.disabled span{padding:7px 9px;border-radius:9px;background:#f6f8fa;color:#96a2af}.html-btn{background:#edf8f7;color:var(--accent);border-color:#cde8e5}.history-count{font-weight:800}.history-item .small-btn{white-space:nowrap}
@media(max-width:900px){.history-item{grid-template-columns:minmax(180px,1fr) 80px minmax(145px,.8fr) 60px 38px}.history-item .state-badge{display:none}.history-downloads{justify-content:flex-start}}
@media(max-width:580px){.history-item{grid-template-columns:1fr auto}.history-item .history-count,.history-item .delete-btn{display:none}.history-downloads{grid-column:1/-1}.history-item .small-btn{display:block}.history-main span{display:block!important}}

/* v8: progress width is animated frame-by-frame in JS to avoid double easing. */
