/* System Control Plane — Phase 11 */

.sys-root {
  display: flex;
  flex-direction: column;
  gap: var(--v2-space-4, 1rem);
  padding: var(--v2-space-2, 0.5rem) 0 var(--v2-space-6, 1.5rem);
}

.sys-hero {
  display: flex;
  justify-content: space-between;
  gap: var(--v2-space-3, 0.75rem);
  align-items: flex-start;
}

.sys-hero h2 {
  margin: 0 0 0.25rem;
  font-size: var(--v2-text-xl, 1.25rem);
  color: var(--v2-text-primary, #111);
}

.sys-zone-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--v2-space-2, 0.5rem);
}

.sys-zone-link {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: var(--v2-radius-md, 8px);
  border: 1px solid var(--v2-border-subtle, #e5e7eb);
  background: var(--v2-surface-raised, #fff);
  color: var(--v2-text-secondary, #4b5563);
  text-decoration: none;
  font-size: var(--v2-text-sm, 0.875rem);
}

.sys-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--v2-space-3, 0.75rem);
}

.sys-kpi {
  text-align: left;
  padding: var(--v2-space-3, 0.75rem);
  border-radius: var(--v2-radius-md, 8px);
  border: 1px solid var(--v2-border-subtle, #e5e7eb);
  background: var(--v2-surface-raised, #fff);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sys-kpi span {
  color: var(--v2-text-secondary, #6b7280);
  font-size: var(--v2-text-sm, 0.875rem);
}

.sys-kpi strong {
  font-size: var(--v2-text-lg, 1.1rem);
  color: var(--v2-text-primary, #111);
}

.sys-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--v2-space-3, 0.75rem);
}

.sys-meta-grid dt {
  color: var(--v2-text-secondary, #6b7280);
  font-size: var(--v2-text-sm, 0.875rem);
}

.sys-meta-grid dd {
  margin: 0.15rem 0 0;
  color: var(--v2-text-primary, #111);
}

.sys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--v2-text-sm, 0.875rem);
}

.sys-table th,
.sys-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--v2-border-subtle, #e5e7eb);
  text-align: left;
  vertical-align: top;
}

.sys-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sys-toolbar {
  display: flex;
  gap: 0.5rem;
}

.sys-toolbar input {
  flex: 1;
  padding: 0.45rem 0.65rem;
  border-radius: var(--v2-radius-md, 8px);
  border: 1px solid var(--v2-border-subtle, #e5e7eb);
}

.sys-drawer {
  padding: var(--v2-space-4, 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sys-drawer textarea {
  width: 100%;
  font-family: inherit;
  padding: 0.5rem;
  border-radius: var(--v2-radius-md, 8px);
  border: 1px solid var(--v2-border-subtle, #e5e7eb);
}

.sys-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sys-preview {
  white-space: pre-wrap;
  padding: 0.75rem;
  border-radius: var(--v2-radius-md, 8px);
  background: var(--v2-surface-muted, #f8fafc);
  border: 1px solid var(--v2-border-subtle, #e5e7eb);
  font-size: var(--v2-text-sm, 0.875rem);
  max-height: 280px;
  overflow: auto;
}

.sys-drawer .error {
  color: var(--v2-danger, #b91c1c);
  min-height: 1.2em;
}
