/* ── Table ── */
.tbox {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: 10px;
  overflow: hidden
}

.tbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--b1)
}

.tbox-title {
  font-size: 13px;
  font-weight: 500
}

table {
  width: 100%;
  border-collapse: collapse
}

th {
  padding: 10px 20px;
  text-align: left;
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  background: var(--s2);
  border-bottom: 1px solid var(--b1)
}

td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--b1);
  font-size: 13px;
  vertical-align: middle
}

tr:last-child td {
  border-bottom: none
}

tr:hover td {
  background: rgba(255, 255, 255, .015)
}

.mono {
  font-family: var(--mono);
  font-size: 12px
}

.dim {
  color: var(--muted2)
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--mono)
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7
}

.b-running {
  background: rgba(0, 229, 176, .1);
  color: var(--accent)
}

.b-building {
  background: rgba(42, 127, 212, .1);
  color: var(--blue)
}

.b-stopped {
  background: rgba(232, 56, 56, .1);
  color: var(--red)
}

.b-error {
  background: rgba(232, 56, 56, .1);
  color: var(--red)
}

.b-pending {
  background: rgba(80, 96, 112, .15);
  color: var(--muted2)
}

.b-active {
  background: rgba(0, 229, 176, .1);
  color: var(--accent)
}

.b-paused {
  background: rgba(212, 144, 10, .1);
  color: var(--yellow)
}

.b-cancelled {
  background: rgba(232, 56, 56, .1);
  color: var(--red)
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: var(--sans);
  transition: all .12s
}

.btn:disabled {
  opacity: .4;
  pointer-events: none
}

.btn-primary {
  background: var(--accent);
  color: #000
}

.btn-primary:hover {
  background: var(--accent2)
}

.btn-ghost {
  background: transparent;
  color: var(--muted2);
  border: 1px solid var(--b2)
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted2)
}

.btn-danger {
  background: rgba(232, 56, 56, .12);
  color: var(--red);
  border: 1px solid rgba(232, 56, 56, .2)
}

.btn-danger:hover {
  background: rgba(232, 56, 56, .22)
}

.btn-success {
  background: rgba(0, 229, 176, .1);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 176, .2)
}

.btn-success:hover {
  background: rgba(0, 229, 176, .2)
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px
}

/* ── Modal ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  z-index: 50;
  align-items: center;
  justify-content: center
}

#m-confirm {
  z-index: 9999
}

.overlay.on {
  display: flex
}

.modal {
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: 12px;
  padding: 28px;
  width: 480px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto
}

.modal h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 22px
}

.field {
  margin-bottom: 14px
}

.field label {
  display: block;
  font-size: 11px;
  color: var(--muted2);
  margin-bottom: 5px;
  letter-spacing: .04em
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--b2);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border .12s;
  resize: vertical
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent)
}

.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px
}

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

.modal-section {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 20px 0 12px;
  border-bottom: 1px solid var(--b1);
  padding-bottom: 8px
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  max-width: 300px;
  transform: translateY(60px);
  opacity: 0;
  transition: all .2s;
  pointer-events: none
}

.toast.on {
  transform: translateY(0);
  opacity: 1
}

.toast.ok {
  border-left: 3px solid var(--accent)
}

.toast.err {
  border-left: 3px solid var(--red)
}

.toast.info {
  border-left: 3px solid var(--blue)
}

.td-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}
