/* חדר הבקרה · סגנון "כהה ונועז" (bold-dark) עם ירוק-ליים */
:root {
  --bg: #0B0B0E;
  --surface: #16161B;
  --surface-2: #202027;
  --surface-3: #2A2A33;
  --text: #F4F4F6;
  --muted: #9A9AA6;
  --line: #2B2B33;
  --accent: #C6FF3D;
  --on-accent: #0B0B0E;
  --red: #FF5A5F;
  --orange: #FF9F43;
  --yellow: #FFD43B;
  --green: #3DDC84;
  --purple: #B197FC;
  --blue: #5AA9FF;
  --gray: #6B6B78;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 14px 34px rgb(0 0 0 / .4);
  --font-head: 'Rubik', 'Heebo', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: 'Heebo', system-ui, sans-serif; font-size: 16px; line-height: 1.5; min-height: 100dvh; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 900; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 18px; height: 18px; }

/* ---------- מבנה ---------- */
.app { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(120px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; min-height: 48px; }
.top h1 { font-size: 26px; flex: 1; }
.back { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-content: center; }
.back svg { transform: scaleX(-1); }

/* ניווט: גלולה צפה בטלפון, תפריט צד במחשב */
.nav { position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); max-width: 440px; margin: 0 auto;
  display: flex; justify-content: space-between; padding: 8px; border-radius: 999px; background: rgb(30 30 36 / .92); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.nav a { position: relative; display: grid; place-content: center; min-width: 52px; height: 52px; border-radius: 999px; color: var(--muted); }
.nav a span { display: none; }
.nav a.on { background: var(--accent); color: var(--on-accent); }
.nav a .dot { position: absolute; top: 9px; left: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 2px #1E1E24; }
.brand { display: none; }

.fab { position: fixed; z-index: 31; left: 18px; bottom: calc(96px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; height: 58px; padding: 0 22px;
  border: 0; border-radius: 999px; font-weight: 800; font-size: 16px; color: var(--on-accent); background: var(--accent); box-shadow: 0 12px 28px rgb(198 255 61 / .28); }

@media (min-width: 900px) {
  .app { max-width: 1120px; padding: 34px 40px 60px; margin-inline-start: 260px; margin-inline-end: auto; }
  .nav { inset: 0 0 0 auto; left: auto; right: 0; bottom: 0; width: 240px; max-width: none; margin: 0; flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: 26px 16px; border-radius: 0; border: 0; border-inline-start: 1px solid var(--line); background: var(--surface); box-shadow: none; }
  .nav a { display: flex; justify-content: flex-start; gap: 12px; padding: 0 16px; height: 50px; border-radius: 14px; place-content: initial; align-items: center; }
  .nav a span { display: inline; font-weight: 700; }
  .nav a .dot { position: static; margin-inline-start: auto; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font-family: var(--font-head); font-weight: 900; font-size: 21px; }
  .brand i { width: 34px; height: 34px; border-radius: 11px; background: var(--accent); display: grid; place-content: center; color: var(--on-accent); }
  .fab { left: 40px; bottom: 34px; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
}

/* ---------- כרטיסים ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.section { margin-top: 28px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section__head h2 { font-size: 20px; }
.section__head a, .linkbtn { font-size: 15px; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 8px 0; }

/* ---------- דשבורד ---------- */
.greet { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.greet h1 { font-size: 30px; }
.greet p { color: var(--muted); margin-top: 2px; }
.pc { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); }
.pc i { width: 10px; height: 10px; border-radius: 50%; background: var(--gray); }
.pc.on i { background: var(--accent); box-shadow: 0 0 0 4px rgb(198 255 61 / .18); animation: pulse 2s infinite; }
.pc.off { color: var(--orange); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgb(198 255 61 / .05); } }

.hero { margin-top: 18px; padding: 22px; border-radius: var(--radius-lg); background: var(--accent); color: var(--on-accent); position: relative; overflow: hidden; }
.hero.bad { background: var(--red); color: #fff; }
.hero b { display: block; font-family: var(--font-head); font-weight: 900; font-size: 54px; line-height: 1; letter-spacing: -1px; }
.hero span { font-weight: 700; font-size: 17px; }
.hero .bars { display: flex; gap: 5px; margin-top: 16px; }
.hero .bars i { flex: 1; height: 10px; border-radius: 6px; background: rgb(11 11 14 / .85); }
.hero .bars i.down { background: #fff; }
.hero.bad .bars i { background: rgb(255 255 255 / .35); }
.hero.bad .bars i.down { background: #fff; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.kpi { padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: start; }
button.kpi { width: 100%; }
.kpi b { display: block; font-family: var(--font-head); font-weight: 900; font-size: 30px; line-height: 1.1; }
.kpi span { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.kpi.alert b { color: var(--purple); }
.kpi.work b { color: var(--yellow); }

/* מערכות */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sys-tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; min-height: 96px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: start; }
.sys-tile strong { font-weight: 800; font-size: 15.5px; line-height: 1.3; }
.sys-tile small { color: var(--muted); font-size: 13px; }
.light { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.light i { width: 10px; height: 10px; border-radius: 50%; background: var(--gray); flex: none; }
.light.up i { background: var(--green); box-shadow: 0 0 10px rgb(61 220 132 / .6); }
.light.slow i { background: var(--yellow); }
.light.down i { background: var(--red); box-shadow: 0 0 12px rgb(255 90 95 / .8); animation: blink 1s infinite; }
.light.down { color: var(--red); }
@keyframes blink { 50% { opacity: .35; } }

/* רשימות */
.list { display: grid; gap: 10px; }
.item { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: start; }
.item__main { flex: 1; min-width: 0; }
.item__title { font-weight: 700; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.item__sub { color: var(--muted); font-size: 14px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.item__av { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); display: grid; place-content: center; font-weight: 800; flex: none; }
.item.urgent { border-color: rgb(255 90 95 / .5); }
.progress { margin-top: 8px; font-size: 14px; color: var(--yellow); display: flex; gap: 8px; align-items: center; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; background: var(--surface-2); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pending { color: var(--orange); } .st-new { color: var(--red); } .st-working { color: var(--yellow); } .st-needs_you { color: var(--purple); }
.st-done { color: var(--green); } .st-failed { color: var(--red); } .st-cancelled { color: var(--gray); }
.st-active { color: var(--green); } .st-invited { color: var(--yellow); } .st-blocked { color: var(--gray); }

/* חיפוש ומסננים */
.search { position: relative; margin-bottom: 12px; }
.search input { width: 100%; height: 52px; padding: 0 48px 0 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; right: 15px; top: 15px; color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 0 -16px 12px; padding-inline: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
.chip b { font-family: var(--font-head); color: var(--muted); }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.chip.on b { color: var(--on-accent); }

/* ריק */
.empty { padding: 34px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-lg); color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* כפתורים */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 800; font-size: 16px; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.danger { color: var(--red); border-color: rgb(255 90 95 / .4); background: transparent; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row .btn { flex: 1 1 140px; }

/* פרטי מערכת */
.sys-head { display: flex; align-items: center; gap: 14px; }
.sys-head .big-light { width: 58px; height: 58px; border-radius: 18px; display: grid; place-content: center; background: var(--surface-2); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.fact { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.fact small { display: block; color: var(--muted); font-size: 13px; }
.fact b { font-family: var(--font-head); font-size: 20px; }

/* שיחה על בקשה */
.thread { display: grid; gap: 12px; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 18px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; font-weight: 700; }
.msg.user { justify-self: start; border-end-start-radius: 6px; }
.msg.claude { justify-self: end; background: #1D2410; border: 1px solid rgb(198 255 61 / .25); border-end-end-radius: 6px; }
.msg img { display: block; max-width: 100%; border-radius: 12px; margin-top: 8px; }
.msg a { color: var(--accent); text-decoration: underline; word-break: break-all; }
.working-box { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 18px; background: rgb(255 212 59 / .08); border: 1px solid rgb(255 212 59 / .3); color: var(--yellow); font-weight: 600; }

/* טפסים וחלונות */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .6); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); border: 1px solid var(--line); animation: up .2s ease-out; }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 4px auto 14px; }
.sheet h2 { font-size: 22px; margin-bottom: 16px; }
.sheet .actions { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 18px -18px calc(-20px - env(safe-area-inset-bottom)); padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet .actions .btn { flex: 1; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 26px; } .sheet .actions { margin-bottom: -20px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { font-weight: 700; font-size: 15px; }
.field small { color: var(--muted); font-size: 13.5px; }
.input, textarea.input, select.input { width: 100%; min-height: 52px; padding: 12px 15px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); outline: none; }
textarea.input { min-height: 130px; resize: vertical; }
.input:focus { border-color: var(--accent); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 44px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; font-size: 15px; }
.opt.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 15px; border-radius: 14px; background: var(--surface-2); font-weight: 700; }
.switch input { width: 46px; height: 28px; accent-color: var(--accent); }
.attach { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 15px; border-radius: 14px; border: 1px dashed var(--line); background: transparent; width: 100%; color: var(--muted); font-weight: 700; }
.attach img { height: 40px; border-radius: 8px; }
.err { color: var(--red); font-weight: 700; min-height: 22px; font-size: 15px; }
.linkbox { display: flex; gap: 8px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); word-break: break-all; font-size: 14px; direction: ltr; }

/* כניסה */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 420px; padding: 26px 20px; }
.login .logo { width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--on-accent); display: grid; place-content: center; margin-bottom: 16px; }
.login h1 { font-size: 30px; margin-bottom: 6px; }
.login p.muted { margin-bottom: 22px; }

/* הודעה קופצת */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 13px 18px; border-radius: 16px; background: var(--text); color: var(--bg); font-weight: 700; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; animation: up .2s; }
.toast button { border: 0; background: none; color: #3A5A00; font-weight: 900; }

/* טבלת משתמשים */
.ugroup { margin-top: 22px; }
.ugroup h3 { font-size: 17px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.ugroup h3 small { font-family: 'Heebo'; font-weight: 600; color: var(--muted); font-size: 13.5px; }
.note { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 14.5px; }
.log { font-size: 14.5px; }
.log .item { padding: 12px 14px; }
.st-stopping { color: var(--orange); }
.light.local i { background: var(--gray); }
details summary { list-style-position: inside; }
.qr { background: #fff; border-radius: 16px; padding: 10px; width: min(240px, 100%); margin: 0 auto 10px; }
.qr svg { display: block; width: 100%; height: auto; }
