/* Cals2Gains Mission Control — dashboard styles */
:root {
  --c-bg: #0E0B14;
  --c-surface: #17121D;
  --c-surface-2: #1F1A2A;
  --c-border: #2A2336;
  --c-text: #F7F2EA;
  --c-text-muted: #A097B0;
  --c-coral: #FF6A4D;
  --c-violet: #9C8CFF;
  --c-orange: #FF9800;
  --c-gold: #FFD700;
  --c-green: #34D399;
  --c-red: #F87171;
  --c-yellow: #FACC15;
  --r-card: 16px;
  --r-pill: 999px;
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.32);
  --gap: 16px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--c-violet);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, var(--c-surface) 0%, transparent 100%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-coral), var(--c-violet));
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.brand-title {
  font-weight: 700;
  letter-spacing: -0.3px;
}
.meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--c-text-muted);
  font-size: 12px;
}
#generated-at {
  font-variant-numeric: tabular-nums;
}

.btn {
  background: var(--c-surface-2);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  font-family: inherit;
}
.btn:hover {
  background: var(--c-border);
}
.btn:active {
  transform: translateY(1px);
}
.btn-ghost {
  background: transparent;
}
.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}
.btn-primary {
  background: var(--c-violet);
  color: #fff;
  border-color: transparent;
}
.btn-primary:hover {
  background: #8a78f0;
}
.btn-danger {
  background: var(--c-coral);
  color: #fff;
  border-color: transparent;
}
.btn-danger:hover {
  background: #ff5235;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  padding: var(--gap);
  max-width: 1600px;
  margin: 0 auto;
}
.span-6 {
  grid-column: span 6;
}
.span-12 {
  grid-column: 1 / -1;
}
@media (max-width: 1100px) {
  .span-6 {
    grid-column: 1 / -1;
  }
}

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.card-body {
  font-size: 13px;
}
.card-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.card-body table th,
.card-body table td {
  text-align: left;
  padding: 6px 4px;
  border-bottom: 1px solid var(--c-border);
}
.card-body table th {
  color: var(--c-text-muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-radius: var(--r-pill);
  padding: 4px 10px;
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}
.status-ok {
  color: var(--c-green);
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}
.status-partial {
  color: var(--c-yellow);
  border-color: rgba(250, 204, 21, 0.3);
  background: rgba(250, 204, 21, 0.08);
}
.status-missing,
.status-error {
  color: var(--c-red);
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.08);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.kpi {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-text-muted);
}
.kpi-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
}

.build-strip {
  margin-top: 8px;
}
.build-strip:empty {
  display: none;
}
.build-strip .build-card {
  background: linear-gradient(135deg, rgba(156, 140, 255, 0.12), rgba(255, 106, 77, 0.08));
  border: 1px solid var(--c-violet);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.build-strip .build-card a {
  color: var(--c-text);
  text-decoration: none;
  font-weight: 600;
}
.build-strip .build-card .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-violet);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.muted {
  color: var(--c-text-muted);
}
.small {
  font-size: 12px;
}
.danger-tag {
  background: rgba(255, 106, 77, 0.18);
  color: var(--c-coral);
  border-radius: var(--r-pill);
  padding: 1px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
code {
  background: var(--c-surface-2);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list li {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.list li.clickable:hover {
  border-color: var(--c-violet);
  cursor: pointer;
}
.tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
}
.tag-ok {
  color: var(--c-green);
  border-color: rgba(52, 211, 153, 0.3);
}
.tag-fail {
  color: var(--c-red);
  border-color: rgba(248, 113, 113, 0.3);
}
.tag-running {
  color: var(--c-violet);
  border-color: rgba(156, 140, 255, 0.4);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.actions-grid .btn {
  text-align: left;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 10px;
}

.footer {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  color: var(--c-text-muted);
  font-size: 12px;
  border-top: 1px solid var(--c-border);
  margin-top: 24px;
}
.footer a {
  color: var(--c-text-muted);
  text-decoration: none;
}
.footer a:hover {
  color: var(--c-text);
}

.empty {
  color: var(--c-text-muted);
  font-style: italic;
  font-size: 12px;
}

/* Company Health — semáforos CEO */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.health-cell {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 12px 14px;
}
.health-cell.health-green {
  border-left-color: var(--c-green);
}
.health-cell.health-amber {
  border-left-color: var(--c-yellow);
}
.health-cell.health-red {
  border-left-color: var(--c-red);
}
.health-cell.health-silent {
  border-left-color: var(--c-text-muted);
  opacity: 0.7;
}
.health-label {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}
.health-status {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  font-weight: 500;
}
.health-cell.health-green .health-status { color: var(--c-green); }
.health-cell.health-amber .health-status { color: var(--c-yellow); }
.health-cell.health-red .health-status { color: var(--c-red); }
.health-cell.health-silent .health-status { color: var(--c-text-muted); }
.health-detail {
  font-size: 11px;
  line-height: 14px;
  word-break: break-word;
}

/* Activity feed — list más densa */
.activity-list li {
  align-items: flex-start;
  padding: 8px 12px;
}
.activity-list li > span:first-child {
  flex: 1;
  min-width: 0;
}
.activity-list li > span:last-child {
  flex-shrink: 0;
  text-align: right;
  font-size: 11px;
}
