/* SysTeam J.A.R.V.I.S. — Comando va Ikkinchi miya ko'rinishlari */

/* Comando / Ikkinchi miya ochiq bo'lsa: umumiy KPI qatori va o'ng lenta o'rniga o'z panellari */
body[data-view="comando"] .kpis, body[data-view="comando"] .side,
body[data-view="brain2"] .kpis, body[data-view="brain2"] .side { display: none; }
body[data-view="comando"] .page, body[data-view="brain2"] .page { grid-template-columns: 1fr; padding-top: 12px; }

.present-btn { background: var(--panel); border: 1px solid var(--line2); color: var(--muted); border-radius: 9px; padding: 6px 10px; font-size: 12.5px; }
.present-btn.on { color: #fca5a5; border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.1); }

/* ───── Comando: 3 ustun ───── */
.cmd { display: grid; grid-template-columns: 300px minmax(0, 1fr) 330px; gap: 12px; height: max(760px, calc(100vh - 92px)); }
.cmd-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.pnl { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; min-height: 0; }
.pnl-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pnl-h .tick { width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.pnl-h .r { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--dim); font-size: 11.5px; }
.pnl-b { padding: 0 12px 10px; overflow: auto; min-height: 0; }
.pnl-f { border-top: 1px solid var(--line); padding: 7px 12px; font-size: 11.5px; color: var(--dim); display: flex; justify-content: space-between; }
.pnl-f b { color: var(--ok); }
.grow { flex: 1 1 0; min-height: 150px; }
.pnl.fill { flex: 1 1 0; min-height: 130px; }
.pnl.fit { flex: 0 0 auto; }

/* Portfel */
.cl-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 9px; align-items: center; padding: 6px 2px; border-bottom: 1px solid rgba(36,48,73,.55); cursor: default; }
.cl-row:last-child { border: 0; }
.cl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.cl-dot.trial { background: var(--warn); } .cl-dot.paused { background: var(--err); }
.cl-nm { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-sv { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-mrr { text-align: right; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-mrr small { display: block; font-weight: 400; color: var(--dim); font-size: 10.5px; }
.cl-tag { font-size: 10px; padding: 1px 6px; border: 1px solid var(--line2); border-radius: 5px; color: var(--muted); margin-left: 6px; font-weight: 500; }

/* Hozir */
.now-clock { font: 600 24px/1 "JetBrains Mono", monospace; color: var(--accent); letter-spacing: .02em; }
.now-date { color: var(--muted); font-size: 12px; margin: 3px 0 6px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 10px; text-align: center; color: var(--dim); }
.cal span { padding: 1px 0; border-radius: 4px; line-height: 15px; }
.cal .wd { font-weight: 700; color: var(--muted); }
.cal .d { background: rgba(36,48,73,.45); color: var(--muted); }
.cal .today { background: var(--accent); color: #0b0f17; font-weight: 700; }
.next-h { margin: 8px 0 3px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.next-i { font-size: 12px; padding: 2px 0; color: var(--text); }
.next-i i { font-style: normal; color: var(--accent); font-family: "JetBrains Mono", monospace; margin-right: 6px; }

/* Funnel */
.fn-row { padding: 6px 0; border-bottom: 1px solid rgba(36,48,73,.55); }
.fn-row:last-child { border: 0; }
.fn-top { display: flex; justify-content: space-between; font-size: 12.5px; }
.fn-top b { font-variant-numeric: tabular-nums; }
.fn-bar { height: 4px; background: var(--panel2); border-radius: 3px; margin: 5px 0 3px; overflow: hidden; }
.fn-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #34d399); border-radius: 3px; }
.fn-sub { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dim); }

/* Markaz: tarmoq xaritasi */
.cmd-center { position: relative; overflow: hidden; background: radial-gradient(ellipse at center, #0f1a2b 0%, #0b0f17 70%); }
.cmd-title { position: absolute; top: 14px; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 2; }
.cmd-title b { font-size: 19px; letter-spacing: .04em; }
.cmd-title b span { color: var(--accent); font-weight: 600; }
.cmd-title div { font-size: 10.5px; letter-spacing: .18em; color: var(--dim); margin-top: 3px; text-transform: uppercase; }
.cmd-center canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cmd-ticker { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; border-top: 1px solid var(--line); background: rgba(11,15,23,.85);
  font: 11.5px "JetBrains Mono", monospace; color: var(--muted); padding: 7px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-ticker b { color: var(--accent); font-weight: 500; }
.cmd-legend { position: absolute; top: 56px; left: 12px; z-index: 2; font-size: 11px; color: var(--dim); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.cmd-legend span { display: flex; align-items: center; gap: 6px; }
.cmd-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: rgba(18,24,38,.96); border: 1px solid var(--line2); border-radius: 8px;
  padding: 7px 10px; font-size: 12px; max-width: 260px; display: none; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.tip b { display: block; margin-bottom: 2px; }
.tip span { color: var(--muted); font-size: 11.5px; }

/* Jamoa */
.team-sum { display: flex; gap: 14px; font-size: 12px; color: var(--muted); padding: 0 12px 8px; }
.team-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.team-sum .run b { color: var(--run); }
.team { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.pod { aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--line2); display: grid; place-items: center; font-size: 15px; position: relative; background: var(--panel2); }
.pod.idle { border-color: rgba(52,211,153,.55); }
.pod.running { border-color: var(--run); box-shadow: 0 0 0 3px rgba(96,165,250,.18), 0 0 14px rgba(96,165,250,.5); animation: podpulse 1.2s ease-in-out infinite; }
.pod.error { border-color: var(--err); box-shadow: 0 0 12px rgba(248,113,113,.5); }
.pod.paused { border-color: var(--warn); opacity: .6; }
.pod.planned { opacity: .35; border-style: dashed; }
@keyframes podpulse { 50% { box-shadow: 0 0 0 5px rgba(96,165,250,.08), 0 0 20px rgba(96,165,250,.7); } }

/* Ogohlantirishlar */
.av-big { display: flex; align-items: baseline; gap: 8px; padding: 0 12px 6px; }
.av-big b { font-size: 26px; color: var(--accent); font-variant-numeric: tabular-nums; }
.av-big span { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.av-row { display: grid; grid-template-columns: 40px 1fr; gap: 8px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid rgba(36,48,73,.5); }
.av-row:last-child { border: 0; }
.av-row i { font-style: normal; font-family: "JetBrains Mono", monospace; color: var(--dim); font-size: 11px; }
.av-row.err span { color: #fca5a5; } .av-row.warn span { color: #fde68a; }

/* Skills deck */
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sk { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sk-c { font: 600 12px "JetBrains Mono", monospace; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-m { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-run { align-self: flex-start; margin-top: 3px; background: rgba(34,211,238,.12); border: 1px solid rgba(34,211,238,.4); color: var(--accent);
  border-radius: 6px; padding: 2px 9px; font-size: 11px; font-weight: 600; }
.sk-run:hover { background: rgba(34,211,238,.22); }
.sk-run:disabled { opacity: .4; cursor: not-allowed; }

/* Rutinalar */
.rt { width: 100%; border: 0; background: none; font-size: 12px; }
.rt td { border: 0; padding: 5px 4px; border-bottom: 1px solid rgba(36,48,73,.5); }
.rt td:first-child { font-family: "JetBrains Mono", monospace; color: var(--dim); white-space: nowrap; font-size: 11px; }
.rt td:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.st-chip { font-size: 10px; padding: 1px 6px; border-radius: 5px; font-weight: 700; white-space: nowrap; }
.st-chip.waiting { color: var(--muted); background: rgba(138,150,173,.12); }
.st-chip.queued { color: var(--warn); background: rgba(251,191,36,.12); }
.st-chip.running { color: var(--run); background: rgba(96,165,250,.14); }
.st-chip.done { color: var(--ok); background: rgba(52,211,153,.12); }
.st-chip.failed { color: var(--err); background: rgba(248,113,113,.12); }
.st-chip.paused { color: var(--warn); background: rgba(251,191,36,.08); }
.st-chip.next { color: #0b0f17; background: var(--accent); }

.empty-sm { color: var(--dim); font-size: 12px; padding: 10px 0; text-align: center; }

/* ───── Ikkinchi miya ───── */
.b2 { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 12px; height: calc(100vh - 92px); min-height: 600px; }
.b2-canvas { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.b2-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.b2-head { position: absolute; top: 12px; left: 14px; z-index: 2; pointer-events: none; }
.b2-head b { font-size: 16px; } .b2-head b span { color: var(--accent); font-weight: 600; }
.b2-head div { font-size: 11px; color: var(--dim); margin-top: 2px; }
.b2-side { overflow: auto; }
.b2-side input[type=search] { width: 100%; background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; color: var(--text); font: inherit; font-size: 13px; }
.b2-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 12px 0 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 5px; }
.seg button { background: var(--panel2); border: 1px solid var(--line2); border-radius: 7px; padding: 4px 10px; font-size: 12px; color: var(--muted); }
.seg button.on { background: rgba(34,211,238,.14); border-color: var(--accent); color: var(--text); }
.rng { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.rng input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.themes { display: flex; flex-direction: column; gap: 6px; }
.theme { border: 1px solid var(--line2); border-radius: 9px; padding: 7px 9px; background: var(--panel2); text-align: left; font-size: 12.5px; }
.theme.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme .sw { display: flex; gap: 3px; margin-bottom: 4px; }
.theme .sw i { width: 14px; height: 10px; border-radius: 3px; }
.b2-stats { font-size: 12px; color: var(--muted); line-height: 1.7; }
.b2-stats b { color: var(--text); }

@media (max-width: 1200px) {
  .cmd { grid-template-columns: 260px minmax(0, 1fr) 290px; }
  .team { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1000px) {
  .cmd, .b2 { grid-template-columns: 1fr; height: auto; }
  .cmd-center { height: 460px; }
  .b2-canvas { height: 480px; }
  .cmd-col .pnl { max-height: 420px; }
}

/* Tor ekranda tab nomlari bir qatorda qolsin */
nav.tabs button, .present-btn { white-space: nowrap; }
@media (max-width: 1400px) { .present-btn { font-size: 0; padding: 6px 9px; } .present-btn::before { content: "🎥"; font-size: 13px; } }
nav.tabs { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
nav.tabs::-webkit-scrollbar { height: 4px; }
nav.tabs::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }

/* ───── Ofis (piksel-art xonalar) ───── */
body[data-view="office"] .kpis, body[data-view="office"] .side { display: none; }
body[data-view="office"] .page { grid-template-columns: 1fr; padding-top: 12px; }
.o-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.o-head > b { font: 700 17px "JetBrains Mono", monospace; letter-spacing: .04em; }
.o-head > b span { color: var(--accent); }
.o-head > span { color: var(--dim); font-size: 12.5px; }
.o-legend { margin-left: auto; display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.o-legend span { display: inline-flex; align-items: center; gap: 5px; }
.o-legend i, .o-st i { width: 8px; height: 8px; display: inline-block; border-radius: 2px; background: var(--ok); }
.o-legend i.run, .o-st i.run { background: var(--run); box-shadow: 0 0 6px var(--run); }
.o-legend i.err, .o-st i.err { background: var(--err); }
.o-legend i.pause { background: var(--warn); }
.o-legend i.plan { background: transparent; border: 1px dashed var(--dim); }
.o-wrap { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0b0f17; }
.o-wrap canvas { display: block; width: 100%; image-rendering: pixelated; }
.o-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.o-dept { background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--c); border-radius: 10px; padding: 8px 10px; text-align: left;
  display: grid; grid-template-columns: auto auto 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; min-width: 0; }
.o-dept:hover { border-color: var(--c); }
.o-num { font: 600 10.5px "JetBrains Mono", monospace; color: var(--dim); }
.o-ic { font-size: 14px; }
.o-nm { font: 700 12px "JetBrains Mono", monospace; text-transform: uppercase; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-st { grid-column: 1 / -1; font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1000px) { .o-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .o-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ───── Xona ichi (anime) ───── */
#v-office.in-room .o-wrap, #v-office.in-room .o-strip { display: none; }
.room-view { border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 14px; padding: 16px;
  background: radial-gradient(ellipse at top, color-mix(in srgb, var(--c) 22%, #0b0f17) 0%, #0b0f17 70%); background-size: cover; background-position: center; min-height: 70vh; }
.rm-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.rm-title { display: flex; align-items: center; gap: 10px; }
.rm-title > span { font-size: 28px; }
.rm-title b { font-size: 20px; display: block; }
.rm-title small { color: var(--muted); font-size: 12.5px; }
.rm-kpi { margin-left: auto; display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.rm-kpi b { color: var(--text); }
.rm-kpi .e b { color: var(--err); }
.rm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.rm-card { background: rgba(18,24,38,.86); backdrop-filter: blur(6px); border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; transition: transform .2s, box-shadow .3s; }
.rm-card:hover { transform: translateY(-3px); }
.rm-frame { position: relative; aspect-ratio: 1 / 1; overflow: hidden; }
.rm-pic { position: absolute; inset: 0; background-repeat: no-repeat; transition: filter .4s, transform .4s; }
.rm-fallback { display: grid; place-content: center; text-align: center; background: radial-gradient(circle, color-mix(in srgb, var(--c) 35%, #0b0f17), #0b0f17); }
.rm-fallback span { font-size: 64px; }
.rm-fallback small { color: var(--dim); font-size: 11px; margin-top: 6px; }
.rm-status { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  background: rgba(11,15,23,.82); border: 1px solid var(--line2); border-radius: 99px; padding: 3px 9px; }
.rm-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.rm-card.running .rm-status i { background: var(--run); box-shadow: 0 0 8px var(--run); }
.rm-card.error .rm-status i { background: var(--err); }
.rm-card.paused .rm-status i { background: var(--warn); }
.rm-card.planned .rm-status i { background: var(--dim); }
/* holatlar */
.rm-card.running { border-color: color-mix(in srgb, var(--c) 70%, transparent); box-shadow: 0 0 0 1px var(--c), 0 0 26px -6px var(--c); }
.rm-card.running .rm-pic { animation: rm-breathe 2.4s ease-in-out infinite; }
@keyframes rm-breathe { 50% { transform: scale(1.025); } }
.rm-card.error { border-color: var(--err); }
.rm-card.error .rm-pic { filter: saturate(.7) sepia(.25) hue-rotate(-25deg) brightness(.9); animation: rm-shake .5s ease-in-out infinite alternate; }
@keyframes rm-shake { from { transform: translateX(-1px); } to { transform: translateX(1px); } }
.rm-card.paused .rm-pic { filter: grayscale(.85) brightness(.7); }
.rm-card.planned .rm-pic { filter: grayscale(1) brightness(.4); }
.rm-card.planned { opacity: .7; }
.rm-card.pop { animation: rm-pop .6s ease; }
@keyframes rm-pop { 40% { box-shadow: 0 0 0 3px var(--ok), 0 0 30px var(--ok); } }
.rm-typing { position: absolute; bottom: 10px; right: 10px; display: flex; gap: 4px; background: rgba(11,15,23,.8); padding: 6px 9px; border-radius: 99px; }
.rm-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--c); animation: rm-dot 1s infinite; }
.rm-typing span:nth-child(2) { animation-delay: .15s; } .rm-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes rm-dot { 50% { opacity: .2; transform: translateY(-3px); } }
.rm-zz { position: absolute; top: 12px; right: 14px; font: 800 22px "JetBrains Mono", monospace; color: var(--warn); animation: rm-dot 2s infinite; }
.rm-alert { position: absolute; top: 8px; right: 12px; font: 900 30px Inter, sans-serif; color: var(--err); text-shadow: 0 0 12px var(--err); }
.rm-bubble { position: absolute; left: 10px; right: 10px; bottom: 44px; background: rgba(248,250,252,.96); color: #0f172a; font-size: 12.5px; line-height: 1.35;
  padding: 7px 10px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.35); animation: in .3s ease; }
.rm-bubble::after { content: ""; position: absolute; bottom: -6px; left: 22px; border: 6px solid transparent; border-top-color: rgba(248,250,252,.96); border-bottom: 0; }
.rm-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 5px; }
.rm-name { font-weight: 700; font-size: 15px; }
.rm-role { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.rm-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.rm-meta span { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line2); color: var(--muted); }
.rm-stats { font-size: 12px; color: var(--dim); }
.rm-stats b { color: var(--text); } .rm-stats b.e { color: var(--err); }
.rm-last { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid var(--c); padding-left: 7px; }
.rm-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.rm-actions .btn { padding: 5px 10px; font-size: 12px; }
