:root {
  --bg: #111827;
  --panel: #171923;
  --panel-soft: #1f2430;
  --panel-muted: #222838;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #ec4899;
  --accent-light: #f472b6;
  --accent-soft: rgba(236, 72, 153, 0.14);
  --success: #22c55e;
  --shadow: rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(236, 72, 153, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

.icon-sprite {
  display: none;
}

.topbar,
main,
footer {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-light);
  font-size: 0.76rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.header-meta {
  display: grid;
  justify-items: end;
  gap: 10px;
  flex: 0 0 auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  box-shadow: 0 10px 24px var(--shadow);
  font-size: 0.9rem;
  font-weight: 700;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.13);
}

.last-update {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.last-update strong {
  display: block;
  color: var(--text);
  font-size: 0.86rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card,
.card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 14px 34px var(--shadow);
}

.metric-card {
  display: grid;
  align-content: space-between;
  min-height: 116px;
  padding: 14px;
}

.metric-top,
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-icon,
.icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(236, 72, 153, 0.34);
  background: var(--accent-soft);
  color: var(--accent-light);
}

.metric-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.metric-icon svg,
.icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-icon svg {
  width: 17px;
  height: 17px;
}

.icon svg {
  width: 20px;
  height: 20px;
}

.summary-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.summary-value {
  margin: 10px 0 3px;
  color: var(--text);
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-line {
  height: 3px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.metric-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.dashboard-sections {
  display: grid;
  gap: 16px;
}

.card {
  padding: 16px;
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
}

.dashboard-row {
  display: grid;
  gap: 16px;
}

.row-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.row-cpu-network {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.row-files-meta {
  grid-template-columns: minmax(0, 5fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 3fr);
  align-items: start;
}

.row-simulation {
  grid-template-columns: 1fr;
}

.card-header {
  margin-bottom: 10px;
}

.card-title,
h2,
h3 {
  margin: 0;
}

.card-title,
h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.card-help {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.info-list {
  display: grid;
  gap: 0;
}

.info-row {
  display: grid;
  grid-template-columns: minmax(105px, 42%) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.info-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-label {
  color: var(--muted);
  font-size: 0.87rem;
}

.info-value {
  min-width: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.app-card .info-row {
  grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1.1fr);
}

.info-value.truncate-value {
  display: block;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}

.compact .info-row {
  padding: 6px 0;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.meter-label strong {
  color: var(--text);
}

.progress-bar {
  width: 100%;
  height: 9px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.25s ease;
}

.core-list {
  display: grid;
  gap: 7px;
  max-height: 190px;
  margin-top: 10px;
  overflow: auto;
  padding-right: 4px;
}

.core-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.core-row .progress-bar {
  height: 7px;
  margin: 0;
}

.core-row strong {
  color: var(--text);
  text-align: right;
}

.table-scroll {
  width: 100%;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.network-scroll {
  max-height: 250px;
}

.files-scroll {
  max-height: 290px;
}

table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  vertical-align: top;
  font-size: 0.86rem;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-muted);
  color: var(--accent-light);
  font-size: 0.74rem;
  font-weight: 800;
}

td {
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.simulation {
  background: linear-gradient(180deg, var(--panel-soft), #171923);
}

.sim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

button {
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 10px;
  background: rgba(236, 72, 153, 0.1);
  color: var(--text);
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: rgba(236, 72, 153, 0.18);
}

.sim-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.process-queue,
.memory-blocks {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
}

.process,
.memory-block {
  border: 1px solid rgba(236, 72, 153, 0.32);
  border-radius: 9px;
  background: rgba(236, 72, 153, 0.12);
  padding: 7px 9px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}

.memory-block {
  min-width: 86px;
  text-align: center;
}

.memory-block.free {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 0.86rem;
}

code {
  color: var(--accent-light);
}

@media (max-width: 1050px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-cpu-network,
  .row-simulation {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    display: grid;
    gap: 16px;
  }

  .header-meta {
    justify-items: start;
  }

  .last-update {
    text-align: left;
  }

  .summary-grid,
  .dashboard-sections,
  .dashboard-row,
  .sim-layout {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 108px;
  }

  .summary-value {
    white-space: normal;
  }

  .info-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .info-value {
    text-align: left;
  }

  footer {
    display: grid;
  }
}
