/* Console theme overrides layered on top of the admin theme. */
.shell {
  max-width: 1500px;
}

/* The reference stylesheet's readability pass sets a dark body color, but
   the page header sits on the dark shell. Keep the header light. */
.app-header h1 {
  color: #e7f1fd;
}
.app-header .kicker {
  color: #6ff2d7;
}
/* The login page uses the light shell background, so its header stays dark. */
.login-shell .header h1 {
  color: #183f3a;
}
.login-shell .kicker {
  color: #1a9c83;
}
.login-shell .header .muted {
  color: #5a706c;
}
.header-actions .who {
  color: #c8dbd7;
}

/* Labels live inside white cards, so they need dark text. */
.form-group label {
  color: #29423e;
}
.login-error {
  color: #9b2c33;
}

.app-header {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

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

.header-actions .who {
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

@media (max-width: 760px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span-2 {
    grid-column: span 1;
  }
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.mono {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

.cell-prompt {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cell-actions button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.status-badge.status-running,
.status-badge.status-submitted {
  background: rgba(44, 148, 199, 0.2);
  color: #6fc7ff;
}
.status-badge.status-succeeded {
  background: rgba(44, 199, 170, 0.2);
  color: #4de2c4;
}
.status-badge.status-queued {
  background: rgba(168, 191, 216, 0.18);
  color: #c5d8ee;
}
.status-badge.status-failed,
.status-badge.status-canceled,
.status-badge.status-needs_reauth {
  background: rgba(225, 96, 104, 0.2);
  color: #ffb4bc;
}
.status-badge.status-disabled {
  background: rgba(168, 191, 216, 0.14);
  color: #a8bfd8;
}

.progress {
  position: relative;
  width: 130px;
  height: 8px;
  border-radius: 999px;
  background: rgba(24, 63, 58, 0.14);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2cc7aa, #45a3e5);
  transition: width 0.3s ease;
}
.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress-row .pct {
  min-width: 34px;
  font-family: Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
}

.thumb {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(24, 63, 58, 0.15);
  background: #edf3f1;
}

.empty-thumb {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  border: 1px dashed #bac9c6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8aa39e;
  font-size: 10px;
}

.notice {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #cfdbd8;
  background: #f8faf9;
  color: #29423e;
  font-size: 13px;
  line-height: 1.55;
}
.notice.warn {
  border-color: #e7c98f;
  background: #fffaf0;
  color: #7a5410;
}
.notice.error {
  border-color: #efb3b6;
  background: #fff5f5;
  color: #9b2c33;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.modal-title {
  margin: 0 0 8px;
  font-size: 17px;
  color: #20312f;
}

.modal-close {
  float: right;
  border: 0;
  background: transparent;
  color: #5f7a75;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  min-height: 24px;
  padding: 0;
}

.field-help {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #29423e;
}

.generated-preview {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.connect-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.connect-status .state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(44, 199, 170, 0.25);
  border-top-color: #2cc7aa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1000px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
.stat-card {
  padding: 16px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(24, 63, 58, 0.06);
}
.stat-card .stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.stat-card .stat-value {
  font-family: Consolas, "Courier New", monospace;
  font-size: 26px;
  font-weight: 700;
  color: #183f3a;
}
.stat-card .stat-value.accent { color: #1a9c83; }
.stat-card .stat-value.danger { color: var(--danger); }

.table-wrapper th,
.table-wrapper td {
  white-space: nowrap;
}

.tab-pane.active {
  gap: 18px;
}

.secret-help {
  color: var(--muted);
  font-size: 12px;
}

.login-shell {
  max-width: 460px;
  margin: 12vh auto;
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-error {
  min-height: 20px;
  color: #ffb4bc;
  font-size: 13px;
}
