/* Minimal styling for the Kanade Client App skeleton.
   The "real" UI redesign lands with the Health / Notifications
   tabs; for now we just want the page legible. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fafafa;
  color: #1a1a1a;
  font-size: 14px;
  line-height: 1.5;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
}

/* Health tab (#290): one row per compliance check. */
ul.checks {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.check-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eee;
}

.check-row:first-child {
  border-top: 0;
}

.check-icon {
  flex: 0 0 auto;
}

.check-name {
  font-weight: 500;
}

.check-detail {
  flex: 1 1 auto;
  color: #666;
}

.fix-btn {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 13px;
}

.fix-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-warn .check-name {
  color: #8a6d00;
}

.status-fail .check-name {
  color: #b00020;
}

.status-unknown .check-name {
  color: #777;
}

/* Job catalog (#291): tab bar + one row per user-invokable job. */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.jobs-tab {
  padding: 4px 12px;
  font-size: 13px;
  background: transparent;
  color: inherit;
  border: 1px solid #ccc;
  border-radius: 999px;
}

.jobs-tab:hover {
  background: rgba(0, 0, 0, 0.05);
}

.jobs-tab.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.job-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eee;
}

.job-row:first-child {
  border-top: 0;
}

.job-name {
  font-weight: 500;
}

.job-desc {
  flex: 1 1 100%;
  color: #666;
  font-size: 13px;
}

.job-run-btn {
  margin-left: auto;
  padding: 4px 14px;
  font-size: 13px;
}

/* Remediation run rows (#291): one per jobs.execute, updated live by
   jobs.progress pushes. */
.run-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eee;
}

.run-row:first-child {
  border-top: 0;
}

.run-icon {
  flex: 0 0 auto;
}

.run-name {
  font-weight: 500;
}

.run-status {
  flex: 1 1 auto;
}

.kill-btn {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 13px;
}

.run-output {
  flex: 1 0 100%;
  margin: 4px 0 0;
  padding: 8px;
  max-height: 160px;
  overflow: auto;
  background: #f4f4f4;
  border-radius: 4px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.run-row.status-completed .run-status {
  color: #2e7d32;
}

.run-row.status-failed .run-status,
.run-row.status-killed .run-status {
  color: #b00020;
}

section {
  padding: 16px;
  margin-bottom: 12px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

section p {
  margin: 0 0 8px;
}

section p:last-child {
  margin-bottom: 0;
}

.muted {
  color: #666;
}

.error {
  color: #b00020;
}

button {
  padding: 6px 14px;
  font-size: 14px;
  background: #1a1a1a;
  color: #ffffff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background: #333;
}

@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #f0f0f0;
  }
  section {
    background: #2a2a2a;
    border-color: #3a3a3a;
  }
  .muted {
    color: #aaa;
  }
  button {
    background: #f0f0f0;
    color: #1a1a1a;
  }
  button:hover {
    background: #d0d0d0;
  }
  .check-row {
    border-color: #3a3a3a;
  }
  .check-detail {
    color: #aaa;
  }
  .status-warn .check-name {
    color: #e0b341;
  }
  .status-fail .check-name {
    color: #ff6b6b;
  }
  .status-unknown .check-name {
    color: #aaa;
  }
  .run-row {
    border-color: #3a3a3a;
  }
  .run-output {
    background: #1e1e1e;
  }
  .run-row.status-completed .run-status {
    color: #7cc47f;
  }
  .run-row.status-failed .run-status,
  .run-row.status-killed .run-status {
    color: #ff6b6b;
  }
  .jobs-tab {
    border-color: #4a4a4a;
  }
  .jobs-tab:hover {
    background: rgba(255, 255, 255, 0.08);
  }
  .jobs-tab.active {
    background: #f0f0f0;
    color: #1a1a1a;
    border-color: #f0f0f0;
  }
  .job-row {
    border-color: #3a3a3a;
  }
  .job-desc {
    color: #aaa;
  }
}
