:root {
  color: #1d2228;
  background: #f3f4f2;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f3f4f2;
}

button, input, select, textarea { font: inherit; }

button {
  border: 1px solid #1d2228;
  border-radius: 5px;
  background: #1d2228;
  color: #fff;
  min-height: 38px;
  padding: 0 16px;
  cursor: pointer;
}

button:hover { background: #343b42; }
button:disabled { cursor: not-allowed; opacity: .5; }

button.secondary {
  border-color: #c8ccc8;
  background: #fff;
  color: #252b31;
}

button.secondary:hover { background: #f0f2ef; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid #d8dbd7;
  background: #fff;
}

.brand, .connection { display: flex; align-items: center; }
.brand { gap: 12px; }

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #191e23;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.brand div { display: flex; flex-direction: column; }
.brand strong { font-size: 15px; }
.brand span:last-child { color: #737a78; font-size: 12px; }

.connection { gap: 8px; }
.connection label { color: #656c69; font-size: 12px; }
.connection input { width: min(26vw, 280px); }

.health {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a7ada9;
}

.health.ok { background: #1f9d61; }
.health.bad { background: #ca4d43; }

.shell {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.sidebar {
  padding: 24px 16px;
  border-right: 1px solid #d8dbd7;
  background: #e9ebe8;
}

.side-title {
  margin: 0 10px 10px;
  color: #6c736f;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.provider-button {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: #30363a;
  text-align: left;
}

.provider-button:hover { background: #dfe2de; }
.provider-button.is-active { border-color: #c4c9c3; background: #fff; }
.provider-button small { color: #7a817d; font-size: 10px; }

.swatch { width: 9px; height: 9px; border-radius: 2px; }
.swatch.paypal { background: #2368b4; }
.swatch.gopay { background: #26966c; }
.swatch.gcash { background: #20a9c4; }
.swatch.ph-card { background: #d47a28; }

main { min-width: 0; }

.workspace-band, .tasks-band, .detail-band {
  padding: 26px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid #d8dbd7;
}

.workspace-band { background: #fbfcfa; }
.tasks-band { background: #f3f4f2; }
.detail-band { background: #fff; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-heading.compact { margin-bottom: 14px; }
.section-heading p { margin: 0 0 4px; color: #747b78; font-size: 10px; font-weight: 800; }
.section-heading h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.section-heading h2 { margin: 0; font-size: 18px; line-height: 1.2; }

.provider-badge {
  padding: 6px 9px;
  border: 1px solid #d2d6d1;
  border-radius: 4px;
  color: #686f6b;
  background: #fff;
  font-size: 11px;
}

.provider-badge.ready { border-color: #80c4a3; color: #147245; background: #eff8f3; }

.form-grid {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(240px, 1.3fr);
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #535b58;
  font-size: 12px;
  font-weight: 650;
}

.full-width { grid-column: 1 / -1; }

input, select, textarea {
  width: 100%;
  border: 1px solid #c8ccc8;
  border-radius: 5px;
  background: #fff;
  color: #20262b;
  outline: none;
}

input, select { height: 40px; padding: 0 11px; }

textarea {
  min-height: 210px;
  resize: vertical;
  padding: 12px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

input:focus, select:focus, textarea:focus {
  border-color: #4f7770;
  box-shadow: 0 0 0 2px rgba(79, 119, 112, .12);
}

.inline-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.form-actions {
  min-height: 54px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.form-message { color: #66706b; font-size: 12px; }
.form-message.error { color: #b43f37; }
.form-message.success { color: #18784a; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid #d2d6d1;
  border-radius: 6px;
  background: #fff;
}

table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e3e5e2; text-align: left; }
th { color: #68706c; background: #f7f8f6; font-size: 11px; }
td { color: #30363a; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-task-id] { cursor: pointer; }
tbody tr[data-task-id]:hover { background: #f5f7f4; }
td:first-child { font-family: "Cascadia Mono", Consolas, monospace; }
.empty { padding: 30px; color: #7a817d; text-align: center; }

.status {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 4px;
  background: #eceeeb;
  color: #5f6663;
  font-size: 10px;
  font-weight: 750;
}

.status.running { background: #e7f1f6; color: #25647d; }
.status.succeeded { background: #e7f5ec; color: #147245; }
.status.failed { background: #fae9e7; color: #a83c34; }
.status.queued { background: #f7f0df; color: #8a641b; }

dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}

dl div { min-width: 0; }
dt { color: #707773; font-size: 10px; font-weight: 700; }
dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 12px; }

pre {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 6px;
  background: #1c2225;
  color: #edf1ed;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .topbar { height: auto; align-items: flex-start; flex-direction: column; padding: 16px; }
  .connection { width: 100%; flex-wrap: wrap; }
  .connection input { flex: 1; width: auto; min-width: 150px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid #d8dbd7;
  }
  .side-title { display: none; }
  .provider-button { margin: 0; }
  .provider-button small { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .workspace-band, .tasks-band, .detail-band { padding: 20px 16px; }
  table { min-width: 650px; }
  dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
