/* מקומות — עיצוב משותף. פשוט, קריא, RTL. */

:root {
  --ground: #F4F6F8;
  --surface: #FFFFFF;
  --surface-2: #EDF1F5;
  --ink: #14202B;
  --text: #35434F;
  --muted: #6B7A87;
  --line: #D8E0E7;
  --line-soft: #E7ECF1;
  --accent: #14567F;
  --accent-soft: #E0EBF3;
  --accent-line: #9DC2DA;
  --ok: #1B6B4A;
  --ok-soft: #DFF0E7;
  --warn: #8A5A05;
  --warn-soft: #F7ECD5;
  --danger: #9A2B31;
  --danger-soft: #F7E1E2;
  --radius: 6px;
  --font: "Segoe UI", "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  direction: rtl;
}

h1, h2, h3 { color: var(--ink); margin: 0 0 8px; line-height: 1.25; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 8px 0; }
a { color: var(--accent); }

.wrap { max-width: 900px; margin: 0 auto; padding: 24px 16px 64px; }
.wide { max-width: 1500px; }

/* ---------- כרטיסים ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

.muted { color: var(--muted); font-size: 14px; }
.tiny { font-size: 13px; }
.center { text-align: center; }
.nums { font-variant-numeric: tabular-nums; }

/* ---------- טפסים ---------- */

label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }

input[type=text], input[type=tel], input[type=email], input[type=password],
input[type=number], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-line);
  outline-offset: 1px;
  border-color: var(--accent);
}
input.bad, select.bad { border-color: var(--danger); background: var(--danger-soft); }
textarea { min-height: 80px; resize: vertical; }

.field { margin-bottom: 14px; }
.err { color: var(--danger); font-size: 13px; margin-top: 3px; display: none; }
.err.on { display: block; }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }

.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 15px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 0; flex: none; }

/* ---------- כפתורים ---------- */

button, .btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: not-allowed; filter: none; }
button.ghost, .btn.ghost { background: var(--surface); color: var(--accent); }
button.plain { background: var(--surface-2); color: var(--text); border-color: var(--line); }
button.danger { background: var(--danger); border-color: var(--danger); }
button.small { font-size: 13px; padding: 5px 11px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- הודעות ---------- */

.note {
  border: 1px solid var(--line);
  border-right: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 4px;
  padding: 12px 15px;
  margin: 14px 0;
  font-size: 15px;
}
.note.warn { border-right-color: var(--warn); background: var(--warn-soft); }
.note.bad { border-right-color: var(--danger); background: var(--danger-soft); }
.note.good { border-right-color: var(--ok); background: var(--ok-soft); }

.pill {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 2px 9px; border-radius: 11px; white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.pill.grey { background: var(--surface-2); color: var(--muted); }

/* ---------- טבלאות ---------- */

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line-soft); }
thead th {
  background: var(--surface-2); color: var(--ink);
  font-size: 12px; letter-spacing: .04em; font-weight: 700; white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--accent-soft); }

/* ---------- סרגל ---------- */

.topbar {
  background: var(--ink); color: #fff;
  padding: 10px 18px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.topbar .brand { font-weight: 700; font-size: 17px; }
.topbar a { color: #C9D8E3; text-decoration: none; font-size: 15px; }
.topbar a:hover, .topbar a.on { color: #fff; }
.topbar .sp { flex: 1; }

/* ---------- חלון ---------- */

.modal-bg {
  position: fixed; inset: 0; background: rgba(10,20,28,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow: auto; z-index: 9000;
}
.modal {
  background: var(--surface); border-radius: 8px; padding: 22px;
  width: 100%; max-width: 620px; box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
.modal.wide { max-width: 980px; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; flex: 1; }
.x { background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; padding: 0 6px; }

/* ---------- מפה ---------- */

.mapbox {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; position: relative;
}
.mapbox svg { display: block; width: 100%; height: auto; touch-action: none; }

.seat { cursor: pointer; }
.seat rect { stroke-width: 1.5; }
.seat text { font-size: 11px; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin: 10px 0; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.2); display: inline-block; }

/* ---------- שונות ---------- */

.split { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

.list { max-height: 62vh; overflow-y: auto; }
.list-item {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px;
  margin-bottom: 6px; cursor: pointer; background: var(--surface); font-size: 14px;
}
.list-item:hover { border-color: var(--accent); }
.list-item.sel { background: var(--accent-soft); border-color: var(--accent); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }

.hide { display: none !important; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--accent-line);
  border-top-color: var(--accent); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 6px;
  font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.3); max-width: 420px;
}
.toast.bad { background: var(--danger); }
.toast.good { background: var(--ok); }
