/* Card / panel / metric / bar / table styles.
   Anything reusable across pages lives here. */

.panel, .metric {
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: .07em;
  color: var(--muted);
}

.metric label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.metric b {
  display: block;
  font-size: 31px;
  margin: 7px 0;
}
.metric small { color: var(--muted); }

/* Horizontal progress bar (RAM, disk, flash progress). */
.bar, .flash-progress {
  height: 23px;
  border: 1px solid var(--line);
  background: #05263a;
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0;
}
.bar i, .flash-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #168952, var(--ok));
  transition: width .5s;
}

/* Per-core CPU visualisation (vertical mini-bars, 16 of them). */
.metric-cpu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.metric-cpu .metric-source {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .06em;
  margin-left: 6px;
}
.cpu-cores {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 4px;
  margin: 4px 0 2px;
  min-height: 74px;
}
.cpu-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cpu-core-lbl { font-size: 9px; color: var(--muted); letter-spacing: .02em; }
.cpu-core-bar {
  position: relative;
  width: 100%;
  height: 54px;
  background: #05263a;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.cpu-core-bar i {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #168952, var(--ok));
  transition: height .5s;
}
.cpu-core-bar i.warm { background: linear-gradient(180deg, #c88a1e, var(--warn)); }
.cpu-core-bar i.hot  { background: linear-gradient(180deg, #c02b3a, var(--bad));  }
.cpu-core-val {
  font-size: 9px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.metric-mem {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.metric-mem .mem-row       { display: flex; flex-direction: column; gap: 2px; }
.metric-mem .mem-row label { font-size: 11px; }
.metric-mem .mem-row b     { font-size: 22px; margin: 2px 0; }
.metric-mem .bar           { height: 16px; margin: 4px 0; }

@media (max-width: 1250px) {
  .cpu-cores { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .cpu-cores { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Tables. */
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  vertical-align: top;
}
th { color: var(--muted); font-size: 10px; letter-spacing: .05em; }

/* Client cards ribbon. */
.clients-ribbon { padding: 11px 13px; position: relative; z-index: 5; }
.ribbon-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ribbon-title strong { font-size: 15px; }
.client-cards {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-top: 10px;
}
.client-card {
  min-width: 230px;
  max-width: 280px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  cursor: pointer;
}
.client-card.selected {
  border-color: var(--efm);
  box-shadow: 0 0 0 2px rgba(0, 139, 210, .18);
}
.client-card .client-head { display: flex; justify-content: space-between; gap: 8px; }
.client-card strong       { font-size: 13px; }
.client-card small        { display: block; color: var(--muted); margin-top: 3px; }
.client-card .mini-row    { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.mini-pill                { font-size: 9px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px; }
.this-browser             { background: var(--efm); border-color: var(--efm); color: #fff; }

/* Stack list (used in Direct Agent Status). */
.stack-list { display: grid; gap: 8px; }
.stack-item, .facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
  font-size: 12px;
}
.stack-item span, .facts span { color: var(--muted); }

/* Wide button (used in Monitor / Bridge). */
.wide { width: 100%; margin-top: 12px; }

/* ========================================================================
 * EFM Download-Button (Recent Builds Tabelle + Downloads-Seite)
 * ======================================================================== */

/* Alle Links in der Recent-Builds "Aktion"-Spalte und der Downloads-Seite */
.builds-recent td a[href*="/download"],
.builds-recent td a[href*="artifact"],
.builds-recent td a[download],
#downloadsList a.download-link,
#downloadsList a[download],
a.efm-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--efm, #008BD2) 0%, #0075B0 100%);
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

/* Kleines Download-Icon (⬇) via ::before */
.builds-recent td a[href*="/download"]::before,
.builds-recent td a[href*="artifact"]::before,
.builds-recent td a[download]::before,
#downloadsList a.download-link::before,
#downloadsList a[download]::before,
a.efm-download-btn::before {
    content: "⬇";
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.9;
}

/* Hover: heller Verlauf + leichter Lift */
.builds-recent td a[href*="/download"]:hover,
.builds-recent td a[href*="artifact"]:hover,
.builds-recent td a[download]:hover,
#downloadsList a.download-link:hover,
#downloadsList a[download]:hover,
a.efm-download-btn:hover {
    background: linear-gradient(180deg, #00A0EE 0%, #008BD2 100%);
    box-shadow: 0 2px 6px rgba(0, 139, 210, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    color: #ffffff !important;
    text-decoration: none;
}

/* Aktiv/Pressed */
.builds-recent td a[href*="/download"]:active,
.builds-recent td a[href*="artifact"]:active,
.builds-recent td a[download]:active,
#downloadsList a.download-link:active,
#downloadsList a[download]:active,
a.efm-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Flash-Log Header (Kopier-Button + Titel) */
.flash-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.flash-log-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim, #9aa4ae);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* EFM MONITOR V3.3.19 APPROVED COMPACT DASHBOARD */
.monitor-v319 { font-size: 0.94em; }
.monitor-v319 .panel,
.monitor-v319 .metric { padding: 12px; border-radius: 9px; }
.monitor-v319 .clients-ribbon { padding: 9px 11px; }
.monitor-v319 .client-cards { padding-top: 7px; gap: 7px; }
.monitor-v319 .client-card { min-width: 210px; padding: 8px; }
.monitor-v319 .page-head { margin: 12px 0 9px; }
.monitor-v319 .page-head h1 { font-size: 24px; }
.monitor-v319 .page-head p { margin-top: 3px; }
.monitor-head-actions { display:flex; align-items:center; gap:10px; }
.monitor-head-actions small { color:var(--muted); white-space:nowrap; }

.monitor-dashboard-grid {
  display:grid;
  grid-template-columns:minmax(0,2.05fr) minmax(340px,.95fr);
  gap:10px;
  align-items:stretch;
}
.monitor-cpu-panel { min-height: 0; }
.monitor-v319 .cpu-cores { gap:3px; min-height:68px; margin:2px 0; }
.monitor-v319 .cpu-core-bar { height:48px; }
.monitor-v319 .cpu-core-lbl,
.monitor-v319 .cpu-core-val { font-size:8px; }
.monitor-v319 .metric-cpu > b { font-size:29px; margin:4px 0; }
.monitor-total-cpu { height:7px !important; margin:5px 0 2px !important; border-radius:999px !important; }

.server-info-card { display:flex; flex-direction:column; gap:8px; }
.server-info-card h2 { color:var(--text); font-size:16px; letter-spacing:0; margin:0; padding-bottom:8px; border-bottom:1px solid var(--line); }
.server-info-topline { display:flex; justify-content:space-between; gap:12px; color:var(--muted); padding:1px 0 4px; font-size:11px; }
.server-info-topline b { color:var(--text); font-weight:650; }
.server-resource { padding-top:5px; }
.server-resource + .server-resource { border-top:1px solid rgba(36,65,84,.65); }
.server-resource-head { display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.server-resource-head span { font-weight:800; font-size:12px; }
.server-resource-head b { color:var(--ok); font-size:18px; }
.server-resource small { display:block; color:var(--muted); margin-top:1px; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.server-resource .bar { height:9px; margin:5px 0 1px; border-radius:999px; }

.load-average-block { border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:8px 0; }
.load-label { display:block; font-weight:800; font-size:12px; margin-bottom:5px; }
.load-values { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; color:var(--muted); }
.load-values span { display:flex; justify-content:space-between; gap:6px; }
.load-values b { color:var(--ok); font-size:16px; }

.server-facts-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; border-top:1px solid rgba(36,65,84,.5); }
.server-facts-grid > div { min-width:0; padding:7px 7px 5px 0; border-bottom:1px solid rgba(36,65,84,.55); }
.server-facts-grid > div:not(:nth-child(3n+1)) { padding-left:9px; border-left:1px solid rgba(36,65,84,.45); }
.server-facts-grid span { display:block; color:var(--muted); font-size:9px; margin-bottom:2px; }
.server-facts-grid b { display:block; color:var(--text); font-size:10px; font-weight:650; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.monitor-v319 .monitor-lower { grid-template-columns:.52fr 1.48fr; gap:10px; margin-top:10px; }
.monitor-v319 .panel h2 { margin-bottom:8px; }
.monitor-v319 .stack-list { gap:5px; }
.monitor-v319 .stack-item { padding:4px 0; font-size:11px; }
.monitor-v319 .wide { margin-top:8px; padding-top:8px; padding-bottom:8px; }
.monitor-v319 table th,
.monitor-v319 table td { padding:6px 7px; font-size:10px; }
.monitor-v319 table th { font-size:9px; }
.monitor-v319 table button { padding:6px 9px; border-radius:6px; }

.monitor-build-strip {
  margin-top:10px;
  min-height:38px;
  border:1px solid var(--line);
  border-radius:8px;
  background:linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0)), var(--panel);
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:9px;
  padding:8px 11px;
  color:var(--muted);
  font-size:10px;
}
.monitor-build-strip span { white-space:nowrap; }
.monitor-build-strip b { color:var(--text); font-weight:650; }
.monitor-build-strip > i { width:1px; height:15px; background:var(--line); display:block; }

@media (max-width:1250px) {
  .monitor-dashboard-grid { grid-template-columns:1fr; }
  .server-info-card { min-width:0; }
}
@media (max-width:850px) {
  .server-info-topline { flex-direction:column; gap:4px; }
  .server-facts-grid { grid-template-columns:1fr 1fr; }
  .server-facts-grid > div { border-left:0 !important; padding-left:0 !important; }
  .monitor-build-strip > i { display:none; }
}

