/* The panel's components.
 *
 * Ordered the way the page is: bar, hesap, tiles, durum, tables.
 */

/* ---------- topbar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 13, 18, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 52px; min-width: 0;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; overflow: hidden; }
.brand-mark {
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--up); box-shadow: 0 0 12px var(--up-soft);
}
.brand-name { font-weight: 650; letter-spacing: -.01em; }

.chip {
  padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-dim); font-size: 11.5px; white-space: nowrap;
}
.chip.live-mode { color: var(--down); border-color: var(--down); }

.live { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.live-text { color: var(--text-dim); font-size: 12px; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-mute); transition: background .2s;
}
.dot.on   { background: var(--up);   box-shadow: 0 0 0 3px var(--up-soft); }
.dot.off  { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }

/* ---------- card ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--pad);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.card-head h2 { font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }
.card-note { color: var(--text-mute); font-size: 11.5px; }
.lead { color: var(--text-dim); font-size: 12.5px; margin-bottom: 12px; max-width: 78ch; }

/* ---------- hesap ---------- */

.equity { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 26px; }
.figure {
  font-size: 38px; font-weight: 620; letter-spacing: -.03em;
  line-height: 1.15; margin-top: 4px; font-family: var(--mono);
}
.figure .unit {
  font-size: 17px; font-weight: 500; color: var(--text-mute);
  letter-spacing: 0; margin-left: 7px;
}
.figure-sub { margin-top: 2px; font-size: 13px; }
.delta { font-weight: 600; }

.microstats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; margin-top: 16px;
  border-top: 1px solid var(--line-soft); padding-top: 12px;
}
.microstats dt { color: var(--text-mute); font-size: 11px; }
.microstats dd { font-size: 13px; margin-top: 2px; font-family: var(--mono); }

.equity-chart { display: flex; flex-direction: column; }
.chart-head .muted { display: block; font-size: 11.5px; margin-top: 3px; }
.spark { display: block; width: 100%; flex: 1; min-height: 92px; margin-top: 10px; }

/* ---------- tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.tile {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 13px 15px;
}
.tile-v { display: block; font-size: 21px; font-weight: 600; margin-top: 5px; font-family: var(--mono); }
.tile-n { display: block; color: var(--text-mute); font-size: 11px; margin-top: 1px; }

/* ---------- durum ---------- */

.status { border-left: 3px solid var(--info); }
.status[data-level="warn"]    { border-left-color: var(--warn); }
.status[data-level="alarm"]   { border-left-color: var(--down); }
.status[data-level="trading"] { border-left-color: var(--up); }
.status[data-level="down"]    { border-left-color: var(--down); }

.status-head { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.status-badge {
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  background: var(--info-soft); color: var(--info);
}
.status[data-level="warn"]    .status-badge { background: var(--warn-soft); color: var(--warn); }
.status[data-level="alarm"]   .status-badge,
.status[data-level="down"]    .status-badge { background: var(--down-soft); color: var(--down); }
.status[data-level="trading"] .status-badge { background: var(--up-soft);   color: var(--up); }
.status-line { font-size: 13.5px; color: var(--text); }

/* Sessizliği ölçülen dağılıma karşı gösterir: sayı tek başına anlam taşımıyor. */
.meter { margin-top: 14px; }
.meter-track {
  position: relative; height: 6px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
}
.meter-fill { height: 100%; border-radius: 999px; background: var(--info); transition: width .4s ease; }
.status[data-level="warn"]  .meter-fill { background: var(--warn); }
.status[data-level="alarm"] .meter-fill { background: var(--down); }

.meter-marks { position: relative; height: 26px; margin-top: 5px; }
.meter-mark {
  position: absolute; top: 0; transform: translateX(-50%);
  color: var(--text-mute); font-size: 10px; white-space: nowrap; text-align: center;
}
.meter-mark::before {
  content: ""; display: block; width: 1px; height: 5px;
  background: var(--line); margin: -9px auto 3px;
}

/* ---------- tables ---------- */

.grid th {
  text-align: left; font-weight: 600; font-size: 10.5px;
  letter-spacing: .07em; text-transform: uppercase; color: var(--text-mute);
  padding: 0 20px 8px 0; border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.grid td {
  padding: 10px 20px 10px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 13px; white-space: nowrap;
}
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: var(--surface-2); }
.grid .r { text-align: right; }
.grid th:last-child, .grid td:last-child { padding-right: 0; }
.grid .num { font-family: var(--mono); }
.grid .dim { color: var(--text-mute); }
.grid .strong { font-weight: 600; }

.grid.is-empty thead { display: none; }
.empty {
  color: var(--text-mute); font-size: 12.5px; text-align: center;
  padding: 26px 0 !important; white-space: normal !important;
}

.side {
  display: inline-block; min-width: 46px; text-align: center;
  padding: 1px 7px; border-radius: var(--r-sm);
  font-size: 10.5px; font-weight: 650; letter-spacing: .05em;
}
.side.long  { color: var(--up);   background: var(--up-soft); }
.side.short { color: var(--down); background: var(--down-soft); }

/* Kalan ufuk ve kapı değerleri: sayı + onu okunur kılan çubuk. */
.bar { display: flex; align-items: center; gap: 9px; }
.bar-track {
  position: relative; width: 88px; height: 5px; border-radius: 999px;
  background: #1c222d; flex: none; overflow: visible;
}
/* display:block matters: the fill is a span inside a span, so without it the
 * width is ignored and every bar renders as an identical empty track. The
 * track itself escaped that only because it is a flex item and gets blockified. */
.bar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--text-dim); transition: width .3s ease;
}
.bar-fill.ok { background: var(--up); }
.bar-gate {
  position: absolute; top: -4px; width: 2px; height: 13px; border-radius: 1px;
  background: var(--text-dim); opacity: .85;
}
.bar-v { font-family: var(--mono); font-size: 12.5px; }

.gates td { padding-block: 9px; }
.tag-ok    { color: var(--up); font-size: 12px; }
.tag-block { color: var(--text-mute); font-size: 12px; }

/* ---------- kayıt ---------- */

.record { padding-block: 0; }
.record summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-block: 15px; cursor: pointer; font-size: 13.5px; font-weight: 650;
  list-style: none;
}
.record summary::-webkit-details-marker { display: none; }
.record summary::after {
  content: "göster"; color: var(--text-mute); font-size: 11.5px; font-weight: 400;
}
.record[open] summary::after { content: "gizle"; }
.record[open] summary { border-bottom: 1px solid var(--line-soft); margin-bottom: 12px; }
.record .foot { padding-block: 12px 16px; }

/* ---------- narrow ---------- */

@media (max-width: 900px) {
  .equity { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .tiles  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .figure { font-size: 30px; }
  .microstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* The strategy name and the freshness line are the two things a phone has no
   * room for. The dot and the running clock already say the same thing: a live
   * connection and a page that is still ticking. */
  .chip.hide-sm, #link, .live .sep { display: none; }
}
