/* GroupPulse — עיצוב לפי מערכת העיצוב הרשמית (design/_ds):
   Pine → Emerald → Sage on warm-cool neutrals · Rubik (display) + Assistant (UI) */
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;500;600;700;800&family=Rubik:wght@400;500;600;700&display=swap');

:root {
  /* brand greens */
  --brand-deep: #0E3B2E;   /* Pine */
  --brand: #1E8E63;        /* Emerald — primary action */
  --brand-hover: #176046;
  --accent: #8FD3B0;       /* Sage */
  --brand-soft: #EAF4EE;   /* Mint surface */
  --brand-soft-2: #D6EFE1;
  /* neutrals (green-cast) */
  --ink: #16221C; --text: #2A3832; --muted: #5E7269; --subtle: #7A8D84;
  --bg: #F4F8F5; --card: #FFFFFF; --line: #DCE6E0; --line-subtle: #E6EEE9; --sunken: #EEF3F0;
  /* semantics — quiet, clinical */
  --danger: #C0492F; --danger-bg: #F4DDD6;
  --warn: #C98A2B; --warn-bg: #F6E9CF;
  --positive: #1E8E63; --positive-bg: #D6EFE1;
  --info: #2E6F8E; --info-bg: #D7E8EE;

  --font-display: 'Rubik', 'Assistant', system-ui, sans-serif;
  --font-sans: 'Assistant', system-ui, 'Segoe UI', sans-serif;
  --radius: 16px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(14,59,46,.05), 0 2px 6px -2px rgba(14,59,46,.08);
  --shadow-md: 0 2px 4px rgba(14,59,46,.05), 0 10px 24px -10px rgba(14,59,46,.14);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg); color: var(--text);
  min-height: 100vh; display: flex; flex-direction: column;
  font-size: 16px;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); }
.container { max-width: 1000px; width: 100%; margin: 0 auto; padding: 24px 20px 60px; flex: 1; }

/* topbar */
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line-subtle);
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; position: sticky; top: 0; z-index: 10; box-shadow: var(--shadow);
}
.brand { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.brand-logo { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.brand-logo img { width: 100%; height: 100%; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--brand-deep); }
.brand-sub { font-size: 12px; color: var(--muted); }
.badge {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--positive-bg); color: var(--brand-hover); font-weight: 600;
}
.badge.sim { background: var(--warn-bg); color: var(--warn); }

.footer { text-align: center; font-size: 12px; color: var(--muted); padding: 16px; border-top: 1px solid var(--line-subtle); background: var(--card); }

/* generic */
h1 { font-size: 24px; margin-bottom: 4px; }
h2 { font-size: 18px; margin-bottom: 10px; }
.sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line-subtle); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.spacer { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumb a { color: var(--brand-hover); cursor: pointer; text-decoration: none; font-weight: 600; }

/* buttons & inputs */
.btn {
  border: 0; border-radius: var(--radius-sm); padding: 10px 18px; font-size: 15px; font-weight: 600;
  cursor: pointer; background: var(--brand); color: #fff; font-family: var(--font-sans);
  transition: background .12s var(--ease);
}
.btn:hover { background: var(--brand-hover); }
.btn.secondary { background: var(--brand-soft); color: var(--brand-hover); border: 1px solid var(--brand-soft-2); }
.btn.secondary:hover { background: var(--brand-soft-2); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { background: var(--danger); }
.btn.big { font-size: 16px; padding: 14px 26px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, textarea, select {
  font-family: var(--font-sans); font-size: 15px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); width: 100%; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,142,99,.25); }
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
label { font-size: 13px; font-weight: 600; display: block; margin: 10px 0 4px; color: var(--ink); }

/* group cards */
.gcard { cursor: pointer; transition: transform .12s var(--ease), box-shadow .12s var(--ease); }
.gcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.gcard .proto { font-size: 12px; color: var(--brand-hover); background: var(--brand-soft); display: inline-block; padding: 2px 10px; border-radius: 999px; margin-bottom: 8px; font-weight: 600; }
.gcard h3 { font-size: 17px; margin-bottom: 6px; }
.gcard .meta { font-size: 13px; color: var(--muted); }

/* participants */
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.plist { display: flex; flex-direction: column; gap: 10px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line-subtle); border-radius: var(--radius-sm); background: #fff; }
.prow .avatar { width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font-display); }
.prow .goals { font-size: 12px; color: var(--muted); }

/* dictation */
.mic-area { text-align: center; padding: 10px 0 16px; }
.mic-btn {
  width: 86px; height: 86px; border-radius: 50%; border: 0; cursor: pointer; font-size: 34px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff;
  box-shadow: 0 6px 20px rgba(30,142,99,.35);
}
.mic-btn.rec { background: linear-gradient(135deg, var(--danger), #8E3220); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(192,73,47,.4);} 50% { box-shadow: 0 0 0 16px rgba(192,73,47,0);} }
.mic-hint { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* notes review */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; font-family: var(--font-sans); display: flex; align-items: center; gap: 7px; color: var(--text); }
.tab.active { background: var(--brand-deep); color: #fff; border-color: var(--brand-deep); }
.tab .ok { color: var(--positive); font-weight: 700; }
.tab.active .ok { color: var(--accent); }
.soap-field { margin-bottom: 12px; }
.soap-key { font-weight: 800; color: var(--brand-hover); font-size: 13px; margin-bottom: 3px; font-family: var(--font-display); }
.status-chip { font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.status-chip.draft { background: var(--warn-bg); color: var(--warn); }
.status-chip.approved { background: var(--positive-bg); color: var(--brand-hover); }
.status-chip.finalized { background: var(--brand-soft); color: var(--brand-deep); }

/* treatment continuity (רצף טיפולי) */
.link-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--warn-bg); border: 1px solid #EBD9B4; border-radius: var(--radius-sm); margin-bottom: 8px; }
.link-row .trend { font-size: 18px; line-height: 1; }
.link-row .goal { font-weight: 700; font-size: 13px; color: var(--ink); }
.link-row .evidence { font-size: 13px; color: var(--muted); }
.link-row .tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff; border: 1px solid #EBD9B4; white-space: nowrap; color: var(--warn); }
.thread-item { border-right: 3px solid var(--brand); padding: 10px 14px; margin-bottom: 12px; background: #fff; border-radius: 8px; border-top: 1px solid var(--line-subtle); border-bottom: 1px solid var(--line-subtle); border-left: 1px solid var(--line-subtle); }

/* crisis */
.crisis {
  background: var(--danger-bg); border: 1px solid #E5B4A6; color: #7E2F1E;
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; font-weight: 600;
}

/* processing */
.processing { text-align: center; padding: 60px 0; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 18px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(14,59,46,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-md); }

/* toast */
.toast {
  position: fixed; bottom: 24px; right: 50%; transform: translateX(50%) translateY(80px);
  background: var(--brand-deep); color: #fff; padding: 12px 22px; border-radius: var(--radius-sm); font-size: 14px;
  transition: transform .25s var(--ease); z-index: 100; box-shadow: var(--shadow-md);
}
.toast.show { transform: translateX(50%) translateY(0); }

.session-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line-subtle); border-radius: var(--radius-sm); background: #fff; cursor: pointer; margin-bottom: 8px; transition: border-color .12s var(--ease); }
.session-row:hover { border-color: var(--brand); }

@media (max-width: 640px) { .container { padding: 16px 12px 50px; } h1 { font-size: 20px; } }
