/* רכיבים חוזרים: כרטיסים, כפתורים, תגיות, רשימות, חלונית תחתונה, הודעות */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 18px; min-height: 44px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 15px;
  transition: transform .12s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.brand { background: var(--brand); }
.btn.soft { background: var(--lavender-soft); color: var(--brand-deep); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 7px 13px; font-size: 14px; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: inline-grid; place-items: center; color: var(--ink-2);
}
.icon-btn svg { width: 20px; height: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.chip.brand { background: var(--lavender-soft); color: var(--brand-deep); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.list { display: grid; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
}
button.item:active { background: var(--surface-2); }
.item .body { flex: 1; }
.item .title { font-weight: 700; }
.item .meta { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.avatar {
  width: 42px; height: 42px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lavender-soft); color: var(--brand-deep); font: 700 16px var(--font-head);
}
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty svg { width: 40px; height: 40px; color: var(--lavender); margin-bottom: 8px; }

.search { position: relative; margin-bottom: 12px; }
.search input { padding-inline-start: 40px; }
.search svg { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--muted); }

.field { margin-bottom: 14px; }
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }

/* חלונית תחתונה (בטלפון) / חלון מרכזי (במסך גדול) */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(35, 25, 45, .35); animation: fade .2s; }
.sheet {
  position: relative; width: 100%; max-width: 620px; max-height: 92dvh; overflow-y: auto;
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 10px 18px calc(22px + var(--safe-b)); box-shadow: var(--shadow-lg);
  animation: up .26s cubic-bezier(.2, .8, .2, 1);
}
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
@media (min-width: 720px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: var(--r-lg); padding-bottom: 24px; }
  .sheet-grip { display: none; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

#toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--lavender-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.note { background: var(--lavender-soft); color: var(--brand-deep); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14.5px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* מתגים (השתקת התראות) */
.toggles { display: grid; gap: 2px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; margin: 0; font-size: 15px; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle:last-child { border-bottom: 0; }
.toggle input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; flex: none; padding: 0; border: 0; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; }
.toggle input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: inset-inline-start .2s; }
.toggle input:checked { background: var(--brand); }
.toggle input:checked::after { inset-inline-start: 21px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; text-decoration: underline; }
