:root {
  --bg: #0a121d;
  --panel: #101c2c;
  --panel-2: #0c1826;
  --border: #1d3348;
  --text: #dbe7f2;
  --text-dim: #7e93a8;
  --accent: #35d499;
  --accent-dim: #1f8f6c;
  --amber: #f0b429;
  --red: #ef5b5b;
  --critical: #ff3366;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(53, 212, 153, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 212, 153, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--panel-2); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--accent-dim) var(--panel-2); }

a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(53, 212, 153, 0.15);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.08em; font-size: 13px; }
.brand-mark { color: var(--accent); text-shadow: 0 0 8px rgba(53, 212, 153, 0.8); }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { padding: 8px 14px; border-radius: 6px; color: var(--text-dim); font-weight: 600; font-size: 13px; transition: all 0.15s ease; }
.topnav a:hover { color: var(--text); background: var(--panel-2); }
.topnav a.active { color: var(--accent); background: rgba(53, 212, 153, 0.1); box-shadow: 0 0 0 1px rgba(53, 212, 153, 0.25), 0 0 14px rgba(53, 212, 153, 0.2); }
.status-cluster { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; font-family: var(--font-mono); margin-right: 8px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(53, 212, 153, 0.9); animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.btn-new {
  background: var(--accent);
  color: #06241a;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 0 16px rgba(53, 212, 153, 0.35);
  transition: all 0.15s ease;
}
.btn-new:hover { background: #4ee6ac; box-shadow: 0 0 22px rgba(53, 212, 153, 0.55); }

main#app { padding: 20px 24px 60px; max-width: 1400px; margin: 0 auto; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-overview { grid-template-columns: 2fr 1fr; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
}
.panel h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding-left: 14px;
}
.panel h2::before { content: '\25C6'; position: absolute; left: 0; top: 1px; color: var(--accent); font-size: 9px; text-shadow: 0 0 6px rgba(53, 212, 153, 0.8); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tile {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.tile:hover { border-color: var(--accent-dim); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(53, 212, 153, 0.18); }
.tile-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tile-name { font-weight: 700; font-size: 13px; }
.tile-count { color: var(--text-dim); font-size: 12px; font-family: var(--font-mono); }
.tile-flags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-ok { background: var(--accent); box-shadow: 0 0 7px rgba(53, 212, 153, 0.7); }
.dot-warn { background: var(--amber); box-shadow: 0 0 7px rgba(240, 180, 41, 0.75); }
.dot-crit { background: var(--critical); box-shadow: 0 0 8px rgba(255, 51, 102, 0.8); }
.dot-neutral { background: var(--text-dim); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-ok { background: rgba(53,212,153,0.14); color: var(--accent); box-shadow: 0 0 0 1px rgba(53,212,153,0.18); }
.badge-warn { background: rgba(240,180,41,0.14); color: var(--amber); box-shadow: 0 0 10px rgba(240,180,41,0.2), 0 0 0 1px rgba(240,180,41,0.22); }
.badge-crit { background: rgba(255,51,102,0.14); color: var(--critical); box-shadow: 0 0 10px rgba(255,51,102,0.22), 0 0 0 1px rgba(255,51,102,0.25); }
.badge-neutral { background: rgba(126,147,168,0.14); color: var(--text-dim); }
.badge.clickable { cursor: pointer; }
.badge.clickable:hover { filter: brightness(1.2); }
.badge-pulse { animation: badge-pulse 2.2s ease-in-out infinite; }
@keyframes badge-pulse { 0%, 100% { box-shadow: 0 0 10px rgba(255,51,102,0.22), 0 0 0 1px rgba(255,51,102,0.25); } 50% { box-shadow: 0 0 18px rgba(255,51,102,0.5), 0 0 0 1px rgba(255,51,102,0.4); } }

.chips { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.chip.active { background: var(--accent); color: #06241a; border-color: var(--accent); box-shadow: 0 0 14px rgba(53, 212, 153, 0.4); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; border-left: 2px solid transparent; }
tbody td:first-child { font-family: var(--font-mono); color: var(--text-dim); font-size: 12.5px; }
tr.row-link { cursor: pointer; transition: background 0.12s ease; }
tr.row-link:hover td { background: var(--panel-2); }
tr.row-link:hover td:first-child { border-left-color: var(--accent); }
.cell-sub { color: var(--text-dim); font-size: 12px; font-family: var(--font-mono); }

.list-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item-top { display: flex; justify-content: space-between; gap: 12px; }
.list-item-title { font-weight: 700; font-size: 13px; }
.list-item-meta { color: var(--text-dim); font-size: 12px; }
.list-item-due { font-size: 11px; color: var(--amber); font-weight: 700; }

.pipeline-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.pipeline-label { width: 110px; font-size: 12px; color: var(--text-dim); }
.pipeline-bar-track { flex: 1; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.pipeline-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); box-shadow: 0 0 10px rgba(53, 212, 153, 0.5); }
.pipeline-count { width: 24px; text-align: right; font-weight: 700; font-size: 12px; font-family: var(--font-mono); }

.subtabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.subtabs a { padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--text-dim); border-bottom: 2px solid transparent; transition: all 0.15s ease; }
.subtabs a.active { color: var(--accent); border-color: var(--accent); box-shadow: 0 2px 10px -2px rgba(53, 212, 153, 0.6); }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
select, input[type=text], input[type=search], input[type=date], input[type=number], textarea {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
}
textarea { width: 100%; min-height: 70px; resize: vertical; }
label { font-size: 12px; color: var(--text-dim); display: block; margin-bottom: 4px; font-weight: 600; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: 16px; height: 16px; }
.checkbox-field label { margin: 0; }

button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}
button.primary { background: var(--accent); color: #06241a; border-color: var(--accent); box-shadow: 0 0 14px rgba(53, 212, 153, 0.3); }
button.primary:hover { background: #4ee6ac; box-shadow: 0 0 20px rgba(53, 212, 153, 0.5); }
button:hover { border-color: var(--accent-dim); }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.detail-title { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.detail-code { color: var(--text-dim); font-size: 12px; font-weight: 600; font-family: var(--font-mono); letter-spacing: 0.03em; }
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

dl.read { display: grid; grid-template-columns: 220px 1fr; gap: 8px 16px; margin: 0; }
dl.read dt { color: var(--text-dim); font-size: 12px; font-weight: 600; padding-top: 2px; }
dl.read dd { margin: 0; white-space: pre-wrap; }

.empty { color: var(--text-dim); font-size: 13px; padding: 20px 0; text-align: center; }
.section-title { font-size: 13px; font-weight: 700; margin: 20px 0 10px; }
.section-title:first-child { margin-top: 0; }
