:root {
  --brand: #2c7a99;
  --brand-dark: #1d5a73;
  --brand-soft: #e3f1f6;
  --accent: #e07a3f;
  --ok: #2e8b57;
  --ok-soft: #e4f4ea;
  --warn: #c9871a;
  --warn-soft: #fbf1dc;
  --danger: #c0392b;
  --danger-soft: #fbe5e2;
  --ink: #1f2a30;
  --muted: #66757d;
  --line: #dde5e9;
  --bg: #f4f7f9;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 40, 50, .06), 0 4px 14px rgba(20, 40, 50, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-dark); }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }
.wrap.wide { max-width: 1100px; }

header.top {
  background: var(--brand);
  color: #fff;
  padding: 18px 16px 16px;
}
header.top .inner { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; justify-content: space-between; }
header.top.wide .inner { max-width: 1100px; }
header.top h1 { font-size: 20px; margin: 0; font-weight: 600; }
header.top .sub { font-size: 14px; opacity: .85; margin-top: 2px; }
header.top button.link { color: #fff; }

.urgent {
  background: var(--danger-soft);
  border: 1px solid #f1c3bd;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 16px 0 0;
  font-size: 15px;
}
.urgent strong { color: var(--danger); }
.urgent .phones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.urgent a {
  background: var(--danger); color: #fff; text-decoration: none;
  padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 15px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 16px;
}
.card h2 { font-size: 18px; margin: 0 0 12px; font-weight: 600; }
.card h3 { font-size: 16px; margin: 16px 0 8px; font-weight: 600; }
.muted { color: var(--muted); font-size: 15px; }
.small { font-size: 14px; }

.hello { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hello b { font-weight: 600; }

.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.big-btn {
  border: 0; border-radius: var(--radius); padding: 22px 12px; cursor: pointer;
  background: var(--card); box-shadow: var(--shadow); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 17px; font-weight: 600;
}
.big-btn .ic { font-size: 34px; line-height: 1; }
.big-btn.fault { border-top: 5px solid var(--accent); }
.big-btn.request { border-top: 5px solid var(--brand); }
.big-btn:active { transform: scale(.98); }

.btn {
  border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 500; font-size: 16px;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; padding: 15px; font-size: 17px; }
.btn.ghost { background: transparent; color: var(--brand-dark); border: 1px solid var(--line); }
.btn.soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
button.link { background: none; border: 0; padding: 0; color: var(--brand-dark); text-decoration: underline; cursor: pointer; font-size: 15px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 9px 15px; cursor: pointer; font-size: 15px;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.names .chip { border-radius: 12px; padding: 12px 10px; text-align: center; }

.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 10px; cursor: pointer; display: flex; align-items: center; gap: 8px; text-align: right;
  font-size: 15px; min-height: 54px;
}
.cat .ic { font-size: 22px; }
.cat.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }

label.fld { display: block; font-weight: 500; margin: 16px 0 6px; }
label.fld .opt { color: var(--muted); font-weight: 400; font-size: 14px; }
input[type=text], input[type=tel], input[type=password], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 12px 14px; font-size: 16px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }

.place-box {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--brand-soft); border-radius: 12px; padding: 12px 14px;
}
.place-box b { font-weight: 600; }

.photo-pick {
  border: 2px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center;
  cursor: pointer; display: block; background: #fbfdfe;
}
.photo-pick.need { border-color: var(--accent); }
.photo-pick img { max-width: 100%; max-height: 260px; border-radius: 10px; display: block; margin: 0 auto 8px; }
.photo-pick input { display: none; }

.err { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 15px; }
.note { background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 15px; }
.success { text-align: center; padding: 28px 18px; }
.success .ic { font-size: 54px; }

.item { border-top: 1px solid var(--line); padding: 12px 0; }
.item:first-of-type { border-top: 0; }
.item .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.item .what { font-weight: 500; }
.item .desc { font-size: 15px; color: #33424a; margin-top: 2px; white-space: pre-wrap; }
.item .reply { background: var(--ok-soft); border-radius: 10px; padding: 8px 10px; margin-top: 6px; font-size: 15px; }

.badge {
  display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 999px;
  background: #eef2f4; color: #3c4b52; white-space: nowrap; font-weight: 500;
}
.badge.s-new { background: var(--warn-soft); color: #8a5a07; }
.badge.s-work { background: var(--brand-soft); color: var(--brand-dark); }
.badge.s-done { background: var(--ok-soft); color: var(--ok); }
.badge.s-no { background: #eceff1; color: #5d6b72; }
.badge.urgent { background: var(--danger); color: #fff; }

.list-plain { list-style: none; margin: 0; padding: 0; }

.hidden { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mt2 { margin-top: 20px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.loading { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- מסך האחראים ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-top: 16px; padding-bottom: 2px; }
.tab {
  border: 0; background: #e6edf0; color: #33424a; padding: 10px 16px; border-radius: 12px;
  cursor: pointer; font-weight: 500; white-space: nowrap; font-size: 15px;
}
.tab.on { background: var(--brand); color: #fff; }
.tab .n { background: rgba(255,255,255,.25); border-radius: 999px; padding: 0 7px; margin-inline-start: 6px; font-size: 13px; }
.tab:not(.on) .n { background: #fff; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 16px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.stat .num { font-size: 26px; font-weight: 600; line-height: 1.1; }
.stat .lbl { font-size: 14px; color: var(--muted); }
.stat.warn .num { color: var(--warn); }
.stat.danger .num { color: var(--danger); }

.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.filters select, .filters input { padding: 9px 12px; font-size: 15px; }

.rcard {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-top: 10px; overflow: hidden; border-inline-start: 5px solid var(--line);
}
.rcard.s-new { border-inline-start-color: var(--warn); }
.rcard.s-work { border-inline-start-color: var(--brand); }
.rcard.s-done { border-inline-start-color: var(--ok); }
.rcard.s-no { border-inline-start-color: #b9c3c8; }
.rcard .head { display: flex; gap: 12px; padding: 12px 14px; cursor: pointer; align-items: flex-start; }
.rcard .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #eef2f4; flex: none; }
.rcard .thumb.none { display: flex; align-items: center; justify-content: center; font-size: 26px; }
.rcard .main { flex: 1; min-width: 0; }
.rcard .t1 { font-weight: 600; }
.rcard .t2 { font-size: 15px; color: #33424a; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rcard .t3 { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.rcard .side { text-align: left; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.rcard .body { border-top: 1px solid var(--line); padding: 14px; background: #fafcfd; }
.rcard .body img.full { max-width: 100%; max-height: 420px; border-radius: 10px; display: block; margin-bottom: 12px; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edit-grid label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 4px; }
.edit-grid .full { grid-column: 1 / -1; }
.metoo { background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 13px; font-weight: 600; }

table.simple { width: 100%; border-collapse: collapse; font-size: 15px; }
table.simple th, table.simple td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.simple th { color: var(--muted); font-weight: 500; font-size: 14px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #22313a; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 15px;
  z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

/* ---------- מפה ---------- */
.mbuilding h2 { margin-bottom: 8px; }
.mfloor { font-size: 14px; color: var(--muted); margin: 12px 0 6px; font-weight: 500; }
.mrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.mgroup { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fafcfd; }
.mglabel { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.mtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.mtile {
  border: 0; border-radius: 10px; padding: 9px 8px; cursor: pointer; text-align: right;
  display: flex; flex-direction: column; gap: 2px; min-height: 62px; font-size: 13px; line-height: 1.3;
  border-inline-start: 5px solid transparent;
}
.mtile b { font-size: 14px; font-weight: 600; }
.mtile i { font-style: normal; font-weight: 600; color: var(--danger); }
.mtile.room b { font-size: 16px; }
.mtile:disabled { cursor: default; }
.m-green { background: var(--ok-soft); border-inline-start-color: var(--ok) !important; }
.m-orange { background: var(--warn-soft); border-inline-start-color: var(--warn) !important; }
.m-red { background: var(--danger-soft); border-inline-start-color: var(--danger) !important; }
.m-off { background: #eef1f3; color: #8a979e; border-inline-start-color: #c4ccd0 !important; }
.mdot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border-inline-start: 4px solid; margin-inline-start: 8px; }

/* ---------- מדבקות להדפסה ---------- */
.stickers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.sticker {
  background: #fff; border: 1px dashed #b8c6cc; border-radius: 12px; padding: 12px 10px 10px;
  text-align: center; break-inside: avoid; page-break-inside: avoid;
}
.sticker .org { font-size: 12px; color: var(--muted); }
.sticker .pl { font-size: 20px; font-weight: 600; margin: 2px 0 6px; color: var(--brand-dark); }
.sticker .qr svg, .sticker .qr img { width: 150px; height: 150px; }
.sticker .cta { font-size: 13px; margin-top: 4px; }

@media print {
  body { background: #fff; }
  header.top, .tabs, .no-print, .stats { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card { box-shadow: none; padding: 0; margin: 0; }
  .stickers { gap: 6mm; }
  .sticker { border-color: #999; }
}

@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .q { grid-column: 1 / -1; }
  .edit-grid { grid-template-columns: 1fr; }
  .stickers { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .cats, .names { grid-template-columns: 1fr; }
}
