/* ============================================================
   Painto — שכבת עיצוב משותפת (גרסה 1)
   לבן עדין · Heebo · רוחב מלא · הדגשות גרדיאנט
   נטענת אחרי ה-CSS של כל מסך ולכן גוברת עליו בעדינות.
   ============================================================ */

@font-face{
  font-family:'Heebo';font-style:normal;font-weight:100 900;font-display:swap;
  src:url('fonts/heebo-hebrew.woff2') format('woff2');
  unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F;
}
@font-face{
  font-family:'Heebo';font-style:normal;font-weight:100 900;font-display:swap;
  src:url('fonts/heebo-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

body{
  font-family:'Heebo','Segoe UI',Arial,sans-serif !important;
  background:
    radial-gradient(1000px 460px at 92% -6%, rgba(20,150,237,.07), transparent 60%),
    radial-gradient(900px 480px at -6% 22%, rgba(123,84,196,.06), transparent 55%),
    radial-gradient(800px 500px at 50% 112%, rgba(13,148,136,.05), transparent 60%),
    linear-gradient(180deg,#f8fafd 0%,#f2f6fb 100%) !important;
  background-attachment:fixed !important;
}

/* ---- רוחב מלא, בלי שוליים מתים ---- */
.wrap{max-width:none !important;padding-left:30px !important;padding-right:30px !important}

/* ---- סרגל עליון זכוכיתי ---- */
.topbar{
  background:rgba(255,255,255,.86) !important;
  backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(20,50,80,.08) !important;
}

/* ---- כותרת ראשית עם גרדיאנט ---- */
.page-head h1{
  font-weight:800;
  background:linear-gradient(90deg,#0e7fd1 0%,#7b54c4 85%);
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
}

/* ---- כרטיסים — פינות רכות יותר, צל עדין ---- */
.card,.section,.panel-card,.supplier-card,.reg-card,.det-head,.totbar,.fbar,
.file-viewer,.sum-card,.mv-stat,.fx-dock,.asof-box,.add-card{
  border-radius:14px !important;
  box-shadow:0 1px 3px rgba(20,50,80,.05),0 10px 26px rgba(20,50,80,.06) !important;
}

/* ---- פס גרדיאנט עדין בראש כרטיסי סיכום ---- */
.sum-card{position:relative;overflow:hidden}
.sum-card::before{
  content:"";position:absolute;top:0;right:0;left:0;height:3px;
  background:linear-gradient(90deg,#1aa3f5,#7b54c4,#d946ef);
  opacity:.75;
}

/* ---- כותרות טבלה עם מעבר גוון ---- */
thead th{background:linear-gradient(180deg,#fbfdff,#f3f7fb) !important}

/* ---- כפתורים וגלולות מעודנים ---- */
.btn{border-radius:10px !important}
.btn.primary{box-shadow:0 3px 12px rgba(20,150,237,.3) !important}
.status-pill,.paid-pill,.curr-pill,.info-tag,.cont-chip{border-radius:20px !important}

/* ---- חלונות קופצים ---- */
.modal,.modal2{border-radius:16px !important}
.modal-head .mh-ico{border-radius:12px !important}

/* ---- מעגן השערים: ברוחב מלא אין שוליים — יושב כפס עליון נעים ---- */
.fx-dock{border-radius:14px !important}

/* ---- טפסים ---- */
.field input,.field select,.pl-edit input,.pl-edit select{border-radius:9px !important}
.field input:focus,.field select:focus{box-shadow:0 0 0 3px rgba(20,150,237,.13) !important}

/* ---- סרגל עליון אחיד (בסגנון הדשבורד, רקע בהיר) ---- */
.tb2{position:sticky;top:0;z-index:60;background:rgba(255,255,255,.86);backdrop-filter:blur(14px);border-bottom:1px solid rgba(20,50,80,.08);min-height:56px;display:flex;align-items:center;gap:12px;padding:6px 20px;flex-wrap:wrap}
.tb2 .brandlink{display:inline-flex;align-items:center;gap:9px;cursor:pointer;border-radius:10px;padding:3px 6px;transition:.12s}
.tb2 .brandlink:hover{background:#f1f5fa}
.tb2 .mark{width:30px;height:30px;border-radius:9px;background:linear-gradient(135deg,#1aa3f5,#7b54c4);color:#fff;display:grid;place-items:center;font-weight:800;font-size:15px;flex-shrink:0}
.tb2 .bname{font-weight:800;font-size:16px;background:linear-gradient(90deg,#0e7fd1,#7b54c4);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.tb2 nav{display:flex;gap:2px;flex-wrap:wrap}
.tb2 nav a{display:inline-block;text-decoration:none}
.tb2 nav button,.tb2 nav a{border:0;background:transparent;color:#5d6b7a;padding:7px 12px;border-radius:9px;cursor:pointer;font-size:13px;font-family:inherit;white-space:nowrap}
.tb2 nav button.on,.tb2 nav a.on{background:#e7f3fd;color:#0e7fd1;font-weight:700}
.tb2 nav button:hover:not(.on),.tb2 nav a:hover:not(.on){background:#f1f5fa;color:#15212e}
.tb2 .sp{flex:1}
.tb2 .chip2{display:inline-flex;align-items:center;gap:6px;background:#fff;border:1px solid #e4ebf2;border-radius:20px;padding:5px 13px;font-size:12.5px;font-weight:700;color:#15212e;cursor:pointer;white-space:nowrap;box-shadow:0 2px 8px rgba(20,50,80,.08)}
.tb2 .chip2:hover{border-color:#1496ed}
.tb2 .chip2 a{color:#0e7fd1;text-decoration:none;font-weight:700}
.tb2 .chip2 a.out{color:#d23b32}

/* ---- פילטר תאריכים אחיד (מלאי + תקבולים) ---- */
.dfbox{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:linear-gradient(165deg,#ffffff,#f1f7fd);border:1px solid rgba(20,50,80,.09);border-radius:12px;padding:8px 14px;box-shadow:0 2px 10px rgba(20,50,80,.06)}
.dfbox .df-lbl{font-size:12px;font-weight:800;color:#5d6b7a;white-space:nowrap}
.df-chip{border:1px solid #cdd8e3;background:#fff;color:#5d6b7a;padding:5px 13px;border-radius:18px;cursor:pointer;font-size:12px;font-weight:700;font-family:inherit;transition:.12s;white-space:nowrap}
.df-chip:hover{border-color:#1496ed;color:#0e7fd1}
.df-chip.on{background:linear-gradient(135deg,#1aa3f5,#0d86e0);color:#fff;border-color:transparent;box-shadow:0 2px 10px rgba(20,150,237,.3)}
.df-in{width:98px;border:1px solid #cdd8e3;border-radius:9px;padding:6px 8px;font-size:12.5px;font-family:inherit;text-align:center;direction:ltr;background:#fff}
.df-in:focus{outline:none;border-color:#1496ed;box-shadow:0 0 0 3px rgba(20,150,237,.13)}
.df-clear{border:0;background:transparent;color:#d23b32;font-weight:800;font-size:12px;cursor:pointer;font-family:inherit;padding:4px 8px}
.df-active{background:#fdf2df;color:#c47d10;font-weight:700;font-size:11.5px;padding:3px 11px;border-radius:20px;white-space:nowrap}

/* ============================================================
   שכבת מובייל — כל המסכים (v5)
   ============================================================ */
@media (max-width: 768px){
  html,body{overflow-x:hidden !important;max-width:100vw}
  /* בסיס */
  .wrap{padding-left:10px !important;padding-right:10px !important;padding-top:10px !important}
  h1,.page-head h1{font-size:20px !important;line-height:1.25}
  .page-head{flex-wrap:wrap !important;gap:8px !important}
  body{background-attachment:scroll !important}

  /* סרגל עליון: שורה אחת נגללת אופקית */
  .tb2{flex-wrap:nowrap !important;overflow-x:auto;-webkit-overflow-scrolling:touch;padding:6px 10px !important;gap:8px !important;scrollbar-width:none}
  .tb2::-webkit-scrollbar{display:none}
  .tb2 nav{flex-wrap:nowrap !important}
  .tb2 nav a{display:inline-block;text-decoration:none}
.tb2 nav button,.tb2 nav a{padding:7px 9px !important;font-size:12.5px !important}
  .tb2 .bname{display:none}
  .tb2 .sp{flex:0 0 4px}
  .tb2 .chip2{padding:5px 9px !important;font-size:11.5px !important}

  /* טבלאות רחבות: גלילה אופקית פנימית במקום שבירת המסך */
  table{display:block;overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
  th,td{white-space:nowrap}

  /* קבוצות כרטיסי סיכום: שתי עמודות */
  div:has(> .sum-card){display:grid !important;grid-template-columns:1fr 1fr !important;gap:9px !important}
  .sum-card{min-width:0 !important}
  .sum-card .val{font-size:17px !important}

  /* טפסים וגרידים לעמודה אחת */
  .form-row{display:grid !important;grid-template-columns:1fr !important;gap:10px !important}
  .fgrid{grid-template-columns:1fr !important}
  .twocol,.cl-2col,.cl-grid{grid-template-columns:1fr !important}
  .grid{grid-template-columns:1fr !important}

  /* חלונות קופצים: כמעט מסך מלא, גלילה פנימית */
  .modal,.modal2,#modal,#modal2{width:96vw !important;max-width:96vw !important;min-width:0 !important}
  .modal.wide,.modal.xwide,#modal.wide,#modal.xwide{width:96vw !important;max-width:96vw !important}
  .modal-body{max-height:68dvh !important;overflow-y:auto !important}
  .overlay{padding:8px !important;align-items:flex-start !important;padding-top:16px !important}

  /* מעגן שערי מט"ח צף — הופך לפס סטטי, לא מכסה תוכן */
  .fx-dock{position:static !important;width:auto !important;max-width:none !important;
    display:flex !important;flex-direction:row !important;flex-wrap:wrap;gap:10px;margin:10px 0 !important}

  /* כותרות ראש-מסך (det-head) נעטפות יפה */
  .det-head{flex-wrap:wrap !important;gap:10px !important}
  .det-head .ha,.debtbox{margin-inline-start:0 !important}

  /* פילטר תאריכים */
  .dfbox{padding:7px 9px !important;gap:6px !important}

  /* כפתורים צפופים פחות */
  .btn{padding:8px 11px !important}
}

/* ===== v7: עריכה נוחה מהפלאפון — קלטים גדולים, כפתורים נגישים ===== */
@media (max-width:768px){
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px !important;min-height:42px;box-sizing:border-box}
  input[type=checkbox],input[type=radio]{width:20px !important;height:20px !important}
  .btn,button.btn{min-height:40px}
  .btn.sm,.btn.sm2{min-height:34px !important;padding:6px 12px !important}
  .modal-foot,.mf{flex-wrap:wrap !important;gap:8px !important}
  .modal-foot .btn,.mf .btn{flex:1 1 45%;min-width:120px}
  .tb2{position:sticky;top:0;z-index:60}
  .dmy{text-align:center}
  .docnav-btn{width:42px !important;height:42px !important}
}

/* ===== v8: שדות מספרים וסכומים אחידים בכל האתר =====
   מלבן נקי, בלי חיצי ספינר, ומסגרת שנצבעת כחול בפוקוס */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
input[type=number]{-moz-appearance:textfield;appearance:textfield}
input[type=number]:not(.dmy),input[inputmode=decimal]:not(.dmy),input[inputmode=numeric]:not(.dmy){
  border:1.5px solid var(--line-strong,#cdd8e3);border-radius:10px;background:#fff}
/* שדות תאריך (.dmy) מוחרגים — לא נוגעים בהם בינתיים */
input:not(.dmy):focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--accent,#1496ed) !important;
  box-shadow:0 0 0 3px rgba(20,150,237,.13) !important}
/* חריגים שמעוצבים בכוונה בלי מסגרת */
.fx-rate-in{border:0 !important;border-radius:0 !important;background:transparent !important;box-shadow:none !important}
.fx-rate-in:focus{border-bottom:1px dashed currentColor !important}
.step input{border:none !important;box-shadow:none !important;border-radius:0 !important}

/* ===== v11: שפת מובייל אחידה לכל המסכים — כמו מסך ההזמנות ===== */
@media (max-width:768px){
  /* חיפושים ברוחב מלא, גדולים לאצבע */
  .srch,input[id*="Search"],input[id*="Srch"],input[id$="Q"],input[id="srch"]{
    width:100% !important;min-width:0 !important;box-sizing:border-box;
    font-size:16px !important;padding:11px 13px !important}
  /* סרגלי סינון: צ'יפים גדולים בגלילה אופקית — גישה מהירה בלי לשבור שורות */
  .filters,.dfbox{flex-wrap:nowrap !important;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .filters>*,.dfbox>*{flex:none}
  .fchip,.df-chip,.ad-chip{padding:9px 16px !important;font-size:13px !important;white-space:nowrap}
  /* שורות טבלה גבוהות יותר — קלות ללחיצה */
  td{padding-top:11px !important;padding-bottom:11px !important}
  /* חלונות קופצים = גיליון תחתון (Bottom Sheet) כמו באפליקציות */
  .ov.open{place-items:end center !important;padding:0 !important}
  .ov .modal{border-radius:18px 18px 0 0 !important;width:100vw !important;max-width:100vw !important;max-height:94dvh !important}
  .overlay{align-items:flex-end !important;padding:0 !important}
  .overlay .modal,#modal{border-radius:18px 18px 0 0 !important;width:100vw !important;max-width:100vw !important;max-height:94dvh !important}
  /* כפתורי פעולה ראשיים — גדולים */
  .btn.primary{padding:12px 18px !important;font-size:14.5px !important}
  /* כרטיסי רשת (גבייה/מפיצים/תקבולים) — עמודה אחת מרווחת */
  .ccard,.reg-card{padding:16px !important}
}

/* ===== v12: בלי זום במובייל — נגיעות יציבות ===== */
@media (max-width:768px){
  *{touch-action:manipulation}
}

/* ===== v13: סרגל עליון בגובה אחיד בכל המסכים =====
   מסכים שונים מדדו את הגובה בשיטה שונה (box-sizing) — מיישרים לפי מראה הגבייה */
body{margin:0}
.tb2,.tb2 *{box-sizing:border-box}
.tb2{min-height:68px}
@media (max-width:768px){ .tb2{min-height:56px} }
