/* [nexus 2026-10-27] פאנל הטלפון - שחור וזהב כמו שאר הפאנלים של Nexus */
:root {
  --bg: #0b0b0d;
  --card: #15151a;
  --card2: #1c1c23;
  --line: #2a2a33;
  --text: #f2f2f4;
  --muted: #9a9aa6;
  --gold: #ffc400;
  --gold-dim: #3a3000;
  --red: #ff4d4f;
  --red-dim: #3a1214;
  --green: #2ecc71;
  --green-dim: #0f2e1c;
  --blue: #4da3ff;
  --radius: 14px;
  --nav-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: 'Rubik', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: currentColor; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- כניסה */
body.login { display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 360px; text-align: center; }
.login-logo { width: 148px; height: 148px; border-radius: 28px; box-shadow: 0 0 40px rgba(255, 196, 0, .18); }
.login-box h1 { margin: 18px 0 2px; font-size: 26px; }
.login-box p { margin: 0 0 24px; }
.login-error { background: var(--red-dim); color: #ffb3b4; border: 1px solid #5c1f22; padding: 12px; border-radius: 12px; margin-bottom: 16px; }
.btn-discord { display: block; background: #5865f2; color: #fff; text-decoration: none; padding: 15px; border-radius: 14px; font-weight: 700; font-size: 17px; }

/* ---------------------------------------------------------------- מסגרת */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: rgba(11, 11, 13, .96);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.top-left { display: flex; align-items: center; gap: 10px; }
.pill { background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; white-space: nowrap; }
.pill.on { color: var(--green); }
.pill.off { color: var(--red); }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gold); background: var(--card2) center/cover no-repeat; padding: 0; }

#view { padding: 14px 16px; max-width: 760px; margin: 0 auto; }

.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #101014; border-top: 1px solid var(--line);
}
.tabs button {
  background: none; border: 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12px;
}
.tabs svg { width: 24px; height: 24px; }
.tabs button.active { color: var(--gold); }

/* ---------------------------------------------------------------- רכיבים */
h2 { font-size: 20px; margin: 4px 0 12px; }
h3 { font-size: 16px; margin: 0 0 10px; color: var(--gold); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.row .v { text-align: left; word-break: break-word; min-width: 0; }

.search {
  width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 16px; outline: none; margin-bottom: 12px;
}
.search:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.item:active { background: var(--card2); }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idbadge { min-width: 44px; height: 44px; border-radius: 10px; background: var(--gold-dim); color: var(--gold); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.idbadge.off { background: var(--card2); color: var(--muted); }

.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); white-space: nowrap; }
.chip.gold { color: var(--gold); border-color: #5a4a00; background: var(--gold-dim); }
.chip.red { color: #ff9a9b; border-color: #5c1f22; background: var(--red-dim); }
.chip.green { color: #8ff0b8; border-color: #1d5c37; background: var(--green-dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips button.chip { padding: 7px 14px; font-size: 14px; }
.chips button.chip.sel { color: var(--bg); background: var(--gold); border-color: var(--gold); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card2); border-radius: 12px;
  padding: 11px 14px; font-weight: 500; min-height: 44px;
}
.btn.gold { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 700; }
.btn.red { background: var(--red); color: #fff; border-color: var(--red); font-weight: 700; }
.btn.ghost-red { color: #ff9a9b; border-color: #5c1f22; background: var(--red-dim); }
.btn.small { min-height: 34px; padding: 6px 10px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; font-size: 16px; outline: none;
}
.field textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg button { background: none; border: 0; padding: 9px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.seg button.sel { background: var(--gold); color: #111; }

.back { background: none; border: 0; color: var(--gold); padding: 6px 0; margin-bottom: 8px; font-size: 15px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

.console {
  direction: ltr; text-align: left; background: #050506; border: 1px solid var(--line); border-radius: 12px;
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; line-height: 1.35;
  height: 46vh; overflow: auto; padding: 10px; white-space: pre-wrap; word-break: break-word;
}
.cmdline { display: flex; gap: 8px; margin-top: 8px; }
.cmdline input { flex: 1; direction: ltr; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, Consolas, monospace; font-size: 15px; outline: none; }

.stat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat div { background: var(--card2); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 18px; color: var(--gold); }

.res { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.res:last-child { border-bottom: 0; }
.res .n { flex: 1; min-width: 0; direction: ltr; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.dot.started { background: var(--green); }
.dot.stopped { background: var(--red); }

/* ---------------------------------------------------------------- מסכים */
.screen { position: relative; background: #000; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.screen img { width: 100%; height: 100%; object-fit: contain; display: block; }
.screen .msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 12px; color: var(--muted); font-size: 14px; }
.screen-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 10px; font-size: 14px; }
.rec { display: inline-flex; align-items: center; gap: 6px; }
.rec::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.rec.paused::before { background: var(--muted); }
.screen-full { position: fixed; inset: 0; z-index: 50; background: #000; }
.screen-full img { position: absolute; top: 50%; left: 50%; width: 100vh; height: 100vw; object-fit: contain; transform: translate(-50%, -50%) rotate(90deg); }
@media (orientation: landscape) { .screen-full img { width: 100vw; height: 100vh; transform: translate(-50%, -50%); } }

/* ---------------------------------------------------------------- חלון מלמטה */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 760px; max-height: 88vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 19px; }
.xbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); display: grid; place-items: center; flex-shrink: 0; }
.xbtn svg { width: 18px; height: 18px; }
.warn { background: var(--red-dim); border: 1px solid #5c1f22; color: #ffc2c3; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }

#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast { max-width: 520px; width: 100%; padding: 12px 14px; border-radius: 12px; background: #202028; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); animation: up .18s ease-out; }
.toast.ok { border-color: #1d5c37; }
.toast.err { border-color: #5c1f22; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
