:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #4f46e5;
  --brand-2: #0ea5e9;
  --accent: #f59e0b;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;

  /* צבעי מצב */
  --s-idea: #f59e0b;
  --s-building: #6366f1;
  --s-qa: #0ea5e9;
  --s-live: #10b981;

  /* צבעי דומיין */
  --d-ideas: #f59e0b;
  --d-apps: #6366f1;
  --d-sites: #0ea5e9;
  --d-office: #14b8a6;
  --d-tools: #ef4444;
  --d-agents: #8b5cf6;
  --d-credits: #eab308;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Assistant', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

/* סרגל עליון */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(120deg, #4f46e5 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  font-weight: 800; font-size: 1.4rem;
}
.brand-text h1 { font-size: 1.25rem; font-weight: 800; }
.brand-text p { font-size: 0.85rem; opacity: 0.9; }

.topbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.search {
  min-width: 220px;
  padding: 0.55rem 0.9rem;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
}
.search:focus { outline: 2px solid #fff; }

.btn {
  padding: 0.55rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: rgba(255, 255, 255, 0.18); color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.btn-primary:hover { background: rgba(255, 255, 255, 0.3); }
.btn-accent { background: var(--accent); color: #3b2600; }

/* סטטיסטיקות */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  padding: 1.25rem 1.5rem 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 1.8rem; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: 0.9rem; }
.stat .bar { height: 4px; border-radius: 4px; margin-top: 0.6rem; opacity: 0.9; }

/* רצועת אישורים — אישורי סיכון לאבי */
.approvals {
  padding: 1.25rem 1.5rem 0;
}
.approvals-head { margin-bottom: 0.6rem; }
.approvals-title { font-weight: 800; font-size: 1.05rem; color: #b91c1c; }
.approvals-empty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--s-live);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.approvals-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.9rem;
}
.approval-card {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-inline-start: 5px solid #ef4444;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.approval-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.risk-badge {
  background: #ef4444; color: #fff;
  font-size: 0.75rem; font-weight: 700;
  padding: 0.15rem 0.6rem; border-radius: 999px;
}
.approval-title { font-weight: 800; }
.approval-detail { font-size: 0.88rem; color: #7f1d1d; }
.approval-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.approval-actions { display: flex; gap: 0.5rem; margin-top: 0.2rem; }
.btn-approve, .btn-reject {
  font-family: inherit; font-weight: 700; font-size: 0.9rem;
  padding: 0.45rem 1.1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent;
}
.btn-approve { background: var(--s-live); color: #fff; }
.btn-reject { background: #fff; color: #b91c1c; border-color: #fecaca; }
.btn-approve:hover, .btn-reject:hover { transform: translateY(-1px); }

/* מוקד — בעבודה עכשיו / דורש התערבות */
.focus {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
  padding: 1rem 1.5rem 0;
}
.focus-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--brand);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.focus-panel:hover { transform: translateY(-2px); }
.focus-panel.active { outline: 2px solid var(--brand); }
.focus-working { border-inline-start-color: var(--s-building); }
.focus-attention { border-inline-start-color: var(--s-idea); }
.focus-attention.active { outline-color: #ef4444; }
.focus-head { display: flex; align-items: center; justify-content: space-between; }
.focus-title {
  font-weight: 800;
  font-size: 1.05rem;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  padding: 0;
  text-align: start;
}
.focus-title:hover { text-decoration: underline; }
.focus-count {
  font-weight: 800;
  font-size: 1.1rem;
  background: var(--bg);
  border-radius: 999px;
  padding: 0.1rem 0.75rem;
}
.focus-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.focus-chip {
  font-size: 0.78rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}
.focus-chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.focus-attention .focus-chip { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.focus-empty { font-size: 0.85rem; color: var(--muted); }

/* מסננים */
.filters {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.25rem 1.5rem 0.25rem;
}
.domain-pills, .status-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: all 0.12s ease;
}
.pill .count {
  background: var(--bg);
  border-radius: 999px;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.active .count { background: rgba(255, 255, 255, 0.25); color: #fff; }
.status-pills .pill.active { background: var(--brand); border-color: var(--brand); }

/* לוח כרטיסים */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem 1.5rem 2rem;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 0.9rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-top: 4px solid var(--line);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(15,23,42,0.12); }
.card .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.card .card-icon { font-size: 1.3rem; }
.card .card-name { font-weight: 700; font-size: 1.02rem; }
.card .status {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}
.attention-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 10px;
}
.info-row { font-size: 0.85rem; line-height: 1.45; }
.info-label { color: var(--muted); font-weight: 700; }
.info-value { color: var(--ink); }
.card-rows { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.no-live {
  font-size: 0.8rem; font-weight: 700; color: var(--muted);
  background: var(--bg); border: 1px dashed var(--line);
  border-radius: 999px; padding: 0.3rem 0.7rem;
}
.kv {
  font-size: 0.78rem; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.15rem 0.6rem;
}
.card .meta { color: var(--muted); font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.card .card-foot { margin-top: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.link, .chat {
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--brand);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}
.link:hover, .chat:hover { background: var(--bg); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 3rem 0; }

/* כותרת תחתונה */
.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  padding: 1rem 1.5rem 2rem;
  color: var(--muted); font-size: 0.85rem;
}

/* מודל */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: grid; place-items: center;
  z-index: 50; padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.9rem;
}
.modal h2 { font-size: 1.2rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field span { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.field input, .field select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
}
.field input.input-error { border-color: #ef4444; background: #fef2f2; }
.field-error { color: #ef4444; font-size: 0.8rem; font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-start; gap: 0.5rem; margin-top: 0.3rem; }
.modal .btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
