/* ============================================================
   Horse E.T. — dashboard & page components
   ============================================================ */

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 16px; box-shadow: var(--sh-1); transition: border-color .2s, box-shadow .2s, transform .2s; }
.stat:hover { border-color: #d6dccd; box-shadow: var(--sh-2); transform: translateY(-2px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: var(--green-soft); color: var(--green-deep); }
.stat-ic.sky { background: var(--sky-soft); color: var(--sky); }
.stat-ic.warn { background: #f6efdc; color: var(--warn); }
.stat-trend { font-size: .74rem; font-weight: 600; color: var(--green-deep); }
.stat-n { font-family: var(--font-head); font-size: 1.9rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; color: var(--ink); }
.stat-l { color: var(--muted); font-size: .82rem; margin-top: 5px; }

/* Card grid */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.col-wide { grid-column: 1 / -1; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.panel-h h3 { font-size: 1.02rem; }
.panel-h .more { font-size: .8rem; font-weight: 600; color: var(--green-deep); }
.panel-h .more:hover { color: var(--green); }
.panel-b { padding: 6px 6px; }
.panel-pad { padding: 16px 18px; }

/* List rows */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line-soft); }
.list li:first-child { border-top: none; }
.list .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm); }
.list .row:hover { background: var(--paper); }
.list .rmain { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list .rmain .rt { font-size: .9rem; font-weight: 600; color: var(--ink); }
.list .rmain .rs { font-size: .76rem; color: var(--muted); }

/* Feed */
.feed { list-style: none; margin: 0; padding: 4px 6px; }
.feed li { display: flex; align-items: center; gap: 11px; padding: 9px 6px; font-size: .88rem; color: var(--ink-soft); }
.feed .fic { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font-size: .78rem; background: var(--surface-2); color: var(--green-deep); }

/* Quick tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--sh-1); transition: border-color .2s, transform .2s, box-shadow .2s; }
.tile:hover { border-color: #d6dccd; transform: translateY(-2px); box-shadow: var(--sh-2); }
.tile .tic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; background: var(--green-soft); color: var(--green-deep); margin-bottom: 13px; }
.tile h3 { font-size: 1.05rem; margin-bottom: 3px; }
.tile p { color: var(--muted); font-size: .85rem; }

/* Stables overview — metric pairs + map placeholder */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.metric { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
.metric-v { font-family: var(--font-head); font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.metric-v .exp { font-size: .92rem; font-weight: 500; color: var(--muted-2); }
.metric-l { font-size: .74rem; color: var(--muted); margin-top: 6px; }
.metric-l i { color: var(--green-deep); margin-right: 3px; }

.stable-map {
  border: 1px dashed #cfd6c4; border-radius: var(--r); min-height: 230px; display: grid; place-items: center;
  background:
    radial-gradient(120% 120% at 50% 0%, var(--green-soft) 0%, transparent 55%),
    repeating-linear-gradient(45deg, var(--surface) 0 14px, var(--paper) 14px 28px);
}
.sm-inner { text-align: center; }
.sm-inner > i { font-size: 1.8rem; color: var(--green-deep); opacity: .55; }
.sm-t { font-family: var(--font-head); font-weight: 600; color: var(--ink-soft); margin-top: 9px; }

@media (max-width: 980px) { .stats { grid-template-columns: repeat(2, 1fr); } .grid { grid-template-columns: 1fr; } .metrics { grid-template-columns: repeat(2, 1fr); } }

/* ── Live flight map ── */
.map-wrap { position: relative; }
#flight-map { height: 420px; width: 100%; background: #0f170f; border-radius: var(--r); z-index: 0; }
.map-wrap.tall #flight-map { height: 560px; }
.map-legend { position: absolute; left: 14px; bottom: 14px; z-index: 500; display: flex; flex-wrap: wrap; gap: 6px 14px;
  background: rgba(15,23,15,.82); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.1); border-radius: 9px; padding: 9px 12px; }
.map-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; color: #cdd6cd; font-family: var(--font-mono); letter-spacing: .02em; }
.map-legend .dot { width: 9px; height: 9px; border-radius: 50%; }
.live-chip { position: absolute; right: 14px; top: 14px; z-index: 500; display: inline-flex; align-items: center; gap: 7px;
  background: rgba(15,23,15,.82); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: 6px 12px; font-family: var(--font-mono); font-size: .72rem; color: #cdd6cd; }
.live-chip .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 0 rgba(143,178,85,.6); animation: lp 1.8s infinite; }
@keyframes lp { 0% { box-shadow: 0 0 0 0 rgba(143,178,85,.55); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.plane-c { color: var(--green-bright); filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); transition: transform .2s linear; }
.plane-c.dim { color: #7c8a7c; opacity: .8; }
.plane-c svg, .plane-l svg { display: block; fill: currentColor; }
.plane-l { color: rgba(190,205,190,.6); }

.leaflet-popup-content-wrapper { background: #141d14; color: #e7ece4; border-radius: 10px; box-shadow: var(--sh-3); }
.leaflet-popup-tip { background: #141d14; }
.fp { font-family: var(--font-body); min-width: 170px; }
.fp-ref { font-family: var(--font-mono); font-weight: 600; color: var(--green-bright); font-size: .82rem; }
.fp-rt { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; margin: 2px 0 6px; color: #fff; }
.fp-meta { font-size: .76rem; color: #aab4a8; }
.fp-status { display: inline-block; margin-top: 7px; font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
