:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

body {
  margin: 0;
}

.topbar {
  align-items: center;
  background: #12343b;
  color: white;
  display: flex;
  justify-content: space-between;
  padding: 18px 28px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 17px;
}

button {
  background: #1f7a8c;
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-weight: 600;
  padding: 9px 12px;
}

button:disabled {
  background: #b7c0c7;
  cursor: not-allowed;
}

button.secondary {
  background: #52616b;
}

button.danger {
  background: #b23a48;
}

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

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metrics article,
.panel,
.item {
  background: white;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
}

.metrics article {
  padding: 12px 14px;
}

.metrics span {
  color: #52616b;
  display: block;
  font-size: 13px;
}

.metrics strong {
  display: block;
  font-size: 24px;
  margin-top: 6px;
}

.layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
}

.section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px;
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  padding: 12px;
}

.item-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.muted {
  color: #657786;
  font-size: 13px;
}

.status {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.SUCCESS { background: #d9f5df; color: #146b2e; }
.FAILED { background: #fde2e2; color: #9b1c1c; }
.RUNNING { background: #fff0c2; color: #7a5500; }
.QUEUED { background: #e7eef9; color: #254b78; }
.CANCELLED { background: #eceff1; color: #455a64; }
.FALLA { background: #fde2e2; color: #9b1c1c; }
.REVISAR { background: #fff0c2; color: #7a5500; }
.INFO { background: #e7eef9; color: #254b78; }
.OK { background: #d9f5df; color: #146b2e; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.panel {
  margin-top: 16px;
  padding: 14px;
}

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

label {
  color: #52616b;
  display: grid;
  font-size: 13px;
  gap: 5px;
}

input, select, textarea {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  font: inherit;
  padding: 9px;
}

.compact-select {
  margin-bottom: 10px;
}

.bot-detail {
  min-height: 160px;
}

.bot-meta {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.bot-meta div {
  border-top: 1px solid #edf1f5;
  padding-top: 8px;
}

.bot-meta dt {
  color: #52616b;
  font-size: 12px;
  font-weight: 700;
}

.bot-meta dd {
  font-size: 12px;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.drop-zone {
  align-items: center;
  background: #f7fafc;
  border: 1px dashed #9fb3c8;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px;
  text-align: center;
}

.drop-zone span {
  color: #657786;
  font-size: 12px;
}

.drop-zone.dragging {
  background: #eef8fb;
  border-color: #1f7a8c;
}

.file-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.file-list div {
  align-items: center;
  background: #f7fafc;
  border: 1px solid #edf1f5;
  border-radius: 6px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 7px 9px;
}

.file-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list small {
  color: #657786;
  flex: 0 0 auto;
}

.schedule-list {
  display: grid;
  gap: 6px;
}

.schedule-item {
  background: white;
  border: 1px solid #d9e1e8;
  border-radius: 6px;
  padding: 8px 10px;
}

.schedule-item summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(160px, 1fr) minmax(160px, 1fr);
}

.schedule-toolbar {
  display: flex;
  gap: 8px;
}

.schedule-toolbar select {
  min-width: 130px;
}

.schedule-kpis {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
}

.kpi {
  align-items: center;
  background: #edf1f5;
  border: 1px solid transparent;
  color: #17202a;
  display: flex;
  justify-content: space-between;
  padding: 9px 10px;
}

.kpi strong {
  font-size: 20px;
}

.kpi span {
  color: #52616b;
  font-size: 12px;
}

.danger-soft { background: #fff1f1; border-color: #f4b8b8; }
.warn-soft { background: #fff7dd; border-color: #efd481; }
.ok-soft { background: #edf9ef; border-color: #acdcb8; }
.info-soft { background: #eef5ff; border-color: #b8cbe8; }

.more-hint,
.compact-empty {
  padding: 8px 2px;
}

textarea {
  min-height: 70px;
}

pre {
  background: #101820;
  border-radius: 8px;
  color: #e8f1f2;
  max-height: 260px;
  min-height: 130px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .metrics,
  .layout,
  .form,
  .schedule-kpis {
    grid-template-columns: 1fr;
  }

  .schedule-item summary {
    grid-template-columns: auto 1fr;
  }

  .schedule-item summary .muted {
    grid-column: 2;
  }
}
