*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%;overflow-x:hidden;touch-action:manipulation}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;background:#f4f7fa;color:#1e293b;direction:rtl}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
input,select,textarea{font-family:inherit;font-size:16px}
#root{min-height:100%;display:flex;flex-direction:column}

/* login */
.login-wrap{flex:1;display:flex;align-items:center;justify-content:center;padding:24px}
.login-card{background:#fff;border-radius:20px;padding:32px 24px;width:100%;max-width:360px;box-shadow:0 8px 30px rgba(15,40,60,.08);text-align:center}
.login-card img{width:72px;height:72px;border-radius:18px;margin-bottom:12px}
.login-card h1{font-size:22px;margin-bottom:4px;color:#0f172a}
.login-card p{font-size:14px;color:#64748b;margin-bottom:20px}
.login-card label{display:block;text-align:right;font-size:13px;color:#64748b;margin:12px 0 6px}
.login-card input{width:100%;padding:13px 14px;border:1.5px solid #e2e8f0;border-radius:12px;background:#f8fafc;text-align:center}
.login-card input:focus{outline:none;border-color:#0891b2;background:#fff}
.login-btn{width:100%;margin-top:20px;padding:14px;border-radius:12px;background:#0e7490;color:#fff;font-size:17px;font-weight:600}
.login-err{color:#dc2626;font-size:14px;margin-top:12px;min-height:18px}

/* header */
.topbar{display:flex;align-items:center;gap:10px;padding:14px 16px 8px}
.topbar img{width:34px;height:34px;border-radius:9px}
.topbar .t{flex:1;min-width:0}
.topbar .t h1{font-size:17px;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .t span{font-size:12px;color:#64748b}
.icon-btn{width:38px;height:38px;border-radius:11px;background:#fff;box-shadow:0 1px 4px rgba(15,40,60,.08);display:flex;align-items:center;justify-content:center;font-size:18px;position:relative}
.icon-btn .dot{position:absolute;top:7px;left:7px;width:9px;height:9px;border-radius:50%;background:#dc2626;display:none}
.icon-btn.has-dot .dot{display:block}

/* content */
.content{flex:1;padding:6px 12px 90px;width:100%}
@media(min-width:768px){.content{padding:10px 28px 100px}}

/* stat cards */
.stats{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin:8px 0 14px}
@media(min-width:768px){.stats{grid-template-columns:repeat(4,1fr)}}
.stat{background:#fff;border-radius:14px;padding:12px 14px;box-shadow:0 1px 4px rgba(15,40,60,.06);text-align:right}
.stat .v{font-size:22px;font-weight:700;color:#0f172a}
.stat .l{font-size:12.5px;color:#64748b;margin-top:2px}
.stat.big{grid-column:1/-1;text-align:center;padding:18px}
.stat.big .v{font-size:38px}
.green{color:#059669!important}.red{color:#dc2626!important}

/* month nav */
.monnav{display:flex;align-items:center;justify-content:center;gap:14px;margin:6px 0 10px}
.monnav button{width:36px;height:36px;border-radius:10px;background:#fff;box-shadow:0 1px 4px rgba(15,40,60,.08);font-size:17px;color:#0e7490}
.monnav .ml{font-size:15px;font-weight:600;min-width:110px;text-align:center}

/* filter chips */
.chips{display:flex;gap:7px;overflow-x:auto;padding:4px 0 10px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:0 0 auto;padding:7px 14px;border-radius:999px;background:#fff;font-size:13.5px;color:#475569;box-shadow:0 1px 3px rgba(15,40,60,.07)}
.chip.on{background:#0e7490;color:#fff;font-weight:600}
.search{width:100%;padding:12px 14px;border:1.5px solid #e2e8f0;border-radius:12px;background:#fff;margin:2px 0 10px}
.search:focus{outline:none;border-color:#0891b2}

/* table cards */
.tbl{background:#fff;border-radius:14px;box-shadow:0 1px 4px rgba(15,40,60,.06);overflow:hidden}
.tbl .thead,.tbl .trow{display:grid;grid-template-columns:2.2fr 1fr .9fr .8fr;gap:4px;align-items:center;padding:10px 12px;font-size:13.5px}
.tbl .thead{background:#f8fafc;color:#64748b;font-size:12px;font-weight:600}
.tbl .trow{border-top:1px solid #f1f5f9}
.tbl .trow:active{background:#f0fdfa}
.tbl .nm-w{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:0}
.tbl .nm-w .nm{max-width:100%}
.tbl .nm-w .trial-chip,.tbl .nm-w .st-chip{flex:0 0 auto}
.tbl .nm{font-weight:600;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tbl .sub{font-size:11.5px;color:#94a3b8;font-weight:400}
.empty{padding:34px;text-align:center;color:#94a3b8;font-size:14px}
.st-chip{display:inline-block;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap}
.st-חדש{background:#dbeafe;color:#1d4ed8}
.st-פולואפ{background:#fef3c7;color:#b45309}
.st-נסגר{background:#d1fae5;color:#047857}
.st-לאר,.st-לא{background:#fee2e2;color:#b91c1c}
.st-מענה{background:#e0e7ff;color:#4338ca}
.st-פרטיים{background:#ede9fe;color:#6d28d9}
.trial-chip{display:inline-block;padding:3px 10px;border-radius:999px;font-size:11.5px;font-weight:700;background:#fef9c3;color:#a16207;border:1px solid #fde047}
.call-btn{width:32px;height:32px;border-radius:9px;background:#ecfdf5;color:#059669;font-size:15px;display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.wa-btn{width:32px;height:32px;border-radius:9px;background:#f0fdf4;color:#16a34a;font-size:15px;display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.rowacts{display:flex;gap:6px}
.new-glow{box-shadow:0 0 0 2px #0891b2 inset}

/* bottom nav */
.bottombar{position:fixed;bottom:0;right:0;left:0;background:#fff;border-top:1px solid #e2e8f0;display:flex;padding:6px 4px calc(8px + env(safe-area-inset-bottom));z-index:40}
.btab{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 0;font-size:11px;color:#94a3b8;position:relative}
.btab .bi{font-size:20px}
.btab.on{color:#0e7490;font-weight:700}
.btab .bdg{position:absolute;top:2px;left:calc(50% - 22px);min-width:17px;height:17px;border-radius:9px;background:#dc2626;color:#fff;font-size:10.5px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 4px}

/* modal */
.overlay{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:60;display:flex;align-items:flex-end;justify-content:center;animation:fadeIn .16s ease}
@media(min-width:768px){.overlay{align-items:center}}
.modal{background:#fff;border-radius:22px 22px 0 0;width:100%;max-width:560px;max-height:92vh;max-height:92dvh;display:flex;flex-direction:column;animation:slideUp .2s ease}
@media(min-width:768px){.modal{border-radius:22px;max-height:88vh;max-height:88dvh}}
@keyframes slideUp{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.m-head{display:flex;align-items:center;padding:16px 18px 10px}
.m-head h2{font-size:18px;flex:1;color:#0f172a}
.m-x{width:34px;height:34px;border-radius:10px;background:#f1f5f9;font-size:16px;color:#64748b;display:flex;align-items:center;justify-content:center}
.m-body{overflow-y:auto;overflow-x:hidden;padding:4px 18px 14px;-webkit-overflow-scrolling:touch}
.m-foot{padding:12px 18px calc(16px + env(safe-area-inset-bottom));border-top:1px solid #f1f5f9;display:flex;gap:10px}
.btn-primary{flex:1;padding:14px;border-radius:13px;background:#0e7490;color:#fff;font-size:16px;font-weight:700}
.btn-danger{flex:1;padding:14px;border-radius:13px;background:#fee2e2;color:#b91c1c;font-size:15px;font-weight:600}
.btn-ghost{flex:1;padding:14px;border-radius:13px;background:#f1f5f9;color:#475569;font-size:15px;font-weight:600}

/* form */
.fld{margin-bottom:13px}
.fld label{display:block;font-size:13px;color:#64748b;margin-bottom:6px}
.fld input,.fld select,.fld textarea{width:100%;min-width:0;box-sizing:border-box;padding:12px 14px;border:1.5px solid #e2e8f0;border-radius:12px;background:#f8fafc}
.fld input:focus,.fld select:focus,.fld textarea:focus{outline:none;border-color:#0891b2;background:#fff}
.fld textarea{min-height:74px;resize:vertical}
.frow{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.frow>.fld{min-width:0}
.action-row{display:flex;gap:10px;margin-bottom:14px}
.action-row a{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;padding:13px;border-radius:13px;font-size:15.5px;font-weight:700;text-decoration:none}
.a-call{background:#059669;color:#fff}
.a-wa{background:#25d366;color:#fff}
.log-list{margin-top:8px}
.log-item{font-size:12.5px;color:#64748b;padding:7px 10px;background:#f8fafc;border-radius:9px;margin-bottom:6px}
.log-item b{color:#334155}
.sec-t{font-size:13px;font-weight:700;color:#94a3b8;margin:16px 0 8px;letter-spacing:.2px}

/* toast */
.toast{position:fixed;top:14px;right:14px;left:14px;z-index:100;background:#0f172a;color:#fff;padding:14px 16px;border-radius:14px;font-size:15px;font-weight:600;box-shadow:0 8px 26px rgba(0,0,0,.25);display:flex;align-items:center;gap:10px;animation:slideUp .2s ease}
@media(min-width:768px){.toast{left:auto;max-width:380px}}
.ver{position:fixed;bottom:calc(70px + env(safe-area-inset-bottom));left:8px;font-size:10px;color:#cbd5e1;z-index:30;direction:ltr}

.stsel{appearance:none;-webkit-appearance:none;border:none;cursor:pointer;font:inherit;max-width:100%;text-align:center;padding:4px 8px;border-radius:999px}
.stsel:focus{outline:2px solid #0891b2}
.grab{display:none;width:44px;height:5px;border-radius:3px;background:#cbd5e1;margin:10px auto -2px;flex:0 0 auto}
@media(pointer:coarse){.grab{display:block}}

@media(max-width:520px){.tbl .thead,.tbl .trow{padding:10px 8px;gap:3px}.tbl .nm{white-space:normal;overflow-wrap:anywhere;line-height:1.25}.tbl .trow>span[dir=ltr]{white-space:nowrap;font-size:12px}}
.note-btn{width:32px;height:32px;border-radius:9px;background:#f8fafc;color:#64748b;font-size:15px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid #e2e8f0}
.note-btn.has{background:#fef9c3;color:#a16207;border-color:#fde68a}
.tbl .nm-notes{cursor:pointer}

/* Keep the lead status compact without letting native select sizing crush names. */
.leads-table .thead,.leads-table .trow{grid-template-columns:minmax(0,1fr) 104px 90px 108px}
.leads-table .trow>span{min-width:0}
.leads-table .lead-status .stsel{width:104px;max-width:100%;min-width:0;min-height:32px;padding:4px 6px;font-size:12px;appearance:none;-webkit-appearance:none;text-align:center;cursor:pointer}
.leads-table .nm{white-space:normal;overflow-wrap:anywhere;line-height:1.35}
@media(max-width:600px){
  .leads-table .thead,.leads-table .trow{grid-template-columns:minmax(0,1fr) 84px 48px 108px;gap:4px;padding:10px 8px}
  .leads-table .lead-status .stsel{width:84px;font-size:11px;padding:4px 2px}
}
