/* ======================================================
   זירת האתגרים — מערכת סקירת הצעות מחקר
   מערכת עיצוב — סגנון ממשלתי נקי, RTL
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800&display=swap');

:root {
  /* כחול ממשלתי */
  --blue-900: #0d2b52;
  --blue-700: #1a4480;
  --blue-500: #2563a8;
  --blue-100: #d6e3f3;
  --blue-50:  #eef4fb;

  /* ציונים */
  --green:    #1e8e5a;  --green-bg:  #e6f4ec;
  --amber:    #b8860b;  --amber-bg:  #fcf3da;
  --red:      #c0392b;  --red-bg:    #fbeae8;

  /* ניטרליים */
  --bg:       #f4f6f9;
  --card:     #ffffff;
  --text:     #1a2233;
  --muted:    #6b7688;
  --border:   #e2e6ec;

  --radius:   10px;
  --shadow:   0 1px 3px rgba(13,43,82,.08), 0 1px 2px rgba(13,43,82,.04);
  --shadow-lg:0 8px 30px rgba(13,43,82,.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: 'Heebo', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- פס עליון ---------- */
.topbar {
  background: var(--blue-700);
  color: #fff;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 19px;
}
.topbar .brand .emblem {
  width: 34px; height: 34px;
  background: #fff;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--blue-700);
  font-weight: 800;
  font-size: 18px;
}
.topbar .brand .emblem-img {
  height: 42px;
  width: auto;
  filter: brightness(0) invert(1);
}
.topbar .sub {
  font-weight: 400;
  font-size: 13px;
  opacity: .85;
  border-right: 1px solid rgba(255,255,255,.3);
  padding-right: 12px;
  margin-right: 4px;
}
.topbar .nav { display: flex; gap: 6px; align-items: center; }
.topbar .nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  opacity: .85;
  transition: .15s;
}
.topbar .nav a:hover, .topbar .nav a.active {
  background: rgba(255,255,255,.15);
  opacity: 1;
}

/* ---------- מעטפת תוכן ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-head .desc { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: .15s;
  background: var(--blue-700);
  color: #fff;
}
.btn:hover { background: var(--blue-900); }
.btn.ghost {
  background: #fff;
  color: var(--blue-700);
  border-color: var(--border);
}
.btn.ghost:hover { background: var(--blue-50); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- כרטיסים ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- שורת סטטיסטיקה ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 30px; font-weight: 800; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat.green .num { color: var(--green); }
.stat.amber .num { color: var(--amber); }
.stat.red   .num { color: var(--red); }

/* ---------- טבלה ---------- */
.tablewrap { overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  padding: 14px 18px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
  vertical-align: middle;
}
tbody tr { transition: .12s; cursor: pointer; }
tbody tr:hover { background: var(--blue-50); }
tbody tr:last-child td { border-bottom: none; }
.t-title { font-weight: 600; }
.t-sub { color: var(--muted); font-size: 13px; }

/* ---------- תג ציון ---------- */
.score-pill {
  display: inline-grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 16px;
}
.score-pill.green { background: var(--green-bg); color: var(--green); }
.score-pill.amber { background: var(--amber-bg); color: var(--amber); }
.score-pill.red   { background: var(--red-bg);   color: var(--red); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
}
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red   { background: var(--red-bg);   color: var(--red); }
.badge.gray  { background: #eef0f3; color: var(--muted); }

/* ---------- סרגל כלים ---------- */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar input[type="search"], .toolbar select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.toolbar input[type="search"] { flex: 1; min-width: 220px; }

/* ======================================================
   מסך פירוט הצעה
   ====================================================== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.detail-head {
  padding: 24px 26px;
  margin-bottom: 20px;
}
.detail-head h1 { font-size: 24px; }
.detail-head .meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.detail-head .verdict {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.detail-head .big-score {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
}
.detail-head .big-score.green { color: var(--green); }
.detail-head .big-score.amber { color: var(--amber); }
.detail-head .big-score.red   { color: var(--red); }
.detail-head .big-score small { font-size: 18px; color: var(--muted); font-weight: 600; }

.section { padding: 22px 26px; margin-bottom: 20px; }
.section h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* קריטריונים */
.criterion { margin-bottom: 16px; }
.criterion:last-child { margin-bottom: 0; }
.criterion .crow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.criterion .cname { font-weight: 600; font-size: 14.5px; }
.criterion .cscore { font-weight: 700; font-size: 14px; }
.criterion .cweight { color: var(--muted); font-size: 12px; font-weight: 400; }
.bar {
  height: 9px;
  background: #eef0f3;
  border-radius: 6px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--blue-500);
  transition: width .6s ease;
}
.bar.green > span { background: var(--green); }
.bar.amber > span { background: var(--amber); }
.bar.red   > span { background: var(--red); }
.criterion .cexp { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* חוזקות / חולשות */
.sw-list { list-style: none; }
.sw-list li {
  padding: 9px 0 9px 0;
  padding-right: 26px;
  position: relative;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.sw-list li:last-child { border-bottom: none; }
.sw-list li::before {
  position: absolute;
  right: 0; top: 9px;
  font-weight: 700;
}
.sw-list.pos li::before { content: '✓'; color: var(--green); }
.sw-list.neg li::before { content: '!'; color: var(--red); }

.report-text { font-size: 14.5px; line-height: 1.85; color: #2a3445; white-space: pre-wrap; }

/* פאנל צד */
.side-panel { position: sticky; top: 88px; }
.side-panel .row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.side-panel .row:last-child { border-bottom: none; }
.side-panel .row .k { color: var(--muted); }
.side-panel .row .v { font-weight: 600; }

/* ======================================================
   מסך העלאה
   ====================================================== */
.dropzone {
  border: 2px dashed var(--blue-100);
  background: var(--blue-50);
  border-radius: var(--radius);
  padding: 56px 30px;
  text-align: center;
  transition: .2s;
  cursor: pointer;
}
.dropzone.drag { border-color: var(--blue-500); background: #e3eefb; }
.dropzone .ico { font-size: 46px; margin-bottom: 12px; }
.dropzone h3 { font-size: 18px; margin-bottom: 6px; }
.dropzone p { color: var(--muted); font-size: 14px; }

.proc-steps { margin-top: 26px; }
.proc-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fff;
  transition: .2s;
}
.proc-step .dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #eef0f3;
  display: grid; place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}
.proc-step.active { border-color: var(--blue-500); background: var(--blue-50); }
.proc-step.active .dot { background: var(--blue-500); color: #fff; }
.proc-step.done .dot { background: var(--green); color: #fff; }
.proc-step .txt { font-size: 14.5px; font-weight: 500; }
.proc-step .spin {
  margin-right: auto;
  width: 18px; height: 18px;
  border: 2px solid var(--blue-100);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.proc-step.active .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================================================
   מסך כניסה
   ====================================================== */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-500));
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 410px;
  padding: 40px 36px;
  text-align: center;
}
.login-card .emblem-img {
  height: 80px;
  width: auto;
  display: block;
  margin: 0 auto 18px;
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.login-card input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  margin-bottom: 14px;
  text-align: center;
}
.login-card input:focus { outline: none; border-color: var(--blue-500); }
.login-card .btn { width: 100%; justify-content: center; padding: 13px; }
.login-card .err { color: var(--red); font-size: 13px; margin-bottom: 12px; min-height: 18px; }
.login-card .foot { color: var(--muted); font-size: 12px; margin-top: 22px; }

/* ---------- מצב ריק ---------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty .ico { font-size: 44px; margin-bottom: 12px; opacity: .6; }
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }

/* ---------- רספונסיב ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .topbar .sub { display: none; }
  .wrap { padding: 18px; }
}
