/*
 * panel.css — only what the admin's own stylesheet does not already give us.
 *
 * The panel wears /admin/styles.css for its shell, buttons, cards and login.
 * What is here is the handful of pieces that are the panel's own: the fleet
 * statistics, the tables it draws, and the marks that say motari rather than
 * admin. Anything that could be answered by the shared stylesheet is not
 * repeated here.
 */

/* The one visual difference from the main admin: orange, because this is the
   motari side of the platform and it should be obvious at a glance which
   building you are standing in. */
.sb-mark-motari {
  background: #f97316;
  color: #000;
}

.panel-where {
  font-size: 14px;
  font-weight: 700;
  color: #e8e8e8;
  letter-spacing: -0.01em;
}

.panel-who {
  font-size: 11.5px;
  color: #8a8a8a;
  margin-right: 10px;
}

/* ── the fleet at a glance ─────────────────────────────────────────────── */

.panel-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.panel-stat {
  background: #0f0f0f;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  padding: 14px 15px;
}

.panel-stat-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a7a7a;
}

.panel-stat-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 6px;
}

.panel-stat-hint {
  font-size: 11px;
  color: #6a6a6a;
  margin-top: 3px;
}

/* ── filters ───────────────────────────────────────────────────────────── */

.panel-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 14px 0 12px;
}

.panel-chip {
  background: #0f0f0f;
  border: 1px solid #1f1f1f;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 11.5px;
  font-weight: 600;
  color: #9a9a9a;
  cursor: pointer;
  font-family: inherit;
}

.panel-chip:hover { border-color: #333; color: #ddd; }

.panel-chip.on {
  background: #f97316;
  border-color: #f97316;
  color: #000;
  font-weight: 800;
}

.panel-search { display: flex; gap: 6px; }

.panel-search input {
  background: #0f0f0f;
  border: 1px solid #1f1f1f;
  border-radius: 9px;
  padding: 7px 12px;
  color: #e8e8e8;
  font-size: 12.5px;
  font-family: inherit;
  min-width: 220px;
}

.panel-search input:focus { outline: none; border-color: #f97316; }

/* ── tables ────────────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  background: #0f0f0f;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  text-align: left;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #6a6a6a;
  padding: 11px 14px;
  border-bottom: 1px solid #1a1a1a;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #151515;
  font-size: 12.5px;
  color: #ccc;
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #131313; }

.panel-name { color: #e8e8e8; font-weight: 700; }
.panel-sub { color: #6f6f6f; font-size: 11px; margin-top: 2px; }
.panel-num { color: #e8e8e8; font-weight: 700; font-variant-numeric: tabular-nums; }

/* The plate is the thing people check, so it reads like a plate. */
.panel-plate {
  display: inline-block;
  background: #fff;
  color: #000;
  border-radius: 5px;
  padding: 2px 8px;
  font-weight: 900;
  font-size: 11.5px;
  letter-spacing: 0.07em;
}

.panel-plate-sm { font-size: 10px; padding: 1px 6px; margin-top: 3px; }

.panel-pill {
  display: inline-block;
  border: 1px solid var(--pill);
  color: var(--pill);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  margin-right: 4px;
  white-space: nowrap;
}

.panel-quote {
  color: #bbb;
  font-size: 11.5px;
  font-style: italic;
  max-width: 260px;
  line-height: 1.45;
}

.panel-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── the empty and the barred ──────────────────────────────────────────── */

.panel-empty {
  background: #0f0f0f;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  color: #6f6f6f;
  font-size: 12.5px;
}

.panel-empty-lock {
  border-color: #2a1f14;
  color: #9a8a76;
  line-height: 1.6;
}

.panel-note {
  color: #6f6f6f;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 12px;
  max-width: 62ch;
}

/* ── the menu, on a phone ──────────────────────────────────────────────── */

.sb-foot {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-foot-link {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  color: #7a7a7a;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.sb-foot-link:hover { color: #ddd; }
.sb-foot-out { color: #b05a5a; }
.sb-foot-out:hover { color: #ef4444; }

.sb-badge {
  margin-left: auto;
  background: #1f1f1f;
  color: #bbb;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
}

.sb-badge-alert { background: #ef4444; color: #fff; }

@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  #app.nav-open #sidebar { transform: none; }
  #app.nav-open #sidebar-backdrop { display: block; }
}

/*
 * The card for an admin who is signed in but was never given this panel.
 *
 * It borrows the login card's look from the shared stylesheet but not its
 * screen, because there is no login here to wrap: the sign-in lives in the
 * admin and this is only ever the end of a wrong turn.
 */
#no-entry {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-mark-motari { background: #f97316; color: #000; }

/* ── live ──────────────────────────────────────────────────────────────── */

/*
 * The pill that says the page is watching. It is a button because the reader
 * has to be able to stop it: someone reading a long table does not want it
 * rebuilt under them, and someone on a phone bundle does not want it fetched
 * every six seconds.
 */
.live-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0f0f0f;
  border: 1px solid #1f2f22;
  border-radius: 999px;
  padding: 5px 11px;
  margin-right: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4ade80;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: live-blink 2s ease-in-out infinite;
}

.live-pill.paused { border-color: #2a2a2a; color: #7a7a7a; }
.live-pill.paused .live-dot { background: #5a5a5a; animation: none; }

@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Someone who would rather nothing moved gets their wish. */
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* ── the bands that break a page into what it is about ─────────────────── */

.panel-band {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6a6a6a;
  margin: 18px 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-band::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #1a1a1a;
}

.panel-band-live { color: #4ade80; }

/* ── the feed ──────────────────────────────────────────────────────────── */

.feed {
  background: #0f0f0f;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  overflow: hidden;
}

.feed-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #151515;
}

.feed-row:last-child { border-bottom: none; }

.feed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
  margin-top: 5px;
  flex-shrink: 0;
}

.feed-body { flex: 1; min-width: 0; }

.feed-what {
  color: #ddd;
  font-size: 12px;
  line-height: 1.4;
}

.feed-kind {
  display: inline-block;
  background: #2a1f3f;
  color: #a78bfa;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 5px;
}

.feed-who { color: #6a6a6a; font-size: 10.5px; margin-top: 2px; }

.feed-when {
  color: #5a5a5a;
  font-size: 10.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── charts, and one motari in full ────────────────────────────────────── */

.panel-chart {
  background: #0f0f0f;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  padding: 16px 14px 10px;
  overflow-x: auto;
}

.panel-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 18px;
  background: #0f0f0f;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
  font-size: 12.5px;
  color: #ccc;
}

.panel-detail .panel-sub { display: inline; margin-right: 6px; }

/* A name worth opening looks like one. */
.link-name {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #e8e8e8;
  cursor: pointer;
  text-align: left;
}

.link-name:hover { color: #f97316; text-decoration: underline; }
