/* Obrelia — שפה עיצובית "חדר בקרה של אולפן". מובייל-תחילה. v3 */
:root {
  --bg: #0b0c10;
  --surface: #14161d;
  --surface-2: #1c1f29;
  --border: #272b38;
  --border-soft: #1f232e;
  --text: #eef0f5;
  --muted: #8f96a6;
  --red: #ff3b41;
  --red-soft: #ff3b4122;
  --green: #3ddc84;
  --amber: #ffb224;
  --blue: #7cb7ff;
  --radius: 18px;
  --radius-sm: 12px;
  font-size: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Heebo', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -5%, #2a151a 0%, transparent 60%),
    radial-gradient(700px 500px at -10% 105%, #131a2a 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); /* מקום לניווט התחתון */
}
a { color: var(--blue); }
h2 { font-weight: 800; font-size: 1.45rem; margin: 1.2rem 0 .4rem; }
h3 {
  margin: 1.7rem 0 .7rem; font-weight: 700; font-size: 1.02rem;
  display: flex; align-items: center; gap: .55rem; color: var(--muted);
  letter-spacing: .02em;
}
h3::after { content: ''; flex: 1; height: 1px; background: var(--border-soft); }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.mono { font-family: 'IBM Plex Mono', monospace; }
.ok { color: var(--green); }
.bad { color: var(--red); }
.err { color: #ffb3b5; }

/* ---------- מסגרת ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1.1rem;
  padding-top: calc(.7rem + env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 20;
  background: #0b0c10d9; backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.brand-inline {
  font-weight: 900; font-size: 1.15rem; letter-spacing: .01em;
  display: flex; align-items: center; gap: .5rem;
}
.rec-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 4px var(--red-soft);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--red-soft); }
  50%      { box-shadow: 0 0 0 9px #ff3b4111; }
}
.topbar-user { display: flex; align-items: center; gap: .55rem; }
.user-chip {
  font-family: 'IBM Plex Mono', monospace; font-size: .72rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: .22rem .6rem; border-radius: 999px; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-ghost {
  color: var(--text); text-decoration: none; border: 1px solid var(--border);
  padding: .32rem .75rem; border-radius: 10px; font-size: .85rem; background: none;
  font-family: inherit; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--red); }
.container { max-width: 980px; margin: 0 auto; padding: .4rem 1rem 2rem; }

/* ניווט: עליון בדסקטופ, תחתון קבוע במובייל */
.mainnav { display: flex; gap: .2rem; }
.mainnav a {
  display: flex; flex-direction: column; align-items: center; gap: .18rem;
  color: var(--muted); text-decoration: none;
  padding: .45rem .85rem; border-radius: 12px;
}
.mainnav a svg { width: 22px; height: 22px; }
.mainnav a .nav-lbl { font-size: .95rem; }
.mainnav a.active { color: var(--text); background: var(--surface-2); }
.mainnav a:hover { color: var(--text); }
@media (max-width: 720px) {
  .mainnav {
    position: fixed; bottom: 0; right: 0; left: 0; z-index: 30;
    background: #0e0f14ee; backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-soft);
    justify-content: space-around;
    padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom));
  }
  .mainnav a { padding: .3rem .9rem; }
  .mainnav a .nav-lbl { font-size: .68rem; }
  .mainnav a.active { background: none; color: var(--red); }
}
@media (min-width: 721px) {
  body { padding-bottom: 2rem; }
  .mainnav a { flex-direction: row; gap: .45rem; }
  .mainnav a svg { width: 18px; height: 18px; }
}

/* ---------- כרטיסי מצב ---------- */
.cards-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1rem; }
.stat-card {
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 90%);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: .8rem .9rem; display: flex; flex-direction: column; gap: .25rem;
  min-width: 0;
}
.lbl { color: var(--muted); font-size: .72rem; letter-spacing: .02em; }
.big { font-size: 1.15rem; font-weight: 700; }
@media (max-width: 420px) { .big { font-size: 1rem; } .stat-card { padding: .7rem .7rem; } }

/* ---------- כרטיס LIVE ---------- */
.live-card {
  position: relative;
  background: linear-gradient(150deg, #1d1216 0%, var(--surface) 55%);
  border: 1px solid #58252b;
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.2rem;
  margin-bottom: .9rem;
  box-shadow: 0 18px 50px #ff3b4109, inset 0 1px 0 #ffffff08;
  overflow: hidden;
}
.live-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: .8;
}
.live-head { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.live-badge {
  color: #fff; background: var(--red); font-weight: 800; font-size: .72rem;
  padding: .18rem .55rem; border-radius: 7px; letter-spacing: .06em;
  animation: blink 1.7s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .55; } }
.live-title { font-weight: 700; font-size: 1.05rem; }
.live-meta {
  color: var(--muted); font-size: .82rem; margin: .5rem 0 .9rem;
  overflow-wrap: anywhere;
}
.live-times { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-bottom: .9rem; }
.live-times > div { display: flex; flex-direction: column; gap: .1rem; }
.live-times .big { font-size: 1.45rem; font-weight: 600; }
.progress { height: 7px; border-radius: 99px; background: #ffffff10; overflow: hidden; }
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #ff6a4d, var(--red));
  border-radius: 99px;
}
.calm-card {
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  color: var(--muted); display: flex; align-items: center; gap: .7rem;
}

/* ---------- צ'יפים ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .14rem .62rem; border-radius: 999px;
  font-size: .74rem; border: 1px solid transparent; white-space: nowrap;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-sched  { background: #262b3844; color: #aab2c5; border-color: var(--border); }
.chip-rec    { background: var(--red-soft); color: #ff8f93; border-color: #7c3237; }
.chip-proc   { background: #ffb22418; color: var(--amber); border-color: #6b532a; }
.chip-done   { background: #3ddc8418; color: var(--green); border-color: #2b5f44; }
.chip-err    { background: var(--red-soft); color: #ffb3b5; border-color: #7c3237; }
.chip-cancel { background: #262b3844; color: var(--muted); border-color: var(--border); }
.chip-link {
  display: inline-flex; padding: .2rem .65rem; border-radius: 999px;
  background: #7cb7ff14; border: 1px solid #35507a; color: var(--blue);
  font-size: .78rem; text-decoration: none; white-space: nowrap;
}
.chip-link:hover { background: #7cb7ff28; }

/* ---------- רשימות כרטיסים (במקום טבלאות במובייל) ---------- */
.job-list { display: flex; flex-direction: column; gap: .6rem; margin-top: .6rem; }
.job-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: .85rem 1rem;
  transition: border-color .15s;
}
a.job-card:hover { border-color: #3a4053; }
.job-card .row1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.job-card .jid { font-family: 'IBM Plex Mono', monospace; font-size: .78rem; color: var(--muted); }
.job-card .jtitle {
  margin: .35rem 0 0; font-size: .92rem; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.job-card .jtimes {
  margin-top: .4rem; color: var(--muted); font-size: .78rem;
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.job-card .clips { margin-top: .55rem; display: flex; gap: .4rem; flex-wrap: wrap; }

/* ---------- טבלאות (ניהול/פירוט) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .88rem; }
th, td { padding: .6rem .85rem; text-align: right; border-bottom: 1px solid var(--border-soft); }
th { color: var(--muted); font-weight: 400; font-size: .76rem; }
tr:last-child td { border-bottom: 0; }
td a { color: var(--blue); text-decoration: none; }
.trunc { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- פירוט עבודה ---------- */
.detail-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin-top: 1rem;
}
.detail-grid .full { grid-column: 1 / -1; overflow-wrap: anywhere; }
.detail-grid .lbl { display: block; margin-bottom: .15rem; }
.logbox {
  background: #08090c; border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 1rem; font-size: .74rem; overflow-x: auto; max-height: 420px;
  font-family: 'IBM Plex Mono', monospace; color: #aeb4c2; line-height: 1.55;
}
@media (max-width: 640px) {
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .trunc { max-width: 150px; }
}

/* ---------- פאנליסטים ---------- */
.panelist-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .8rem; margin-top: 1rem;
}
.panelist-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden; text-align: center;
  position: relative;
}
.panelist-card.disabled img { filter: grayscale(1) brightness(.6); }
.panelist-card img, .face-placeholder {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  background: var(--surface-2);
}
.face-placeholder { display: grid; place-items: center; font-size: 2.6rem; color: var(--muted); }
.panelist-info {
  padding: .65rem .55rem .85rem; display: flex; flex-direction: column;
  gap: .35rem; align-items: center;
}
.panelist-info strong { font-size: .95rem; }

/* ---------- כניסה והרשמה ---------- */
.login-wrap { min-height: 92vh; display: grid; place-items: center; padding: 1.25rem; }
.login-card {
  width: 100%; max-width: 380px;
  background: linear-gradient(165deg, #191c25 0%, var(--surface) 70%);
  border: 1px solid var(--border);
  border-radius: 22px; padding: 2.2rem 1.9rem;
  box-shadow: 0 30px 80px #00000088, inset 0 1px 0 #ffffff0a;
}
.brand { text-align: center; margin-bottom: 1.4rem; }
.brand h1 { margin: .45rem 0 0; font-weight: 900; letter-spacing: .01em; font-size: 1.9rem; }
.tagline { color: var(--muted); margin: .3rem 0 0; font-size: .92rem; }
label { display: block; margin: .95rem 0 .3rem; font-size: .88rem; color: var(--muted); }
input {
  width: 100%; padding: .72rem .85rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #10121a; color: var(--text); font: inherit;
}
input:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: transparent; }
button[type=submit] {
  width: 100%; margin-top: 1.4rem; padding: .78rem;
  border: 0; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ff5b52, var(--red));
  color: #fff; font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 26px #ff3b4133;
}
button[type=submit]:hover { filter: brightness(1.08); }
.alert {
  background: var(--red-soft); border: 1px solid #7c3237; color: #ffb3b5;
  border-radius: var(--radius-sm); padding: .6rem .85rem; font-size: .88rem;
  margin-bottom: .5rem;
}
.hint { color: var(--muted); font-size: .82rem; text-align: center; margin-top: 1.3rem; }
.hint a, .login-card a { color: var(--blue); }

/* ---------- ניהול ---------- */
.actions form { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.btn-ok, .btn-danger {
  border: 0; border-radius: 9px; padding: .32rem .7rem; font: inherit;
  font-size: .8rem; cursor: pointer; color: #fff;
}
.btn-ok { background: #2e9e5b; }
.btn-danger { background: var(--red); }
.actions select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: .28rem .4rem; font: inherit; font-size: .8rem; width: auto;
}

/* ---------- שלב 3: פעולות ---------- */
.stop-row { display: flex; gap: .6rem; margin-top: .9rem; flex-wrap: wrap; }
.btn-stop {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  padding: .5rem .95rem; font: inherit; font-size: .88rem; cursor: pointer;
}
.btn-stop.danger { border-color: #7c3237; color: #ffb3b5; background: var(--red-soft); }
.btn-stop:hover { filter: brightness(1.15); }
.btn-toggle {
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  padding: .28rem .8rem; font: inherit; font-size: .78rem;
  background: var(--surface-2); color: var(--text); width: auto;
}
.btn-toggle.on { border-color: #2b5f44; color: var(--green); }
.btn-toggle.off { border-color: #7c3237; color: #ffb3b5; }
.sched-form {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-top: 1rem;
  max-width: 560px;
}
.sched-form button[type=submit] { max-width: 320px; }
.seg { display: flex; gap: .45rem; flex-wrap: wrap; margin: .3rem 0 .6rem; }
.seg label { margin: 0; }
.seg input[type=radio] { position: absolute; opacity: 0; width: 0; }
.seg span {
  display: inline-block; padding: .45rem .85rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: .88rem; cursor: pointer; color: var(--text);
}
.seg input[type=radio]:checked + span {
  border-color: var(--red); background: var(--red-soft); color: #ffc9cb;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.sched-form select {
  width: 100%; padding: .65rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #10121a; color: var(--text); font: inherit;
}
.confirm-line { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; color: #ffd9a1; }
.confirm-line input { width: auto; }
