/* =========================================================================
 * estatemonitor.css — dashboard styling on top of the shared TSGB site.css.
 * The estate brand (navy #012169 / red #C8102E) with a compact, instrument-
 * panel feel for the server-vitals board. Everything here is namespaced `em-`
 * (plus the shared `chart-tab`) so it never collides with the estate design
 * system it sits on.
 * ========================================================================= */

.em-live-note { font-size: 0.72rem; color: #64748b; }
.em-mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---- Stat tiles (compact KPI row) --------------------------------------- */
.em-stat-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px)  { .em-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .em-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.em-stat {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 0.6rem; padding: 0.9rem 1rem;
  box-shadow: 0 8px 20px -8px rgba(1, 33, 105, 0.18), inset 0 1px 0 rgba(255,255,255,0.7);
  border-left: 4px solid #012169;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .em-stat { background: #fff; } }
.em-stat.warn { border-left-color: #f59e0b; }
.em-stat.crit { border-left-color: #C8102E; }
.em-stat-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #64748b; }
.em-stat-value { font-size: 1.55rem; font-weight: 800; color: #012169; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 0.15rem; }
.em-stat-unit { font-size: 0.72rem; color: #94a3b8; font-weight: 600; margin-left: 0.15rem; }
.em-stat-sub { font-size: 0.68rem; color: #94a3b8; margin-top: 0.2rem; }

/* ---- Usage meter (thin bar under a stat) -------------------------------- */
.em-meter { height: 6px; border-radius: 999px; background: rgba(1,33,105,0.10); overflow: hidden; margin-top: 0.55rem; }
.em-meter-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #012169, #3b5ba9); transition: width 0.5s ease; }
.em-meter-fill.warn { background: linear-gradient(90deg, #d97706, #f59e0b); }
.em-meter-fill.crit { background: linear-gradient(90deg, #9b0d23, #C8102E); }

/* ---- Per-core heat strip ------------------------------------------------ */
.em-core-strip { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 0.5rem; }
.em-core-cell {
  width: 15px; height: 15px; border-radius: 3px; background: #e5e7eb;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.em-core-cell[title] { cursor: default; }

/* ---- Chart window tabs (shared with History/Network/etc.) --------------- */
.chart-tab {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em;
  color: #475569; background: rgba(1,33,105,0.05);
  border: 1px solid transparent; border-radius: 999px;
  padding: 0.28rem 0.7rem; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.chart-tab:hover { background: rgba(1,33,105,0.10); color: #012169; }
.chart-tab.active { background: #012169; color: #fff; box-shadow: inset 0 -2px 0 #C8102E; }

/* ---- Data table (containers) -------------------------------------------- */
.em-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.em-table th {
  text-align: left; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #64748b; padding: 0.55rem 0.7rem; border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
.em-table th.num, .em-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.em-table td { padding: 0.55rem 0.7rem; border-bottom: 1px solid #f1f5f9; color: #1f2937; }
.em-table tbody tr:hover { background: #f8fafc; }
.em-table .name { font-weight: 600; color: #012169; }
.em-barcell { position: relative; min-width: 90px; }
.em-barcell .bar { position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 60%; border-radius: 3px; background: rgba(1,33,105,0.12); z-index: 0; }
.em-barcell .val { position: relative; z-index: 1; }

/* ---- Service board ------------------------------------------------------ */
.em-service-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px)  { .em-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .em-service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.em-service {
  background: #fff; border: 1px solid #e6e8ef; border-radius: 0.7rem; padding: 1rem 1.1rem;
  box-shadow: 0 8px 20px -12px rgba(1,33,105,0.18); border-top: 3px solid #16a34a;
}
.em-service.down { border-top-color: #C8102E; }
.em-service.unknown { border-top-color: #94a3b8; }
.em-service-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.em-service-name { font-weight: 700; color: #012169; }
.em-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; display: inline-block; flex: none; }
.em-dot.up { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
.em-dot.down { background: #C8102E; box-shadow: 0 0 0 3px rgba(200,16,46,0.15); }
.em-dot.unknown { background: #94a3b8; }
.em-service-meta { font-size: 0.72rem; color: #64748b; margin-top: 0.5rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.em-service-meta b { color: #1f2937; font-variant-numeric: tabular-nums; }
.em-service-url { font-size: 0.68rem; color: #94a3b8; overflow-wrap: anywhere; margin-top: 0.25rem; }

/* ---- Freshness pill ----------------------------------------------------- */
.em-fresh { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: #64748b; }
.em-banner { background: #fef3c7; border: 1px solid #fde68a; color: #92400e; border-radius: 0.6rem; padding: 0.7rem 1rem; font-size: 0.85rem; }
