:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --text: #16202e;
  --muted: #667386;
  --line: #d8e0ea;
  --blue: #1f5fbf;
  --green: #178045;
  --amber: #a46300;
  --red: #bd2430;
  --gray: #637083;
  --nav: #101824;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  background: var(--nav);
  color: #fff;
  padding: 22px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.brand small {
  display: block;
  color: #95a3b8;
  font-size: 11px;
  margin-top: 2px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--blue);
  font-weight: 800;
}

nav { display: grid; gap: 6px; }

nav a {
  color: #cdd5e1;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
}

nav a.active,
nav a:hover {
  background: #263244;
  color: #fff;
}

.main {
  margin-left: 236px;
  padding: 28px;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.last-update {
  color: var(--muted);
  font-size: 13px;
}

h1, h2, p { margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
p { color: var(--muted); margin-top: 5px; }

.button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.secondary { background: #e8eef8; color: #22324a; }
.button.danger { background: #fbe5e7; color: var(--red); }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric span {
  display: block;
  font-size: 34px;
  font-weight: 800;
}

.metric small {
  color: var(--muted);
  font-weight: 700;
}

.up span, .status.up { color: var(--green); }
.degraded span, .status.degraded { color: var(--amber); }
.down span, .status.down { color: var(--red); }
.unknown span, .status.unknown { color: var(--gray); }

.ops-grid,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel,
.form-band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.panel.wide { min-width: 0; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.resource-list,
.status-list,
.container-grid,
.events {
  display: grid;
  gap: 10px;
}

.subpanel {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.subpanel h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.container-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.resource,
.status-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.resource-top,
.resource-meta,
.status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resource-meta,
.status-item small {
  color: var(--muted);
  font-size: 12px;
}

.status-item small {
  display: block;
  margin-top: 3px;
  word-break: break-all;
}

.bar {
  height: 9px;
  background: #e7edf5;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar .up { background: var(--green); }
.bar .degraded { background: var(--amber); }
.bar .down { background: var(--red); }
.bar .unknown { background: var(--gray); }

.table-wrap { overflow: auto; }

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

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-width: 82px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  background: #edf1f6;
}

.status.up { background: #e0f4e7; }
.status.degraded { background: #fff1d6; }
.status.down { background: #fde3e5; }
.status.unknown { background: #edf1f6; }

.event {
  border-left: 4px solid var(--line);
  padding: 8px 0 8px 10px;
}

.event.down { border-color: var(--red); }
.event.degraded { border-color: var(--amber); }
.event strong { display: block; }
.event small { color: var(--muted); }

.target-form {
  display: grid;
  grid-template-columns: 1.2fr 130px 1.6fr 150px 150px 110px 120px auto;
  align-items: end;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input, select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 1080px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .main {
    margin-left: 0;
    padding: 18px;
  }

  .kpis,
  .ops-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .target-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
