/* עיצוב לפי ההדגמה שאושרה (29.11.2026): נראות Pipedrive, צבעי STAMP, פונט IBM Plex Sans Hebrew */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Hebrew:wght@400;500;600;700&display=swap');

:root {
  --copper: #BE936B;
  --copper-dark: #8A5A30;
  --copper-darker: #7A4E26;
  --copper-hover: #5E3A18;
  --cream: #FFF4EB;
  --light: #FFFBF7;
  --text: #26231f;
  --muted: #635d57;
  --line: #E2DFDC;
  --input-line: #CFCAC5;
  --work-bg: #F5F4F2;
  --head-active: #EFECE9;
  --nav-on-bg: #F4E7D9;
  --nav-on-text: #6B4220;
  --chip-on-bg: #F0E0CF;
  --chip-on-text: #4a2c10;
  --red: #A3261C;
  --green: #2F6B2F;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: #ffffff; color: var(--text); font-family: 'IBM Plex Sans Hebrew', Arial, sans-serif; font-size: 14px; }
a { color: var(--copper-dark); }
a:hover { color: var(--copper-hover); }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }

/* ---------- מסגרת ---------- */
.app { display: flex; min-height: 100vh; }
.nav { flex: 0 0 216px; background: #fff; border-left: 1px solid var(--line); padding: 0 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.brand { height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--line); margin: 0 -8px 8px; }
.brand b { font-size: 17px; font-weight: 700; letter-spacing: 1.5px; color: var(--copper-dark); }
.brand span { font-size: 14px; color: var(--muted); }
.nav-item { display: flex; gap: 10px; align-items: center; text-align: right; border: 0; border-radius: 4px; background: transparent; color: #2f2b27; min-height: 38px; padding: 0 10px; font-size: 14.5px; margin-top: 4px; text-decoration: none; }
.nav-item.sub { min-height: 32px; font-size: 13.5px; margin-top: 0; }
.nav-item .ico { width: 18px; height: 18px; flex: none; display: flex; }
.nav-item.on { background: var(--nav-on-bg); color: var(--nav-on-text); font-weight: 600; }
.nav-item:hover:not(.on) { background: #FAF6F2; }
.nav-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { min-height: 56px; display: flex; gap: 12px; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--line); background: #fff; }
.top h1 { margin: 0; font-size: 16px; font-weight: 600; min-width: 170px; }
.top h1 .parent { color: var(--muted); font-weight: 400; }
.top .center { flex: 1; display: flex; justify-content: center; gap: 10px; align-items: center; }
.gsearch { position: relative; width: min(340px, 100%); }
.gsearch input { width: 100%; height: 36px; border: 1px solid var(--input-line); border-radius: 18px; padding: 0 16px; font-size: 14px; background: #fff; }
.hits { position: absolute; top: 40px; right: 0; left: 0; background: #fff; border: 1px solid var(--input-line); border-radius: 6px; box-shadow: 0 6px 20px rgba(30,25,20,.16); display: flex; flex-direction: column; z-index: 4; padding: 4px; }
.hits button { border: 0; background: none; text-align: right; padding: 8px 12px; font-size: 14px; color: var(--text); border-radius: 4px; }
.hits button:hover { background: var(--work-bg); }
.round-plus { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--input-line); background: #fff; font-size: 20px; color: var(--text); }
.top .end { min-width: 100px; display: flex; justify-content: flex-end; }

.work { flex: 1; background: var(--work-bg); padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 14px; }

.testbar { background: var(--cream); border-bottom: 1px solid #EBD9C6; color: var(--copper-darker); font-size: 13px; padding: 6px 20px; }

/* ---------- רכיבים ---------- */
.link { border: 0; background: none; padding: 4px 2px; min-height: 28px; font-size: 14px; color: var(--copper-dark); text-decoration: underline; text-underline-offset: 3px; text-align: right; }
.link.muted { color: var(--muted); }
.btn-fill { min-height: 32px; padding: 0 12px; border-radius: 4px; font-size: 14px; font-weight: 600; border: 1px solid var(--copper-darker); background: var(--copper-dark); color: #fff; }
.btn-fill:hover { background: var(--copper-darker); }
.btn-fill:disabled { opacity: .6; cursor: default; }
.chip { height: 28px; padding: 0 10px; border-radius: 4px; font-size: 13px; border: 0; background: none; color: #46403a; }
.chip.on { background: var(--chip-on-bg); color: var(--chip-on-text); font-weight: 600; }
.chip:hover:not(.on) { background: #EEEAE6; }
.sep { width: 1px; height: 20px; background: var(--input-line); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.grow { flex: 1; }
.count { font-size: 14px; color: var(--muted); }
.tsearch { height: 32px; min-width: 200px; border: 1px solid var(--input-line); border-radius: 4px; padding: 0 10px; font-size: 14px; background: #fff; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.card h2 { margin: 0; padding: 10px 14px; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--line); }
h2.section { margin: 0; font-size: 18px; }

/* כרטיסי מספרים */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { text-align: right; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; }
.kpi .l { font-size: 14px; font-weight: 600; }
.kpi .v { font-size: 32px; font-weight: 500; }
.kpi .h { font-size: 13px; color: var(--copper-dark); text-decoration: underline; text-underline-offset: 3px; }

/* פסי שלבים */
.bars { padding: 8px 16px 14px; display: flex; flex-direction: column; }
.bar-row { display: flex; gap: 10px; align-items: center; border: 0; border-bottom: 1px solid #EFE3D7; background: none; padding: 8px 0; font-size: 15px; color: var(--text); text-align: right; text-decoration: none; }
.bar-row:last-child { border-bottom: 0; }
.bar-row .lbl { width: 150px; }
.bar-row .track { flex: 1; }
.bar-row .fill { display: block; height: 10px; border-radius: 4px; background: var(--copper); }
.bar-row b { width: 24px; }

/* טבלה */
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.tbl-row { display: grid; align-items: stretch; border-bottom: 1px solid var(--line); min-height: 40px; }
.tbl-row:last-child { border-bottom: 0; }
.tbl-head { min-height: 0; }
.tbl-head button { border: 0; border-left: 1px solid var(--line); padding: 8px 10px; text-align: right; font-size: 13px; font-weight: 600; color: var(--text); background: #fff; }
.tbl-head button.sorted { background: var(--head-active); }
.tbl-head button .arr { font-size: 9px; }
.cell { border-left: 1px solid var(--line); padding: 5px 10px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-width: 0; }
.tbl-row > :last-child, .tbl-head > :last-child { border-left: 0; }
.cell .name { border: 0; background: none; padding: 0; font-size: 14px; font-weight: 500; color: var(--copper-darker); text-align: right; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.cell .sub { font-size: 12px; color: var(--muted); }
.cell .bold { font-weight: 700; }
.cell .red { color: var(--red); font-weight: 600; }
.cell .green { color: var(--green); font-weight: 600; }
.cell .gray { color: var(--muted); }
.empty { padding: 24px; text-align: center; color: var(--muted); }

.placeholder { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 28px; color: var(--muted); }
.placeholder b { color: var(--text); display: block; font-size: 16px; margin-bottom: 6px; }

/* חלון */
.dialog-back { position: fixed; inset: 0; background: rgba(30,25,20,.35); display: flex; align-items: center; justify-content: center; z-index: 10; }
.dialog { background: #fff; border-radius: 6px; padding: 20px 22px; width: min(440px, 92vw); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(30,25,20,.25); }
.dialog h3 { margin: 0; font-size: 17px; }
.dialog .actions { display: flex; gap: 16px; justify-content: flex-start; align-items: center; }

/* מסך כניסה */
.login-page { min-height: 100vh; background: var(--work-bg); display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { background: #fff; border: 1px solid var(--line); border-radius: 6px; width: min(380px, 100%); padding: 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.login-box .brand { border: 0; margin: 0; padding: 0; height: auto; }
.login-box h1 { margin: 0; font-size: 18px; font-weight: 600; }
.login-box label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.login-box input { height: 38px; border: 1px solid var(--input-line); border-radius: 4px; padding: 0 10px; font-size: 15px; font-weight: 400; }
.login-box input.code { letter-spacing: 6px; font-size: 20px; text-align: center; direction: ltr; }
.login-box .btn-fill { min-height: 38px; }
.login-box .note { font-size: 13px; color: var(--muted); }
.login-box .err { font-size: 13px; color: var(--red); min-height: 18px; }
.login-box .testcode { background: var(--cream); border: 1px solid #EBD9C6; border-radius: 4px; padding: 8px 10px; font-size: 13px; color: var(--copper-darker); }
.login-box .testcode b { letter-spacing: 3px; font-size: 16px; }
.hidden { display: none !important; }
