/* ============================================================
   FORTE — style.css  |  עיצוב גלובלי
   ============================================================ */

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

:root {
  --gold:    #e8a020;
  --dark:    #1a1a2e;
  --dark2:   #16213e;
  --text:    #1a1a2e;
  --text-sub:#5a6070;
  --bg:      #f0f2f7;
  --card:    #ffffff;
  --border:  #d0d5e0;
  --radius:  8px;
  --red:     #c62828;
  --green:   #2e7d32;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
}

/* ── Header ── */
.app-header {
  background: var(--dark);
  color: #fff;
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header__brand { display: flex; align-items: baseline; gap: 10px; }

.app-header__logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold);
}

.app-header__title {
  font-size: 0.85rem;
  color: #9ba8bf;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: #9ba8bf;
}

.bc-link {
  cursor: pointer;
  color: #b8c4d8;
  transition: color 0.15s;
}
.bc-link:hover { color: var(--gold); }
.bc-sep { color: #4a5568; }
.bc-current { color: var(--gold); font-weight: 600; }

/* ── Main ── */
.app-main {
  max-width: 900px;
  margin: 28px auto;
  padding: 0 16px 60px;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  margin-bottom: 20px;
}

.section-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.section-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 6px 0 4px;
}

.page-sub {
  font-size: 0.85rem;
  color: var(--text-sub);
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}
.btn-back:hover { color: var(--gold); }

/* ── Fields grid ── */
.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.fields-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field--wide { grid-column: 1 / -1; }

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
}

.required { color: var(--red); }

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.93rem;
  direction: rtl;
  font-family: inherit;
  background: #fafbfc;
  transition: border-color 0.18s, background 0.18s;
  width: 100%;
  color: var(--text);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
}

textarea { resize: vertical; min-height: 60px; }

/* ── Buttons ── */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }

.btn-primary  { background: var(--gold); color: var(--dark); }
.btn-primary:hover  { opacity: 0.88; }

.btn-secondary { background: #e8edf5; color: var(--dark); }
.btn-secondary:hover { opacity: 0.8; }

.btn-danger   { background: #fdecea; color: var(--red); border: 1.5px solid #f5b7b1; }
.btn-danger:hover { background: #fad0cd; }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-danger-sm { background: none; border: none; color: #b0b8cc; font-size: 0.82rem;
                 cursor: pointer; padding: 6px 10px; border-radius: 4px; }
.btn-danger-sm:hover { color: var(--red); background: #fdecea; }

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

/* ── Status message ── */
.status-msg {
  font-size: 0.87rem;
  font-weight: 600;
  min-height: 22px;
  margin-top: 10px;
  color: var(--green);
}
.status-msg.error { color: var(--red); }

/* ── Dashboard ── */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.dashboard-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

/* ── Project cards ── */
.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  overflow: hidden;
  border: 1.5px solid var(--border);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.project-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(232,160,32,0.12);
}

.project-card__body {
  padding: 18px 18px 12px;
  cursor: pointer;
}

.project-card__body h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.project-card__meta {
  font-size: 0.82rem;
  color: var(--text-sub);
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.project-card__stats {
  font-size: 0.8rem;
  color: #9ba8bf;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.project-card__actions {
  padding: 8px 12px;
  background: #f7f9fc;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── List items (מעליות בבניין) ── */
.list { display: flex; flex-direction: column; gap: 8px; }

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f7f9fc;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.list-item__info { display: flex; flex-direction: column; gap: 2px; }
.list-item__info strong { font-size: 0.93rem; }
.list-item__info span  { font-size: 0.8rem; color: var(--text-sub); }
.list-item__actions { display: flex; gap: 8px; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sub);
  font-size: 0.95rem;
  grid-column: 1 / -1;
}
.empty-state p { margin-bottom: 6px; }

/* ── Inspect button ── */
.btn-inspect { background: #1a6e3c; color: #fff; }
.btn-inspect:hover { opacity: 0.88; }

/* ── Module select ── */
.empty-state-text { color: var(--text-sub, #888); font-style: italic; font-size: 0.9rem; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  border: 2px solid var(--gold, #e8a020);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-align: center;
}
.module-card:hover { background: rgba(232,160,32,0.1); transform: translateY(-2px); }
.module-card--disabled {
  border-color: var(--border, #2a2a4a);
  opacity: 0.5;
  cursor: default;
}
.module-card--disabled:hover { background: none; transform: none; }
.module-card__icon { font-size: 2rem; }
.module-card__label { font-weight: 600; font-size: 0.95rem; }
.module-card__action { font-size: 0.8rem; color: var(--gold, #e8a020); }
.module-card__soon { font-size: 0.75rem; color: var(--text-sub, #888); }
.reports-history-list { display: flex; flex-direction: column; gap: 8px; }
.report-history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 8px;
}
.report-history-icon { font-size: 1.4rem; }
.report-history-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.report-history-meta { font-size: 0.8rem; color: var(--text-sub, #888); }
.report-history-actions { display: flex; gap: 6px; }

/* ── Inspection meta ── */
.inspection-meta { margin-bottom: 20px; }
.inspection-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.stat {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid;
}
.stat--ok      { color: #2e7d32; border-color: #a5d6a7; background: #f1f8f2; }
.stat--fail    { color: #c62828; border-color: #ef9a9a; background: #fef3f3; }
.stat--na      { color: #5a6070; border-color: #c5cae9; background: #f3f4fb; }
.stat--pending { color: #e65100; border-color: #ffcc80; background: #fff8f0; }

/* ── Chapter block ── */
.chapters-list { display: flex; flex-direction: column; gap: 10px; }

.chapter-block {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  overflow: hidden;
  border: 1.5px solid var(--border);
}

.chapter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.chapter-header:hover { background: #f7f9fc; }

.chapter-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chapter-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--dark);
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chapter-title {
  font-size: 0.97rem;
  font-weight: 700;
}

.chapter-progress {
  font-size: 0.78rem;
  color: var(--text-sub);
  background: #eef1f8;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 8px;
}
.ch-status--fail { background: #fdecea; color: var(--red); }
.ch-status--done { background: #e8f5e9; color: #2e7d32; }

.chapter-toggle { font-size: 0.85rem; color: var(--text-sub); }

.chapter-body {
  border-top: 1px solid var(--border);
  padding: 0 0 8px;
}

/* ── Item row ── */
.item-row {
  padding: 14px 18px;
  border-bottom: 1px solid #eef1f8;
  transition: background 0.12s;
}
.item-row:last-child { border-bottom: none; }
.item-row--ok   { background: #f6fbf6; }
.item-row--fail { background: #fff8f8; }
.item-row--na   { background: #f8f9fc; }

.item-row__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.item-title {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
  min-width: 180px;
  line-height: 1.4;
}

.item-status-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.status-btn {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: var(--text-sub);
  font-family: inherit;
  transition: all 0.14s;
}
.status-btn:hover { border-color: var(--gold); color: var(--dark); }
.status-btn--ok   { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.status-btn--fail { background: #fdecea; color: var(--red); border-color: #ef9a9a; }
.status-btn--na   { background: #eceff1; color: #546e7a; border-color: #b0bec5; }

/* ── Severity / comments / note ── */
.item-severity,
.item-comments,
.item-freenote {
  margin-top: 10px;
}

.item-severity label,
.item-comments label,
.item-freenote label {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-bottom: 6px;
  display: block;
}

.severity-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sev-btn {
  padding: 4px 14px;
  border: 1.5px solid var(--sev-color, #aaa);
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: var(--sev-color, #333);
  font-family: inherit;
  transition: all 0.14s;
}
.sev-btn:hover { opacity: 0.8; }
.sev-btn--active { background: var(--sev-color, #aaa); color: #fff; }

.comment-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.comment-chip {
  padding: 4px 12px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-size: 0.78rem;
  cursor: pointer;
  background: #f7f9fc;
  color: var(--text);
  font-family: inherit;
  transition: all 0.14s;
  text-align: right;
}
.comment-chip:hover { border-color: var(--gold); }
.comment-chip--active { background: #fff3e0; border-color: var(--gold); color: var(--dark); font-weight: 600; }

.item-freenote textarea {
  width: 100%;
  font-size: 0.85rem;
}

/* ── Page header row (title + actions) ── */
.page-header__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex-shrink: 0; }

/* ── Overview list (buildings / elevators) ── */
.overview-section { }
.overview-section__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.overview-list { display: flex; flex-direction: column; gap: 8px; }

.overview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  gap: 12px;
}
.overview-card:hover { border-color: var(--gold); box-shadow: 0 3px 10px rgba(232,160,32,0.12); }

.overview-card__main { flex: 1; min-width: 0; }
.overview-card__title { font-size: 0.97rem; font-weight: 700; margin-bottom: 2px; }
.overview-card__sub   { font-size: 0.82rem; color: var(--text-sub); }

.overview-card__arrow { font-size: 1.3rem; color: var(--border); transform: scaleX(-1); display: inline-block; }

.overview-card__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  cursor: default;
}

/* ── Chapter page header with summary button ── */
.chapter-page-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* ── Summary ── */
.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.summary-info-card { margin-bottom: 20px; }

.summary-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 20px;
}

.summary-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-sub);
}

.summary-info-item span:last-child {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Stats row ── */
.summary-stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.summary-stat {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 16px 8px;
  border-radius: var(--radius);
  border: 2px solid;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-stat__num  { font-size: 2rem; font-weight: 800; line-height: 1; }
.summary-stat__label { font-size: 0.82rem; font-weight: 600; }

.summary-stat--ok       { border-color: #a5d6a7; background: #f1f8f2; color: #2e7d32; }
.summary-stat--fail     { border-color: #ef9a9a; background: #fef3f3; color: var(--red); }
.summary-stat--na       { border-color: #c5cae9; background: #f3f4fb; color: #5a6070; }
.summary-stat--pending  { border-color: #ffcc80; background: #fff8f0; color: #e65100; }

/* ── Findings table ── */
.no-findings { color: var(--text-sub); font-size: 0.9rem; }

.findings-table-wrap { overflow-x: auto; }

.findings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.findings-table th {
  text-align: right;
  padding: 9px 12px;
  background: #f7f9fc;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-sub);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.findings-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef1f8;
  vertical-align: top;
}

.finding-row:last-child td { border-bottom: none; }
.finding-row:hover td { background: #fafbfd; }

.finding-chapter { font-weight: 700; color: var(--text-sub); white-space: nowrap; }
.finding-item    { max-width: 200px; }
.finding-notes   { max-width: 220px; color: var(--text-sub); font-size: 0.8rem; }

.sev-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1.5px solid;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.finding-status-select {
  padding: 4px 8px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  background: #fff;
  direction: rtl;
  cursor: pointer;
}
.finding-status-select:focus { outline: none; border-color: var(--gold); }

/* ── System recommendation ── */
.system-rec {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 2px solid;
}

.system-rec__icon { font-size: 1.6rem; flex-shrink: 0; }
.system-rec__label { font-size: 1rem; font-weight: 800; }
.system-rec__reason { font-size: 0.83rem; margin-top: 2px; opacity: 0.8; }

.system-rec--approved    { background: #f1f8f2; border-color: #a5d6a7; color: #2e7d32; }
.system-rec--conditional { background: #fff8f0; border-color: #ffcc80; color: #e65100; }
.system-rec--rejected    { background: #fef3f3; border-color: #ef9a9a; color: var(--red); }

/* ── Inspector decision ── */
.decision-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.decision-btn {
  padding: 10px 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: var(--text-sub);
  font-family: inherit;
  transition: all 0.15s;
}
.decision-btn:hover { border-color: var(--gold); color: var(--dark); }

.decision-btn--active.decision-btn--approved    { background: #e8f5e9; border-color: #2e7d32; color: #2e7d32; }
.decision-btn--active.decision-btn--conditional { background: #fff3e0; border-color: #e65100; color: #e65100; }
.decision-btn--active.decision-btn--rejected    { background: #fdecea; border-color: var(--red); color: var(--red); }

/* ── Report classification (chapter.js) ── */
.item-report-opts {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.report-include-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  user-select: none;
}

.report-include-cb {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--gold);
}

.report-category {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-sub);
}

.report-category label { font-weight: 600; }

.report-category-select {
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  background: #fff;
  direction: rtl;
  cursor: pointer;
  color: var(--text);
}
.report-category-select:focus { outline: none; border-color: var(--gold); }

/* ── Findings by category (summary.js) ── */
.findings-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.findings-total-label {
  font-size: 0.88rem;
  color: var(--text-sub);
}

.findings-excluded-note {
  font-size: 0.8rem;
  color: var(--text-sub);
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
}

.findings-category-card { margin-bottom: 16px; }
.findings-category-card .section-title { font-size: 0.92rem; }

/* ── Word Export ── */
.word-export-card { border-right: 4px solid #1565c0; }
.word-export-desc { font-size: 0.85rem; color: var(--text-sub); margin-bottom: 14px; }
.btn-word {
  background: #1565c0;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}
.btn-word:hover { background: #0d47a1; }

/* ══════════════════════════════════════════════════════════
   Supervision Module
   ══════════════════════════════════════════════════════════ */

/* מטא */
.sv-meta-card .participants-section { margin-top: 14px; }

/* קטגוריית ממצאים */
.sv-findings-card { margin-top: 18px; }
.sv-bank-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.sv-search-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 6px;
  background: var(--input-bg, #12122a);
  color: var(--text, #e8e8f0);
  font-size: 0.9rem;
}
.sv-search-input:focus { outline: 2px solid var(--gold, #e8a020); }

/* תוצאות חיפוש */
.sv-search-results {
  border: 1px solid var(--border, #d0d5e0);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 12px;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg, #f0f2f7);
  direction: rtl;
  -webkit-overflow-scrolling: touch;
}
.sv-results-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #1a1a2e);
  background: var(--bg, #f0f2f7);
  border-bottom: 1px solid var(--border, #d0d5e0);
  border-radius: 8px 8px 0 0;
}
.sv-results-header .btn { margin-right: auto; }
.sv-results-header .btn-xs {
  padding: 2px 7px;
  font-size: 0.78rem;
  line-height: 1.4;
}
.sv-result-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text, #1a1a2e);
  border-bottom: 1px solid var(--border, #d0d5e0);
  direction: rtl;
  line-height: 1.45;
}
.sv-result-row:last-child { border-bottom: none; }
.sv-result-row:hover { background: rgba(232,160,32,0.12); }
.sv-result-cb { accent-color: var(--gold, #e8a020); margin-top: 3px; flex-shrink: 0; }

/* רשימת ממצאים בדוח */
.sv-findings-list { margin-bottom: 10px; min-height: 36px; }
.sv-finding-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--border, #d0d5e0);
  border-radius: 6px;
  margin-bottom: 5px;
  background: var(--card, #fff);
  color: var(--text, #1a1a2e);
  cursor: grab;
}
.sv-finding-row:active { cursor: grabbing; opacity: 0.75; }
.sv-drag-handle { color: var(--text-sub, #666); font-size: 1.1rem; cursor: grab; flex-shrink: 0; }
.sv-finding-text { flex: 1; font-size: 0.9rem; }
.sv-finding-actions { display: flex; gap: 4px; flex-shrink: 0; }
.sv-inline-edit {
  width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--gold, #e8a020);
  border-radius: 4px;
  background: var(--card-bg, #1a1a3a);
  color: var(--text, #e8e8f0);
  font-size: 0.9rem;
}
.sv-empty { color: var(--text-sub, #888); font-style: italic; font-size: 0.85rem; padding: 6px 0; }

/* הוספה חופשית */
.sv-free-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.sv-free-input {
  flex: 1;
  min-width: 200px;
  padding: 7px 10px;
  border: 1px dashed var(--border, #2a2a4a);
  border-radius: 6px;
  background: var(--input-bg, #12122a);
  color: var(--text, #e8e8f0);
  font-size: 0.9rem;
}
.sv-free-input:focus { outline: 2px solid var(--gold, #e8a020); border-style: solid; }
.sv-save-to-bank-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--text-sub, #888);
  cursor: pointer;
}
.sv-save-to-bank-label input { accent-color: var(--gold, #e8a020); }

/* תמונות */
.sv-photos-card { margin-top: 18px; }
.photo-caption-input {
  width: 100%;
  margin-top: 4px;
  padding: 3px 6px;
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 4px;
  background: var(--input-bg, #12122a);
  color: var(--text, #e8e8f0);
  font-size: 0.78rem;
}

/* סיכום */
.sv-summary-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 8px;
  background: var(--input-bg, #12122a);
  color: var(--text, #e8e8f0);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
}
.sv-summary-textarea:focus { outline: 2px solid var(--gold, #e8a020); }

/* ── Elevator select + other ── */
.ef-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.93rem;
  background: #fff;
  color: var(--text);
  direction: rtl;
}
.ef-select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.ef-other {
  margin-top: 6px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.ef-other:focus { outline: 2px solid var(--gold); }
.hidden { display: none !important; }

/* ── Elevator profile ── */
.elevator-profile-card { margin-top: 18px; }
.elevator-profile-hint { font-size: 0.85rem; color: var(--text-muted, #888); margin: 0 0 12px; }
.profile-flags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.profile-flag-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 6px;
  transition: background 0.15s;
}
.profile-flag-item:hover { background: rgba(232,160,32,0.08); }
.profile-flag-item input[type=checkbox] { accent-color: var(--gold, #e8a020); width: 16px; height: 16px; }

/* ── Cabin photos ── */
.cabin-photos-card { margin-top: 18px; }
.photos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.photo-thumb {
  position: relative;
  width: 110px;
  height: 90px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del-btn {
  position: absolute;
  top: 3px;
  left: 3px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  cursor: pointer;
  line-height: 22px;
  text-align: center;
  padding: 0;
}
.photo-del-btn:hover { background: var(--red); }
.photos-msg { font-size: 0.82rem; color: var(--text-sub); margin-bottom: 8px; min-height: 18px; }
.btn-add-photo {
  display: inline-block;
  padding: 8px 18px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-sub);
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s, color 0.15s;
}
.btn-add-photo:hover { border-color: var(--gold); color: var(--gold); }

/* ── Responsive ── */
@media (max-width: 620px) {
  .fields-grid,
  .fields-grid--3 { grid-template-columns: 1fr; }
  .field--wide { grid-column: 1; }
  .app-main { margin: 16px auto; }
  .project-list { grid-template-columns: 1fr; }
  .summary-info-grid { grid-template-columns: 1fr 1fr; }
  .summary-stats-row { gap: 8px; }
  .chapter-page-header__top { flex-direction: column; gap: 8px; }
}

/* ============================================================
   מאגר הערות — note toolbar, suggestions, modal, manager
   ============================================================ */

.note-toolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:4px; }
.note-toolbar-btns { display:flex; align-items:center; gap:8px; }
.btn-notes-bank { font-size:11pt; padding:3px 10px; }
.save-to-bank-label { font-size:10pt; color:#666; display:flex; align-items:center; gap:4px; cursor:pointer; }
.save-to-bank-label input { cursor:pointer; }

.note-input-wrap { position:relative; }
.note-input-wrap textarea { width:100%; }

.note-suggestions { position:absolute; top:100%; right:0; left:0; z-index:200; background:#fff; border:1px solid #ddd; border-top:none; border-radius:0 0 6px 6px; list-style:none; max-height:180px; overflow-y:auto; box-shadow:0 4px 12px rgba(0,0,0,.12); }
.note-suggestions.hidden { display:none !important; }
.note-sug-item { padding:7px 12px; cursor:pointer; font-size:10.5pt; border-bottom:1px solid #f0f0f0; direction:rtl; text-align:right; }
.note-sug-item:hover { background:#fdf3e0; }

.nb-modal-overlay { position:fixed; inset:0; z-index:1000; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; }
.nb-modal { background:#fff; border-radius:10px; width:min(560px,94vw); max-height:80vh; display:flex; flex-direction:column; box-shadow:0 8px 40px rgba(0,0,0,.25); direction:rtl; }
.nb-modal-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid #eee; font-weight:bold; font-size:12pt; }
.nb-close-btn { background:none; border:none; font-size:14pt; cursor:pointer; color:#666; padding:0 4px; }
.nb-close-btn:hover { color:#c00; }
.nb-modal-search { margin:10px 16px 6px; padding:8px 12px; border:1px solid #ddd; border-radius:6px; font-size:11pt; direction:rtl; width:calc(100% - 32px); }
.nb-modal-list { overflow-y:auto; padding:8px 16px 14px; flex:1; }
.nb-modal-section { font-size:10pt; color:#777; margin:4px 0 8px; }
.nb-modal-empty { color:#999; font-style:italic; font-size:10.5pt; padding:10px 0; }
.nb-modal-ul { list-style:none; }
.nb-modal-item { display:flex; justify-content:space-between; align-items:center; padding:9px 10px; border-radius:6px; cursor:pointer; border-bottom:1px solid #f5f5f5; font-size:10.5pt; }
.nb-modal-item:hover { background:#fdf3e0; }
.nb-use-count { font-size:9.5pt; color:#aaa; white-space:nowrap; margin-right:8px; }

.nb-manager-card { padding:20px; }
.nb-controls { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.nb-filter-input { flex:1; min-width:160px; padding:8px 10px; border:1px solid #ddd; border-radius:6px; font-size:11pt; direction:rtl; }
.nb-filter-select { padding:8px 10px; border:1px solid #ddd; border-radius:6px; font-size:10.5pt; direction:rtl; }
.nb-empty-msg { color:#999; font-style:italic; padding:12px 0; }
.nb-table { width:100%; border-collapse:collapse; font-size:10.5pt; direction:rtl; }
.nb-table th { text-align:right; padding:8px 10px; border-bottom:2px solid #ddd; color:#555; font-weight:600; background:#fafafa; }
.nb-table td { padding:8px 10px; border-bottom:1px solid #f0f0f0; vertical-align:top; }
.nb-table tr:hover td { background:#fdf9f2; }
.nb-cell-text { max-width:280px; }
.nb-display-text { display:block; }
.nb-edit-input { width:100%; padding:4px 8px; border:1px solid #e8a020; border-radius:4px; font-size:10.5pt; }
.nb-edit-input.hidden { display:none; }
.nb-cell-num { text-align:center; color:#888; }
.nb-cell-date { white-space:nowrap; color:#888; font-size:10pt; }
.nb-cell-actions { white-space:nowrap; display:flex; gap:6px; }

.dashboard-header-actions { display:flex; gap:8px; }

/* badges מקור */
.nb-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:9.5pt; font-weight:600; }
.nb-badge--system { background:#e3f2fd; color:#1565c0; }
.nb-badge--user   { background:#e8f5e9; color:#2e7d32; }

/* הודעת ייבוא */
.nb-import-msg { padding:10px 16px; border-radius:6px; font-size:10.5pt; margin-bottom:12px; }
.nb-import-msg.hidden { display:none; }
.nb-import-msg--visible { display:block; background:#e8f5e9; color:#2e7d32; border:1px solid #a5d6a7; }

/* ── פרטי דוח ── */
.report-meta-card { border-right: 4px solid var(--gold); margin-bottom: 18px; }
.report-meta-card__header { margin-bottom: 14px; }
.report-meta-title { font-size: 1rem; font-weight: 700; margin: 0; color: var(--dark); }
.report-meta-body { display: flex; flex-direction: column; gap: 16px; }
.report-type-field { max-width: 320px; }
.report-type-select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  direction: rtl;
  cursor: pointer;
}
.report-type-select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

.participants-section { display: flex; flex-direction: column; gap: 8px; }
.participants-header { display: flex; align-items: center; gap: 14px; }
.participants-header label { font-size: 0.88rem; font-weight: 600; color: var(--text-sub); }

.rm-participant-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.rm-input {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
  direction: rtl;
}
.rm-input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.rm-input--role { }
.rm-del-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}
.rm-del-btn:hover { color: var(--red); background: #fdecea; }
.rm-empty-msg { font-size: 0.83rem; color: #bbb; font-style: italic; margin: 4px 0 0; }

@media (max-width: 620px) {
  .rm-participant-row { grid-template-columns: 1fr 1fr; }
  .rm-input--role { grid-column: 1 / -1; }
  .rm-del-btn { grid-column: 2; justify-self: end; }
}

/* ══════════════════════════════════════════════════════════
   Responsive — iPad (≤ 900px)
   ══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .app-main { margin: 16px auto; }

  /* summary info: 4 עמודות → 2 */
  .summary-info-grid { grid-template-columns: 1fr 1fr; }

  /* כפתורי סטטוס בדיקה — אזור מגע ≥44px */
  .status-btn {
    padding: 9px 16px;
    font-size: 0.85rem;
    min-height: 44px;
  }

  /* כפתורי החלטה בסיכום */
  .decision-btn {
    padding: 12px 20px;
    min-height: 44px;
  }

  /* overview cards — כפתורים גדולים יותר */
  .overview-card__actions .btn { min-height: 40px; }
}

/* ══════════════════════════════════════════════════════════
   Responsive — טלפון (≤ 480px)
   ══════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  /* Header — breadcrumb מתחת ללוגו */
  .app-header {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 6px;
  }
  .breadcrumb { font-size: 0.75rem; flex-wrap: wrap; }

  /* Main */
  .app-main { padding: 0 12px 60px; }

  /* Dashboard header — כפתורים בשורה נפרדת, רוחב מלא */
  .dashboard-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .dashboard-header-actions { flex-direction: column; gap: 8px; }
  .dashboard-header-actions .btn { width: 100%; text-align: center; padding: 12px; min-height: 48px; }

  /* כרטיס overview (בניין/מעלית) — כפתורים מתחת לתוכן */
  .overview-card { flex-direction: column; align-items: stretch; gap: 10px; }
  .overview-card__actions { justify-content: flex-end; }
  .overview-card__arrow { display: none; }

  /* כותרת פרק בדיקה + כפתור סיכום — שתי שורות */
  .chapter-page-header__top { flex-direction: column; gap: 10px; }
  .chapter-page-header__top .btn { width: 100%; text-align: center; min-height: 48px; }

  /* שורת סעיף — כותרת מעל כפתורים */
  .item-row__top { flex-direction: column; gap: 10px; }
  .item-status-btns { width: 100%; justify-content: flex-start; gap: 8px; }

  /* כפתורי תקין/לא תקין/לא רלוונטי — גדולים למגע */
  .status-btn {
    padding: 10px 18px;
    font-size: 0.88rem;
    min-height: 48px;
    flex: 1;
    text-align: center;
  }

  /* chips חומרה והערות */
  .sev-btn    { padding: 9px 14px; min-height: 40px; font-size: 0.82rem; }
  .comment-chip { padding: 9px 14px; min-height: 40px; font-size: 0.82rem; }

  /* כפתור חזרה — אזור מגע */
  .btn-back { min-height: 40px; padding: 8px 0; }

  /* כפתורי החלטה בסיכום */
  .decision-btns { flex-direction: column; }
  .decision-btn  { width: 100%; text-align: center; min-height: 48px; }

  /* כרטיסי פרויקט */
  .project-card__actions { flex-wrap: wrap; gap: 6px; }
  .project-card__actions .btn { min-height: 44px; }

  /* page-header row */
  .page-header__row { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-header__actions { justify-content: flex-end; }
}
